Skip to content

Commit

Permalink
Normalize addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcgary committed Sep 9, 2024
1 parent 817befb commit b232ad4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/eigenState/avsOperators/avsOperators.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func (a *AvsOperatorsModel) GetStateTransitions() (types.StateTransitions[Accumu
return nil, xerrors.Errorf("No state accumulator found for block %d", log.BlockNumber)
}

avs := arguments[0].Value.(string)
operator := arguments[1].Value.(string)
avs := strings.ToLower(arguments[0].Value.(string))
operator := strings.ToLower(arguments[1].Value.(string))

registered := false
if val, ok := outputData["status"]; ok {
Expand Down
6 changes: 5 additions & 1 deletion internal/eigenState/operatorShares/operatorShares.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ func parseLogOutputForOperatorShares(outputDataStr string) (*operatorSharesOutpu
decoder.UseNumber()

err := decoder.Decode(&outputData)
if err != nil {
return nil, err
}
outputData.Strategy = strings.ToLower(outputData.Strategy)
return outputData, err
}

Expand All @@ -129,7 +133,7 @@ func (osm *OperatorSharesModel) GetStateTransitions() (types.StateTransitions[Ac
if _, ok := osm.stateAccumulator[log.BlockNumber]; !ok {
return nil, xerrors.Errorf("No state accumulator found for block %d", log.BlockNumber)
}
operator := arguments[0].Value.(string)
operator := strings.ToLower(arguments[0].Value.(string))

sharesStr := outputData.Shares.String()
shares, err := uint256.FromDecimal(sharesStr)
Expand Down
4 changes: 2 additions & 2 deletions internal/eigenState/stakerDelegations/stakerDelegations.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func (s *StakerDelegationsModel) GetStateTransitions() (types.StateTransitions[A
return nil, xerrors.Errorf("No state accumulator found for block %d", log.BlockNumber)
}

staker := arguments[0].Value.(string)
operator := arguments[1].Value.(string)
staker := strings.ToLower(arguments[0].Value.(string))
operator := strings.ToLower(arguments[1].Value.(string))

slotId := NewSlotId(staker, operator)
record, ok := s.stateAccumulator[log.BlockNumber][slotId]
Expand Down
1 change: 1 addition & 0 deletions internal/eigenState/stakerShares/stakerShares.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func parseLogOutputForDepositEvent(outputDataStr string) (*depositOutputData, er
return nil, err
}
outputData.Staker = strings.ToLower(outputData.Staker)
outputData.Depositor = strings.ToLower(outputData.Depositor)
outputData.Strategy = strings.ToLower(outputData.Strategy)
return outputData, err
}
Expand Down

0 comments on commit b232ad4

Please sign in to comment.