35 lines
1.4 KiB
Rust
35 lines
1.4 KiB
Rust
//! Casper specific configuration
|
|
|
|
use subxt::{
|
|
Config, blocks::Block, client::OnlineClient,
|
|
config::{DefaultExtrinsicParamsBuilder, DefaultExtrinsicParams, SubstrateConfig},
|
|
};
|
|
|
|
/// Default set of commonly used type by Casper nodes.
|
|
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
|
|
pub enum CasperConfig {}
|
|
|
|
impl Config for CasperConfig {
|
|
type Hash = <SubstrateConfig as Config>::Hash;
|
|
type AccountId = <SubstrateConfig as Config>::AccountId;
|
|
type Address = <SubstrateConfig as Config>::Address;
|
|
type Signature = <SubstrateConfig as Config>::Signature;
|
|
type Hasher = <SubstrateConfig as Config>::Hasher;
|
|
type Header = <SubstrateConfig as Config>::Header;
|
|
type ExtrinsicParams = CasperExtrinsicParams<Self>;
|
|
type AssetId = u32;
|
|
}
|
|
|
|
/// A 32-byte cryptographic identifier. This is a simplified version of
|
|
/// `sp_core::crypto::AccountId32`.
|
|
pub type CasperAccountId = subxt::utils::AccountId32;
|
|
pub type CasperBlock = Block<CasperConfig, OnlineClient<CasperConfig>>;
|
|
|
|
/// A struct representing the signed extra and additional parameters required to construct a
|
|
/// transaction for a casper node.
|
|
pub type CasperExtrinsicParams<T> = DefaultExtrinsicParams<T>;
|
|
|
|
/// A builder which leads to [`CasperExtrinsicParams`] being constructed. This is what we provide
|
|
/// to methods like `sign_and_submit()`.
|
|
pub type CasperExtrinsicParamsBuilder<T> = DefaultExtrinsicParamsBuilder<T>;
|