Skip to content

Commit

Permalink
fix(plugin): correctly format balance updates with 0aseda
Browse files Browse the repository at this point in the history
Since these entries just get deleted from the store we have to manually
set the published amount to 0.
  • Loading branch information
Thomasvdam committed Apr 11, 2024
1 parent 24feec8 commit fd14b10
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/indexing/bank/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ func ExtractUpdate(ctx *types.BlockContext, _ codec.Codec, logger *log.Logger, c
}

var balance math.Int
err = balance.Unmarshal(change.Value)
if err != nil {
return nil, err
if change.Delete {
balance = math.ZeroInt()
} else {
err = balance.Unmarshal(change.Value)
if err != nil {
return nil, err
}
}

data := struct {
Expand Down

0 comments on commit fd14b10

Please sign in to comment.