From b232ad446df9c3dde2065a471422a19e48d0aefc Mon Sep 17 00:00:00 2001 From: Sean McGary Date: Mon, 9 Sep 2024 11:56:49 -0500 Subject: [PATCH] Normalize addresses --- internal/eigenState/avsOperators/avsOperators.go | 4 ++-- internal/eigenState/operatorShares/operatorShares.go | 6 +++++- internal/eigenState/stakerDelegations/stakerDelegations.go | 4 ++-- internal/eigenState/stakerShares/stakerShares.go | 1 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/eigenState/avsOperators/avsOperators.go b/internal/eigenState/avsOperators/avsOperators.go index c3df7a3d..cc6f0a97 100644 --- a/internal/eigenState/avsOperators/avsOperators.go +++ b/internal/eigenState/avsOperators/avsOperators.go @@ -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 { diff --git a/internal/eigenState/operatorShares/operatorShares.go b/internal/eigenState/operatorShares/operatorShares.go index 3bc60a15..0073fcf0 100644 --- a/internal/eigenState/operatorShares/operatorShares.go +++ b/internal/eigenState/operatorShares/operatorShares.go @@ -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 } @@ -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) diff --git a/internal/eigenState/stakerDelegations/stakerDelegations.go b/internal/eigenState/stakerDelegations/stakerDelegations.go index d5cdfc47..181154be 100644 --- a/internal/eigenState/stakerDelegations/stakerDelegations.go +++ b/internal/eigenState/stakerDelegations/stakerDelegations.go @@ -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] diff --git a/internal/eigenState/stakerShares/stakerShares.go b/internal/eigenState/stakerShares/stakerShares.go index 7c10d2d9..5ed9dcf2 100644 --- a/internal/eigenState/stakerShares/stakerShares.go +++ b/internal/eigenState/stakerShares/stakerShares.go @@ -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 }