From 91206bd952ddbde9fdef19bf09915abfd116f2d3 Mon Sep 17 00:00:00 2001 From: Silas Lenihan <32529249+silaslenihan@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:46:03 -0400 Subject: [PATCH] Adjusted solana CR interface tests to be compatible with CW additions (#827) * Adjusted solana CR interface tests to be compatable with CW additions * Delete gotest.log * Refactored ChainReaderTests to ChainComponentsTests * gomodtidy * updated test names and added in dirtycontracts --- go.mod | 4 ++-- go.sum | 8 ++++---- integration-tests/go.mod | 10 +++++----- integration-tests/go.sum | 20 +++++++++---------- pkg/solana/chainreader/chain_reader_test.go | 22 ++++++++++++++------- 5 files changed, 36 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 12c2ea189..cda1cd771 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99 github.com/pelletier/go-toml/v2 v2.2.0 github.com/prometheus/client_golang v1.17.0 - github.com/smartcontractkit/chainlink-common v0.2.2-0.20240829145110-4a45c426fbe8 + github.com/smartcontractkit/chainlink-common v0.2.2-0.20240904135753-00ac29d259a7 github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 @@ -72,7 +72,6 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect github.com/mr-tron/base58 v1.2.0 // indirect - github.com/mwitkow/grpc-proxy v0.0.0-20230212185441-f345521cb9c9 // indirect github.com/oklog/run v1.0.0 // indirect github.com/onsi/gomega v1.24.1 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -85,6 +84,7 @@ require ( github.com/ryanuber/go-glob v1.0.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 // indirect github.com/shopspring/decimal v1.4.0 // indirect + github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect diff --git a/go.sum b/go.sum index cd2c94f8c..2a2a834af 100644 --- a/go.sum +++ b/go.sum @@ -425,10 +425,10 @@ 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.2.2-0.20240829145110-4a45c426fbe8 h1:MOFuL1J4/rRcR0x09qSlOsKIiq4I7YzbZcQ421KqUZA= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240829145110-4a45c426fbe8/go.mod h1:TJSY2ETKiXLRPvGHNO7Dp1tlpFIPSCWwN3iIdrsadIE= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240904135753-00ac29d259a7 h1:VL+mgHtgAuGbOOpRvjlhV/go+OpdCGqko1DxFrbw9jM= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240904135753-00ac29d259a7/go.mod h1:D/qaCoq0SxXzg5NRN5FtBRv98VBf+D2NOC++RbvvuOc= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e h1:9ypZ/8aW8Vm497i1gXHcT96oNLiu88jbg9QdX+IUE3E= github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 9478a2c8a..9e8bfea95 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -14,12 +14,12 @@ require ( github.com/lib/pq v1.10.9 github.com/pelletier/go-toml/v2 v2.2.2 github.com/rs/zerolog v1.33.0 - github.com/smartcontractkit/chainlink-common v0.2.2-0.20240829145110-4a45c426fbe8 + github.com/smartcontractkit/chainlink-common v0.2.2-0.20240904135753-00ac29d259a7 github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240821170223-a2f5c39f457f github.com/smartcontractkit/chainlink-testing-framework v1.35.0 github.com/smartcontractkit/chainlink-testing-framework/seth v1.2.1 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240902145730-2d77ff4623d0 - github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240902145730-2d77ff4623d0 + github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240904164340-3ba567d984a2 github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 github.com/stretchr/testify v1.9.0 github.com/testcontainers/testcontainers-go v0.28.0 @@ -327,7 +327,6 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect - github.com/mwitkow/grpc-proxy v0.0.0-20230212185441-f345521cb9c9 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/oklog/run v1.1.0 // indirect github.com/oklog/ulid v1.3.1 // indirect @@ -377,13 +376,14 @@ require ( github.com/slack-go/slack v0.12.2 // indirect github.com/smartcontractkit/chain-selectors v1.0.21 // indirect github.com/smartcontractkit/chainlink-automation v1.0.4 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20240828115624-442f1cff195b // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20240902144105-70b5719fd098 // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45 // indirect - github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240820130645-cf4b159fbba2 // indirect + github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240904093355-e40169857652 // indirect github.com/smartcontractkit/chainlink-feeds v0.0.0-20240710170203-5b41615da827 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799 // indirect github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.1 // indirect github.com/smartcontractkit/chainlink-testing-framework/wasp v0.4.10 // indirect + github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 // indirect github.com/smartcontractkit/wsrpc v0.8.1 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index c0b796ce2..95a7aeaad 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1388,14 +1388,14 @@ github.com/smartcontractkit/chain-selectors v1.0.21 h1:KCR9SA7PhOexaBzFieHoLv1Wo github.com/smartcontractkit/chain-selectors v1.0.21/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= 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-ccip v0.0.0-20240828115624-442f1cff195b h1:v1RnZVfUoHIm/lwIqRAH4eDRNTu+N+AtQE5Ik4U9hsU= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20240828115624-442f1cff195b/go.mod h1:Z9lQ5t20kRk28pzRLnqAJZUVOw8E6/siA3P3MLyKqoM= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240829145110-4a45c426fbe8 h1:MOFuL1J4/rRcR0x09qSlOsKIiq4I7YzbZcQ421KqUZA= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240829145110-4a45c426fbe8/go.mod h1:TJSY2ETKiXLRPvGHNO7Dp1tlpFIPSCWwN3iIdrsadIE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240902144105-70b5719fd098 h1:gZsXQ//TbsaD9bcvR2wOdao7AgNDIS/Uml0FEF0vJuI= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240902144105-70b5719fd098/go.mod h1:Z9lQ5t20kRk28pzRLnqAJZUVOw8E6/siA3P3MLyKqoM= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240904135753-00ac29d259a7 h1:VL+mgHtgAuGbOOpRvjlhV/go+OpdCGqko1DxFrbw9jM= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240904135753-00ac29d259a7/go.mod h1:D/qaCoq0SxXzg5NRN5FtBRv98VBf+D2NOC++RbvvuOc= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45 h1:NBQLtqk8zsyY4qTJs+NElI3aDFTcAo83JHvqD04EvB0= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45/go.mod h1:LV0h7QBQUpoC2UUi6TcUvcIFm1xjP/DtEcqV8+qeLUs= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240820130645-cf4b159fbba2 h1:KH6tpCw5hu8u6UTtgll7a8mE4sIbHCbmtzHJdKuRwBw= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240820130645-cf4b159fbba2/go.mod h1:V/86loaFSH0dqqUEHqyXVbyNqDRSjvcf9BRomWFTljU= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240904093355-e40169857652 h1:0aZ3HiEz2bMM5ywHAyKlFMN95qTzpNDn7uvnHLrFX6s= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240904093355-e40169857652/go.mod h1:PwPcmQNAzVmU8r8JWKrDRgvXesDwxnqbMD6DvYt/Z7M= github.com/smartcontractkit/chainlink-feeds v0.0.0-20240710170203-5b41615da827 h1:BCHu4pNP6arrcHLEWx61XjLaonOd2coQNyL0NTUcaMc= github.com/smartcontractkit/chainlink-feeds v0.0.0-20240710170203-5b41615da827/go.mod h1:OPX+wC2TWQsyLNpR7daMt2vMpmsNcoBxbZyGTHr6tiA= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799 h1:HyLTySm7BR+oNfZqDTkVJ25wnmcTtxBBD31UkFL+kEM= @@ -1410,10 +1410,10 @@ github.com/smartcontractkit/chainlink-testing-framework/wasp v0.4.10 h1:s7e9YPU/ github.com/smartcontractkit/chainlink-testing-framework/wasp v0.4.10/go.mod h1:E7x2ICsT8vzy0nL6wwBphoQMoNwOMl0L9voQpEl1FoM= github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240902145730-2d77ff4623d0 h1:7Djr0n61hgCywndPLqOCq5QjPzSWC/b4TpuOC4mqXAA= github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240902145730-2d77ff4623d0/go.mod h1:NjCfyvWFZE+z/enmDyLbKcPVW0ILJ61jTC8ce0lPmVI= -github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240902145730-2d77ff4623d0 h1:Ry0b3GaBLTcXre8RnZztOj1Q6vgTzp5APrdr9cZLCec= -github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240902145730-2d77ff4623d0/go.mod h1:omJ9mZWX3VGD5is3iQSdmSVV1v02r6SnAZ3YND9ci2A= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= +github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240904164340-3ba567d984a2 h1:9VEYv2v+T7AyDCDAQQrZmnUCdGfPgN6ToAqV5R091cw= +github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240904164340-3ba567d984a2/go.mod h1:R9OfCOgddtzbufMQKnbpo66dqTY3bTDZnJUVG4MP5tk= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 h1:e38V5FYE7DA1JfKXeD5Buo/7lczALuVXlJ8YNTAUxcw= github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 h1:yiKnypAqP8l0OX0P3klzZ7SCcBUxy5KqTAKZmQOvSQE= diff --git a/pkg/solana/chainreader/chain_reader_test.go b/pkg/solana/chainreader/chain_reader_test.go index 5732e743a..9357c40bb 100644 --- a/pkg/solana/chainreader/chain_reader_test.go +++ b/pkg/solana/chainreader/chain_reader_test.go @@ -43,9 +43,9 @@ func TestSolanaChainReaderService_ReaderInterface(t *testing.T) { t.Parallel() it := &chainReaderInterfaceTester{} - RunChainReaderInterfaceTests(t, it) - lsIt := &skipEventsChainReaderTester{ChainReaderInterfaceTester: commontestutils.WrapChainReaderTesterForLoop(it)} - RunChainReaderInterfaceTests(t, lsIt) + RunContractReaderInterfaceTests(t, it, true) + lsIt := &skipEventsChainReaderTester{ChainComponentsInterfaceTester: commontestutils.WrapContractReaderTesterForLoop(it)} + RunContractReaderInterfaceTests(t, lsIt, true) } func TestSolanaChainReaderService_ServiceCtx(t *testing.T) { @@ -538,7 +538,7 @@ type wrappedTestChainReader struct { test *testing.T service *chainreader.SolanaChainReaderService client *mockedRPCClient - tester ChainReaderInterfaceTester[*testing.T] + tester ChainComponentsInterfaceTester[*testing.T] testStructQueue []*TestStruct } @@ -558,6 +558,11 @@ func (r *wrappedTestChainReader) HealthReport() map[string]error { return nil } +func (r *chainReaderInterfaceTester) GetChainWriter(t *testing.T) types.ChainWriter { + t.Skip("ChainWriter is not yet supported on Solana") + return nil +} + func (r *wrappedTestChainReader) Name() string { return "wrappedTestChainReader" } @@ -666,7 +671,7 @@ func (r *wrappedTestChainReader) QueryKey(ctx context.Context, contractName stri return nil, nil } -func getAddresses(t *testing.T, tester ChainReaderInterfaceTester[*testing.T], a, b int) (ag_solana.PublicKey, ag_solana.PublicKey) { +func getAddresses(t *testing.T, tester ChainComponentsInterfaceTester[*testing.T], a, b int) (ag_solana.PublicKey, ag_solana.PublicKey) { t.Helper() bindings := tester.GetBindings(t) @@ -695,6 +700,9 @@ func (r *chainReaderInterfaceTester) GenerateBlocksTillConfidenceLevel(t *testin t.Skip("GenerateBlocksTillConfidenceLevel is not yet supported in Solana") } +func (r *chainReaderInterfaceTester) DirtyContracts() { +} + // SetTestStructLatestValue is expected to return the same bound contract and method in the same test // Any setup required for this should be done in Setup. // The contract should take a LatestParams as the params and return the nth TestStruct set @@ -851,12 +859,12 @@ const ( // Required to allow test skipping to be on the same goroutine type skipEventsChainReaderTester struct { - ChainReaderInterfaceTester[*testing.T] + ChainComponentsInterfaceTester[*testing.T] } func (s *skipEventsChainReaderTester) GetChainReader(t *testing.T) types.ContractReader { return &skipEventsChainReader{ - ContractReader: s.ChainReaderInterfaceTester.GetChainReader(t), + ContractReader: s.ChainComponentsInterfaceTester.GetChainReader(t), t: t, } }