Skip to content

Commit

Permalink
Fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Sep 12, 2024
1 parent 59b639f commit 7ffcc21
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/indexer/decode/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@ func CalldataForL1Handler(contractAbi abi.Abi, selector []byte, calldata []strin

// Event -
func Event(contractAbi abi.Abi, keys []string, data []string) (map[string]any, string, error) {
values := make([]string, 0)
var values []string
switch len(keys) {
case 0:
return nil, "", nil
case 1:
values = append(values, data...)
values = make([]string, len(data))
copy(values, data)
default:
values = append(keys[1:], data...)
values = make([]string, len(keys[1:]))
copy(values, keys[1:])
values = append(values, data...)
}
selector := encoding.EncodeHex(encoding.MustDecodeHex(keys[0]))
event, ok := contractAbi.GetEventBySelector(selector)
Expand Down

0 comments on commit 7ffcc21

Please sign in to comment.