diff --git a/integration-tests/relayinterface/chain_components_test.go b/integration-tests/relayinterface/chain_components_test.go index cd47d224e..95a7ceb24 100644 --- a/integration-tests/relayinterface/chain_components_test.go +++ b/integration-tests/relayinterface/chain_components_test.go @@ -131,48 +131,39 @@ type SolanaChainComponentsInterfaceTester[T TestingT[T]] struct { TestSelectionSupport Helper SolanaChainComponentsInterfaceTesterHelper[T] cr *chainreader.SolanaChainReaderService - chainReaderConfig config.ChainReader + contractReaderConfig config.ContractReader } func (it *SolanaChainComponentsInterfaceTester[T]) Setup(t T) { t.Cleanup(func() {}) - it.chainReaderConfig = config.ChainReader{ - Namespaces: map[string]config.ChainReaderMethods{ + it.contractReaderConfig = config.ContractReader{ + Namespaces: map[string]config.ChainContractReader{ AnyContractName: { - Methods: map[string]config.ChainDataReader{ + IDL: string(it.Helper.GetJSONEncodedIDL(t)), + Reads: map[string]config.ReadDefinition{ MethodReturningUint64: { - AnchorIDL: string(it.Helper.GetJSONEncodedIDL(t)), - Encoding: config.EncodingTypeBorsh, - Procedure: config.ChainReaderProcedure{ - IDLAccount: "DataAccount", - OutputModifications: codec.ModifiersConfig{ - &codec.PropertyExtractorConfig{FieldName: "U64Value"}, - }, + ChainSpecificName: "DataAccount", + ReadType: config.Account, + OutputModifications: codec.ModifiersConfig{ + &codec.PropertyExtractorConfig{FieldName: "U64Value"}, }, }, MethodReturningUint64Slice: { - AnchorIDL: string(it.Helper.GetJSONEncodedIDL(t)), - Encoding: config.EncodingTypeBorsh, - Procedure: config.ChainReaderProcedure{ - IDLAccount: "DataAccount", - OutputModifications: codec.ModifiersConfig{ - &codec.PropertyExtractorConfig{FieldName: "U64Slice"}, - }, + ChainSpecificName: "DataAccount", + OutputModifications: codec.ModifiersConfig{ + &codec.PropertyExtractorConfig{FieldName: "U64Slice"}, }, }, }, }, AnySecondContractName: { - Methods: map[string]config.ChainDataReader{ + IDL: string(it.Helper.GetJSONEncodedIDL(t)), + Reads: map[string]config.ReadDefinition{ MethodReturningUint64: { - AnchorIDL: string(it.Helper.GetJSONEncodedIDL(t)), - Encoding: config.EncodingTypeBorsh, - Procedure: config.ChainReaderProcedure{ - IDLAccount: "DataAccount", - OutputModifications: codec.ModifiersConfig{ - &codec.PropertyExtractorConfig{FieldName: "U64Value"}, - }, + ChainSpecificName: "DataAccount", + OutputModifications: codec.ModifiersConfig{ + &codec.PropertyExtractorConfig{FieldName: "U64Value"}, }, }, }, @@ -199,7 +190,7 @@ func (it *SolanaChainComponentsInterfaceTester[T]) GetContractReader(t T) types. return it.cr } - svc, err := chainreader.NewChainReaderService(it.Helper.Logger(t), it.Helper.RPCClient(), it.chainReaderConfig) + svc, err := chainreader.NewChainReaderService(it.Helper.Logger(t), it.Helper.RPCClient(), it.contractReaderConfig) require.NoError(t, err) require.NoError(t, svc.Start(ctx)) diff --git a/pkg/solana/chainreader/account_read_binding.go b/pkg/solana/chainreader/account_read_binding.go index 4f14c0aa7..c2cfaf6ff 100644 --- a/pkg/solana/chainreader/account_read_binding.go +++ b/pkg/solana/chainreader/account_read_binding.go @@ -7,6 +7,7 @@ import ( "github.com/gagliardetto/solana-go/rpc" "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-solana/pkg/solana/codec" ) diff --git a/pkg/solana/chainreader/chain_reader.go b/pkg/solana/chainreader/chain_reader.go index 9b2c4bf36..9b96ed319 100644 --- a/pkg/solana/chainreader/chain_reader.go +++ b/pkg/solana/chainreader/chain_reader.go @@ -288,11 +288,6 @@ func (s *SolanaChainReaderService) init(namespaces map[string]config.ChainContra return nil } -type accountIDLTypes struct { - Account codec.IdlTypeDef - Types codec.IdlTypeDefSlice -} - func (s *SolanaChainReaderService) addAccountRead(namespace string, itemType string, idl codec.IDL, idlType codec.IdlTypeDef, readDefinition config.ReadDefinition) error { inputAccountIDLDef := codec.NilIdlTypeDefTy // TODO: