diff --git a/src/extrinsic/extra.rs b/src/extrinsic/extra.rs index 6388c49517..c4a75ec7ba 100644 --- a/src/extrinsic/extra.rs +++ b/src/extrinsic/extra.rs @@ -211,10 +211,16 @@ where /// in the queue. #[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] #[scale_info(skip_type_params(T))] -pub struct ChargeTransactionPayment(#[codec(compact)] pub u128); +pub struct ChargeAssetTxPayment { + /// The tip for the block author. + #[codec(compact)] + pub tip: u128, + /// The asset with which to pay the tip. + pub asset_id: Option, +} -impl SignedExtension for ChargeTransactionPayment { - const IDENTIFIER: &'static str = "ChargeTransactionPayment"; +impl SignedExtension for ChargeAssetTxPayment { + const IDENTIFIER: &'static str = "ChargeAssetTxPayment"; type AccountId = u64; type Call = (); type AdditionalSigned = (); @@ -264,7 +270,7 @@ impl SignedExtra for DefaultExt CheckMortality, CheckNonce, CheckWeight, - ChargeTransactionPayment, + ChargeAssetTxPayment, ); type Parameters = (); @@ -291,7 +297,10 @@ impl SignedExtra for DefaultExt CheckMortality((Era::Immortal, PhantomData), self.genesis_hash), CheckNonce(self.nonce), CheckWeight(PhantomData), - ChargeTransactionPayment(u128::default()), + ChargeAssetTxPayment { + tip: u128::default(), + asset_id: None, + }, ) } } diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index 376e5b54e1..1336c3565b 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -21,7 +21,7 @@ mod signer; pub use self::{ extra::{ - ChargeTransactionPayment, + ChargeAssetTxPayment, CheckGenesis, CheckMortality, CheckNonce, diff --git a/tests/integration/frame/balances.rs b/tests/integration/frame/balances.rs index 765414d7be..8b12790ffa 100644 --- a/tests/integration/frame/balances.rs +++ b/tests/integration/frame/balances.rs @@ -77,11 +77,11 @@ async fn tx_basic_transfer() { .expect("Failed to decode ExtrinisicSuccess") .expect("Failed to find ExtrinisicSuccess"); - let expected_event = balances::events::Transfer( - alice.account_id().clone(), - bob.account_id().clone(), - 10_000, - ); + let expected_event = balances::events::Transfer { + from: alice.account_id().clone(), + to: bob.account_id().clone(), + amount: 10_000, + }; assert_eq!(event, expected_event); let alice_post = api @@ -215,7 +215,11 @@ async fn transfer_subscription() { let event = balances::events::Transfer::decode(&mut &raw.data[..]).unwrap(); assert_eq!( event, - balances::events::Transfer(alice.account_id().clone(), bob.clone(), 10_000,) + balances::events::Transfer { + from: alice.account_id().clone(), + to: bob.clone(), + amount: 10_000 + } ); } diff --git a/tests/integration/node_runtime.scale b/tests/integration/node_runtime.scale index cff019d32c..2ab10bd2a8 100644 Binary files a/tests/integration/node_runtime.scale and b/tests/integration/node_runtime.scale differ