ac_primitives/config/
default_runtime_config.rs

1// Copyright 2019-2022 Parity Technologies (UK) Ltd.
2// This file is dual-licensed as Apache-2.0 or GPL-3.0.
3// see LICENSE for license details.
4
5//! Default set of commonly used types by Substrate and Polkadot nodes.
6//!
7//! This file is mostly subxt.
8//! https://github.com/paritytech/subxt/blob/ce0a82e3227efb0eae131f025da5f839d9623e15/subxt/src/config/polkadot.rs
9
10use crate::{
11	config::Config, sr25519, types::AccountData, AccountId32, BlakeTwo256, Block, ExtrinsicSigner,
12	GenericExtrinsicParams, Header, MultiAddress, MultiSignature, OpaqueExtrinsic, PlainTip, H256,
13};
14use codec::{Decode, Encode};
15use core::fmt::Debug;
16
17/// Standard runtime config for Substrate and Polkadot nodes.
18#[derive(Decode, Encode, Clone, Eq, PartialEq, Debug)]
19pub struct DefaultRuntimeConfig {}
20
21impl Config for DefaultRuntimeConfig {
22	type Index = u32;
23	type BlockNumber = u32;
24	type Hash = H256;
25	type AccountId = AccountId32;
26	type Address = MultiAddress<Self::AccountId, u32>;
27	type Signature = MultiSignature;
28	type Hasher = BlakeTwo256;
29	type Header = Header<Self::BlockNumber, BlakeTwo256>;
30	type AccountData = AccountData<Self::Balance>;
31	type ExtrinsicParams = PlainTipExtrinsicParams<Self>;
32	type CryptoKey = sr25519::Pair;
33	type ExtrinsicSigner = ExtrinsicSigner<Self>;
34	type Block = Block<Self::Header, OpaqueExtrinsic>;
35	type Balance = u128;
36	type ContractCurrency = u128;
37	type StakingBalance = u128;
38}
39
40/// A struct representing the signed extra and additional parameters required
41/// to construct a transaction and pay in token fees.
42pub type PlainTipExtrinsicParams<T> = GenericExtrinsicParams<T, PlainTip<<T as Config>::Balance>>;