From 78196dbdd278fcb3982c9be367f9487077e4bd95 Mon Sep 17 00:00:00 2001 From: y Date: Wed, 22 Nov 2023 11:43:41 -0500 Subject: [PATCH] [runtime/merke] Document method merkle_add() --- src/runtime/import/merkle.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/runtime/import/merkle.rs b/src/runtime/import/merkle.rs index 7fa569a54895..f3a9a7816f09 100644 --- a/src/runtime/import/merkle.rs +++ b/src/runtime/import/merkle.rs @@ -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, ptr: WasmPtr, len: u32) -> i32 { let env = ctx.data(); match env.contract_section {