From e7e56f543905fc1c24745d67eccda07a9da81179 Mon Sep 17 00:00:00 2001 From: Ryan Tinianov Date: Tue, 18 Jun 2024 05:46:44 -0400 Subject: [PATCH] Update common to update chain reader test (#750) * Fixing upstream issue where SIMULATED failed a check * Update common to update chain reader test * Testing out integration tests fix * Reverting default.toml * Adding workaround --------- Co-authored-by: Damjan Smickovski --- go.mod | 3 +-- go.sum | 4 +-- integration-tests/go.mod | 16 ++++++------ integration-tests/go.sum | 28 ++++++++++----------- integration-tests/testconfig/default.toml | 12 ++++++--- pkg/solana/chainreader/chain_reader_test.go | 10 +++++--- 6 files changed, 40 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index 3a215b068..b107fdd45 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/pelletier/go-toml/v2 v2.1.1 github.com/prometheus/client_golang v1.17.0 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240614120734-7fa0ab584458 github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.26.0 @@ -105,7 +105,6 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.2.0 // indirect golang.org/x/crypto v0.18.0 // indirect - golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/term v0.16.0 // indirect diff --git a/go.sum b/go.sum index 0f2e9fce0..82ca984b2 100644 --- a/go.sum +++ b/go.sum @@ -452,8 +452,8 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 h1:iyLE5c2YFxy89t2v5u+aQOHqRE4c+sCMze70KIo07mI= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240614120734-7fa0ab584458 h1:+7LQmbMNaLXej+0ajbTxUfTt4w/ILODpmrOETQ5rTCI= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240614120734-7fa0ab584458/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 5ebe9c12f..6971aa797 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -12,13 +12,13 @@ require ( github.com/go-resty/resty/v2 v2.11.0 github.com/google/uuid v1.6.0 github.com/lib/pq v1.10.9 - github.com/pelletier/go-toml/v2 v2.1.1 + github.com/pelletier/go-toml/v2 v2.2.2 github.com/rs/zerolog v1.30.0 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 - github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240524201401-88d0b3763b20 - github.com/smartcontractkit/chainlink-testing-framework v1.28.17 - github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240528175738-765a1e8107d6 - github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240528175738-765a1e8107d6 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240614120734-7fa0ab584458 + github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240605170242-555ff582f36a + github.com/smartcontractkit/chainlink-testing-framework v1.30.5 + github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240612165958-63fbee90b223 + github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240612165958-63fbee90b223 github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c github.com/smartcontractkit/seth v1.0.11 github.com/stretchr/testify v1.9.0 @@ -357,11 +357,11 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/slack-go/slack v0.12.2 // indirect github.com/smartcontractkit/chain-selectors v1.0.10 // indirect - github.com/smartcontractkit/chainlink-automation v1.0.3 // indirect + github.com/smartcontractkit/chainlink-automation v1.0.4 // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d // indirect github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 // indirect github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240527073251-56197f1413e0 // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240531021326-99118e47f696 // indirect github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449 // indirect github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index c5c00c91a..a43e44735 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1254,8 +1254,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= @@ -1404,28 +1404,28 @@ github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCqR1LNS7aI3jT0V+xGrg= github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= -github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs= -github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 h1:iyLE5c2YFxy89t2v5u+aQOHqRE4c+sCMze70KIo07mI= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= +github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8umfIfVVlwC7+n5izbLSFgjw8= +github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240614120734-7fa0ab584458 h1:+7LQmbMNaLXej+0ajbTxUfTt4w/ILODpmrOETQ5rTCI= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240614120734-7fa0ab584458/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d h1:5tgMC5Gi2UAOKZ+m28W8ubjLeR0pQCAcrz6eQ0rW510= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d/go.mod h1:0UNuO3nDt9MFsZPaHJBEUolxVkN0iC69j1ccDp95e8k= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540/go.mod h1:sjAmX8K2kbQhvDarZE1ZZgDgmHJ50s0BBc/66vKY2ek= github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 h1:MD80ZRCTvxxJ8PBmhtrKoTnky8cVNYrCrIBLVRbrOM0= github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917/go.mod h1:jwVxhctE6BgLOSSsVq9wbREpZ8Ev34H+UBxeUhESZRs= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240527073251-56197f1413e0 h1:5QNKQTQpIp+0ogXUu9B85tEie473RZttOhYxM2vHyOc= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240527073251-56197f1413e0/go.mod h1:OiWUTrrpSLLTMh7FINWjEh6mmDJCVPaC4yEsDCVaWdU= -github.com/smartcontractkit/chainlink-testing-framework v1.28.17 h1:zezoeiG3GUGW1T2+genS/HD1BvRJwC3rqFnFTFNB9aY= -github.com/smartcontractkit/chainlink-testing-framework v1.28.17/go.mod h1:xjxJK+4SUjBmJJWfRFl02poauU4XQE37aH7WYtxTLKg= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240531021326-99118e47f696 h1:h1E87+z+JcUEfvbJVF56SnZA/YUFE5ewUE61MaR/Ewg= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240531021326-99118e47f696/go.mod h1:OiWUTrrpSLLTMh7FINWjEh6mmDJCVPaC4yEsDCVaWdU= +github.com/smartcontractkit/chainlink-testing-framework v1.30.5 h1:RBeQkaUH095L/hOH6JbfScAo4jkI0osBp8kgULnGwos= +github.com/smartcontractkit/chainlink-testing-framework v1.30.5/go.mod h1:E6uNEZhZZid9PHv6/Kq5Vn63GlO61ZcKB+/f0DKo3Q4= github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449 h1:fX/xmGm1GBsD1ZZnooNT+eWA0hiTAqFlHzOC5CY4dy8= github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449/go.mod h1:DC8sQMyTlI/44UCTL8QWFwb0bYNoXCfjwCv2hMivYZU= github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772 h1:LQmRsrzzaYYN3wEU1l5tWiccznhvbyGnu2N+wHSXZAo= github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772/go.mod h1:Kn1Hape05UzFZ7bOUnm3GVsHzP0TNrVmpfXYNHdqGGs= -github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240528175738-765a1e8107d6 h1:JqDatfHDw6cMJHuvypezAILXjm1lu5eWU6662M7U9JY= -github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240528175738-765a1e8107d6/go.mod h1:SbwNOxDd9g7RM3TAbPmbpj3o74I0JSg+r0eDbI+TQow= -github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240528175738-765a1e8107d6 h1:Ilc7PRaAOMEZR7KvO1cI9gDwDsGFdQ8s7KV+BGOLiBs= -github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240528175738-765a1e8107d6/go.mod h1:JX5DEIy628WS5MWMff9G5mb89rywLWdIoFILYIQtXcc= +github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240612165958-63fbee90b223 h1:HwM63aDVoA0F0zJclo439N6jdZJQQBkyjEnc5pfXWWM= +github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240612165958-63fbee90b223/go.mod h1:yRtMRgqxQRMO/GEba9oHyP3lKNSMxvrpej/dqa5QIHo= +github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240612165958-63fbee90b223 h1:6SUCN2CqY0AKRdCJzvoK/FFKRQFpNLBzgWPEABhs0ak= +github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240612165958-63fbee90b223/go.mod h1:ojnjvZtC38CPRB2M02heO2g+d7pJmfKtiZuNTqCZ348= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= diff --git a/integration-tests/testconfig/default.toml b/integration-tests/testconfig/default.toml index 76239df54..954bb48ff 100644 --- a/integration-tests/testconfig/default.toml +++ b/integration-tests/testconfig/default.toml @@ -11,14 +11,20 @@ log_targets=["file"] log_producer_timeout="10s" log_producer_retry_limit=10 +#################################################################################### +# TODO - Workaround due to lack of non-evm support in CTF and core [Network] -selected_networks=["SIMULATED"] # Not needed for Solana but mandatory from CTF (do not change) +selected_networks=["SEPOLIA"] [Network.RpcHttpUrls] -simulated = ["http://127.0.0.1"] # Not needed for Solana but mandatory from CTF (do not change) +sepolia = ["https://sepolia.drpc.org"] [Network.RpcWsUrls] -simulated = ["wss://127.0.0.1"] # Not needed for Solana but mandatory from CTF (do not change) +sepolia = ["wss://sepolia.drpc.org"] + +[Network.WalletKeys] +sepolia = ["5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"] +#################################################################################### # Testnet program ID's [SolanaConfig] diff --git a/pkg/solana/chainreader/chain_reader_test.go b/pkg/solana/chainreader/chain_reader_test.go index 7b34ecacd..db970f011 100644 --- a/pkg/solana/chainreader/chain_reader_test.go +++ b/pkg/solana/chainreader/chain_reader_test.go @@ -548,7 +548,7 @@ type wrappedTestChainReader struct { test *testing.T service *chainreader.SolanaChainReaderService client *mockedRPCClient - tester ChainReaderInterfaceTester + tester ChainReaderInterfaceTester[*testing.T] testStructQueue []*TestStruct } @@ -624,7 +624,7 @@ func (r *wrappedTestChainReader) GetLatestValue(ctx context.Context, contractNam r.client.SetNext(bts, nil, 0) case AnyContractName + MethodReturningSeenStruct: - nextStruct := CreateTestStruct(0, r.tester) + nextStruct := CreateTestStruct[*testing.T](0, r.tester) r.testStructQueue = append(r.testStructQueue, &nextStruct) a, b = getAddresses(r.test, r.tester, 5, 6) @@ -670,7 +670,7 @@ func (r *wrappedTestChainReader) QueryKey(ctx context.Context, contractName stri return nil, nil } -func getAddresses(t *testing.T, tester ChainReaderInterfaceTester, a, b int) (ag_solana.PublicKey, ag_solana.PublicKey) { +func getAddresses(t *testing.T, tester ChainReaderInterfaceTester[*testing.T], a, b int) (ag_solana.PublicKey, ag_solana.PublicKey) { t.Helper() bindings := tester.GetBindings(t) @@ -843,7 +843,9 @@ const ( ) // Required to allow test skipping to be on the same goroutine -type skipEventsChainReaderTester struct{ ChainReaderInterfaceTester } +type skipEventsChainReaderTester struct { + ChainReaderInterfaceTester[*testing.T] +} func (s *skipEventsChainReaderTester) GetChainReader(t *testing.T) types.ContractReader { return &skipEventsChainReader{