mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 22:45:40 +00:00
A simple check to reject obviously wrong validation code binaries (#1989)
* A simple check to reject obviously wrong validation code binaries * Use wasm-magic constants in the tests. * tabs not spaces * move WASM_MAGIC into lib.rs
This commit is contained in:
@@ -49,6 +49,10 @@ pub use impls::ToAuthor;
|
||||
|
||||
pub type NegativeImbalance<T> = <pallet_balances::Module<T> as Currency<<T as frame_system::Trait>::AccountId>>::NegativeImbalance;
|
||||
|
||||
/// The sequence of bytes a valid wasm module binary always starts with. Apart from that it's also a
|
||||
/// valid wasm module.
|
||||
const WASM_MAGIC: &[u8] = &[0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00];
|
||||
|
||||
/// We assume that an on-initialize consumes 2.5% of the weight on average, hence a single extrinsic
|
||||
/// will not be allowed to consume more than `AvailableBlockRatio - 2.5%`.
|
||||
pub const AVERAGE_ON_INITIALIZE_WEIGHT: Perbill = Perbill::from_perthousand(25);
|
||||
|
||||
Reference in New Issue
Block a user