Skip to content

Commit

Permalink
ensure requeued withdrawal records have amount and distribution zeroe…
Browse files Browse the repository at this point in the history
…d as this will be recalculated on processing
  • Loading branch information
Joe Bowman committed Aug 7, 2024
1 parent 926c1cc commit 99fe642
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x/interchainstaking/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ func (k msgServer) RequeueRedemption(goCtx context.Context, msg *types.MsgRequeu
return nil, fmt.Errorf("incorrect user for record with hash \"%s\"", msg.Hash)
}

// all good. update sendErrors to zero, and update the state to queued.
// all good. update sendErrors to zero, nil the distributions and amount (as this we be recalculated when processed), and update the state to queued.
record.SendErrors = 0
record.Amount = nil
record.Distribution = nil
k.UpdateWithdrawalRecordStatus(ctx, &record, types.WithdrawStatusQueued)

ctx.EventManager().EmitEvents(sdk.Events{
Expand Down

0 comments on commit 99fe642

Please sign in to comment.