Update Substrate & Polkadot (#375)

* Update Substrate & Polkadot

* Remove `can_set_code` for now
This commit is contained in:
Bastian Köcher
2021-03-23 15:54:40 +01:00
committed by GitHub
parent 4ad027079f
commit 4d680a5107
5 changed files with 322 additions and 244 deletions
+299 -220
View File
File diff suppressed because it is too large Load Diff
@@ -28,7 +28,7 @@ use sp_inherents::InherentDataProviders;
use sp_runtime::{ use sp_runtime::{
generic::BlockId, generic::BlockId,
traits::{Block as BlockT, Header as HeaderT}, traits::{Block as BlockT, Header as HeaderT},
Justification, Justifications,
}; };
/// A verifier that just checks the inherents. /// A verifier that just checks the inherents.
@@ -48,7 +48,7 @@ where
&mut self, &mut self,
origin: BlockOrigin, origin: BlockOrigin,
header: Block::Header, header: Block::Header,
justification: Option<Justification>, justifications: Option<Justifications>,
mut body: Option<Vec<Block::Extrinsic>>, mut body: Option<Vec<Block::Extrinsic>>,
) -> Result< ) -> Result<
( (
@@ -88,7 +88,7 @@ where
let post_hash = Some(header.hash()); let post_hash = Some(header.hash());
let mut block_import_params = BlockImportParams::new(origin, header); let mut block_import_params = BlockImportParams::new(origin, header);
block_import_params.body = body; block_import_params.body = body;
block_import_params.justification = justification; block_import_params.justifications = justifications;
// Best block is determined by the relay chain, or if we are doing the intial sync // Best block is determined by the relay chain, or if we are doing the intial sync
// we import all blocks as new best. // we import all blocks as new best.
+2 -3
View File
@@ -142,7 +142,6 @@ decl_module! {
#[weight = (0, DispatchClass::Operational)] #[weight = (0, DispatchClass::Operational)]
pub fn schedule_upgrade(origin, validation_function: Vec<u8>) { pub fn schedule_upgrade(origin, validation_function: Vec<u8>) {
ensure_root(origin)?; ensure_root(origin)?;
<frame_system::Module<T>>::can_set_code(&validation_function)?;
Self::schedule_upgrade_impl(validation_function)?; Self::schedule_upgrade_impl(validation_function)?;
} }
@@ -909,8 +908,8 @@ mod tests {
NodeBlock = Block, NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic, UncheckedExtrinsic = UncheckedExtrinsic,
{ {
System: frame_system::{Module, Call, Config, Storage, Event<T>}, System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
ParachainSystem: parachain_system::{Module, Call, Storage, Event}, ParachainSystem: parachain_system::{Pallet, Call, Storage, Event},
} }
); );
+10 -10
View File
@@ -299,15 +299,15 @@ construct_runtime! {
NodeBlock = rococo_parachain_primitives::Block, NodeBlock = rococo_parachain_primitives::Block,
UncheckedExtrinsic = UncheckedExtrinsic, UncheckedExtrinsic = UncheckedExtrinsic,
{ {
System: frame_system::{Module, Call, Storage, Config, Event<T>}, System: frame_system::{Pallet, Call, Storage, Config, Event<T>},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>}, Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
Sudo: pallet_sudo::{Module, Call, Storage, Config<T>, Event<T>}, Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage}, RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage},
ParachainSystem: cumulus_pallet_parachain_system::{Module, Call, Storage, Inherent, Event}, ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Storage, Inherent, Event},
TransactionPayment: pallet_transaction_payment::{Module, Storage}, TransactionPayment: pallet_transaction_payment::{Pallet, Storage},
ParachainInfo: parachain_info::{Module, Storage, Config}, ParachainInfo: parachain_info::{Pallet, Storage, Config},
XcmHandler: cumulus_pallet_xcm_handler::{Module, Call, Event<T>, Origin}, XcmHandler: cumulus_pallet_xcm_handler::{Pallet, Call, Event<T>, Origin},
} }
} }
@@ -340,7 +340,7 @@ pub type Executive = frame_executive::Executive<
Block, Block,
frame_system::ChainContext<Runtime>, frame_system::ChainContext<Runtime>,
Runtime, Runtime,
AllModules, AllPallets,
>; >;
impl_runtime_apis! { impl_runtime_apis! {
+8 -8
View File
@@ -225,13 +225,13 @@ construct_runtime! {
NodeBlock = NodeBlock, NodeBlock = NodeBlock,
UncheckedExtrinsic = UncheckedExtrinsic, UncheckedExtrinsic = UncheckedExtrinsic,
{ {
System: frame_system::{Module, Call, Storage, Config, Event<T>}, System: frame_system::{Pallet, Call, Storage, Config, Event<T>},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>}, Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
Sudo: pallet_sudo::{Module, Call, Storage, Config<T>, Event<T>}, Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage}, RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage},
ParachainSystem: cumulus_pallet_parachain_system::{Module, Call, Storage, Inherent, Event}, ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Storage, Inherent, Event},
TransactionPayment: pallet_transaction_payment::{Module, Storage}, TransactionPayment: pallet_transaction_payment::{Pallet, Storage},
} }
} }
@@ -280,7 +280,7 @@ pub type Executive = frame_executive::Executive<
Block, Block,
frame_system::ChainContext<Runtime>, frame_system::ChainContext<Runtime>,
Runtime, Runtime,
AllModules, AllPallets,
>; >;
/// 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>;