mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-18 10:35:42 +00:00
Update substrate and hardcoded default ChargeAssetTxPayment extension (#330)
* Update balances events * Update node_runtime.scale * Update default extra to include ChargeAssetTxPayment with extra field * Fmt
This commit is contained in:
+14
-5
@@ -211,10 +211,16 @@ where
|
|||||||
/// in the queue.
|
/// in the queue.
|
||||||
#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)]
|
#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)]
|
||||||
#[scale_info(skip_type_params(T))]
|
#[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<u32>,
|
||||||
|
}
|
||||||
|
|
||||||
impl SignedExtension for ChargeTransactionPayment {
|
impl SignedExtension for ChargeAssetTxPayment {
|
||||||
const IDENTIFIER: &'static str = "ChargeTransactionPayment";
|
const IDENTIFIER: &'static str = "ChargeAssetTxPayment";
|
||||||
type AccountId = u64;
|
type AccountId = u64;
|
||||||
type Call = ();
|
type Call = ();
|
||||||
type AdditionalSigned = ();
|
type AdditionalSigned = ();
|
||||||
@@ -264,7 +270,7 @@ impl<T: Config + Clone + Debug + Eq + Send + Sync> SignedExtra<T> for DefaultExt
|
|||||||
CheckMortality<T>,
|
CheckMortality<T>,
|
||||||
CheckNonce<T>,
|
CheckNonce<T>,
|
||||||
CheckWeight<T>,
|
CheckWeight<T>,
|
||||||
ChargeTransactionPayment,
|
ChargeAssetTxPayment,
|
||||||
);
|
);
|
||||||
type Parameters = ();
|
type Parameters = ();
|
||||||
|
|
||||||
@@ -291,7 +297,10 @@ impl<T: Config + Clone + Debug + Eq + Send + Sync> SignedExtra<T> for DefaultExt
|
|||||||
CheckMortality((Era::Immortal, PhantomData), self.genesis_hash),
|
CheckMortality((Era::Immortal, PhantomData), self.genesis_hash),
|
||||||
CheckNonce(self.nonce),
|
CheckNonce(self.nonce),
|
||||||
CheckWeight(PhantomData),
|
CheckWeight(PhantomData),
|
||||||
ChargeTransactionPayment(u128::default()),
|
ChargeAssetTxPayment {
|
||||||
|
tip: u128::default(),
|
||||||
|
asset_id: None,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ mod signer;
|
|||||||
|
|
||||||
pub use self::{
|
pub use self::{
|
||||||
extra::{
|
extra::{
|
||||||
ChargeTransactionPayment,
|
ChargeAssetTxPayment,
|
||||||
CheckGenesis,
|
CheckGenesis,
|
||||||
CheckMortality,
|
CheckMortality,
|
||||||
CheckNonce,
|
CheckNonce,
|
||||||
|
|||||||
@@ -77,11 +77,11 @@ async fn tx_basic_transfer() {
|
|||||||
.expect("Failed to decode ExtrinisicSuccess")
|
.expect("Failed to decode ExtrinisicSuccess")
|
||||||
.expect("Failed to find ExtrinisicSuccess");
|
.expect("Failed to find ExtrinisicSuccess");
|
||||||
|
|
||||||
let expected_event = balances::events::Transfer(
|
let expected_event = balances::events::Transfer {
|
||||||
alice.account_id().clone(),
|
from: alice.account_id().clone(),
|
||||||
bob.account_id().clone(),
|
to: bob.account_id().clone(),
|
||||||
10_000,
|
amount: 10_000,
|
||||||
);
|
};
|
||||||
assert_eq!(event, expected_event);
|
assert_eq!(event, expected_event);
|
||||||
|
|
||||||
let alice_post = api
|
let alice_post = api
|
||||||
@@ -215,7 +215,11 @@ async fn transfer_subscription() {
|
|||||||
let event = balances::events::Transfer::decode(&mut &raw.data[..]).unwrap();
|
let event = balances::events::Transfer::decode(&mut &raw.data[..]).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
event,
|
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
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user