From f5d924df5c7f1b38ba297d015918a0d53e7f9621 Mon Sep 17 00:00:00 2001 From: Madhur Shrimal Date: Sat, 20 Jul 2024 15:56:25 -0700 Subject: [PATCH] remove logs mock and deprecate signer --- logging/gen.go | 3 - logging/mocks/mock_logger.go | 228 ----------------------------------- signer/basic_signer.go | 1 + signer/privatekey_signer.go | 1 + signer/signer.go | 1 + 5 files changed, 3 insertions(+), 231 deletions(-) delete mode 100644 logging/gen.go delete mode 100644 logging/mocks/mock_logger.go diff --git a/logging/gen.go b/logging/gen.go deleted file mode 100644 index ef6269cf..00000000 --- a/logging/gen.go +++ /dev/null @@ -1,3 +0,0 @@ -package logging - -//go:generate mockgen -destination=mocks/mock_logger.go -package=mocks github.com/Layr-Labs/eigensdk-go/logging Logger diff --git a/logging/mocks/mock_logger.go b/logging/mocks/mock_logger.go deleted file mode 100644 index 31747a1a..00000000 --- a/logging/mocks/mock_logger.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/logging (interfaces: Logger) -// -// Generated by this command: -// -// mockgen -destination=mocks/mock_logger.go -package=mocks github.com/Layr-Labs/eigensdk-go/logging Logger -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - reflect "reflect" - - logging "github.com/Layr-Labs/eigensdk-go/logging" - gomock "go.uber.org/mock/gomock" -) - -// MockLogger is a mock of Logger interface. -type MockLogger struct { - ctrl *gomock.Controller - recorder *MockLoggerMockRecorder -} - -// MockLoggerMockRecorder is the mock recorder for MockLogger. -type MockLoggerMockRecorder struct { - mock *MockLogger -} - -// NewMockLogger creates a new mock instance. -func NewMockLogger(ctrl *gomock.Controller) *MockLogger { - mock := &MockLogger{ctrl: ctrl} - mock.recorder = &MockLoggerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockLogger) EXPECT() *MockLoggerMockRecorder { - return m.recorder -} - -// Debug mocks base method. -func (m *MockLogger) Debug(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Debug", varargs...) -} - -// Debug indicates an expected call of Debug. -func (mr *MockLoggerMockRecorder) Debug(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Debug", reflect.TypeOf((*MockLogger)(nil).Debug), varargs...) -} - -// Debugf mocks base method. -func (m *MockLogger) Debugf(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Debugf", varargs...) -} - -// Debugf indicates an expected call of Debugf. -func (mr *MockLoggerMockRecorder) Debugf(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Debugf", reflect.TypeOf((*MockLogger)(nil).Debugf), varargs...) -} - -// Error mocks base method. -func (m *MockLogger) Error(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockLoggerMockRecorder) Error(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockLogger)(nil).Error), varargs...) -} - -// Errorf mocks base method. -func (m *MockLogger) Errorf(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Errorf", varargs...) -} - -// Errorf indicates an expected call of Errorf. -func (mr *MockLoggerMockRecorder) Errorf(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Errorf", reflect.TypeOf((*MockLogger)(nil).Errorf), varargs...) -} - -// Fatal mocks base method. -func (m *MockLogger) Fatal(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Fatal", varargs...) -} - -// Fatal indicates an expected call of Fatal. -func (mr *MockLoggerMockRecorder) Fatal(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Fatal", reflect.TypeOf((*MockLogger)(nil).Fatal), varargs...) -} - -// Fatalf mocks base method. -func (m *MockLogger) Fatalf(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Fatalf", varargs...) -} - -// Fatalf indicates an expected call of Fatalf. -func (mr *MockLoggerMockRecorder) Fatalf(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Fatalf", reflect.TypeOf((*MockLogger)(nil).Fatalf), varargs...) -} - -// Info mocks base method. -func (m *MockLogger) Info(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockLoggerMockRecorder) Info(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockLogger)(nil).Info), varargs...) -} - -// Infof mocks base method. -func (m *MockLogger) Infof(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Infof", varargs...) -} - -// Infof indicates an expected call of Infof. -func (mr *MockLoggerMockRecorder) Infof(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Infof", reflect.TypeOf((*MockLogger)(nil).Infof), varargs...) -} - -// Warn mocks base method. -func (m *MockLogger) Warn(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Warn", varargs...) -} - -// Warn indicates an expected call of Warn. -func (mr *MockLoggerMockRecorder) Warn(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Warn", reflect.TypeOf((*MockLogger)(nil).Warn), varargs...) -} - -// Warnf mocks base method. -func (m *MockLogger) Warnf(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Warnf", varargs...) -} - -// Warnf indicates an expected call of Warnf. -func (mr *MockLoggerMockRecorder) Warnf(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Warnf", reflect.TypeOf((*MockLogger)(nil).Warnf), varargs...) -} - -// With mocks base method. -func (m *MockLogger) With(arg0 ...any) logging.Logger { - m.ctrl.T.Helper() - varargs := []any{} - for _, a := range arg0 { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "With", varargs...) - ret0, _ := ret[0].(logging.Logger) - return ret0 -} - -// With indicates an expected call of With. -func (mr *MockLoggerMockRecorder) With(arg0 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "With", reflect.TypeOf((*MockLogger)(nil).With), arg0...) -} diff --git a/signer/basic_signer.go b/signer/basic_signer.go index 778c214c..59eecb5d 100644 --- a/signer/basic_signer.go +++ b/signer/basic_signer.go @@ -20,6 +20,7 @@ import ( // exported as the default so that users can call NewBasicSigner with it if they don't know any better var FallbackGasTipCap = big.NewInt(15000000000) +// Deprecated: Use SignerV2 instead type BasicSigner struct { logger logging.Logger ethClient sdkethclient.Client diff --git a/signer/privatekey_signer.go b/signer/privatekey_signer.go index 4b84c330..73b8cdef 100644 --- a/signer/privatekey_signer.go +++ b/signer/privatekey_signer.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" ) +// Deprecated: Use SignerV2 instead type PrivateKeySigner struct { txOpts *bind.TransactOpts } diff --git a/signer/signer.go b/signer/signer.go index 708a2572..1c8573b3 100644 --- a/signer/signer.go +++ b/signer/signer.go @@ -15,6 +15,7 @@ import ( // // 2. A signer (remote signer) that we will send to an external rpc which takes care of signing and broadcasting the // signed transaction. They need to implement SendToExternal() function and leave GetSigner() unimplemented. +// Deprecated: Use SignerV2 instead type Signer interface { GetTxOpts() *bind.TransactOpts SendToExternal(ctx context.Context, tx *types.Transaction) (common.Hash, error)