Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-shim committed Apr 9, 2024
1 parent 5c748d0 commit 59f5af6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/mock/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (d *ChainDataMock) GetTotalOperatorStateWithQuorums(ctx context.Context, bl
for opID := range operatorsByID {
if aggPubKeys[quorumID] == nil {
key := privateOperators[opID].KeyPair.GetPubKeyG1()
aggPubKeys[quorumID] = key.Deserialize(key.Serialize())
aggPubKeys[quorumID] = key.Clone()
} else {
aggPubKeys[quorumID].Add(privateOperators[opID].KeyPair.GetPubKeyG1())
}
Expand Down
24 changes: 20 additions & 4 deletions core/thegraph/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ func (m mockGraphQLQuerier) Query(ctx context.Context, q any, variables map[stri
func TestIndexedChainState_GetIndexedOperatorState(t *testing.T) {
logger := logging.NewNoopLogger()

chainState, _ := mock.MakeChainDataMock(1)
chainState, _ := mock.MakeChainDataMock(map[uint8]int{
0: 1,
1: 1,
2: 1,
})
chainState.On("GetCurrentBlockNumber").Return(uint(1), nil)

state, err := chainState.GetOperatorState(context.Background(), 1, quorums)
Expand Down Expand Up @@ -91,7 +95,11 @@ func TestIndexedChainState_GetIndexedOperatorState(t *testing.T) {
func TestIndexedChainState_GetIndexedOperatorStateMissingOperator(t *testing.T) {
logger := logging.NewNoopLogger()

chainState, _ := mock.MakeChainDataMock(2)
chainState, _ := mock.MakeChainDataMock(map[uint8]int{
0: 2,
1: 2,
2: 2,
})
chainState.On("GetCurrentBlockNumber").Return(uint(1), nil)

state, err := chainState.GetOperatorState(context.Background(), 1, quorums)
Expand Down Expand Up @@ -154,7 +162,11 @@ func TestIndexedChainState_GetIndexedOperatorStateMissingOperator(t *testing.T)
func TestIndexedChainState_GetIndexedOperatorStateExtraOperator(t *testing.T) {
logger := logging.NewNoopLogger()

chainState, _ := mock.MakeChainDataMock(1)
chainState, _ := mock.MakeChainDataMock(map[uint8]int{
0: 1,
1: 1,
2: 1,
})
chainState.On("GetCurrentBlockNumber").Return(uint(1), nil)

state, err := chainState.GetOperatorState(context.Background(), 1, quorums)
Expand Down Expand Up @@ -233,7 +245,11 @@ func TestIndexedChainState_GetIndexedOperatorStateExtraOperator(t *testing.T) {
func TestIndexedChainState_GetIndexedOperatorInfoByOperatorId(t *testing.T) {
logger := logging.NewNoopLogger()

chainState, _ := mock.MakeChainDataMock(1)
chainState, _ := mock.MakeChainDataMock(map[uint8]int{
0: 1,
1: 1,
2: 1,
})
chainState.On("GetCurrentBlockNumber").Return(uint(1), nil)

state, err := chainState.GetOperatorState(context.Background(), 1, quorums)
Expand Down

0 comments on commit 59f5af6

Please sign in to comment.