From fd046b0eafc553ae821103dee2964544a8bd9fa1 Mon Sep 17 00:00:00 2001 From: Tadeo Hepperle <62739623+tadeohepperle@users.noreply.github.com> Date: Tue, 2 May 2023 18:35:45 +0200 Subject: [PATCH] use unit type in polkadot config (#943) --- subxt/src/config/mod.rs | 8 -------- subxt/src/config/polkadot.rs | 24 +++++++++++++++++++----- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/subxt/src/config/mod.rs b/subxt/src/config/mod.rs index 8d3cddd6cc..ba569efa39 100644 --- a/subxt/src/config/mod.rs +++ b/subxt/src/config/mod.rs @@ -95,14 +95,6 @@ pub trait Header: Sized + Encode { /// Take a type implementing [`Config`] (eg [`SubstrateConfig`]), and some type which describes the /// additional and extra parameters to pass to an extrinsic (see [`ExtrinsicParams`]), /// and returns a type implementing [`Config`] with those new [`ExtrinsicParams`]. -/// -/// # Example -/// -/// ``` -/// use subxt::config::{ SubstrateConfig, WithExtrinsicParams, polkadot::PolkadotExtrinsicParams }; -/// -/// // This is how PolkadotConfig is implemented: -/// type PolkadotConfig = WithExtrinsicParams>; /// ``` pub struct WithExtrinsicParams> { _marker: std::marker::PhantomData<(T, E)>, diff --git a/subxt/src/config/polkadot.rs b/subxt/src/config/polkadot.rs index 649c4475dc..de46f05b44 100644 --- a/subxt/src/config/polkadot.rs +++ b/subxt/src/config/polkadot.rs @@ -4,15 +4,29 @@ //! Polkadot specific configuration +use super::{ + extrinsic_params::{BaseExtrinsicParams, BaseExtrinsicParamsBuilder}, + Config, +}; use codec::Encode; -use super::extrinsic_params::{BaseExtrinsicParams, BaseExtrinsicParamsBuilder}; +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 type PolkadotConfig = super::WithExtrinsicParams< - super::SubstrateConfig, - PolkadotExtrinsicParams, ->; +pub enum PolkadotConfig {} + +impl Config for PolkadotConfig { + type Index = ::Index; + type Hash = ::Hash; + type AccountId = ::AccountId; + type Address = MultiAddress; + type Signature = ::Signature; + type Hasher = ::Hasher; + type Header = ::Header; + type ExtrinsicParams = PolkadotExtrinsicParams; +} /// A struct representing the signed extra and additional parameters required /// to construct a transaction for a polkadot node.