Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 7 additions & 3 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,19 @@ packages:
config:
dir: "./sdk/aptos/mocks/aptos"
filename: "transactionsigner.go"
github.com/block-vision/sui-go-sdk/sui:
github.com/smartcontractkit/chainlink-sui/relayer/client:
config:
all: false
outpkg: "mock_sui"
interfaces:
ISuiAPI:
BindingsClient:
config:
dir: "./sdk/sui/mocks/sui"
filename: "isuiapi.go"
filename: "bindingsclient.go"
SuiPTBClient:
config:
dir: "./sdk/sui/mocks/sui"
filename: "suiptbclient.go"
github.com/smartcontractkit/chainlink-sui/bindings/utils:
config:
all: false
Expand Down
5 changes: 3 additions & 2 deletions chainwrappers/chainaccessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package chainwrappers

import (
aptoslib "github.com/aptos-labs/aptos-go-sdk"
"github.com/block-vision/sui-go-sdk/sui"
sol "github.com/gagliardetto/solana-go"
solrpc "github.com/gagliardetto/solana-go/rpc"
"github.com/xssnick/tonutils-go/ton"
tonwallet "github.com/xssnick/tonutils-go/ton/wallet"

cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client"

cantonsdk "github.com/smartcontractkit/mcms/sdk/canton"
evmsdk "github.com/smartcontractkit/mcms/sdk/evm"
suisdk "github.com/smartcontractkit/mcms/sdk/sui"
Expand All @@ -21,7 +22,7 @@ type ChainAccessor interface {
SolanaSigner(selector uint64) (*sol.PrivateKey, bool)
AptosClient(selector uint64) (aptoslib.AptosRpcClient, bool)
AptosSigner(selector uint64) (aptoslib.TransactionSigner, bool)
SuiClient(selector uint64) (sui.ISuiAPI, bool)
SuiClient(selector uint64) (cslclient.BindingsClient, bool)
SuiSigner(selector uint64) (suisdk.SuiSigner, bool)
TonClient(selector uint64) (ton.APIClientWrapped, bool)
TonSigner(selector uint64) (*tonwallet.Wallet, bool)
Expand Down
2 changes: 1 addition & 1 deletion chainwrappers/executors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestBuildExecutors(t *testing.T) {
aptosCurseSigner := aptosmocks.NewTransactionSigner(t)
aptosCurseEncoder := aptos.NewEncoder(aptosSelector, 0, false)
aptosCurseExecutor := aptos.NewExecutorWithMCMSType(aptosCurseClient, aptosCurseSigner, aptosCurseEncoder, aptos.TimelockRoleProposer, aptos.MCMSTypeCurse)
suiClient := suimocks.NewISuiAPI(t)
suiClient := suimocks.NewBindingsClient(t)
suiSigner := suibindmocks.NewSuiSigner(t)
suiEncoder := sui.NewEncoder(suiSelector, 0, false)
suiExecutor, err := sui.NewExecutor(suiClient, suiSigner, suiEncoder, nil, "mcms-pkg-id",
Expand Down
43 changes: 18 additions & 25 deletions chainwrappers/mocks/chain_accessor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion chainwrappers/timelock_executors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestBuildTimelockExecutors(t *testing.T) {
aptosClient := aptosmocks.NewAptosRpcClient(t)
aptosSigner := aptosmocks.NewTransactionSigner(t)
aptosExecutor := aptos.NewTimelockExecutor(aptosClient, aptosSigner)
suiClient := suimocks.NewISuiAPI(t)
suiClient := suimocks.NewBindingsClient(t)
suiSigner := suibindmocks.NewSuiSigner(t)
suiExecutor, err := sui.NewTimelockExecutor(suiClient, suiSigner, nil, "mcms-pkg-id", "0xregistry456", "0xaccount123")
require.NoError(t, err)
Expand Down
21 changes: 15 additions & 6 deletions e2e/tests/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ import (
"testing"

"github.com/aptos-labs/aptos-go-sdk"
"github.com/block-vision/sui-go-sdk/sui"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/gagliardetto/solana-go/rpc"
"github.com/gagliardetto/solana-go/rpc/ws"
"github.com/joho/godotenv"
"github.com/stretchr/testify/require"
"github.com/xssnick/tonutils-go/ton"

"github.com/smartcontractkit/chainlink-common/pkg/logger"
tonchain "github.com/smartcontractkit/chainlink-ton/pkg/ton/chain"

cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client"

suisdk "github.com/smartcontractkit/mcms/sdk/sui"

"github.com/smartcontractkit/chainlink-testing-framework/framework"
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
"github.com/smartcontractkit/freeport"
Expand Down Expand Up @@ -60,7 +64,7 @@ type TestSetup struct {
AptosRPCClient *aptos.NodeClient
SolanaBlockchain *blockchain.Output
AptosBlockchain *blockchain.Output
SuiClient sui.ISuiAPI
SuiClient cslclient.BindingsClient
SuiBlockchain *blockchain.Output
SuiNodeURL string
TonClient *ton.APIClient
Expand Down Expand Up @@ -187,14 +191,17 @@ func InitializeSharedTestSetup(t *testing.T) *TestSetup {
}

var (
suiClient sui.ISuiAPI
suiClient cslclient.BindingsClient
suiBlockchainOutput *blockchain.Output
suiNodeURL string
)
suiLog := logger.Test(t)
if in.Settings.LocalSuiNodeURL != "" {
// Connect to local Sui node (highest priority)
suiNodeURL = in.Settings.LocalSuiNodeURL
suiClient = sui.NewSuiClient(suiNodeURL)
var clientErr error
suiClient, clientErr = suisdk.NewBindingsClientFromNodeURL(suiLog, suiNodeURL, "")
require.NoError(t, clientErr, "Failed to create Sui gRPC client")
t.Logf("Connected to local Sui node @ %s", suiNodeURL)
} else if in.SuiChain != nil {
// Use blockchain network setup (fallback)
Expand All @@ -208,10 +215,12 @@ func InitializeSharedTestSetup(t *testing.T) *TestSetup {
require.NoError(t, err, "Failed to initialize Sui blockchain")

suiNodeURL = suiBlockchainOutput.Nodes[0].ExternalHTTPUrl
suiClient = sui.NewSuiClient(suiNodeURL)
var clientErr error
suiClient, clientErr = suisdk.NewBindingsClientFromNodeURL(suiLog, suiNodeURL, "")
require.NoError(t, clientErr, "Failed to create Sui gRPC client")

// Test liveness, will also fetch ChainID
t.Logf("Initialized Sui RPC client @ %s", suiNodeURL)
t.Logf("Initialized Sui gRPC client @ %s", suiNodeURL)
}

var (
Expand Down
7 changes: 4 additions & 3 deletions e2e/tests/sui/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"fmt"

"github.com/block-vision/sui-go-sdk/signer"
"github.com/block-vision/sui-go-sdk/sui"
"github.com/block-vision/sui-go-sdk/transaction"
"github.com/stretchr/testify/suite"

chainsel "github.com/smartcontractkit/chain-selectors"

cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client"

"github.com/smartcontractkit/chainlink-sui/bindings/bind"
modulemcms "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms"
modulemcmsaccount "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms_account"
Expand All @@ -29,7 +30,7 @@ type TestSuite struct {
suite.Suite
e2e.TestSetup

client sui.ISuiAPI
client cslclient.BindingsClient
signer bindutils.SuiSigner

chainSelector types.ChainSelector
Expand Down Expand Up @@ -181,7 +182,7 @@ func (s *TestSuite) extractByteArgsFromEncodedCall(encodedCall bind.EncodedCall)

type TestEntrypointArgEncoder struct {
registryObj string
client sui.ISuiAPI
client cslclient.BindingsClient
}

func (e *TestEntrypointArgEncoder) EncodeEntryPointArg(executingCallbackParams *transaction.Argument, target, module, function, stateObjID string, data []byte, typeArgs []string) (*bind.EncodedCall, error) {
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ require (
github.com/google/uuid v1.6.0
github.com/joho/godotenv v1.5.1
github.com/karalabe/hid v1.0.1-0.20260315100226-f5d04adeffeb
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/samber/lo v1.53.0
github.com/smartcontractkit/chain-selectors v1.0.101
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260428085939-5c70de12dbfc
github.com/smartcontractkit/chainlink-canton v0.0.0-20260609155219-dcbe77d4a320
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260129103204-4c8453dd8139
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260129103204-4c8453dd8139
github.com/smartcontractkit/chainlink-sui v0.0.0-20260527160341-aa3adc0abf67
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260506120607-7f10be016c89
github.com/smartcontractkit/chainlink-sui v0.0.0-20260610194843-349ea43d69ce
github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.5
github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260514223130-48bc90aca745
github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad
Expand Down Expand Up @@ -232,7 +234,6 @@ require (
github.com/shopspring/decimal v1.4.0 // indirect
github.com/sigurn/crc16 v0.0.0-20211026045750-20ab5afb07e3 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260506120607-7f10be016c89 // indirect
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect
github.com/smartcontractkit/chainlink-deployments-framework v0.109.0 // indirect
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260505131349-78e491b80735 // indirect
Expand Down
8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,8 @@ github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3I
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pelletier/go-toml/v2 v2.3.0 h1:k59bC/lIZREW0/iVaQR8nDHxVq8OVlIzYCOJf421CaM=
Expand Down Expand Up @@ -686,6 +688,8 @@ github.com/smartcontractkit/chainlink-aptos v0.0.0-20260428085939-5c70de12dbfc h
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260428085939-5c70de12dbfc/go.mod h1:zfE2R7887kiwXkGTHKPe5NBgwhFwIC3pnA2uAxrbvig=
github.com/smartcontractkit/chainlink-canton v0.0.0-20260609155219-dcbe77d4a320 h1:ix4tCtSTB7S2XGll+uqnhrqAQ+2iW/Zk/vnPjBMYRB0=
github.com/smartcontractkit/chainlink-canton v0.0.0-20260609155219-dcbe77d4a320/go.mod h1:WKmNUX4oy8IvB66ukudrE99uaXjlZ7WghCDwHOTyB1c=
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260428205619-2db1389501a1 h1:p0nFrTYrOQzDhWYm6suaM5CoWiXV5NV7llHnp6/Kn/8=
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260428205619-2db1389501a1/go.mod h1:1XxxpkgCmG/z6y30yRuVrcxre6zixIVX3xzi706Db/8=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260129103204-4c8453dd8139 h1:jkChf04hhdiMBApbb+lLDxHMY62Md6UeM7v++GSw3K8=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260129103204-4c8453dd8139/go.mod h1:wuhagkM/lU0GbV2YcrROOH0GlsfXJYwm6qmpa4CK70w=
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260129103204-4c8453dd8139 h1:tw3K4UkH5XfW5SoyYkvAlbzrccoGSLdz/XkxD6nyGC8=
Expand All @@ -706,8 +710,8 @@ github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260211172625
github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260211172625-dff40e83b3c9/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM=
github.com/smartcontractkit/chainlink-protos/op-catalog v0.1.0 h1:hGEJFD2X3oNIPXQbtIPxCJyg5CcKglRCYBmESS+gmeQ=
github.com/smartcontractkit/chainlink-protos/op-catalog v0.1.0/go.mod h1:PjZD54vr6rIKEKQj6HNA4hllvYI/QpT+Zefj3tqkFAs=
github.com/smartcontractkit/chainlink-sui v0.0.0-20260527160341-aa3adc0abf67 h1:NNvPOgvf5vbOYVLxLST+5E88iPOAnpmzZGPihEx8DFc=
github.com/smartcontractkit/chainlink-sui v0.0.0-20260527160341-aa3adc0abf67/go.mod h1:k1HSbHyPaQWPOj6lXDIAe04EuwbC5ge1nK+cpG2E8hE=
github.com/smartcontractkit/chainlink-sui v0.0.0-20260610194843-349ea43d69ce h1:Xglr7eM24+Y9eMOhgK//QjXLDjPuT1oUAtdvsGqY8P0=
github.com/smartcontractkit/chainlink-sui v0.0.0-20260610194843-349ea43d69ce/go.mod h1:Y2kTVIsAUjqqSNGiEQomsaVH5XsBJzxov4j07MaDJOw=
github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.5 h1:EiQx0LCPzxlfO9piSPeMCVSZAnp/BxAsPIGh/jBal18=
github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.5/go.mod h1:nyOjn4ADJGqRMe3+4ZXSV+J/7nWb1H2Vx8Qk57eLRYA=
github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.5 h1:RwZXxdIAOyjp6cwc9Quxgr38k8r7ACz+Lxh9o/A6oH0=
Expand Down
5 changes: 2 additions & 3 deletions sdk/aptos/mocks/aptos/rpcclient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion sdk/aptos/mocks/aptos/transactionsigner.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions sdk/aptos/mocks/mcms/mcms.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions sdk/aptos/mocks/mcms/mcms/mcms.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading