mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 16:57:58 +00:00
Adds some derives for the inherent data stuff (#1543)
* Adds some derives for the inherent data stuff This makes working with them easier. * More defaults!
This commit is contained in:
@@ -50,6 +50,7 @@ pub use runtime_primitives::RuntimeString;
|
||||
pub type InherentIdentifier = [u8; 8];
|
||||
|
||||
/// Inherent data to include in a block.
|
||||
#[derive(Clone, Default)]
|
||||
pub struct InherentData {
|
||||
/// All inherent data encoded with parity-codec and an identifier.
|
||||
data: BTreeMap<InherentIdentifier, Vec<u8>>
|
||||
@@ -152,7 +153,7 @@ impl codec::Decode for InherentData {
|
||||
///
|
||||
/// When a fatal error occurres, all other errors are removed and the implementation needs to
|
||||
/// abbort checking inherents.
|
||||
#[derive(Encode, Decode)]
|
||||
#[derive(Encode, Decode, Clone, Default)]
|
||||
pub struct CheckInherentsResult {
|
||||
/// Did the check succeed?
|
||||
okay: bool,
|
||||
@@ -243,7 +244,7 @@ impl PartialEq for CheckInherentsResult {
|
||||
|
||||
/// All `InherentData` providers.
|
||||
#[cfg(feature = "std")]
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Default)]
|
||||
pub struct InherentDataProviders {
|
||||
providers: Arc<RwLock<Vec<Box<dyn ProvideInherentData + Send + Sync>>>>,
|
||||
}
|
||||
@@ -252,9 +253,7 @@ pub struct InherentDataProviders {
|
||||
impl InherentDataProviders {
|
||||
/// Create a new instance.
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
providers: Default::default(),
|
||||
}
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Register an `InherentData` provider.
|
||||
|
||||
@@ -71,7 +71,7 @@ use runtime_primitives::ApplyResult;
|
||||
use runtime_primitives::transaction_validity::TransactionValidity;
|
||||
use runtime_primitives::generic;
|
||||
use runtime_primitives::traits::{
|
||||
Convert, BlakeTwo256, Block as BlockT, DigestFor, NumberFor, Extrinsic, StaticLookup,
|
||||
Convert, BlakeTwo256, Block as BlockT, DigestFor, NumberFor, StaticLookup,
|
||||
};
|
||||
use version::RuntimeVersion;
|
||||
use council::{motions as council_motions, voting as council_voting};
|
||||
|
||||
Reference in New Issue
Block a user