remove WASM_MAGIC (#2832)

* remove WASM_MAGIC

* fix test warnings
This commit is contained in:
Robert Habermeier
2021-04-07 11:00:22 +02:00
committed by GitHub
parent e67f31cc49
commit 251b6ca7bf
5 changed files with 7 additions and 39 deletions
@@ -16,7 +16,6 @@
//! A simple wrapper allowing `Sudo` to call into `paras` routines.
use crate::WASM_MAGIC;
use sp_std::prelude::*;
use frame_support::{
decl_error, decl_module, ensure,
@@ -47,8 +46,6 @@ decl_error! {
/// A DMP message couldn't be sent because it exceeds the maximum size allowed for a downward
/// message.
ExceedsMaxMessageSize,
/// The validation code provided doesn't start with the Wasm file magic string.
DefinitelyNotWasm,
/// Could not schedule para cleanup.
CouldntCleanup,
/// Not a parathread.
@@ -75,7 +72,6 @@ decl_module! {
genesis: ParaGenesisArgs,
) -> DispatchResult {
ensure_root(origin)?;
ensure!(genesis.validation_code.0.starts_with(WASM_MAGIC), Error::<T>::DefinitelyNotWasm);
runtime_parachains::schedule_para_initialize::<T>(id, genesis).map_err(|_| Error::<T>::ParaAlreadyExists)?;
Ok(())
}