From 1bdbd2c1767ef360b3b6daba567a5a80e90938b6 Mon Sep 17 00:00:00 2001 From: yarikbratashchuk Date: Mon, 10 Jan 2022 17:20:13 +0200 Subject: [PATCH] Addressing @xgreenx's comments --- frame/contracts/src/benchmarking/mod.rs | 11 +---------- frame/contracts/src/wasm/runtime.rs | 5 +++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index d4cc428e99f8d..9de6dc09b01b7 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -1348,11 +1348,6 @@ benchmarks! { let hashes_len = hashes_bytes.len(); let hashes_offset = 0; - let value = T::Currency::minimum_balance(); - assert!(value > 0u32.into()); - let value_bytes = value.encode(); - let value_offset = hashes_offset + hashes_len; - let code = WasmModule::::from(ModuleDefinition { memory: Some(ImportedMemory::max::()), imported_functions: vec![ImportedFunction { @@ -1373,15 +1368,11 @@ benchmarks! { offset: hashes_offset as u32, value: hashes_bytes, }, - DataSegment { - offset: value_offset as u32, - value: value_bytes, - }, ], call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE, vec![ Regular(Instruction::I32Const(0)), // flags Counter(hashes_offset as u32, hash_len as u32), // code_hash_ptr - Regular(Instruction::I32Const(value_offset as i32)), // input_data_ptr + Regular(Instruction::I32Const(0)), // input_data_ptr Regular(Instruction::I32Const(0)), // input_data_len Regular(Instruction::I32Const(u32::max_value() as i32)), // output_ptr Regular(Instruction::I32Const(0)), // output_len_ptr diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index 4a76de9cb237e..e097e924c9a20 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -1882,8 +1882,8 @@ define_env!(Env, , // // # Parameters // - // - flags: See [`CallFlags`] for a documenation of the supported flags. - // - code_hash: a pointer to the address of the code to be called. + // - flags: See [`CallFlags`] for a documentation of the supported flags. + // - code_hash: a pointer to the hash of the code to be called. // - input_data_ptr: a pointer to a buffer to be used as input data to the callee. // - input_data_len: length of the input data buffer. // - output_ptr: a pointer where the output buffer is copied to. @@ -1897,6 +1897,7 @@ define_env!(Env, , // // `ReturnCode::CalleeReverted`: Output buffer is returned. // `ReturnCode::CalleeTrapped` + // `ReturnCode::CodeNotFound` [__unstable__] seal_call_code( ctx, flags: u32,