From b0e1bf192e8bb6ae28cc495c047e33f0b3804312 Mon Sep 17 00:00:00 2001 From: Joe Huang Date: Tue, 7 Jan 2025 11:17:34 -0600 Subject: [PATCH] add solana config --- .../capabilities/ccip/oraclecreator/plugin.go | 20 ++++++++++++------- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/core/capabilities/ccip/oraclecreator/plugin.go b/core/capabilities/ccip/oraclecreator/plugin.go index bff860cd573..c529d4825fd 100644 --- a/core/capabilities/ccip/oraclecreator/plugin.go +++ b/core/capabilities/ccip/oraclecreator/plugin.go @@ -41,6 +41,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/pluginconfig" "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-solana/pkg/solana/chainwriter" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" @@ -492,12 +493,18 @@ func createChainWriter( execBatchGasLimit uint64, chainFamily string, ) (types.ContractWriter, error) { + var err error transmitter, ok := transmitters[types.NewRelayID(chainFamily, chainID)] - chainWriterConfig := make([]byte, 0) - if chainFamily == relay.NetworkSolana { + var chainWriterConfig []byte + if chainFamily == relay.NetworkSolana { + // TODO once onchain account lookup address are available, create construct function that initialize the config + solConfig := chainwriter.ChainWriterConfig{} + if chainWriterConfig, err = json.Marshal(solConfig); err != nil { + return nil, fmt.Errorf("failed to marshal Solana chain writer config: %w", err) + } } else { - var fromAddress common.Address + fromAddress := common.Address{} if ok { fromAddress = common.HexToAddress(transmitter[0]) } @@ -507,11 +514,10 @@ func createChainWriter( execBatchGasLimit, ) if err != nil { - return nil, fmt.Errorf("failed to create chain writer config: %w", err) + return nil, fmt.Errorf("failed to create EVM chain writer config: %w", err) } - chainWriterConfig, err = json.Marshal(chainWriterRawConfig) - if err != nil { - return nil, fmt.Errorf("failed to marshal chain writer config: %w", err) + if chainWriterConfig, err = json.Marshal(chainWriterRawConfig); err != nil { + return nil, fmt.Errorf("failed to marshal EVM chain writer config: %w", err) } } diff --git a/go.mod b/go.mod index a0b4bca1a87..af96ca832e9 100644 --- a/go.mod +++ b/go.mod @@ -84,7 +84,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 github.com/smartcontractkit/chainlink-feeds v0.1.1 github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250103164418-319e58e52798 github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de diff --git a/go.sum b/go.sum index 49520fd1845..525c18a0b57 100644 --- a/go.sum +++ b/go.sum @@ -1163,6 +1163,8 @@ github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2Lp github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250103164418-319e58e52798 h1:Ea+cqrzM2EVVwcYTVtvlEZHlulo1xUOcKhY1zf9/hfU= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250103164418-319e58e52798/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=