mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 17:07:56 +00:00
fd0fe57002
* Asset Id in Config trait * add example configuring the config * fmt * fix Default trait bound * merge examples, fix default again * adjust config in examples * Update subxt/src/config/mod.rs Co-authored-by: James Wilson <james@jsdw.me> --------- Co-authored-by: James Wilson <james@jsdw.me>
34 lines
1.3 KiB
Rust
34 lines
1.3 KiB
Rust
// Copyright 2019-2023 Parity Technologies (UK) Ltd.
|
|
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
|
|
// see LICENSE for license details.
|
|
|
|
//! Polkadot specific configuration
|
|
|
|
use super::{Config, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder};
|
|
|
|
pub use crate::utils::{AccountId32, MultiAddress, MultiSignature};
|
|
use crate::SubstrateConfig;
|
|
pub use primitive_types::{H256, U256};
|
|
|
|
/// Default set of commonly used types by Polkadot nodes.
|
|
pub enum PolkadotConfig {}
|
|
|
|
impl Config for PolkadotConfig {
|
|
type Hash = <SubstrateConfig as Config>::Hash;
|
|
type AccountId = <SubstrateConfig as Config>::AccountId;
|
|
type Address = MultiAddress<Self::AccountId, ()>;
|
|
type Signature = <SubstrateConfig as Config>::Signature;
|
|
type Hasher = <SubstrateConfig as Config>::Hasher;
|
|
type Header = <SubstrateConfig as Config>::Header;
|
|
type ExtrinsicParams = PolkadotExtrinsicParams<Self>;
|
|
type AssetId = u32;
|
|
}
|
|
|
|
/// A struct representing the signed extra and additional parameters required
|
|
/// to construct a transaction for a polkadot node.
|
|
pub type PolkadotExtrinsicParams<T> = DefaultExtrinsicParams<T>;
|
|
|
|
/// A builder which leads to [`PolkadotExtrinsicParams`] being constructed.
|
|
/// This is what you provide to methods like `sign_and_submit()`.
|
|
pub type PolkadotExtrinsicParamsBuilder<T> = DefaultExtrinsicParamsBuilder<T>;
|