diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 437ec17db15..4e0ba91bb1d 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -258,7 +258,7 @@ require ( github.com/shirou/gopsutil/v3 v3.23.10 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect - github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208012003-888e7dbdb9c6 // indirect + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208164731-2783ddbbdd8c // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 // indirect github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 // indirect github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index e9de4b92a4e..b7685cd0335 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1214,8 +1214,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk= github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208012003-888e7dbdb9c6 h1:Vqi/po+LG3J47USCh83vvjutn2KX8nr7PsU9q4qHt2o= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208012003-888e7dbdb9c6/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208164731-2783ddbbdd8c h1:YgizNDPRAP2ObjetDIQTJlrpzLBBkYsNjA10Mo5HByo= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208164731-2783ddbbdd8c/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 h1:iu1pNbUoSDTrp+7BUtfTygZ2C0f5C2ZOBQhIoJjp+S0= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679/go.mod h1:2Jx7bTEk4ujFQdsZpZq3A0BydvaVPs6mX8clUfxHOEM= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ= diff --git a/core/services/relay/evm/chain_reader_test.go b/core/services/relay/evm/chain_reader_test.go index 0dd5183c08a..7efa27b4608 100644 --- a/core/services/relay/evm/chain_reader_test.go +++ b/core/services/relay/evm/chain_reader_test.go @@ -3,7 +3,6 @@ package evm_test //go:generate ./testfiles/chainlink_reader_test_setup.sh import ( - "context" "crypto/ecdsa" "math" "math/big" @@ -55,7 +54,7 @@ type chainReaderInterfaceTester struct { cr evm.ChainReaderService } -func (it *chainReaderInterfaceTester) Setup(ctx context.Context, t *testing.T) { +func (it *chainReaderInterfaceTester) Setup(t *testing.T) { t.Cleanup(func() { it.address = "" require.NoError(t, it.cr.Close()) @@ -64,7 +63,7 @@ func (it *chainReaderInterfaceTester) Setup(ctx context.Context, t *testing.T) { // can re-use the same chain for tests, just make new contract for each test if it.chain != nil { - it.deployNewContract(ctx, t) + it.deployNewContract(t) return } @@ -111,7 +110,7 @@ func (it *chainReaderInterfaceTester) Setup(ctx context.Context, t *testing.T) { }, } it.chain.On("Client").Return(client.NewSimulatedBackendClient(t, it.sim, big.NewInt(1337))) - it.deployNewContract(ctx, t) + it.deployNewContract(t) } func (it *chainReaderInterfaceTester) Name() string { @@ -125,7 +124,8 @@ func (it *chainReaderInterfaceTester) GetAccountBytes(i int) []byte { return account } -func (it *chainReaderInterfaceTester) GetChainReader(ctx context.Context, t *testing.T) clcommontypes.ChainReader { +func (it *chainReaderInterfaceTester) GetChainReader(t *testing.T) clcommontypes.ChainReader { + ctx := testutils.Context(t) if it.cr != nil { return it.cr } @@ -143,39 +143,39 @@ func (it *chainReaderInterfaceTester) GetChainReader(ctx context.Context, t *tes return cr } -func (it *chainReaderInterfaceTester) GetPrimitiveContract(_ context.Context, t *testing.T) clcommontypes.BoundContract { +func (it *chainReaderInterfaceTester) GetPrimitiveContract(_ *testing.T) clcommontypes.BoundContract { return clcommontypes.BoundContract{ Address: it.address, Name: MethodReturningUint64, } } -func (it *chainReaderInterfaceTester) GetReturnSeenContract(ctx context.Context, t *testing.T) clcommontypes.BoundContract { - it.deployNewContract(ctx, t) +func (it *chainReaderInterfaceTester) GetReturnSeenContract(t *testing.T) clcommontypes.BoundContract { + it.deployNewContract(t) return clcommontypes.BoundContract{ Address: it.address, Name: returnSeenName, } } -func (it *chainReaderInterfaceTester) GetSliceContract(ctx context.Context, t *testing.T) clcommontypes.BoundContract { +func (it *chainReaderInterfaceTester) GetSliceContract(t *testing.T) clcommontypes.BoundContract { // Since most tests don't use the contract, it's set up lazily to save time - it.deployNewContract(ctx, t) + it.deployNewContract(t) return clcommontypes.BoundContract{ Address: it.address, Name: MethodReturningUint64Slice, } } -func (it *chainReaderInterfaceTester) SetLatestValue(ctx context.Context, t *testing.T, testStruct *TestStruct) clcommontypes.BoundContract { - it.sendTxWithTestStruct(ctx, t, testStruct, (*testfiles.TestfilesTransactor).AddTestStruct) +func (it *chainReaderInterfaceTester) SetLatestValue(t *testing.T, testStruct *TestStruct) clcommontypes.BoundContract { + it.sendTxWithTestStruct(t, testStruct, (*testfiles.TestfilesTransactor).AddTestStruct) return clcommontypes.BoundContract{ Address: it.address, Name: MethodTakingLatestParamsReturningTestStruct, } } -func (it *chainReaderInterfaceTester) TriggerEvent(ctx context.Context, t *testing.T, testStruct *TestStruct) clcommontypes.BoundContract { - it.sendTxWithTestStruct(ctx, t, testStruct, (*testfiles.TestfilesTransactor).TriggerEvent) +func (it *chainReaderInterfaceTester) TriggerEvent(t *testing.T, testStruct *TestStruct) clcommontypes.BoundContract { + it.sendTxWithTestStruct(t, testStruct, (*testfiles.TestfilesTransactor).TriggerEvent) return clcommontypes.BoundContract{ Address: it.address, Name: EventName, @@ -184,9 +184,9 @@ func (it *chainReaderInterfaceTester) TriggerEvent(ctx context.Context, t *testi type testStructFn = func(*testfiles.TestfilesTransactor, *bind.TransactOpts, int32, string, uint8, [32]uint8, [32]byte, [][32]byte, *big.Int, testfiles.MidLevelTestStruct) (*evmtypes.Transaction, error) -func (it *chainReaderInterfaceTester) sendTxWithTestStruct(ctx context.Context, t *testing.T, testStruct *TestStruct, fn testStructFn) { +func (it *chainReaderInterfaceTester) sendTxWithTestStruct(t *testing.T, testStruct *TestStruct, fn testStructFn) { // Since most tests don't use the contract, it's set up lazily to save time - it.deployNewContract(ctx, t) + it.deployNewContract(t) tx, err := fn( &it.evmTest.TestfilesTransactor, @@ -203,7 +203,7 @@ func (it *chainReaderInterfaceTester) sendTxWithTestStruct(ctx context.Context, require.NoError(t, err) it.sim.Commit() it.incNonce() - it.awaitTx(ctx, t, tx) + it.awaitTx(t, tx) } func convertOracleIDs(oracleIDs [32]commontypes.OracleID) [32]byte { @@ -234,7 +234,8 @@ func (it *chainReaderInterfaceTester) setupChainNoClient(t require.TestingT) { it.sim.Commit() } -func (it *chainReaderInterfaceTester) deployNewContract(ctx context.Context, t *testing.T) { +func (it *chainReaderInterfaceTester) deployNewContract(t *testing.T) { + ctx := testutils.Context(t) if it.address != "" { return } @@ -252,11 +253,12 @@ func (it *chainReaderInterfaceTester) deployNewContract(ctx context.Context, t * it.sim.Commit() it.evmTest = ts it.incNonce() - it.awaitTx(ctx, t, tx) + it.awaitTx(t, tx) it.address = address.String() } -func (it *chainReaderInterfaceTester) awaitTx(ctx context.Context, t *testing.T, tx *evmtypes.Transaction) { +func (it *chainReaderInterfaceTester) awaitTx(t *testing.T, tx *evmtypes.Transaction) { + ctx := testutils.Context(t) receipt, err := it.sim.TransactionReceipt(ctx, tx.Hash()) require.NoError(t, err) require.Equal(t, evmtypes.ReceiptStatusSuccessful, receipt.Status) diff --git a/core/services/relay/evm/codec_test.go b/core/services/relay/evm/codec_test.go index bb4ee98a44b..dd1977eb39c 100644 --- a/core/services/relay/evm/codec_test.go +++ b/core/services/relay/evm/codec_test.go @@ -1,7 +1,6 @@ package evm_test import ( - "context" "encoding/json" "testing" @@ -50,7 +49,7 @@ func TestCodec(t *testing.T) { type codecInterfaceTester struct{} -func (it *codecInterfaceTester) Setup(_ context.Context, _ *testing.T) {} +func (it *codecInterfaceTester) Setup(_ *testing.T) {} func (it *codecInterfaceTester) GetAccountBytes(i int) []byte { account := []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2} diff --git a/go.mod b/go.mod index f83a095f2a8..84fa78e7d4d 100644 --- a/go.mod +++ b/go.mod @@ -66,7 +66,7 @@ require ( github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 github.com/smartcontractkit/chainlink-automation v1.0.0-alpha.0.0.20231120164534-d4cab696c459 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208012003-888e7dbdb9c6 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208164731-2783ddbbdd8c github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d diff --git a/go.sum b/go.sum index ddb8a245d68..0573207a302 100644 --- a/go.sum +++ b/go.sum @@ -1217,8 +1217,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-automation v1.0.0-alpha.0.0.20231120164534-d4cab696c459 h1:hJhuShYv9eUQxHJQdOmyEymVmApOrICrQdOY7kKQ5Io= github.com/smartcontractkit/chainlink-automation v1.0.0-alpha.0.0.20231120164534-d4cab696c459/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208012003-888e7dbdb9c6 h1:Vqi/po+LG3J47USCh83vvjutn2KX8nr7PsU9q4qHt2o= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208012003-888e7dbdb9c6/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208164731-2783ddbbdd8c h1:YgizNDPRAP2ObjetDIQTJlrpzLBBkYsNjA10Mo5HByo= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208164731-2783ddbbdd8c/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 h1:iu1pNbUoSDTrp+7BUtfTygZ2C0f5C2ZOBQhIoJjp+S0= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679/go.mod h1:2Jx7bTEk4ujFQdsZpZq3A0BydvaVPs6mX8clUfxHOEM= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 2541b60bc99..198d613ba1b 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/segmentio/ksuid v1.0.4 github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.1 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208012003-888e7dbdb9c6 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208164731-2783ddbbdd8c github.com/smartcontractkit/chainlink-testing-framework v1.20.0 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index df5dbc86cac..90f8209f0f6 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1507,8 +1507,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk= github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208012003-888e7dbdb9c6 h1:Vqi/po+LG3J47USCh83vvjutn2KX8nr7PsU9q4qHt2o= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208012003-888e7dbdb9c6/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208164731-2783ddbbdd8c h1:YgizNDPRAP2ObjetDIQTJlrpzLBBkYsNjA10Mo5HByo= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231208164731-2783ddbbdd8c/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 h1:iu1pNbUoSDTrp+7BUtfTygZ2C0f5C2ZOBQhIoJjp+S0= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679/go.mod h1:2Jx7bTEk4ujFQdsZpZq3A0BydvaVPs6mX8clUfxHOEM= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ=