mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 22:51:13 +00:00
This PR reverts #2280 which introduced `TransactionExtension` to replace `SignedExtension`. As a result of the discussion [here](https://github.com/paritytech/polkadot-sdk/pull/3623#issuecomment-1986789700), the changes will be reverted for now with plans to reintroduce the concept in the future. --------- Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
This commit is contained in:
@@ -30,7 +30,7 @@ use sp_core::{
|
||||
|
||||
use sp_keystore::{testing::MemoryKeystore, Keystore, KeystoreExt};
|
||||
use sp_runtime::{
|
||||
generic::UncheckedExtrinsic,
|
||||
testing::TestXt,
|
||||
traits::{BlakeTwo256, Extrinsic as ExtrinsicT, IdentifyAccount, IdentityLookup, Verify},
|
||||
RuntimeAppPublic,
|
||||
};
|
||||
@@ -73,7 +73,7 @@ impl frame_system::Config for Test {
|
||||
type MaxConsumers = ConstU32<16>;
|
||||
}
|
||||
|
||||
type Extrinsic = UncheckedExtrinsic<u64, RuntimeCall, (), ()>;
|
||||
type Extrinsic = TestXt<RuntimeCall, ()>;
|
||||
type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;
|
||||
|
||||
impl frame_system::offchain::SigningTypes for Test {
|
||||
@@ -99,7 +99,7 @@ where
|
||||
_account: AccountId,
|
||||
nonce: u64,
|
||||
) -> Option<(RuntimeCall, <Extrinsic as ExtrinsicT>::SignaturePayload)> {
|
||||
Some((call, (nonce, (), ())))
|
||||
Some((call, (nonce, ())))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,8 +219,8 @@ fn should_submit_signed_transaction_on_chain() {
|
||||
let tx = pool_state.write().transactions.pop().unwrap();
|
||||
assert!(pool_state.read().transactions.is_empty());
|
||||
let tx = Extrinsic::decode(&mut &*tx).unwrap();
|
||||
assert!(matches!(tx.preamble, sp_runtime::generic::Preamble::Signed(0, (), ())));
|
||||
assert_eq!(tx.function, RuntimeCall::Example(crate::Call::submit_price { price: 15523 }));
|
||||
assert_eq!(tx.signature.unwrap().0, 0);
|
||||
assert_eq!(tx.call, RuntimeCall::Example(crate::Call::submit_price { price: 15523 }));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -259,11 +259,11 @@ fn should_submit_unsigned_transaction_on_chain_for_any_account() {
|
||||
// then
|
||||
let tx = pool_state.write().transactions.pop().unwrap();
|
||||
let tx = Extrinsic::decode(&mut &*tx).unwrap();
|
||||
assert!(tx.is_inherent());
|
||||
assert_eq!(tx.signature, None);
|
||||
if let RuntimeCall::Example(crate::Call::submit_price_unsigned_with_signed_payload {
|
||||
price_payload: body,
|
||||
signature,
|
||||
}) = tx.function
|
||||
}) = tx.call
|
||||
{
|
||||
assert_eq!(body, price_payload);
|
||||
|
||||
@@ -313,11 +313,11 @@ fn should_submit_unsigned_transaction_on_chain_for_all_accounts() {
|
||||
// then
|
||||
let tx = pool_state.write().transactions.pop().unwrap();
|
||||
let tx = Extrinsic::decode(&mut &*tx).unwrap();
|
||||
assert!(tx.is_inherent());
|
||||
assert_eq!(tx.signature, None);
|
||||
if let RuntimeCall::Example(crate::Call::submit_price_unsigned_with_signed_payload {
|
||||
price_payload: body,
|
||||
signature,
|
||||
}) = tx.function
|
||||
}) = tx.call
|
||||
{
|
||||
assert_eq!(body, price_payload);
|
||||
|
||||
@@ -353,9 +353,9 @@ fn should_submit_raw_unsigned_transaction_on_chain() {
|
||||
let tx = pool_state.write().transactions.pop().unwrap();
|
||||
assert!(pool_state.read().transactions.is_empty());
|
||||
let tx = Extrinsic::decode(&mut &*tx).unwrap();
|
||||
assert!(tx.is_inherent());
|
||||
assert_eq!(tx.signature, None);
|
||||
assert_eq!(
|
||||
tx.function,
|
||||
tx.call,
|
||||
RuntimeCall::Example(crate::Call::submit_price_unsigned {
|
||||
block_number: 1,
|
||||
price: 15523
|
||||
|
||||
Reference in New Issue
Block a user