Skip to content

Commit

Permalink
fix handleRevert
Browse files Browse the repository at this point in the history
  • Loading branch information
wlawt committed Apr 22, 2024
1 parent a47f87d commit 7b4d77c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions chain/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func (t *Transaction) Execute(
// are set when this function is defined. If any of them are
// modified later, they will not be used here.
ts.Rollback(ctx, actionStart)
return &Result{false, utils.ErrBytes(rerr), maxUnits, maxFee, nil}, nil
return []*Result{{false, utils.ErrBytes(rerr), maxUnits, maxFee, nil}}, nil
}
for _, action := range t.Actions {
success, actionCUs, output, warpMessage, err := action.Execute(ctx, r, ts, timestamp, t.Auth.Actor(), t.id, warpVerified)
Expand Down Expand Up @@ -439,6 +439,7 @@ func (t *Transaction) Execute(
if err := warpMessage.Initialize(); err != nil {
return handleRevert(err)
}
// TODO: use actionID?
// We use txID here because did not know the warpID before execution (and
// we pre-reserve this key for the processor).
p := s.OutgoingWarpKeyPrefix(t.id)
Expand Down Expand Up @@ -536,15 +537,15 @@ func (t *Transaction) Execute(
return handleRevert(err)
}
}
return &Result{
return []*Result{{
Success: success,
Output: output,

Consumed: used,
Fee: feeRequired,

WarpMessage: warpMessage,
}, nil
}}, nil
}

func (t *Transaction) Marshal(p *codec.Packer) error {
Expand Down

0 comments on commit 7b4d77c

Please sign in to comment.