Skip to content

Commit

Permalink
challenger fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodeymo committed Oct 10, 2024
1 parent 1210835 commit fef94ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion aggregator/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (mr *MockBlsAggregationServiceMockRecorder) InitializeNewTask(arg0, arg1, a
}

// ProcessNewSignature mocks base method.
func (m *MockBlsAggregationService) ProcessNewSignature(arg0 context.Context, arg1 uint32, arg2 sdktypes.Bytes32, arg3 *bls.Signature, arg4 sdktypes.Bytes32) error {
func (m *MockBlsAggregationService) ProcessNewSignature(arg0 context.Context, arg1 uint32, arg2 interface{}, arg3 *bls.Signature, arg4 sdktypes.Bytes32) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ProcessNewSignature", arg0, arg1, arg2, arg3, arg4)
ret0, _ := ret[0].(error)
Expand Down
11 changes: 8 additions & 3 deletions challenger/challenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@ import (
"context"
"math/big"

"github.com/Layr-Labs/eigensdk-go/chainio/clients/eth"
"github.com/Layr-Labs/eigensdk-go/logging"
"github.com/Layr-Labs/incredible-squaring-avs/common"
"github.com/Layr-Labs/incredible-squaring-avs/core/config"
"github.com/ethereum/go-ethereum/accounts/abi"
commoneth "github.com/ethereum/go-ethereum/common"
typeseth "github.com/ethereum/go-ethereum/core/types"

"github.com/Layr-Labs/incredible-squaring-avs/challenger/types"
cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager"
"github.com/Layr-Labs/incredible-squaring-avs/core/chainio"
)

type ChallengerClient interface {
TransactionByHash(ctx context.Context, hash commoneth.Hash) (tx *typeseth.Transaction, isPending bool, err error)
}

type Challenger struct {
logger logging.Logger
ethClient eth.InstrumentedClient
ethClient ChallengerClient
avsReader chainio.AvsReaderer
avsWriter chainio.AvsWriterer
avsSubscriber chainio.AvsSubscriberer
Expand Down Expand Up @@ -48,7 +53,7 @@ func NewChallenger(c *config.Config) (*Challenger, error) {

challenger := &Challenger{
logger: c.Logger,
ethClient: c.EthHttpClient,
ethClient: &c.EthHttpClient,
avsReader: avsReader,
avsWriter: avsWriter,
avsSubscriber: avsSubscriber,
Expand Down
4 changes: 1 addition & 3 deletions challenger/challenger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"reflect"
"testing"

"github.com/Layr-Labs/eigensdk-go/chainio/clients/eth"
"github.com/Layr-Labs/eigensdk-go/testutils"
aggtypes "github.com/Layr-Labs/incredible-squaring-avs/aggregator/types"
"github.com/Layr-Labs/incredible-squaring-avs/challenger/mocks"
Expand Down Expand Up @@ -238,13 +237,12 @@ func createMockChallenger(mockCtrl *gomock.Controller) (*Challenger, *chainiomoc
mockAvsReader := chainiomocks.NewMockAvsReaderer(mockCtrl)
mockAvsSubscriber := chainiomocks.NewMockAvsSubscriberer(mockCtrl)
mockEthClient := NewMockEthClient(mockCtrl)
mockEthClientInstrumented, _ := eth.NewInstrumentedClient("", nil) // TODO, add RPC URL

challenger := &Challenger{
logger: logger,
avsWriter: mockAvsWriter,
avsReader: mockAvsReader,
ethClient: *mockEthClientInstrumented,
ethClient: mockEthClient,
avsSubscriber: mockAvsSubscriber,
tasks: make(map[uint32]cstaskmanager.IIncredibleSquaringTaskManagerTask),
taskResponses: make(map[uint32]chtypes.TaskResponseData),
Expand Down

0 comments on commit fef94ea

Please sign in to comment.