mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 16:57:58 +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:
@@ -107,21 +107,18 @@ pub fn create_extrinsic(
|
||||
.map(|c| c / 2)
|
||||
.unwrap_or(2) as u64;
|
||||
let tip = 0;
|
||||
let tx_ext: kitchensink_runtime::TxExtension =
|
||||
let extra: kitchensink_runtime::SignedExtra =
|
||||
(
|
||||
(
|
||||
frame_system::CheckNonZeroSender::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckSpecVersion::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckTxVersion::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckGenesis::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckEra::<kitchensink_runtime::Runtime>::from(generic::Era::mortal(
|
||||
period,
|
||||
best_block.saturated_into(),
|
||||
)),
|
||||
frame_system::CheckNonce::<kitchensink_runtime::Runtime>::from(nonce),
|
||||
frame_system::CheckWeight::<kitchensink_runtime::Runtime>::new(),
|
||||
)
|
||||
.into(),
|
||||
frame_system::CheckNonZeroSender::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckSpecVersion::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckTxVersion::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckGenesis::<kitchensink_runtime::Runtime>::new(),
|
||||
frame_system::CheckEra::<kitchensink_runtime::Runtime>::from(generic::Era::mortal(
|
||||
period,
|
||||
best_block.saturated_into(),
|
||||
)),
|
||||
frame_system::CheckNonce::<kitchensink_runtime::Runtime>::from(nonce),
|
||||
frame_system::CheckWeight::<kitchensink_runtime::Runtime>::new(),
|
||||
pallet_skip_feeless_payment::SkipCheckIfFeeless::from(
|
||||
pallet_asset_conversion_tx_payment::ChargeAssetTxPayment::<
|
||||
kitchensink_runtime::Runtime,
|
||||
@@ -131,17 +128,15 @@ pub fn create_extrinsic(
|
||||
|
||||
let raw_payload = kitchensink_runtime::SignedPayload::from_raw(
|
||||
function.clone(),
|
||||
tx_ext.clone(),
|
||||
extra.clone(),
|
||||
(
|
||||
(
|
||||
(),
|
||||
kitchensink_runtime::VERSION.spec_version,
|
||||
kitchensink_runtime::VERSION.transaction_version,
|
||||
genesis_hash,
|
||||
best_hash,
|
||||
(),
|
||||
(),
|
||||
),
|
||||
(),
|
||||
kitchensink_runtime::VERSION.spec_version,
|
||||
kitchensink_runtime::VERSION.transaction_version,
|
||||
genesis_hash,
|
||||
best_hash,
|
||||
(),
|
||||
(),
|
||||
(),
|
||||
),
|
||||
);
|
||||
@@ -151,7 +146,7 @@ pub fn create_extrinsic(
|
||||
function,
|
||||
sp_runtime::AccountId32::from(sender.public()).into(),
|
||||
kitchensink_runtime::Signature::Sr25519(signature),
|
||||
tx_ext,
|
||||
extra,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -796,7 +791,7 @@ mod tests {
|
||||
use codec::Encode;
|
||||
use kitchensink_runtime::{
|
||||
constants::{currency::CENTS, time::SLOT_DURATION},
|
||||
Address, BalancesCall, RuntimeCall, TxExtension, UncheckedExtrinsic,
|
||||
Address, BalancesCall, RuntimeCall, UncheckedExtrinsic,
|
||||
};
|
||||
use node_primitives::{Block, DigestItem, Signature};
|
||||
use sc_client_api::BlockBackend;
|
||||
@@ -998,31 +993,25 @@ mod tests {
|
||||
let tx_payment = pallet_skip_feeless_payment::SkipCheckIfFeeless::from(
|
||||
pallet_asset_conversion_tx_payment::ChargeAssetTxPayment::from(0, None),
|
||||
);
|
||||
let tx_ext: TxExtension = (
|
||||
(
|
||||
check_non_zero_sender,
|
||||
check_spec_version,
|
||||
check_tx_version,
|
||||
check_genesis,
|
||||
check_era,
|
||||
check_nonce,
|
||||
check_weight,
|
||||
)
|
||||
.into(),
|
||||
let extra = (
|
||||
check_non_zero_sender,
|
||||
check_spec_version,
|
||||
check_tx_version,
|
||||
check_genesis,
|
||||
check_era,
|
||||
check_nonce,
|
||||
check_weight,
|
||||
tx_payment,
|
||||
);
|
||||
let raw_payload = SignedPayload::from_raw(
|
||||
function,
|
||||
tx_ext,
|
||||
(
|
||||
((), spec_version, transaction_version, genesis_hash, genesis_hash, (), ()),
|
||||
(),
|
||||
),
|
||||
extra,
|
||||
((), spec_version, transaction_version, genesis_hash, genesis_hash, (), (), ()),
|
||||
);
|
||||
let signature = raw_payload.using_encoded(|payload| signer.sign(payload));
|
||||
let (function, tx_ext, _) = raw_payload.deconstruct();
|
||||
let (function, extra, _) = raw_payload.deconstruct();
|
||||
index += 1;
|
||||
UncheckedExtrinsic::new_signed(function, from.into(), signature.into(), tx_ext)
|
||||
UncheckedExtrinsic::new_signed(function, from.into(), signature.into(), extra)
|
||||
.into()
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user