Created
May 16, 2022 13:39
-
-
Save darwinsubramaniam/1a6d58243d7bf340a31d5e48d4d0fb0b to your computer and use it in GitHub Desktop.
Ink! Set Caller and Callee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let accounts = | |
ink_env::test::default_accounts::<ink_env::DefaultEnvironment>(); | |
assert_eq!(erc20.balance_of(accounts.bob), 0); | |
// Set the contract as callee and Bob as caller. | |
let contract = ink_env::account_id::<ink_env::DefaultEnvironment>(); | |
ink_env::test::set_callee::<ink_env::DefaultEnvironment>(contract); | |
ink_env::test::set_caller::<ink_env::DefaultEnvironment>(accounts.bob); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment