fn do_check(&mut self) -> Result<()> {
let caller = self.env().caller();
...
}
我正在为函数编写一个测试do_check
函数。在这里,我想设置一个调用者,但不知道该怎么做。
#[cfg(test)]
mod tests {
use super::*;
use ink_lang as ink;
#[ink::test]
fn do_check_works() {
let mut test = Test::new();
// here I want to set a caller for calling do_check
test.do_check();
...