Skip to content

Commit

Permalink
fix: properly read filtered logs for params
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Jan 3, 2025
1 parent 7351502 commit a2a3f52
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions core/eth/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,21 @@ func (cs *ChainState) indexSocketMap(ctx context.Context) error {
if err != nil {
return err
}
input := inputs[0].(socketUpdateInput)

socketUpdates = append(socketUpdates, &input)
var socket string
if method.Name == "registerOperator" {
socket = inputs[1].(string)
} else if method.Name == "updateOperatorSocket" {
socket = inputs[0].(string)
} else {
return fmt.Errorf("unknown method filtered for socket update event: %s", method.Name)
}
operatorID := gcommon.BytesToAddress(log.Topics[1].Bytes())

socketUpdates = append(socketUpdates, &socketUpdateInput{
Socket: socket,
OperatorID: operatorID,
})
}

cs.socketMu.Lock()
Expand Down

0 comments on commit a2a3f52

Please sign in to comment.