Closed kobby-pentangeli closed 2 years ago
Reviewing :)
The loading of the destination account fails because the helper function create_account
in vmcalls_tests.rs
creates a new GlobalState::in_memory
at every call. The two accounts effectively exist in two separate databases. I believe we've never had a test that required creating multiple accounts!
The solution is:
gs: &GlobalState
parameter to create_account
and .clone()
it inside the function body if necessary. Cloning a GlobalState
is relatively cheap because it's wrapped in an Arc
.let gs = GlobalState::in_memory();
where necessary and pass it as an argument to create_account
.
This PR addresses issue#406, i.e. introducing a new host function that sends coins from the current executing account to a destination account.
TODO: