I write tests for my smart contract and got this error:
no caller has been set
The error comes from: ink_engine-4.2.0/src/ext.rs:325:14
. In function that I want to write tests I have following line:
let caller = self.env().caller();
Any suggestion what I do wrongly?
I look at the place the error comes from, and I see following code:
/// Returns the address of the caller.
pub fn caller(&self, output: &mut &mut [u8]) {
let caller = self
.exec_context
.caller
.as_ref()
.expect("no caller has been set")
.as_bytes();
set_output(output, caller);
}
set_caller
like this