diff --git a/src/client.rs b/src/client.rs index ae8a5a91c8..c243d0fc91 100644 --- a/src/client.rs +++ b/src/client.rs @@ -213,7 +213,7 @@ where where <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static { - let extrinsic = self.create_signed(signer).await?; + let extrinsic = self.create_signed(signer, Default::default()).await?; self.client .rpc() .submit_and_watch_extrinsic(extrinsic, self.client.events_decoder()) @@ -235,7 +235,7 @@ where where <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static { - let extrinsic = self.create_signed(signer).await?; + let extrinsic = self.create_signed(signer, Default::default()).await?; self.client.rpc().submit_extrinsic(extrinsic).await } @@ -243,6 +243,7 @@ where pub async fn create_signed( &self, signer: &(dyn Signer + Send + Sync), + additional_params: >::Parameters, ) -> Result, Error> where <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static @@ -273,6 +274,7 @@ where account_nonce, call, signer, + additional_params, ) .await?; Ok(signed) diff --git a/src/extrinsic/extra.rs b/src/extrinsic/extra.rs index 62c66bd6f6..6388c49517 100644 --- a/src/extrinsic/extra.rs +++ b/src/extrinsic/extra.rs @@ -230,6 +230,8 @@ impl SignedExtension for ChargeTransactionPayment { pub trait SignedExtra: SignedExtension { /// The type the extras. type Extra: SignedExtension + Send + Sync; + /// The additional config parameters. + type Parameters: Default + Send + Sync; /// Creates a new `SignedExtra`. fn new( @@ -237,6 +239,7 @@ pub trait SignedExtra: SignedExtension { tx_version: u32, nonce: T::Index, genesis_hash: T::Hash, + additional_params: Self::Parameters, ) -> Self; /// Returns the transaction extra. @@ -263,12 +266,14 @@ impl SignedExtra for DefaultExt CheckWeight, ChargeTransactionPayment, ); + type Parameters = (); fn new( spec_version: u32, tx_version: u32, nonce: T::Index, genesis_hash: T::Hash, + _params: Self::Parameters, ) -> Self { DefaultExtra { spec_version, diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index 542382bab5..376e5b54e1 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -68,6 +68,7 @@ pub async fn create_signed( nonce: T::Index, call: Encoded, signer: &(dyn Signer + Send + Sync), + additional_params: >::Parameters, ) -> Result, Error> where T: Config + ExtrinsicExtraData, @@ -81,6 +82,7 @@ where tx_version, nonce, genesis_hash, + additional_params, ); let payload = SignedPayload::::new(call, extra.extra())?; let signed = signer.sign(payload).await?;