mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 09:51:10 +00:00
seal: Add benchmarks for dispatchables (#6715)
* seal: Fix syntax that confuses rust-analyzer * seal: Add benchmarks for Dispatchables These are only the benchmarks for the dispatchables of the pallet. Those are not listed in the Schedule because we do not want to pull the Schedule from storage before dispatching. This OK because those costs are not related to actual contract execution. Those costs (instruction costs, ext_* costs) will be benchmarked seperatly and entered into the default Schedule. * seal: Add a maximum code size * Fix comments from review * Removed SEED constant
This commit is contained in:
committed by
GitHub
parent
e7d8040af8
commit
a2163420f4
@@ -157,7 +157,6 @@ mod tests {
|
||||
use crate::tests::{Test, Call};
|
||||
use crate::wasm::prepare::prepare_contract;
|
||||
use crate::{CodeHash, BalanceOf};
|
||||
use wabt;
|
||||
use hex_literal::hex;
|
||||
use assert_matches::assert_matches;
|
||||
use sp_runtime::DispatchError;
|
||||
@@ -459,7 +458,7 @@ mod tests {
|
||||
) -> ExecResult {
|
||||
use crate::exec::Vm;
|
||||
|
||||
let wasm = wabt::wat2wasm(wat).unwrap();
|
||||
let wasm = wat::parse_str(wat).unwrap();
|
||||
let schedule = crate::Schedule::default();
|
||||
let prefab_module =
|
||||
prepare_contract::<super::runtime::Env>(&wasm, &schedule).unwrap();
|
||||
|
||||
@@ -391,7 +391,6 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::exec::Ext;
|
||||
use std::fmt;
|
||||
use wabt;
|
||||
use assert_matches::assert_matches;
|
||||
|
||||
impl fmt::Debug for PrefabWasmModule {
|
||||
@@ -417,7 +416,7 @@ mod tests {
|
||||
($name:ident, $wat:expr, $($expected:tt)*) => {
|
||||
#[test]
|
||||
fn $name() {
|
||||
let wasm = wabt::Wat2Wasm::new().validate(false).convert($wat).unwrap();
|
||||
let wasm = wat::parse_str($wat).unwrap();
|
||||
let schedule = Schedule::default();
|
||||
let r = prepare_contract::<TestEnv>(wasm.as_ref(), &schedule);
|
||||
assert_matches!(r, $($expected)*);
|
||||
@@ -694,7 +693,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn ext_println_debug_enabled() {
|
||||
let wasm = wabt::Wat2Wasm::new().validate(false).convert(
|
||||
let wasm = wat::parse_str(
|
||||
r#"
|
||||
(module
|
||||
(import "env" "ext_println" (func $ext_println (param i32 i32)))
|
||||
|
||||
Reference in New Issue
Block a user