Skip to content

Commit

Permalink
[runtime/merke] Document method merkle_add()
Browse files Browse the repository at this point in the history
  • Loading branch information
y committed Nov 22, 2023
1 parent d4b8d45 commit 78196db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/runtime/import/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ use wasmer::{FunctionEnvMut, WasmPtr};

use crate::runtime::vm_runtime::{ContractSection, Env};

/// Adds data to merkle tree. The tree, database connection, and new data to add is
/// read from `ptr` at offset specified by `len`.
/// Returns `0` on success; otherwise, returns a negative error-code corresponding to a
/// [`ContractError`] (defined in the SDK).
/// See also the method `merkle_add` in `sdk/src/merkle.rs`.
pub(crate) fn merkle_add(ctx: FunctionEnvMut<Env>, ptr: WasmPtr<u8>, len: u32) -> i32 {
let env = ctx.data();
match env.contract_section {
Expand Down

0 comments on commit 78196db

Please sign in to comment.