Skip to content

Commit

Permalink
Revert "Update substrate and hardcoded default ChargeAssetTxPayment
Browse files Browse the repository at this point in the history
… extension (paritytech#330)"

This reverts commit d6840df.
  • Loading branch information
sander2 committed Nov 29, 2021
1 parent f1a81eb commit a229889
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
19 changes: 5 additions & 14 deletions src/extrinsic/extra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,10 @@ where
/// in the queue.
#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)]
#[scale_info(skip_type_params(T))]
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<u32>,
}
pub struct ChargeTransactionPayment(#[codec(compact)] pub u128);

impl SignedExtension for ChargeAssetTxPayment {
const IDENTIFIER: &'static str = "ChargeAssetTxPayment";
impl SignedExtension for ChargeTransactionPayment {
const IDENTIFIER: &'static str = "ChargeTransactionPayment";
type AccountId = u64;
type Call = ();
type AdditionalSigned = ();
Expand Down Expand Up @@ -270,7 +264,7 @@ impl<T: Config + Clone + Debug + Eq + Send + Sync> SignedExtra<T> for DefaultExt
CheckMortality<T>,
CheckNonce<T>,
CheckWeight<T>,
ChargeAssetTxPayment,
ChargeTransactionPayment,
);
type Parameters = ();

Expand All @@ -297,10 +291,7 @@ impl<T: Config + Clone + Debug + Eq + Send + Sync> SignedExtra<T> for DefaultExt
CheckMortality((Era::Immortal, PhantomData), self.genesis_hash),
CheckNonce(self.nonce),
CheckWeight(PhantomData),
ChargeAssetTxPayment {
tip: u128::default(),
asset_id: None,
},
ChargeTransactionPayment(u128::default()),
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/extrinsic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod signer;

pub use self::{
extra::{
ChargeAssetTxPayment,
ChargeTransactionPayment,
CheckGenesis,
CheckMortality,
CheckNonce,
Expand Down
16 changes: 6 additions & 10 deletions tests/integration/frame/balances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
from: alice.account_id().clone(),
to: bob.account_id().clone(),
amount: 10_000,
};
let expected_event = balances::events::Transfer(
alice.account_id().clone(),
bob.account_id().clone(),
10_000,
);
assert_eq!(event, expected_event);

let alice_post = api
Expand Down Expand Up @@ -215,11 +215,7 @@ async fn transfer_subscription() {
let event = balances::events::Transfer::decode(&mut &raw.data[..]).unwrap();
assert_eq!(
event,
balances::events::Transfer {
from: alice.account_id().clone(),
to: bob.clone(),
amount: 10_000
}
balances::events::Transfer(alice.account_id().clone(), bob.clone(), 10_000,)
);
}

Expand Down
Binary file modified tests/integration/node_runtime.scale
Binary file not shown.

0 comments on commit a229889

Please sign in to comment.