Simplify chain config

This commit is contained in:
Daan van der Plas
2023-10-30 15:40:37 +01:00
parent a6efebac04
commit bb237a3f15
+4 -16
View File
@@ -1,5 +1,5 @@
use subxt::{
config::{Config, PolkadotConfig, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder},
PolkadotConfig,
utils::{AccountId32, MultiAddress},
OnlineClient,
};
@@ -8,21 +8,9 @@ use subxt_signer::sr25519::dev::{self};
#[subxt::subxt(runtime_metadata_path = "statemint_metadata.scale")]
pub mod statemint {}
/// Custom config that works with Statemint:
pub enum StatemintConfig {}
impl Config for StatemintConfig {
type Hash = <PolkadotConfig as Config>::Hash;
type AccountId = <PolkadotConfig as Config>::AccountId;
type Address = <PolkadotConfig as Config>::Address;
type Signature = <PolkadotConfig as Config>::Signature;
type Hasher = <PolkadotConfig as Config>::Hasher;
type Header = <PolkadotConfig as Config>::Header;
type ExtrinsicParams = StatemintExtriniscParams<Self>;
}
pub type StatemintExtriniscParams<T> = DefaultExtrinsicParams<T>;
pub type StatemintExtrinsicParamsBuilder<T> = DefaultExtrinsicParamsBuilder<T>;
// PolkadotConfig or SubstrateConfig will suffice for this example at the moment,
// but PolkadotConfig is a little more correct, having the right `Address` type.
type StatemintConfig = PolkadotConfig;
#[tokio::main]
pub async fn main() {