Skip to content

Commit

Permalink
Fix: duplicate in actions count
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Jul 8, 2024
1 parent 12cce1a commit 2644051
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pkg/indexer/decode/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,12 @@ func parseBridgeSudoChange(body *astria.Action_BridgeSudoChangeAction, height ty

if sudo != "" {
action.Data["sudo"] = sudo
addr := ctx.Addresses.Set(sudo, height, decimal.Zero, "", 1, 0)

sudoActionsCount := 1
if bridgeAddress == sudo {
sudoActionsCount = 0
}
addr := ctx.Addresses.Set(sudo, height, decimal.Zero, "", sudoActionsCount, 0)
action.Addresses = append(action.Addresses, &storage.AddressAction{
Address: addr,
Action: action,
Expand All @@ -450,9 +455,15 @@ func parseBridgeSudoChange(body *astria.Action_BridgeSudoChangeAction, height ty
})
bridge.Sudo = addr
}

if withdrawer != "" {
action.Data["withdrawer"] = withdrawer
addr := ctx.Addresses.Set(withdrawer, height, decimal.Zero, "", 1, 0)

withdrawerActionsCount := 1
if bridgeAddress == withdrawer || sudo == withdrawer {
withdrawerActionsCount = 0
}
addr := ctx.Addresses.Set(withdrawer, height, decimal.Zero, "", withdrawerActionsCount, 0)
action.Addresses = append(action.Addresses, &storage.AddressAction{
Address: addr,
Action: action,
Expand Down

0 comments on commit 2644051

Please sign in to comment.