Skip to content

Commit

Permalink
Fix refund for failed callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
sidenaio committed Feb 13, 2023
1 parent 08a09d9 commit cc15ac4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ impl<B: Backend + 'static> VmRunner<B> {
Action::FunctionCall(ref call) => {
let mut gas_used = 0;
let action_result = self.apply_function_call(self.contact_addr.clone(), &call, promise_result, &mut gas_used, true);
if action_result.is_err() && !call.deposit.is_empty() {
if (action_result.is_err() || !action_result.as_ref().unwrap().success) && !call.deposit.is_empty(){
// refund deposit
self.refund_deposit(&p.predecessor_id, &call.deposit);
}
Expand Down

0 comments on commit cc15ac4

Please sign in to comment.