Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(standalone): set predecessor_account_id appropriately when executing promise callbacks #467

Merged
merged 1 commit into from
Mar 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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