mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +00:00
Move inherents to primitives (#4126)
* Split Aura and Timestamp inherents out of paint * fixup node depedencies * move babe inherents to primitives * move authorship inherents into primitives * Move finalty tracker inherents into primitives * fix aura primitives import
This commit is contained in:
committed by
GitHub
parent
5979a8c3e5
commit
303843f483
@@ -35,8 +35,8 @@ use sr_primitives::{
|
||||
use transaction_factory::RuntimeAdapter;
|
||||
use transaction_factory::modes::Mode;
|
||||
use inherents::InherentData;
|
||||
use timestamp;
|
||||
use finality_tracker;
|
||||
use sp_timestamp;
|
||||
use sp_finality_tracker;
|
||||
|
||||
type AccountPublic = <Signature as Verify>::Signer;
|
||||
|
||||
@@ -160,9 +160,9 @@ impl RuntimeAdapter for FactoryState<Number> {
|
||||
let timestamp = (self.block_no as u64 + 1) * MinimumPeriod::get();
|
||||
|
||||
let mut inherent = InherentData::new();
|
||||
inherent.put_data(timestamp::INHERENT_IDENTIFIER, ×tamp)
|
||||
inherent.put_data(sp_timestamp::INHERENT_IDENTIFIER, ×tamp)
|
||||
.expect("Failed putting timestamp inherent");
|
||||
inherent.put_data(finality_tracker::INHERENT_IDENTIFIER, &self.block_no)
|
||||
inherent.put_data(sp_finality_tracker::INHERENT_IDENTIFIER, &self.block_no)
|
||||
.expect("Failed putting finalized number inherent");
|
||||
inherent
|
||||
}
|
||||
|
||||
@@ -370,8 +370,8 @@ mod tests {
|
||||
traits::Verify,
|
||||
OpaqueExtrinsic,
|
||||
};
|
||||
use timestamp;
|
||||
use finality_tracker;
|
||||
use sp_timestamp;
|
||||
use sp_finality_tracker;
|
||||
use keyring::AccountKeyring;
|
||||
use substrate_service::{AbstractService, Roles};
|
||||
use crate::service::new_full;
|
||||
@@ -484,7 +484,7 @@ mod tests {
|
||||
let mut inherent_data = inherent_data_providers
|
||||
.create_inherent_data()
|
||||
.expect("Creates inherent data.");
|
||||
inherent_data.replace_data(finality_tracker::INHERENT_IDENTIFIER, &1u64);
|
||||
inherent_data.replace_data(sp_finality_tracker::INHERENT_IDENTIFIER, &1u64);
|
||||
|
||||
let parent_id = BlockId::number(service.client().info().chain.best_number);
|
||||
let parent_header = service.client().header(&parent_id).unwrap().unwrap();
|
||||
@@ -498,7 +498,7 @@ mod tests {
|
||||
// even though there's only one authority some slots might be empty,
|
||||
// so we must keep trying the next slots until we can claim one.
|
||||
let babe_pre_digest = loop {
|
||||
inherent_data.replace_data(timestamp::INHERENT_IDENTIFIER, &(slot_num * SLOT_DURATION));
|
||||
inherent_data.replace_data(sp_timestamp::INHERENT_IDENTIFIER, &(slot_num * SLOT_DURATION));
|
||||
if let Some(babe_pre_digest) = babe::test_helpers::claim_slot(
|
||||
slot_num,
|
||||
&parent_header,
|
||||
|
||||
Reference in New Issue
Block a user