mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
add runtime upgrade
This commit is contained in:
@@ -883,6 +883,17 @@ impl proxy::Trait for Runtime {
|
|||||||
type MaxProxies = MaxProxies;
|
type MaxProxies = MaxProxies;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct CustomOnRuntimeUpgrade;
|
||||||
|
impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
|
||||||
|
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||||
|
if scheduler::Module::<Runtime>::migrate_v1_to_t2() {
|
||||||
|
<Runtime as system::Trait>::MaximumBlockWeight::get()
|
||||||
|
} else {
|
||||||
|
<Runtime as system::Trait>::DbWeight::get().reads(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
construct_runtime! {
|
construct_runtime! {
|
||||||
pub enum Runtime where
|
pub enum Runtime where
|
||||||
Block = Block,
|
Block = Block,
|
||||||
@@ -984,7 +995,14 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
|
|||||||
/// Extrinsic type that has already been checked.
|
/// Extrinsic type that has already been checked.
|
||||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
|
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
|
||||||
/// Executive: handles dispatch to the various modules.
|
/// Executive: handles dispatch to the various modules.
|
||||||
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
|
pub type Executive = executive::Executive<
|
||||||
|
Runtime,
|
||||||
|
Block,
|
||||||
|
system::ChainContext<Runtime>,
|
||||||
|
Runtime,
|
||||||
|
AllModules,
|
||||||
|
CustomOnRuntimeUpgrade
|
||||||
|
>;
|
||||||
/// The payload being signed in the transactions.
|
/// The payload being signed in the transactions.
|
||||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||||
|
|
||||||
|
|||||||
@@ -865,6 +865,17 @@ impl proxy::Trait for Runtime {
|
|||||||
type MaxProxies = MaxProxies;
|
type MaxProxies = MaxProxies;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct CustomOnRuntimeUpgrade;
|
||||||
|
impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
|
||||||
|
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||||
|
if scheduler::Module::<Runtime>::migrate_v1_to_t2() {
|
||||||
|
<Runtime as system::Trait>::MaximumBlockWeight::get()
|
||||||
|
} else {
|
||||||
|
<Runtime as system::Trait>::DbWeight::get().reads(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
construct_runtime! {
|
construct_runtime! {
|
||||||
pub enum Runtime where
|
pub enum Runtime where
|
||||||
Block = Block,
|
Block = Block,
|
||||||
@@ -962,7 +973,14 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
|
|||||||
/// Extrinsic type that has already been checked.
|
/// Extrinsic type that has already been checked.
|
||||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
|
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
|
||||||
/// Executive: handles dispatch to the various modules.
|
/// Executive: handles dispatch to the various modules.
|
||||||
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
|
pub type Executive = executive::Executive<
|
||||||
|
Runtime,
|
||||||
|
Block,
|
||||||
|
system::ChainContext<Runtime>,
|
||||||
|
Runtime,
|
||||||
|
AllModules,
|
||||||
|
CustomOnRuntimeUpgrade
|
||||||
|
>;
|
||||||
/// The payload being signed in transactions.
|
/// The payload being signed in transactions.
|
||||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user