From d21e2375d0d5978d1365f072d5c1efcf1c530c6c Mon Sep 17 00:00:00 2001 From: ilija Date: Thu, 23 May 2024 17:42:30 +0200 Subject: [PATCH] Satisfy Relayer interface with unsupported NewContractReader impl. --- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 10 +++++----- integration-tests/go.sum | 16 ++++++++-------- pkg/solana/chainreader/chain_reader_test.go | 20 ++++++++++++++++++++ pkg/solana/relay.go | 4 ++++ 6 files changed, 40 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index ee369de8e..e0be9e291 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.20240516150131-e1be553a9d10 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240523151838-6e3062af4108 github.com/smartcontractkit/libocr v0.0.0-20240326191951-2bbe9382d052 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.26.0 diff --git a/go.sum b/go.sum index a977cafcf..0fe9cf321 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.20240516150131-e1be553a9d10 h1:IwJKWZHPBJbbh4oI3BGX8VNT3c/ChNiPZ/XI4iq6c0E= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240516150131-e1be553a9d10/go.mod h1:sj0pjL+METqeYL9ibp0T8SXquymlaQsofa6bdfLgXX8= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240523151838-6e3062af4108 h1:axezfe+jaVhrvN0WvS3HtAcU84uVS3du/NqQ16/EEns= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240523151838-6e3062af4108/go.mod h1:s+68EchlrXqHKRW3JJgZLEARvzMSKRI5+cE5Zx7pVJA= 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 13d79e8bb..84f708f94 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -14,11 +14,11 @@ require ( github.com/lib/pq v1.10.9 github.com/pelletier/go-toml/v2 v2.1.1 github.com/rs/zerolog v1.30.0 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240516150131-e1be553a9d10 - github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240510181707-46b1311a5a83 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240523151838-6e3062af4108 + github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240523142643-351e6bbefc51 github.com/smartcontractkit/chainlink-testing-framework v1.28.15 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240515225456-aeb9f4d50d65 - github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240515225456-aeb9f4d50d65 + github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240523150834-946bae2148b2 github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c github.com/smartcontractkit/seth v1.0.9 github.com/stretchr/testify v1.9.0 @@ -359,10 +359,10 @@ require ( 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-cosmos v0.4.1-0.20240508101745-af1ed7bc8a69 // indirect + github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240523150516-9205525c0da4 // indirect github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 // indirect github.com/smartcontractkit/chainlink-feeds v0.0.0-20240422130241-13c17a91b2ab // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240508155030-1024f2b55c69 // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240522111630-f2915c4ffbaa // 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 e959f07bf..f465f985d 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1406,16 +1406,16 @@ github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCq 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.20240516150131-e1be553a9d10 h1:IwJKWZHPBJbbh4oI3BGX8VNT3c/ChNiPZ/XI4iq6c0E= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240516150131-e1be553a9d10/go.mod h1:sj0pjL+METqeYL9ibp0T8SXquymlaQsofa6bdfLgXX8= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240508101745-af1ed7bc8a69 h1:Sec/GpBpUVaTEax1kSHlTvkzF/+d3w5roAQXaj5+SLA= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240508101745-af1ed7bc8a69/go.mod h1:ZQKf+0OLzCLYIisH/OdOIQuFRI6bDuw+jPBTATyHfFM= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240523151838-6e3062af4108 h1:axezfe+jaVhrvN0WvS3HtAcU84uVS3du/NqQ16/EEns= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240523151838-6e3062af4108/go.mod h1:s+68EchlrXqHKRW3JJgZLEARvzMSKRI5+cE5Zx7pVJA= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240523150516-9205525c0da4 h1:fcvZX/Wv0YEmVYFEK/bFDPyQtJTo9vCDOKwFQaQf7m8= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240523150516-9205525c0da4/go.mod h1:VoegrWrT48aBapE3w+l7pTYrzfSD6qAL9ZwiHTBSKqs= 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-20240422130241-13c17a91b2ab h1:Ct1oUlyn03HDUVdFHJqtRGRUujMqdoMzvf/Cjhe30Ag= github.com/smartcontractkit/chainlink-feeds v0.0.0-20240422130241-13c17a91b2ab/go.mod h1:RPUY7r8GxgzXxS1ijtU1P/fpJomOXztXgUbEziNmbCA= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240508155030-1024f2b55c69 h1:ssh/w3oXWu+C6bE88GuFRC1+0Bx/4ihsbc80XMLrl2k= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240508155030-1024f2b55c69/go.mod h1:VsfjhvWgjxqWja4q+FlXEtX5lu8BSxn10xRo6gi948g= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240522111630-f2915c4ffbaa h1:6qm+pZU3v+ZTW0ORXjFhzLAZkomvzmddDgzB9Mi2cSQ= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240522111630-f2915c4ffbaa/go.mod h1:5sX2GGdPVALo/uP8CwUPWQ6Ei6RF+991+0z9uxuq3dk= github.com/smartcontractkit/chainlink-testing-framework v1.28.15 h1:mga7N6jtXQ3UOCt43IdsEnCMBh9xjOWPaE9BiM6kr6Q= github.com/smartcontractkit/chainlink-testing-framework v1.28.15/go.mod h1:x1zDOz8zcLjEvs9fNA9y/DMguLam/2+CJdpxX0+rM8A= github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449 h1:fX/xmGm1GBsD1ZZnooNT+eWA0hiTAqFlHzOC5CY4dy8= @@ -1424,8 +1424,8 @@ github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772 h1: github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772/go.mod h1:Kn1Hape05UzFZ7bOUnm3GVsHzP0TNrVmpfXYNHdqGGs= github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240515225456-aeb9f4d50d65 h1:8AoBDPHOLgZA1JodqysYK/JxcVbjwNhyGfmwzQuep4s= github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240515225456-aeb9f4d50d65/go.mod h1:DOeyxJuvSV8No26UHAtmvZTycuGe0S4w/XMMj1EGMV8= -github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240515225456-aeb9f4d50d65 h1:ba2ZooA598i9P2qakTggT81f5TIFI9efPVsGy7MjY9Y= -github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240515225456-aeb9f4d50d65/go.mod h1:ICLCfUotU6Zk+S2kry3XE6i3lyhk30sr2rz89Y5QkGI= +github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240523150834-946bae2148b2 h1:ts9fJzfCfAuGYJe9WXxt8iKv4mIFouGhpLkE2RWz0y0= +github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240523150834-946bae2148b2/go.mod h1:osSDmpcJLIbFdhZFZrCHnak58Csdu2qX4XcNnTlZiTg= 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/pkg/solana/chainreader/chain_reader_test.go b/pkg/solana/chainreader/chain_reader_test.go index c644e8a4f..60b899989 100644 --- a/pkg/solana/chainreader/chain_reader_test.go +++ b/pkg/solana/chainreader/chain_reader_test.go @@ -552,6 +552,26 @@ type wrappedTestChainReader struct { testStructQueue []*TestStruct } +func (r *wrappedTestChainReader) Start(ctx context.Context) error { + return nil +} + +func (r *wrappedTestChainReader) Close() error { + return nil +} + +func (r *wrappedTestChainReader) Ready() error { + return nil +} + +func (r *wrappedTestChainReader) HealthReport() map[string]error { + return nil +} + +func (r *wrappedTestChainReader) Name() string { + return "wrappedTestChainReader" +} + func (r *wrappedTestChainReader) GetLatestValue(ctx context.Context, contractName string, method string, params, returnVal any) error { var ( a ag_solana.PublicKey diff --git a/pkg/solana/relay.go b/pkg/solana/relay.go index 68652fcd2..1bfba47d6 100644 --- a/pkg/solana/relay.go +++ b/pkg/solana/relay.go @@ -92,6 +92,10 @@ func (r *Relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.Confi return configWatcher, err } +func (r *Relayer) NewContractReader(_ []byte) (relaytypes.ContractReader, error) { + return nil, errors.New("contract reader is not supported for solana") +} + func (r *Relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MedianProvider, error) { ctx, cancel := r.stopCh.NewCtx() defer cancel()