mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 03:11:01 +00:00
cargo fmt with stable defaults (#876)
This commit is contained in:
@@ -7,21 +7,11 @@
|
||||
//! implementation of the trait is provided ([`BaseExtrinsicParams`]) which is
|
||||
//! used by the provided Substrate and Polkadot configuration.
|
||||
|
||||
use crate::{
|
||||
utils::Encoded,
|
||||
Config,
|
||||
};
|
||||
use codec::{
|
||||
Compact,
|
||||
Decode,
|
||||
Encode,
|
||||
};
|
||||
use crate::{utils::Encoded, Config};
|
||||
use codec::{Compact, Decode, Encode};
|
||||
use core::fmt::Debug;
|
||||
use derivative::Derivative;
|
||||
use serde::{
|
||||
Deserialize,
|
||||
Serialize,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// This trait allows you to configure the "signed extra" and
|
||||
/// "additional" parameters that are signed and used in transactions.
|
||||
@@ -148,9 +138,7 @@ impl<T: Config, Tip: Debug + Encode + 'static> ExtrinsicParams<T::Index, T::Hash
|
||||
) -> Self {
|
||||
BaseExtrinsicParams {
|
||||
era: other_params.era,
|
||||
mortality_checkpoint: other_params
|
||||
.mortality_checkpoint
|
||||
.unwrap_or(genesis_hash),
|
||||
mortality_checkpoint: other_params.mortality_checkpoint.unwrap_or(genesis_hash),
|
||||
tip: other_params.tip,
|
||||
nonce,
|
||||
spec_version,
|
||||
|
||||
+3
-12
@@ -12,15 +12,9 @@ pub mod extrinsic_params;
|
||||
pub mod polkadot;
|
||||
pub mod substrate;
|
||||
|
||||
use codec::{
|
||||
Decode,
|
||||
Encode,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use core::fmt::Debug;
|
||||
use serde::{
|
||||
de::DeserializeOwned,
|
||||
Serialize,
|
||||
};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
|
||||
pub use extrinsic_params::ExtrinsicParams;
|
||||
pub use polkadot::PolkadotConfig;
|
||||
@@ -110,10 +104,7 @@ pub trait Header: Sized + Encode {
|
||||
/// // This is how PolkadotConfig is implemented:
|
||||
/// type PolkadotConfig = WithExtrinsicParams<SubstrateConfig, PolkadotExtrinsicParams<SubstrateConfig>>;
|
||||
/// ```
|
||||
pub struct WithExtrinsicParams<
|
||||
T: Config,
|
||||
E: extrinsic_params::ExtrinsicParams<T::Index, T::Hash>,
|
||||
> {
|
||||
pub struct WithExtrinsicParams<T: Config, E: extrinsic_params::ExtrinsicParams<T::Index, T::Hash>> {
|
||||
_marker: std::marker::PhantomData<(T, E)>,
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,7 @@
|
||||
|
||||
use codec::Encode;
|
||||
|
||||
use super::extrinsic_params::{
|
||||
BaseExtrinsicParams,
|
||||
BaseExtrinsicParamsBuilder,
|
||||
};
|
||||
use super::extrinsic_params::{BaseExtrinsicParams, BaseExtrinsicParamsBuilder};
|
||||
|
||||
/// Default set of commonly used types by Polkadot nodes.
|
||||
pub type PolkadotConfig = super::WithExtrinsicParams<
|
||||
|
||||
@@ -5,32 +5,14 @@
|
||||
//! Substrate specific configuration
|
||||
|
||||
use super::{
|
||||
extrinsic_params::{
|
||||
BaseExtrinsicParams,
|
||||
BaseExtrinsicParamsBuilder,
|
||||
},
|
||||
Config,
|
||||
Hasher,
|
||||
Header,
|
||||
};
|
||||
use codec::{
|
||||
Decode,
|
||||
Encode,
|
||||
};
|
||||
use serde::{
|
||||
Deserialize,
|
||||
Serialize,
|
||||
extrinsic_params::{BaseExtrinsicParams, BaseExtrinsicParamsBuilder},
|
||||
Config, Hasher, Header,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub use crate::utils::{
|
||||
AccountId32,
|
||||
MultiAddress,
|
||||
MultiSignature,
|
||||
};
|
||||
pub use primitive_types::{
|
||||
H256,
|
||||
U256,
|
||||
};
|
||||
pub use crate::utils::{AccountId32, MultiAddress, MultiSignature};
|
||||
pub use primitive_types::{H256, U256};
|
||||
|
||||
/// Default set of commonly used types by Substrate runtimes.
|
||||
// Note: We only use this at the type level, so it should be impossible to
|
||||
@@ -137,9 +119,7 @@ where
|
||||
}
|
||||
|
||||
/// Generic header digest. From `sp_runtime::generic::digest`.
|
||||
#[derive(
|
||||
Encode, Decode, Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Default,
|
||||
)]
|
||||
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Default)]
|
||||
pub struct Digest {
|
||||
/// A list of digest items.
|
||||
pub logs: Vec<DigestItem>,
|
||||
@@ -240,9 +220,7 @@ impl Decode for DigestItem {
|
||||
Ok(Self::Seal(vals.0, vals.1))
|
||||
}
|
||||
DigestItemType::Other => Ok(Self::Other(Decode::decode(input)?)),
|
||||
DigestItemType::RuntimeEnvironmentUpdated => {
|
||||
Ok(Self::RuntimeEnvironmentUpdated)
|
||||
}
|
||||
DigestItemType::RuntimeEnvironmentUpdated => Ok(Self::RuntimeEnvironmentUpdated),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user