Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Addressing @xgreenx's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikbratashchuk committed Jan 10, 2022
1 parent 99bb2bc commit 1bdbd2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
11 changes: 1 addition & 10 deletions frame/contracts/src/benchmarking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<T>::from(ModuleDefinition {
memory: Some(ImportedMemory::max::<T>()),
imported_functions: vec![ImportedFunction {
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions frame/contracts/src/wasm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1882,8 +1882,8 @@ define_env!(Env, <E: Ext>,
//
// # 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.
Expand All @@ -1897,6 +1897,7 @@ define_env!(Env, <E: Ext>,
//
// `ReturnCode::CalleeReverted`: Output buffer is returned.
// `ReturnCode::CalleeTrapped`
// `ReturnCode::CodeNotFound`
[__unstable__] seal_call_code(
ctx,
flags: u32,
Expand Down

0 comments on commit 1bdbd2c

Please sign in to comment.