Skip to content

Commit

Permalink
[CI] Fix the integration test (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix authored Jul 7, 2023
1 parent 9dd3fcf commit 82d07ee
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
33 changes: 33 additions & 0 deletions core/mock/tx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package mock

import (
"context"

"github.com/Layr-Labs/eigenda/core"
"github.com/stretchr/testify/mock"
)

type MockTransactor struct {
mock.Mock
}

func (t *MockTransactor) RegisterOperator(ctx context.Context, pubkeyG1 core.PubKeyG1, socket string, quorumIds []core.QuorumID) error {
args := t.Called()
return args.Error(0)
}

func (t *MockTransactor) DeregisterOperator(ctx context.Context, pubkeyG1 core.PubKeyG1, blockNumber uint32) error {
args := t.Called()
return args.Error(0)
}

func (t *MockTransactor) GetOperatorStakes(ctx context.Context, operatorId core.OperatorId, blockNumber uint32) ([][]core.OperatorStake, error) {
args := t.Called()
result := args.Get(0)
return result.([][]core.OperatorStake), args.Error(1)
}

func (t *MockTransactor) ConfirmBatch(ctx context.Context, batchHeader core.BatchHeader, signatureAggregation core.SignatureAggregation) error {
args := t.Called()
return args.Error(0)
}
5 changes: 4 additions & 1 deletion test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ func mustMakeOperators(cst *mock.ChainDataMock, logger common.Logger) map[core.O
log.Panic(err)
}

tx := &mock.MockTransactor{}
tx.On("RegisterOperator").Return(nil)

n := &node.Node{
Config: config,
Logger: logger,
Expand All @@ -177,7 +180,7 @@ func mustMakeOperators(cst *mock.ChainDataMock, logger common.Logger) map[core.O
Store: store,
ChainState: cst,
Validator: val,
Transactor: nil,
Transactor: tx,
}

if err != nil {
Expand Down

0 comments on commit 82d07ee

Please sign in to comment.