diff --git a/contracts/dynamic-caller-contract/src/contract.rs b/contracts/dynamic-caller-contract/src/contract.rs index 9b53faf62..2948a0f83 100644 --- a/contracts/dynamic-caller-contract/src/contract.rs +++ b/contracts/dynamic-caller-contract/src/contract.rs @@ -24,6 +24,8 @@ struct CalleeContract { address: Addr, } +// When `user_defined_mock = true`, user can and must write mock implement +// with `#[cfg(not(target_arch = "wasm32"))]` for test of the trait for specified struct. #[dynamic_link(CalleeContract, user_defined_mock = true)] trait Callee: Contract { fn pong(&self, ping_num: u64) -> u64; @@ -38,6 +40,8 @@ trait Callee: Contract { fn call_caller_address_of(&self, addr: Addr) -> Addr; } +// This is the mock implementation for test. +// So, this is specified by `#[cfg(not(target_arch = "wasm32"))]`. #[cfg(not(target_arch = "wasm32"))] impl Callee for CalleeContract { fn pong(&self, ping_num: u64) -> u64 {