Revert "FRAME: Create TransactionExtension as a replacement for SignedExtension (#2280)" (#3665)

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:
georgepisaltu
2024-03-13 16:10:59 +02:00
committed by GitHub
parent 60ac5a723c
commit bbd51ce867
350 changed files with 15826 additions and 24304 deletions
+9 -31
View File
@@ -238,7 +238,6 @@ impl pallet_transaction_payment::Config for Runtime {
type WeightToFee = WeightToFee;
type LengthToFee = frame_support::weights::ConstantMultiplier<Balance, TransactionByteFee>;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
type WeightInfo = ();
}
parameter_types! {
@@ -394,7 +393,7 @@ where
let current_block = System::block_number().saturated_into::<u64>().saturating_sub(1);
let tip = 0;
let tx_ext: TxExtension = (
let extra: SignedExtra = (
frame_system::CheckNonZeroSender::<Runtime>::new(),
frame_system::CheckSpecVersion::<Runtime>::new(),
frame_system::CheckTxVersion::<Runtime>::new(),
@@ -406,17 +405,16 @@ where
frame_system::CheckNonce::<Runtime>::from(nonce),
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
)
.into();
let raw_payload = SignedPayload::new(call, tx_ext)
);
let raw_payload = SignedPayload::new(call, extra)
.map_err(|e| {
log::warn!("Unable to create signed payload: {:?}", e);
})
.ok()?;
let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?;
let (call, tx_ext, _) = raw_payload.deconstruct();
let (call, extra, _) = raw_payload.deconstruct();
let address = Indices::unlookup(account);
Some((call, (address, signature, tx_ext)))
Some((call, (address, signature, extra)))
}
}
@@ -444,32 +442,12 @@ parameter_types! {
pub Prefix: &'static [u8] = b"Pay KSMs to the Kusama account:";
}
#[cfg(feature = "runtime-benchmarks")]
pub struct ClaimsHelper;
#[cfg(feature = "runtime-benchmarks")]
use frame_support::dispatch::DispatchInfo;
#[cfg(feature = "runtime-benchmarks")]
impl claims::BenchmarkHelperTrait<RuntimeCall, DispatchInfo> for ClaimsHelper {
fn default_call_and_info() -> (RuntimeCall, DispatchInfo) {
use frame_support::dispatch::GetDispatchInfo;
let call = RuntimeCall::Claims(claims::Call::attest {
statement: claims::StatementKind::Regular.to_text().to_vec(),
});
let info = call.get_dispatch_info();
(call, info)
}
}
impl claims::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type VestingSchedule = Vesting;
type Prefix = Prefix;
type MoveClaimOrigin = frame_system::EnsureRoot<AccountId>;
type WeightInfo = claims::TestWeightInfo;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = ClaimsHelper;
}
parameter_types! {
@@ -750,8 +728,8 @@ pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type SignedBlock = generic::SignedBlock<Block>;
/// `BlockId` type as expected by this runtime.
pub type BlockId = generic::BlockId<Block>;
/// The extension to the basic transaction logic.
pub type TxExtension = (
/// The `SignedExtension` to the basic transaction logic.
pub type SignedExtra = (
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>,
@@ -763,7 +741,7 @@ pub type TxExtension = (
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, TxExtension>;
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
@@ -774,7 +752,7 @@ pub type Executive = frame_executive::Executive<
AllPalletsWithSystem,
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<RuntimeCall, TxExtension>;
pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
pub type Hash = <Block as BlockT>::Hash;
pub type Extrinsic = <Block as BlockT>::Extrinsic;