diff --git a/integration-tests/go.sum b/integration-tests/go.sum index bcad27447..3402df7d3 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -951,6 +951,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= +github.com/linkedin/goavro/v2 v2.12.0 h1:rIQQSj8jdAUlKQh6DttK8wCRv4t4QO09g1C4aBWXslg= +github.com/linkedin/goavro/v2 v2.12.0/go.mod h1:KXx+erlq+RPlGSPmLF7xGo6SAbh8sCQ53x064+ioxhk= github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= github.com/lithammer/dedent v1.1.0 h1:VNzHMVCBNG1j0fh3OrsFRkVUwStdDArbgBWoPAffktY= diff --git a/integration-tests/relayinterface/lookups_test.go b/integration-tests/relayinterface/lookups_test.go index 1d7e9f799..1b91dc8df 100644 --- a/integration-tests/relayinterface/lookups_test.go +++ b/integration-tests/relayinterface/lookups_test.go @@ -1,7 +1,6 @@ package relayinterface import ( - "context" "reflect" "testing" "time" @@ -153,7 +152,7 @@ func TestPDALookups(t *testing.T) { IsWritable: true, } - ctx := context.Background() + ctx := tests.Context(t) result, err := pdaLookup.Resolve(ctx, nil, nil, nil) require.NoError(t, err) require.Equal(t, expectedMeta, result) @@ -184,7 +183,7 @@ func TestPDALookups(t *testing.T) { IsWritable: true, } - ctx := context.Background() + ctx := tests.Context(t) args := map[string]interface{}{ "test_seed": seed1, "another_seed": seed2, @@ -206,7 +205,7 @@ func TestPDALookups(t *testing.T) { IsWritable: true, } - ctx := context.Background() + ctx := tests.Context(t) args := map[string]interface{}{ "test_seed": []byte("data"), } @@ -242,7 +241,7 @@ func TestPDALookups(t *testing.T) { IsWritable: true, } - ctx := context.Background() + ctx := tests.Context(t) args := map[string]interface{}{ "test_seed": seed1, "another_seed": seed2, diff --git a/pkg/solana/chainwriter/ccip_example_config.go b/pkg/solana/chainwriter/ccip_example_config.go index 89038fd6a..acdaf3d35 100644 --- a/pkg/solana/chainwriter/ccip_example_config.go +++ b/pkg/solana/chainwriter/ccip_example_config.go @@ -2,8 +2,6 @@ package chainwriter import ( "fmt" - - commoncodec "github.com/smartcontractkit/chainlink-common/pkg/codec" ) func TestConfig() { @@ -22,14 +20,9 @@ func TestConfig() { executionReportSingleChainIDL := `{"name":"ExecutionReportSingleChain","type":{"kind":"struct","fields":[{"name":"source_chain_selector","type":"u64"},{"name":"message","type":{"defined":"Any2SolanaRampMessage"}},{"name":"root","type":{"array":["u8",32]}},{"name":"proofs","type":{"vec":{"array":["u8",32]}}}]}},{"name":"Any2SolanaRampMessage","type":{"kind":"struct","fields":[{"name":"header","type":{"defined":"RampMessageHeader"}},{"name":"sender","type":{"vec":"u8"}},{"name":"data","type":{"vec":"u8"}},{"name":"receiver","type":{"array":["u8",32]}},{"name":"extra_args","type":{"defined":"SolanaExtraArgs"}}]}},{"name":"RampMessageHeader","type":{"kind":"struct","fields":[{"name":"message_id","type":{"array":["u8",32]}},{"name":"source_chain_selector","type":"u64"},{"name":"dest_chain_selector","type":"u64"},{"name":"sequence_number","type":"u64"},{"name":"nonce","type":"u64"}]}},{"name":"SolanaExtraArgs","type":{"kind":"struct","fields":[{"name":"compute_units","type":"u32"},{"name":"allow_out_of_order_execution","type":"bool"}]}}` executeConfig := MethodConfig{ - FromAddress: userAddress, - InputModifications: commoncodec.ModifiersConfig{ - // remove merkle root since it isn't a part of the on-chain type - &commoncodec.DropModifierConfig{ - Fields: []string{"Message.ExtraArgs.MerkleRoot"}, - }, - }, - ChainSpecificName: "execute", + FromAddress: userAddress, + InputModifications: nil, + ChainSpecificName: "execute", // LookupTables are on-chain stores of accounts. They can be used in two ways: // 1. As a way to store a list of accounts that are all associated together (i.e. Token State registry) // 2. To compress the transactions in a TX and reduce the size of the TX. (The traditional way) diff --git a/pkg/solana/chainwriter/chain_writer.go b/pkg/solana/chainwriter/chain_writer.go index 8c82038f1..e07842201 100644 --- a/pkg/solana/chainwriter/chain_writer.go +++ b/pkg/solana/chainwriter/chain_writer.go @@ -251,7 +251,7 @@ func (s *SolanaChainWriterService) SubmitTransaction(ctx context.Context, contra } // Prepare transaction - programID, err := solana.PublicKeyFromBase58(contractName) + programID, err := solana.PublicKeyFromBase58(toAddress) if err != nil { return errorWithDebugID(fmt.Errorf("error parsing program ID: %w", err), debugID) } @@ -281,11 +281,6 @@ func (s *SolanaChainWriterService) SubmitTransaction(ctx context.Context, contra return nil } -var ( - _ services.Service = &SolanaChainWriterService{} - _ types.ContractWriter = &SolanaChainWriterService{} -) - // GetTransactionStatus returns the current status of a transaction in the underlying chain's TXM. func (s *SolanaChainWriterService) GetTransactionStatus(ctx context.Context, transactionID string) (types.TransactionStatus, error) { return s.txm.GetTransactionStatus(ctx, transactionID) diff --git a/pkg/solana/chainwriter/helpers.go b/pkg/solana/chainwriter/helpers.go index 22a2d1c67..8b7276276 100644 --- a/pkg/solana/chainwriter/helpers.go +++ b/pkg/solana/chainwriter/helpers.go @@ -56,7 +56,7 @@ func GetValuesAtLocation(args any, location string) ([][]byte, error) { } func GetDebugIDAtLocation(args any, location string) (string, error) { - debugIDList, err := GetValueAtLocation(args, location) + debugIDList, err := GetValuesAtLocation(args, location) if err != nil { return "", err } @@ -67,26 +67,6 @@ func GetDebugIDAtLocation(args any, location string) (string, error) { return debugID, nil } -func GetValueAtLocation(args any, location string) ([][]byte, error) { - path := strings.Split(location, ".") - - valueList, err := traversePath(args, path) - if err != nil { - return nil, err - } - - var values [][]byte - for _, value := range valueList { - byteArray, ok := value.([]byte) - if !ok { - return nil, fmt.Errorf("invalid value format at path: %s", location) - } - values = append(values, byteArray) - } - - return values, nil -} - func errorWithDebugID(err error, debugID string) error { if debugID == "" { return err