Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BCI-3989][solana] - CR methods err when service unstarted #829

Draft
wants to merge 29 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e4b1032
add missing methods to testing interface
Farber98 Aug 22, 2024
72b155d
rename interface tester methods
Farber98 Aug 23, 2024
ae54542
remove unnecesary Start method
Farber98 Aug 26, 2024
826bfb9
Merge branch 'develop' into BCI-3989-cr-methods-error-when-unstarted
Farber98 Aug 29, 2024
07e8c77
close method impl
Farber98 Aug 29, 2024
06201dc
svc not started test in solana
Farber98 Aug 29, 2024
411032a
Merge branch 'develop' into BCI-3989-cr-methods-error-when-unstarted
Farber98 Aug 30, 2024
e666621
start service again so cleanup closes gracefully
Farber98 Aug 30, 2024
c14eed5
bump common ref
Farber98 Sep 3, 2024
a0b44bd
close ignoring error as core does. It might be already closed
Farber98 Sep 3, 2024
fc6cfe8
add start. address comment
Farber98 Sep 4, 2024
b15fafd
bump common
Farber98 Sep 4, 2024
0c335b0
merge develop
Farber98 Sep 4, 2024
6254cdb
bump common
Farber98 Sep 4, 2024
9769b7d
bump data streams for core integration tests
Farber98 Sep 4, 2024
048d13c
fix v2 dependencies
Farber98 Sep 4, 2024
c82beda
Merge branch 'develop' into BCI-3989-cr-methods-error-when-unstarted
Farber98 Sep 5, 2024
53f53b6
fix conflicts with chain components pr
Farber98 Sep 5, 2024
f629984
Merge branch 'develop' into BCI-3989-cr-methods-error-when-unstarted
Farber98 Sep 12, 2024
1cf0ccd
fix pr conflicts
Farber98 Sep 12, 2024
6d6b396
bump common version
Farber98 Sep 12, 2024
3f986a2
add flag to control if we return cr started
Farber98 Sep 15, 2024
1f37e8a
bump common
Farber98 Sep 15, 2024
79b4500
bump common
Farber98 Sep 16, 2024
cf4ce48
Merge branch 'develop' into BCI-3989-cr-methods-error-when-unstarted
Farber98 Sep 16, 2024
71454f3
make gomodtidy
Farber98 Sep 16, 2024
b7f19d9
refactor codec and chaincomponents ifaces
Farber98 Sep 16, 2024
099f8de
Merge branch 'develop' into BCI-3989-cr-methods-error-when-unstarted
Farber98 Sep 16, 2024
bc3a0f4
bump common
Farber98 Sep 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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.20240903142547-fa1ace87cf7c
github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.27.0
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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.20240903142547-fa1ace87cf7c h1:F8hJnja4luqP4OHB9KcYhrwQFLR1WsS0Xs4TTkHAdBc=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240903142547-fa1ace87cf7c/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=
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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.20240903142547-fa1ace87cf7c
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240821170223-a2f5c39f457f
github.com/smartcontractkit/chainlink-testing-framework v1.34.10
github.com/smartcontractkit/chainlink-testing-framework/seth v1.2.1
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -384,6 +383,7 @@ require (
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
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1390,8 +1390,8 @@ github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8um
github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240806144315-04ac101e9c95 h1:LAgJTg9Yr/uCo2g7Krp88Dco2U45Y6sbJVl8uKoLkys=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240806144315-04ac101e9c95/go.mod h1:/ZWraCBaDDgaIN1prixYcbVvIk/6HeED9+8zbWQ+TMo=
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-common v0.2.2-0.20240903142547-fa1ace87cf7c h1:F8hJnja4luqP4OHB9KcYhrwQFLR1WsS0Xs4TTkHAdBc=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240903142547-fa1ace87cf7c/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=
Expand All @@ -1412,8 +1412,8 @@ github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240829192404-67
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240829192404-674eac31cc16/go.mod h1:FP0vXPTAIyGFLVN3GU1zwp/eoi+nKZiTVG4Q97qEk0A=
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240829192404-674eac31cc16 h1:xtxqhCCRIcOfsu/4Wd0qc2mIpSA7frbLUp1DXzVyAVE=
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240829192404-674eac31cc16/go.mod h1:0hlkF9wKyi6Mcybla6kEcFvSRyBT0CmzxeH+AqCBxXo=
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/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=
Expand Down
11 changes: 10 additions & 1 deletion pkg/solana/chainreader/chain_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func (r *chainReaderInterfaceTester) GetChainReader(t *testing.T) types.Contract

require.NoError(t, svc.Start(context.Background()))
t.Cleanup(func() {
require.NoError(t, svc.Close())
_ = svc.Close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is important. Why are you removing it?

Suggested change
_ = svc.Close()
require.NoError(t, svc.Close())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Answered here: #829 (comment)

})

if r.reader == nil {
Expand All @@ -534,6 +534,10 @@ func (r *chainReaderInterfaceTester) GetChainReader(t *testing.T) types.Contract
return r.reader
}

func (r *chainReaderInterfaceTester) Close(t *testing.T) {
require.NoError(t, r.reader.service.Close())
}

type wrappedTestChainReader struct {
test *testing.T
service *chainreader.SolanaChainReaderService
Expand Down Expand Up @@ -621,6 +625,11 @@ func (r *wrappedTestChainReader) GetLatestValue(ctx context.Context, contractNam

fallthrough
default:
// If you called a method and the service is not started
if r.service.Ready() != nil {
return errors.New("service not ready")
Farber98 marked this conversation as resolved.
Show resolved Hide resolved
}

if len(r.testStructQueue) == 0 {
r.test.FailNow()
}
Expand Down
Loading