Skip to content

Commit

Permalink
Fix(standalone): set predecessor_account_id appropriately when execut…
Browse files Browse the repository at this point in the history
…ing promise callbacks (#467)
  • Loading branch information
birchmd authored Mar 15, 2022
1 parent d3a3dd5 commit 7d8c023
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions engine-standalone-storage/src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ pub fn consume_message(storage: &mut crate::Storage, message: Message) -> Result
&promise_args.callback.args,
)
.expect("Connector deposit function must return valid args");
// Since this would be executed as a callback, the predecessor_account_id
// is now equal to the current_account_id
let env = {
let mut tmp = env.clone();
tmp.predecessor_account_id = env.current_account_id;
tmp
};
let maybe_promise_args = connector_contract.finish_deposit(
env.predecessor_account_id(),
env.current_account_id(),
Expand Down

0 comments on commit 7d8c023

Please sign in to comment.