Skip to content

Commit f008eb3

Browse files
authored
[CR-403] Refactor txmgr mocks. (#17729)
* Minor. * Organize imports.
1 parent 58933b5 commit f008eb3

File tree

17 files changed

+37
-299
lines changed

17 files changed

+37
-299
lines changed

.mockery.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ packages:
4545
LogPoller:
4646
github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr:
4747
interfaces:
48-
ChainConfig:
49-
config:
50-
mockname: Config
51-
filename: config.go
5248
EvmTxStore:
5349
github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm:
5450
interfaces:

common/txmgr/mocks/utils.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package mocks
2+
3+
import (
4+
"math/big"
5+
"testing"
6+
7+
"github.com/ethereum/go-ethereum/common"
8+
9+
"github.com/smartcontractkit/chainlink-evm/pkg/gas"
10+
"github.com/smartcontractkit/chainlink-evm/pkg/types"
11+
)
12+
13+
type MockEvmTxManager = TxManager[*big.Int, *types.Head, common.Address, common.Hash, common.Hash, types.Nonce, gas.EvmFee]
14+
15+
func NewMockEvmTxManager(t *testing.T) *MockEvmTxManager {
16+
return NewTxManager[*big.Int, *types.Head, common.Address, common.Hash, common.Hash, types.Nonce, gas.EvmFee](t)
17+
}

core/chains/evm/txmgr/mocks/config.go

Lines changed: 0 additions & 260 deletions
This file was deleted.

core/chains/evm/txmgr/mocks/utils.go

Lines changed: 0 additions & 18 deletions
This file was deleted.

core/services/blockhashstore/bhs_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212
"github.com/smartcontractkit/chainlink-evm/pkg/keys"
1313
"github.com/smartcontractkit/chainlink-evm/pkg/keys/keystest"
1414
"github.com/smartcontractkit/chainlink-evm/pkg/types"
15+
txmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/mocks"
1516
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr"
16-
txmmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks"
1717
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
1818
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
1919
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest"

core/services/fluxmonitorv2/orm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import (
1414
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"
1515

1616
"github.com/smartcontractkit/chainlink-evm/pkg/utils/big"
17+
txmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/mocks"
1718
commontxmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/types/mocks"
1819
"github.com/smartcontractkit/chainlink/v2/core/bridges"
1920
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr"
20-
txmmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks"
2121
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
2222
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
2323
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest"

core/services/keeper/upkeep_executer_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ import (
2424
evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types"
2525
"github.com/smartcontractkit/chainlink-evm/pkg/utils"
2626
ubig "github.com/smartcontractkit/chainlink-evm/pkg/utils/big"
27+
28+
txmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/mocks"
2729
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr"
28-
txmmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks"
2930
"github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm"
3031
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
3132
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"

core/services/ocr2/delegate_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import (
1313

1414
"github.com/smartcontractkit/chainlink-evm/pkg/config/toml"
1515
"github.com/smartcontractkit/chainlink-evm/pkg/utils/big"
16-
txmmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks"
16+
17+
txmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/mocks"
1718
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
1819
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
1920
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest"

core/services/ocr2/plugins/ccip/transmitter/transmitter_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ import (
1414
"github.com/smartcontractkit/chainlink-evm/pkg/keys"
1515
"github.com/smartcontractkit/chainlink-evm/pkg/keys/keystest"
1616
ubig "github.com/smartcontractkit/chainlink-evm/pkg/utils/big"
17+
18+
txmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/mocks"
1719
commontxmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/types/mocks"
1820
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr"
19-
txmmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks"
2021
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
2122
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest"
2223
"github.com/smartcontractkit/chainlink/v2/core/logger"

core/services/ocrcommon/transmitter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
"github.com/smartcontractkit/chainlink-evm/pkg/keys"
1212
"github.com/smartcontractkit/chainlink-evm/pkg/keys/keystest"
1313
"github.com/smartcontractkit/chainlink-evm/pkg/utils"
14+
txmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/mocks"
1415
commontxmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/types/mocks"
1516
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr"
16-
txmmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks"
1717
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
1818
"github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon"
1919
"github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types"

0 commit comments

Comments
 (0)