From 6376a863e37bf4c04fb4a78991d3692428903c84 Mon Sep 17 00:00:00 2001 From: faisal-link Date: Thu, 4 Jun 2026 20:17:52 +0400 Subject: [PATCH 01/12] update sui client --- .mockery.yaml | 6 +- chainwrappers/chainaccessor.go | 5 +- chainwrappers/executors_test.go | 2 +- chainwrappers/mocks/chain_accessor.go | 16 +- chainwrappers/timelock_executors_test.go | 2 +- e2e/tests/setup.go | 20 +- e2e/tests/sui/common.go | 7 +- go.mod | 5 +- go.sum | 6 +- sdk/sui/client_helper.go | 58 + sdk/sui/configurer.go | 7 +- sdk/sui/configurer_test.go | 4 +- sdk/sui/executing_callback.go | 8 +- sdk/sui/executing_callback_test.go | 32 +- sdk/sui/executor.go | 8 +- sdk/sui/executor_test.go | 36 +- sdk/sui/inspector.go | 6 +- sdk/sui/inspector_test.go | 10 +- sdk/sui/mocks/sui/bindingsclient.go | 156 + sdk/sui/mocks/sui/isuiapi.go | 3367 ---------------------- sdk/sui/timelock_executor.go | 8 +- sdk/sui/timelock_executor_test.go | 20 +- sdk/sui/timelock_inspector.go | 7 +- sdk/sui/timelock_inspector_test.go | 20 +- 24 files changed, 338 insertions(+), 3478 deletions(-) create mode 100644 sdk/sui/client_helper.go create mode 100644 sdk/sui/mocks/sui/bindingsclient.go delete mode 100644 sdk/sui/mocks/sui/isuiapi.go diff --git a/.mockery.yaml b/.mockery.yaml index d4ad3d309..0ee965856 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -94,15 +94,15 @@ 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" github.com/smartcontractkit/chainlink-sui/bindings/utils: config: all: false diff --git a/chainwrappers/chainaccessor.go b/chainwrappers/chainaccessor.go index ca1fed01c..0ad7e6681 100644 --- a/chainwrappers/chainaccessor.go +++ b/chainwrappers/chainaccessor.go @@ -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" + evmsdk "github.com/smartcontractkit/mcms/sdk/evm" suisuisdk "github.com/smartcontractkit/mcms/sdk/sui" ) @@ -20,7 +21,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) (suisuisdk.SuiSigner, bool) TonClient(selector uint64) (ton.APIClientWrapped, bool) TonSigner(selector uint64) (*tonwallet.Wallet, bool) diff --git a/chainwrappers/executors_test.go b/chainwrappers/executors_test.go index 626930cf2..8e0361f5e 100644 --- a/chainwrappers/executors_test.go +++ b/chainwrappers/executors_test.go @@ -53,7 +53,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", diff --git a/chainwrappers/mocks/chain_accessor.go b/chainwrappers/mocks/chain_accessor.go index a0bbdbb67..2a11823c2 100644 --- a/chainwrappers/mocks/chain_accessor.go +++ b/chainwrappers/mocks/chain_accessor.go @@ -16,7 +16,7 @@ import ( solana "github.com/gagliardetto/solana-go" - sui "github.com/block-vision/sui-go-sdk/sui" + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" ton "github.com/xssnick/tonutils-go/ton" @@ -432,23 +432,23 @@ func (_c *ChainAccessor_SolanaSigner_Call) RunAndReturn(run func(uint64) (*solan } // SuiClient provides a mock function with given fields: selector -func (_m *ChainAccessor) SuiClient(selector uint64) (sui.ISuiAPI, bool) { +func (_m *ChainAccessor) SuiClient(selector uint64) (cslclient.BindingsClient, bool) { ret := _m.Called(selector) if len(ret) == 0 { panic("no return value specified for SuiClient") } - var r0 sui.ISuiAPI + var r0 cslclient.BindingsClient var r1 bool - if rf, ok := ret.Get(0).(func(uint64) (sui.ISuiAPI, bool)); ok { + if rf, ok := ret.Get(0).(func(uint64) (cslclient.BindingsClient, bool)); ok { return rf(selector) } - if rf, ok := ret.Get(0).(func(uint64) sui.ISuiAPI); ok { + if rf, ok := ret.Get(0).(func(uint64) cslclient.BindingsClient); ok { r0 = rf(selector) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(sui.ISuiAPI) + r0 = ret.Get(0).(cslclient.BindingsClient) } } @@ -479,12 +479,12 @@ func (_c *ChainAccessor_SuiClient_Call) Run(run func(selector uint64)) *ChainAcc return _c } -func (_c *ChainAccessor_SuiClient_Call) Return(_a0 sui.ISuiAPI, _a1 bool) *ChainAccessor_SuiClient_Call { +func (_c *ChainAccessor_SuiClient_Call) Return(_a0 cslclient.BindingsClient, _a1 bool) *ChainAccessor_SuiClient_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *ChainAccessor_SuiClient_Call) RunAndReturn(run func(uint64) (sui.ISuiAPI, bool)) *ChainAccessor_SuiClient_Call { +func (_c *ChainAccessor_SuiClient_Call) RunAndReturn(run func(uint64) (cslclient.BindingsClient, bool)) *ChainAccessor_SuiClient_Call { _c.Call.Return(run) return _c } diff --git a/chainwrappers/timelock_executors_test.go b/chainwrappers/timelock_executors_test.go index eb9d07a72..810227e0b 100644 --- a/chainwrappers/timelock_executors_test.go +++ b/chainwrappers/timelock_executors_test.go @@ -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) diff --git a/e2e/tests/setup.go b/e2e/tests/setup.go index 65adf90f1..4f5afef55 100644 --- a/e2e/tests/setup.go +++ b/e2e/tests/setup.go @@ -12,7 +12,6 @@ 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" @@ -21,6 +20,10 @@ import ( "github.com/xssnick/tonutils-go/ton" tonchain "github.com/smartcontractkit/chainlink-ton/pkg/ton/chain" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + 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" @@ -59,7 +62,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 @@ -185,14 +188,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) @@ -206,10 +212,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 ( diff --git a/e2e/tests/sui/common.go b/e2e/tests/sui/common.go index 881235e20..057d782c8 100644 --- a/e2e/tests/sui/common.go +++ b/e2e/tests/sui/common.go @@ -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" @@ -29,7 +30,7 @@ type TestSuite struct { suite.Suite e2e.TestSetup - client sui.ISuiAPI + client cslclient.BindingsClient signer bindutils.SuiSigner chainSelector types.ChainSelector @@ -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) { diff --git a/go.mod b/go.mod index 460685248..6edd2985a 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,8 @@ go 1.26.2 //nolint:gomoddirectives // allow replace directive replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 +replace github.com/smartcontractkit/chainlink-sui => ../chainlink-sui + require ( github.com/Masterminds/semver/v3 v3.4.0 github.com/aptos-labs/aptos-go-sdk v1.13.0 @@ -21,6 +23,7 @@ require ( github.com/smartcontractkit/chainlink-aptos v0.0.0-20260428085939-5c70de12dbfc github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 + github.com/smartcontractkit/chainlink-common v0.11.2-0.20260506120607-7f10be016c89 github.com/smartcontractkit/chainlink-sui v0.0.0-20260527160341-aa3adc0abf67 github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.3 github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260514223130-48bc90aca745 @@ -187,6 +190,7 @@ require ( github.com/oklog/run v1.2.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.3.0 // indirect github.com/pion/dtls/v2 v2.2.12 // indirect @@ -213,7 +217,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-protos/cre/go v0.0.0-20260505131349-78e491b80735 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect diff --git a/go.sum b/go.sum index 898f04ca2..f4d6b9252 100644 --- a/go.sum +++ b/go.sum @@ -525,6 +525,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= @@ -606,6 +608,8 @@ github.com/smartcontractkit/chain-selectors v1.0.100 h1:wpiSpmI/eFjY+wx/nPr5VuNF github.com/smartcontractkit/chain-selectors v1.0.100/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260428085939-5c70de12dbfc h1:Um9FBcf0JNSFuGbxgccDG1vM3cNrMGy0SdJ7r6VbX0o= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260428085939-5c70de12dbfc/go.mod h1:zfE2R7887kiwXkGTHKPe5NBgwhFwIC3pnA2uAxrbvig= +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-20260121163256-85accaf3d28d h1:xdFpzbApEMz4Rojg2Y2OjFlrh0wu7eB10V2tSZGW5y8= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d/go.mod h1:bgmqE7x9xwmIVr8PqLbC0M5iPm4AV2DBl596lO6S5Sw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 h1:Z4t2ZY+ZyGWxtcXvPr11y4o3CGqhg3frJB5jXkCSvWA= @@ -620,8 +624,6 @@ github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-202510021 github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260211172625-dff40e83b3c9 h1:hhevsu8k7tlDRrYZmgAh7V4avGQDMvus1bwIlial3Ps= github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260211172625-dff40e83b3c9/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= -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-testing-framework/framework v0.16.3 h1:y3dFPfouGziisDJa0JbY6DE7/JjoSCP/5aebzHcj4jA= github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.3/go.mod h1:W+X9xaRulD8dD87QOB0njHkBKkmYxB4E0osfpe9808I= github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260514223130-48bc90aca745 h1:eieKLvYuzwBPh/FdbUS1gnIanI86zgWby1L10o90g4o= diff --git a/sdk/sui/client_helper.go b/sdk/sui/client_helper.go new file mode 100644 index 000000000..31997968e --- /dev/null +++ b/sdk/sui/client_helper.go @@ -0,0 +1,58 @@ +package sui + +import ( + "fmt" + "net/url" + "strings" + "time" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" +) + +const defaultSuiGrpcToken = "test" + +// NewBindingsClientFromNodeURL creates a gRPC-backed bindings client from an HTTP RPC URL. +// Local Sui nodes expose gRPC on the same host:port as JSON-RPC. +func NewBindingsClientFromNodeURL(log logger.Logger, nodeURL string, grpcToken string) (cslclient.BindingsClient, error) { + grpcTarget, err := grpcTargetFromNodeURL(nodeURL) + if err != nil { + return nil, err + } + if grpcToken == "" { + grpcToken = defaultSuiGrpcToken + } + + return cslclient.NewPTBClient(log, cslclient.PTBClientConfig{ + GrpcTarget: grpcTarget, + GrpcToken: grpcToken, + TransactionTimeout: 30 * time.Second, + MaxConcurrentRequests: 50, + DefaultRequestType: cslclient.WaitForEffectsCert, + }) +} + +func grpcTargetFromNodeURL(nodeURL string) (string, error) { + u, err := url.Parse(nodeURL) + if err != nil { + return "", fmt.Errorf("parse node URL %q: %w", nodeURL, err) + } + host := u.Hostname() + port := u.Port() + if host == "" { + return "", fmt.Errorf("node URL %q has no host", nodeURL) + } + if port == "" { + switch u.Scheme { + case "https": + port = "443" + default: + port = "9000" + } + } + if strings.Contains(host, ":") && !strings.HasPrefix(host, "[") { + return fmt.Sprintf("[%s]:%s", host, port), nil + } + return fmt.Sprintf("%s:%s", host, port), nil +} diff --git a/sdk/sui/configurer.go b/sdk/sui/configurer.go index ac2e09664..9030729d3 100644 --- a/sdk/sui/configurer.go +++ b/sdk/sui/configurer.go @@ -7,11 +7,10 @@ import ( chainsel "github.com/smartcontractkit/chain-selectors" - "github.com/block-vision/sui-go-sdk/sui" - "github.com/smartcontractkit/chainlink-sui/bindings/bind" modulemcms "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms" bindutils "github.com/smartcontractkit/chainlink-sui/bindings/utils" + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" "github.com/smartcontractkit/mcms/sdk" "github.com/smartcontractkit/mcms/types" @@ -20,7 +19,7 @@ import ( var _ sdk.Configurer = &Configurer{} type Configurer struct { - client sui.ISuiAPI + client cslclient.BindingsClient signer bindutils.SuiSigner role TimelockRole mcms modulemcms.IMcms @@ -28,7 +27,7 @@ type Configurer struct { chainSelector uint64 } -func NewConfigurer(client sui.ISuiAPI, signer bindutils.SuiSigner, role TimelockRole, mcmsPackageID string, ownerCap string, chainSelector uint64) (*Configurer, error) { +func NewConfigurer(client cslclient.BindingsClient, signer bindutils.SuiSigner, role TimelockRole, mcmsPackageID string, ownerCap string, chainSelector uint64) (*Configurer, error) { mcms, err := modulemcms.NewMcms(mcmsPackageID, client) if err != nil { return nil, err diff --git a/sdk/sui/configurer_test.go b/sdk/sui/configurer_test.go index d4aef378e..12a1f52da 100644 --- a/sdk/sui/configurer_test.go +++ b/sdk/sui/configurer_test.go @@ -41,7 +41,7 @@ func MustMarshalJSON(t *testing.T, v any) []byte { } func TestNewConfigurer(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) // Test successful creation @@ -225,7 +225,7 @@ func TestConfigurer_SetConfig(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) Modulemockmcms := mockmodulemcms.NewIMcms(t) diff --git a/sdk/sui/executing_callback.go b/sdk/sui/executing_callback.go index 4f829e5b4..152cf1965 100644 --- a/sdk/sui/executing_callback.go +++ b/sdk/sui/executing_callback.go @@ -7,13 +7,13 @@ import ( "strings" "github.com/block-vision/sui-go-sdk/models" - "github.com/block-vision/sui-go-sdk/sui" "github.com/block-vision/sui-go-sdk/transaction" "github.com/smartcontractkit/chainlink-sui/bindings/bind" modulemcms "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms" module_mcms_deployer "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms_deployer" bindutils "github.com/smartcontractkit/chainlink-sui/bindings/utils" + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" ) const ( @@ -29,7 +29,7 @@ type ExecutingCallbackAppender interface { } type ExecutingCallbackParams struct { - client sui.ISuiAPI + client cslclient.BindingsClient mcms modulemcms.IMcms mcmsPackageID string entryPointEncoder EntrypointArgEncoder // Encoder for the entrypoint function. Users can provide their own implementation @@ -37,10 +37,10 @@ type ExecutingCallbackParams struct { accountObj string extractExecutingCallbackParams func(mcmsPackageID string, ptb *transaction.Transaction, vectorExecutingCallback *transaction.Argument) (*transaction.Argument, error) closeExecutingCallbackParams func(mcmsPackageID string, ptb *transaction.Transaction, vectorExecutingCallback *transaction.Argument) error - createDeployerFunc func(mcmsPackageID string, client sui.ISuiAPI) (module_mcms_deployer.IMcmsDeployer, error) + createDeployerFunc func(mcmsPackageID string, client cslclient.BindingsClient) (module_mcms_deployer.IMcmsDeployer, error) } -func NewExecutingCallbackParams(client sui.ISuiAPI, mcms modulemcms.IMcms, mcmsPackageID string, entryPointEncoder EntrypointArgEncoder, registryObj string, accountObj string) *ExecutingCallbackParams { +func NewExecutingCallbackParams(client cslclient.BindingsClient, mcms modulemcms.IMcms, mcmsPackageID string, entryPointEncoder EntrypointArgEncoder, registryObj string, accountObj string) *ExecutingCallbackParams { return &ExecutingCallbackParams{ client: client, mcms: mcms, diff --git a/sdk/sui/executing_callback_test.go b/sdk/sui/executing_callback_test.go index 9f2946e84..774dc880b 100644 --- a/sdk/sui/executing_callback_test.go +++ b/sdk/sui/executing_callback_test.go @@ -12,10 +12,10 @@ import ( "github.com/stretchr/testify/require" "github.com/block-vision/sui-go-sdk/models" - "github.com/block-vision/sui-go-sdk/sui" "github.com/block-vision/sui-go-sdk/transaction" "github.com/smartcontractkit/chainlink-sui/bindings/bind" + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" module_mcms_deployer "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms_deployer" mockbindutils "github.com/smartcontractkit/mcms/sdk/sui/mocks/bindutils" @@ -51,7 +51,7 @@ func TestNewExecutingCallbackParams(t *testing.T) { t.Parallel() // Create mock objects - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockMcms := mockmcms.NewIMcms(t) entrypointEncoder := &MockEntrypointArgEncoder{t: t, registryObj: "0xregistry"} @@ -78,7 +78,7 @@ func TestExecutingCallbackParams_AppendPTB_WithMCMSSetConfig(t *testing.T) { t.Parallel() // Create mock objects - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockMcms := mockmcms.NewIMcms(t) entrypointEncoder := &MockEntrypointArgEncoder{t: t, registryObj: "0xregistry"} mockMcmsEncoder := mockmcms.NewMcmsEncoder(t) @@ -159,7 +159,7 @@ func TestExecutingCallbackParams_AppendPTB_WithMCMSSetConfig(t *testing.T) { func TestExecutingCallbackParams_AppendPTB_WithMCMSTimelockUpdateMinDelay(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockMcms := mockmcms.NewIMcms(t) entrypointEncoder := &MockEntrypointArgEncoder{t: t, registryObj: "0xregistry"} mockMcmsEncoder := mockmcms.NewMcmsEncoder(t) @@ -223,7 +223,7 @@ func TestExecutingCallbackParams_AppendPTB_WithMCMSTimelockUpdateMinDelay(t *tes func TestExecutingCallbackParams_AppendPTB_WithUnsupportedMCMSMainModuleCall(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockMcms := mockmcms.NewIMcms(t) entrypointEncoder := &MockEntrypointArgEncoder{t: t, registryObj: "0xregistry"} @@ -263,7 +263,7 @@ func TestExecutingCallbackParams_AppendPTB_WithMCMSAccountModule(t *testing.T) { t.Parallel() // Create mock objects - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockMcms := mockmcms.NewIMcms(t) entrypointEncoder := &MockEntrypointArgEncoder{t: t, registryObj: "0xregistry"} mockMcmsEncoder := mockmcms.NewMcmsEncoder(t) @@ -345,7 +345,7 @@ func TestExecutingCallbackParams_AppendPTB_WithNonMCMSTarget(t *testing.T) { t.Parallel() // Create mock objects - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockMcms := mockmcms.NewIMcms(t) mockBound := mockbindutils.NewIBoundContract(t) @@ -420,7 +420,7 @@ func TestExecutingCallbackParams_AppendPTB_ExtractError(t *testing.T) { t.Parallel() // Create mock objects - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockMcms := mockmcms.NewIMcms(t) entrypointEncoder := &MockEntrypointArgEncoder{ t: t, @@ -524,7 +524,7 @@ func TestCloseExecutingCallbackParams_InvalidPackageID(t *testing.T) { func TestExecutingCallbackParams_AppendPTB_WithMCMSDeployerTarget_Success(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockMcms := mockmcms.NewIMcms(t) entrypointEncoder := &MockEntrypointArgEncoder{t: t, registryObj: "0xregistry"} mockMcmsEncoder := mockmcms.NewMcmsEncoder(t) @@ -594,7 +594,7 @@ func TestExecutingCallbackParams_AppendPTB_WithMCMSDeployerTarget_Success(t *tes params.closeExecutingCallbackParams = func(mcmsPackageID string, ptb *transaction.Transaction, vectorExecutingCallback *transaction.Argument) error { return nil } - params.createDeployerFunc = func(mcmsPackageID string, client sui.ISuiAPI) (module_mcms_deployer.IMcmsDeployer, error) { + params.createDeployerFunc = func(mcmsPackageID string, client cslclient.BindingsClient) (module_mcms_deployer.IMcmsDeployer, error) { return mockDeployer, nil } @@ -622,7 +622,7 @@ func TestExecutingCallbackParams_AppendPTB_WithMCMSDeployerTarget_Success(t *tes func TestExecutingCallbackParams_AppendPTB_WithMCMSDeployerTarget_InvalidFunction(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockMcms := mockmcms.NewIMcms(t) entrypointEncoder := &MockEntrypointArgEncoder{t: t, registryObj: "0xregistry"} mockDeployer := mockmcmsdeployer.NewIMcmsDeployer(t) @@ -647,7 +647,7 @@ func TestExecutingCallbackParams_AppendPTB_WithMCMSDeployerTarget_InvalidFunctio params.closeExecutingCallbackParams = func(mcmsPackageID string, ptb *transaction.Transaction, vectorExecutingCallback *transaction.Argument) error { return nil } - params.createDeployerFunc = func(mcmsPackageID string, client sui.ISuiAPI) (module_mcms_deployer.IMcmsDeployer, error) { + params.createDeployerFunc = func(mcmsPackageID string, client cslclient.BindingsClient) (module_mcms_deployer.IMcmsDeployer, error) { return mockDeployer, nil } @@ -673,7 +673,7 @@ func TestExecutingCallbackParams_AppendPTB_WithMCMSDeployerTarget_InvalidFunctio func TestExecutingCallbackParams_AppendPTB_WithMCMSDeployerTarget_ExecuteDispatchError(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockMcms := mockmcms.NewIMcms(t) entrypointEncoder := &MockEntrypointArgEncoder{t: t, registryObj: "0xregistry"} mockMcmsEncoder := mockmcms.NewMcmsEncoder(t) @@ -706,7 +706,7 @@ func TestExecutingCallbackParams_AppendPTB_WithMCMSDeployerTarget_ExecuteDispatc params.closeExecutingCallbackParams = func(mcmsPackageID string, ptb *transaction.Transaction, vectorExecutingCallback *transaction.Argument) error { return nil } - params.createDeployerFunc = func(mcmsPackageID string, client sui.ISuiAPI) (module_mcms_deployer.IMcmsDeployer, error) { + params.createDeployerFunc = func(mcmsPackageID string, client cslclient.BindingsClient) (module_mcms_deployer.IMcmsDeployer, error) { return mockDeployer, nil } @@ -733,7 +733,7 @@ func TestExecutingCallbackParams_AppendPTB_WithMCMSDeployerTarget_ExecuteDispatc func TestExecutingCallbackParams_AppendPTB_WithMCMSDeployerTarget_AppendPTBError(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockMcms := mockmcms.NewIMcms(t) entrypointEncoder := &MockEntrypointArgEncoder{t: t, registryObj: "0xregistry"} mockMcmsEncoder := mockmcms.NewMcmsEncoder(t) @@ -777,7 +777,7 @@ func TestExecutingCallbackParams_AppendPTB_WithMCMSDeployerTarget_AppendPTBError params.closeExecutingCallbackParams = func(mcmsPackageID string, ptb *transaction.Transaction, vectorExecutingCallback *transaction.Argument) error { return nil } - params.createDeployerFunc = func(mcmsPackageID string, client sui.ISuiAPI) (module_mcms_deployer.IMcmsDeployer, error) { + params.createDeployerFunc = func(mcmsPackageID string, client cslclient.BindingsClient) (module_mcms_deployer.IMcmsDeployer, error) { return mockDeployer, nil } diff --git a/sdk/sui/executor.go b/sdk/sui/executor.go index 1a57bc4bf..0adddbacc 100644 --- a/sdk/sui/executor.go +++ b/sdk/sui/executor.go @@ -8,7 +8,6 @@ import ( "math/big" "github.com/block-vision/sui-go-sdk/models" - "github.com/block-vision/sui-go-sdk/sui" "github.com/block-vision/sui-go-sdk/transaction" "github.com/ethereum/go-ethereum/common" @@ -17,6 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-sui/bindings/bind" modulemcms "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms" bindutils "github.com/smartcontractkit/chainlink-sui/bindings/utils" + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" "github.com/smartcontractkit/mcms/sdk" "github.com/smartcontractkit/mcms/types" @@ -34,7 +34,7 @@ var _ sdk.Executor = &Executor{} type Executor struct { *Encoder *Inspector - client sui.ISuiAPI + client cslclient.BindingsClient signer bindutils.SuiSigner mcmsPackageID string mcms modulemcms.IMcms @@ -45,12 +45,12 @@ type Executor struct { timelockObj string // ExecutePTB function for dependency injection and testing - ExecutePTB func(ctx context.Context, opts *bind.CallOpts, client sui.ISuiAPI, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) + ExecutePTB func(ctx context.Context, opts *bind.CallOpts, client cslclient.BindingsClient, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) executingCallbackParams ExecutingCallbackAppender } -func NewExecutor(client sui.ISuiAPI, signer bindutils.SuiSigner, encoder *Encoder, entrypointEncoder EntrypointArgEncoder, mcmsPackageID string, role TimelockRole, mcmsObj string, accountObj string, registryObj string, timelockObj string) (*Executor, error) { +func NewExecutor(client cslclient.BindingsClient, signer bindutils.SuiSigner, encoder *Encoder, entrypointEncoder EntrypointArgEncoder, mcmsPackageID string, role TimelockRole, mcmsObj string, accountObj string, registryObj string, timelockObj string) (*Executor, error) { mcms, err := modulemcms.NewMcms(mcmsPackageID, client) if err != nil { return nil, err diff --git a/sdk/sui/executor_test.go b/sdk/sui/executor_test.go index 5af3fd519..e6c7f830a 100644 --- a/sdk/sui/executor_test.go +++ b/sdk/sui/executor_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/block-vision/sui-go-sdk/models" - "github.com/block-vision/sui-go-sdk/sui" "github.com/block-vision/sui-go-sdk/transaction" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" @@ -15,6 +14,7 @@ import ( chainsel "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/chainlink-sui/bindings/bind" + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" mockbindutils "github.com/smartcontractkit/mcms/sdk/sui/mocks/bindutils" mockmcms "github.com/smartcontractkit/mcms/sdk/sui/mocks/mcms" @@ -24,7 +24,7 @@ import ( // executorTestExecutingCallbackParams is a mock implementation of ExecutingCallbackAppender for testing type executorTestExecutingCallbackParams struct { - client sui.ISuiAPI + client cslclient.BindingsClient mcms *mockmcms.IMcms mcmsPackageID string registryObj string @@ -54,7 +54,7 @@ var timelockObj = "0xtimelock" func TestNewExecutor(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) encoder := &Encoder{ @@ -295,7 +295,7 @@ func TestExecutor_ExecuteOperation_InvalidAdditionalFields(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcmsContract := mockmcms.NewIMcms(t) @@ -337,7 +337,7 @@ func TestExecutor_ExecuteOperation_Success_ScheduleBatch(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcmsContract := mockmcms.NewIMcms(t) mockEncoder := mockmcms.NewMcmsEncoder(t) @@ -357,7 +357,7 @@ func TestExecutor_ExecuteOperation_Success_ScheduleBatch(t *testing.T) { TxCount: 5, }, // Mock ExecutePTB function directly in the struct - ExecutePTB: func(ctx context.Context, opts *bind.CallOpts, client sui.ISuiAPI, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { + ExecutePTB: func(ctx context.Context, opts *bind.CallOpts, client cslclient.BindingsClient, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { return &models.SuiTransactionBlockResponse{ Digest: "9WzSXdwbky8tNbH7juvyaui4QzMUYEjdCEKMrMgLhXHT", Transaction: models.SuiTransactionBlock{ @@ -422,7 +422,7 @@ func TestExecutor_ExecuteOperation_Success_Bypass(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcmsContract := mockmcms.NewIMcms(t) mockEncoder := mockmcms.NewMcmsEncoder(t) @@ -451,7 +451,7 @@ func TestExecutor_ExecuteOperation_Success_Bypass(t *testing.T) { TxCount: 5, }, // Mock ExecutePTB function directly in the struct - ExecutePTB: func(ctx context.Context, opts *bind.CallOpts, client sui.ISuiAPI, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { + ExecutePTB: func(ctx context.Context, opts *bind.CallOpts, client cslclient.BindingsClient, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { return &models.SuiTransactionBlockResponse{ Digest: "0xbypass_success_digest", Transaction: models.SuiTransactionBlock{ @@ -537,7 +537,7 @@ func TestExecutor_ExecuteOperation_Success_Cancel(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcmsContract := mockmcms.NewIMcms(t) mockEncoder := mockmcms.NewMcmsEncoder(t) @@ -557,7 +557,7 @@ func TestExecutor_ExecuteOperation_Success_Cancel(t *testing.T) { TxCount: 5, }, // Mock ExecutePTB function directly in the struct - ExecutePTB: func(ctx context.Context, opts *bind.CallOpts, client sui.ISuiAPI, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { + ExecutePTB: func(ctx context.Context, opts *bind.CallOpts, client cslclient.BindingsClient, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { return &models.SuiTransactionBlockResponse{ Digest: "0xcancel_success_digest", Transaction: models.SuiTransactionBlock{ @@ -634,7 +634,7 @@ func TestExecutor_ExecuteOperation_Cancel_InvalidOperationID(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcmsContract := mockmcms.NewIMcms(t) @@ -679,7 +679,7 @@ func TestExecutor_ExecuteOperation_Cancel_InvalidOperationID(t *testing.T) { mockEncoder := mockmcms.NewMcmsEncoder(t) mockBound := mockbindutils.NewIBoundContract(t) - executor.ExecutePTB = func(ctx context.Context, opts *bind.CallOpts, client sui.ISuiAPI, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { + executor.ExecutePTB = func(ctx context.Context, opts *bind.CallOpts, client cslclient.BindingsClient, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { return &models.SuiTransactionBlockResponse{ Digest: "0xcancel_invalid_op_digest", }, nil @@ -725,7 +725,7 @@ func newBypassExecutor( ) *Executor { t.Helper() mockSigner := mockbindutils.NewSuiSigner(t) - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) return &Executor{ signer: mockSigner, @@ -740,7 +740,7 @@ func newBypassExecutor( ChainSelector: types.ChainSelector(chainsel.SUI_TESTNET.Selector), TxCount: 5, }, - ExecutePTB: func(_ context.Context, _ *bind.CallOpts, _ sui.ISuiAPI, _ *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { + ExecutePTB: func(_ context.Context, _ *bind.CallOpts, _ cslclient.BindingsClient, _ *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { return &models.SuiTransactionBlockResponse{Digest: responseDigest}, nil }, executingCallbackParams: capturer, @@ -819,7 +819,7 @@ func TestExecutor_Bypass_PerCallLatestPackageID(t *testing.T) { "internal_latest_package_ids": ["` + latest1 + `", "` + latest2 + `"] }` - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockBound := mockbindutils.NewIBoundContract(t) mockEnc := mockmcms.NewMcmsEncoder(t) mockedMcms := mockmcms.NewIMcms(t) @@ -861,7 +861,7 @@ func TestExecutor_Bypass_BatchLevelLatestPackageID(t *testing.T) { "latest_package_id": "` + latestBatch + `" }` - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockBound := mockbindutils.NewIBoundContract(t) mockEnc := mockmcms.NewMcmsEncoder(t) mockedMcms := mockmcms.NewIMcms(t) @@ -899,7 +899,7 @@ func TestExecutor_Bypass_NoLatestPackageID(t *testing.T) { "internal_type_args": [[], []] }` - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockBound := mockbindutils.NewIBoundContract(t) mockEnc := mockmcms.NewMcmsEncoder(t) mockedMcms := mockmcms.NewIMcms(t) @@ -934,7 +934,7 @@ func TestExecutor_Bypass_InvalidInternalLatestPackageID(t *testing.T) { "internal_latest_package_ids": ["not-a-hex-address", ""] }` - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockBound := mockbindutils.NewIBoundContract(t) mockEnc := mockmcms.NewMcmsEncoder(t) mockedMcms := mockmcms.NewIMcms(t) diff --git a/sdk/sui/inspector.go b/sdk/sui/inspector.go index e6a4193f4..8eb552f87 100644 --- a/sdk/sui/inspector.go +++ b/sdk/sui/inspector.go @@ -5,12 +5,12 @@ import ( "errors" "fmt" - "github.com/block-vision/sui-go-sdk/sui" "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/chainlink-sui/bindings/bind" modulemcms "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms" bindutils "github.com/smartcontractkit/chainlink-sui/bindings/utils" + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" "github.com/smartcontractkit/mcms/sdk" "github.com/smartcontractkit/mcms/sdk/evm" @@ -29,7 +29,7 @@ var _ sdk.Inspector = &Inspector{} type Inspector struct { ConfigTransformer - client sui.ISuiAPI + client cslclient.BindingsClient signer bindutils.SuiSigner mcmsPackageID string mcms modulemcms.IMcms @@ -75,7 +75,7 @@ func (c *ConfigTransformer) ToConfig(config modulemcms.Config) (*types.Config, e return c.evmTransformer.ToConfig(evmConfig) } -func NewInspector(client sui.ISuiAPI, signer bindutils.SuiSigner, mcmsPackageID string, role TimelockRole) (*Inspector, error) { +func NewInspector(client cslclient.BindingsClient, signer bindutils.SuiSigner, mcmsPackageID string, role TimelockRole) (*Inspector, error) { mcms, err := modulemcms.NewMcms(mcmsPackageID, client) if err != nil { return nil, err diff --git a/sdk/sui/inspector_test.go b/sdk/sui/inspector_test.go index 355e3f355..d897c4edb 100644 --- a/sdk/sui/inspector_test.go +++ b/sdk/sui/inspector_test.go @@ -22,7 +22,7 @@ import ( func TestNewInspector(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mcmsPackageID := "0x123456789abcdef" role := TimelockRoleProposer @@ -174,7 +174,7 @@ func TestInspector_GetConfig(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcms := mockmodulemcms.NewIMcms(t) @@ -258,7 +258,7 @@ func TestInspector_GetOpCount(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcms := mockmodulemcms.NewIMcms(t) @@ -405,7 +405,7 @@ func TestInspector_GetRoot(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcms := mockmodulemcms.NewIMcms(t) @@ -497,7 +497,7 @@ func TestInspector_GetRootMetadata(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcms := mockmodulemcms.NewIMcms(t) diff --git a/sdk/sui/mocks/sui/bindingsclient.go b/sdk/sui/mocks/sui/bindingsclient.go new file mode 100644 index 000000000..23a1e780d --- /dev/null +++ b/sdk/sui/mocks/sui/bindingsclient.go @@ -0,0 +1,156 @@ +// Code generated manually for BindingsClient gRPC migration. DO NOT EDIT. + +package mock_sui + +import ( + "context" + "math/big" + + suirpcv2 "github.com/block-vision/sui-go-sdk/pb/sui/rpc/v2" + suigosigner "github.com/block-vision/sui-go-sdk/signer" + "github.com/block-vision/sui-go-sdk/transaction" + mock "github.com/stretchr/testify/mock" + + "github.com/smartcontractkit/chainlink-sui/relayer/client" +) + +// BindingsClient is a mock type for client.BindingsClient. +type BindingsClient struct { + mock.Mock +} + +type BindingsClient_Expecter struct { + mock *mock.Mock +} + +func (_m *BindingsClient) EXPECT() *BindingsClient_Expecter { + return &BindingsClient_Expecter{mock: &_m.Mock} +} + +func (_m *BindingsClient) ReadObjectId(ctx context.Context, objectId string) (*suirpcv2.Object, error) { + ret := _m.Called(ctx, objectId) + if len(ret) == 0 { + panic("no return value specified for ReadObjectId") + } + var r0 *suirpcv2.Object + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*suirpcv2.Object, error)); ok { + return rf(ctx, objectId) + } + if ret.Get(0) != nil { + r0 = ret.Get(0).(*suirpcv2.Object) + } + r1 = ret.Error(1) + return r0, r1 +} + +func (_m *BindingsClient) QueryCoinsByAddress(ctx context.Context, address string, coinType string) ([]*suirpcv2.Object, error) { + ret := _m.Called(ctx, address, coinType) + if len(ret) == 0 { + panic("no return value specified for QueryCoinsByAddress") + } + var r0 []*suirpcv2.Object + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]*suirpcv2.Object, error)); ok { + return rf(ctx, address, coinType) + } + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*suirpcv2.Object) + } + r1 = ret.Error(1) + return r0, r1 +} + +func (_m *BindingsClient) GetReferenceGasPrice(ctx context.Context) (*big.Int, error) { + ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for GetReferenceGasPrice") + } + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { + return rf(ctx) + } + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + r1 = ret.Error(1) + return r0, r1 +} + +func (_m *BindingsClient) SimulatePTB(ctx context.Context, bcsBytes []byte) ([]any, error) { + ret := _m.Called(ctx, bcsBytes) + if len(ret) == 0 { + panic("no return value specified for SimulatePTB") + } + var r0 []any + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []byte) ([]any, error)); ok { + return rf(ctx, bcsBytes) + } + if ret.Get(0) != nil { + r0 = ret.Get(0).([]any) + } + r1 = ret.Error(1) + return r0, r1 +} + +func (_m *BindingsClient) SendTransaction(ctx context.Context, req *suirpcv2.ExecuteTransactionRequest) (*suirpcv2.ExecuteTransactionResponse, error) { + ret := _m.Called(ctx, req) + if len(ret) == 0 { + panic("no return value specified for SendTransaction") + } + var r0 *suirpcv2.ExecuteTransactionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *suirpcv2.ExecuteTransactionRequest) (*suirpcv2.ExecuteTransactionResponse, error)); ok { + return rf(ctx, req) + } + if ret.Get(0) != nil { + r0 = ret.Get(0).(*suirpcv2.ExecuteTransactionResponse) + } + r1 = ret.Error(1) + return r0, r1 +} + +func (_m *BindingsClient) GetTransactionStatus(ctx context.Context, digest string) (client.TransactionResult, error) { + ret := _m.Called(ctx, digest) + if len(ret) == 0 { + panic("no return value specified for GetTransactionStatus") + } + var r0 client.TransactionResult + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (client.TransactionResult, error)); ok { + return rf(ctx, digest) + } + r0 = ret.Get(0).(client.TransactionResult) + r1 = ret.Error(1) + return r0, r1 +} + +func (_m *BindingsClient) FinishPTBAndSend(ctx context.Context, txnSigner *suigosigner.Signer, tx *transaction.Transaction, requestType client.TransactionRequestType) (*suirpcv2.ExecuteTransactionResponse, error) { + ret := _m.Called(ctx, txnSigner, tx, requestType) + if len(ret) == 0 { + panic("no return value specified for FinishPTBAndSend") + } + var r0 *suirpcv2.ExecuteTransactionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *suigosigner.Signer, *transaction.Transaction, client.TransactionRequestType) (*suirpcv2.ExecuteTransactionResponse, error)); ok { + return rf(ctx, txnSigner, tx, requestType) + } + if ret.Get(0) != nil { + r0 = ret.Get(0).(*suirpcv2.ExecuteTransactionResponse) + } + r1 = ret.Error(1) + return r0, r1 +} + +// NewBindingsClient creates a new instance of BindingsClient. +func NewBindingsClient(t interface { + mock.TestingT + Cleanup(func()) +}) *BindingsClient { + mockClient := &BindingsClient{} + mockClient.Mock.Test(t) + t.Cleanup(func() { mockClient.AssertExpectations(t) }) + return mockClient +} diff --git a/sdk/sui/mocks/sui/isuiapi.go b/sdk/sui/mocks/sui/isuiapi.go deleted file mode 100644 index 434d05a56..000000000 --- a/sdk/sui/mocks/sui/isuiapi.go +++ /dev/null @@ -1,3367 +0,0 @@ -// Code generated by mockery v2.53.5. DO NOT EDIT. - -package mock_sui - -import ( - context "context" - - models "github.com/block-vision/sui-go-sdk/models" - mock "github.com/stretchr/testify/mock" -) - -// ISuiAPI is an autogenerated mock type for the ISuiAPI type -type ISuiAPI struct { - mock.Mock -} - -type ISuiAPI_Expecter struct { - mock *mock.Mock -} - -func (_m *ISuiAPI) EXPECT() *ISuiAPI_Expecter { - return &ISuiAPI_Expecter{mock: &_m.Mock} -} - -// BatchTransaction provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) BatchTransaction(ctx context.Context, req models.BatchTransactionRequest) (models.BatchTransactionResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for BatchTransaction") - } - - var r0 models.BatchTransactionResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.BatchTransactionRequest) (models.BatchTransactionResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.BatchTransactionRequest) models.BatchTransactionResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.BatchTransactionResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.BatchTransactionRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_BatchTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchTransaction' -type ISuiAPI_BatchTransaction_Call struct { - *mock.Call -} - -// BatchTransaction is a helper method to define mock.On call -// - ctx context.Context -// - req models.BatchTransactionRequest -func (_e *ISuiAPI_Expecter) BatchTransaction(ctx interface{}, req interface{}) *ISuiAPI_BatchTransaction_Call { - return &ISuiAPI_BatchTransaction_Call{Call: _e.mock.On("BatchTransaction", ctx, req)} -} - -func (_c *ISuiAPI_BatchTransaction_Call) Run(run func(ctx context.Context, req models.BatchTransactionRequest)) *ISuiAPI_BatchTransaction_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.BatchTransactionRequest)) - }) - return _c -} - -func (_c *ISuiAPI_BatchTransaction_Call) Return(_a0 models.BatchTransactionResponse, _a1 error) *ISuiAPI_BatchTransaction_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_BatchTransaction_Call) RunAndReturn(run func(context.Context, models.BatchTransactionRequest) (models.BatchTransactionResponse, error)) *ISuiAPI_BatchTransaction_Call { - _c.Call.Return(run) - return _c -} - -// MergeCoins provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) MergeCoins(ctx context.Context, req models.MergeCoinsRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for MergeCoins") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.MergeCoinsRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.MergeCoinsRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.MergeCoinsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_MergeCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MergeCoins' -type ISuiAPI_MergeCoins_Call struct { - *mock.Call -} - -// MergeCoins is a helper method to define mock.On call -// - ctx context.Context -// - req models.MergeCoinsRequest -func (_e *ISuiAPI_Expecter) MergeCoins(ctx interface{}, req interface{}) *ISuiAPI_MergeCoins_Call { - return &ISuiAPI_MergeCoins_Call{Call: _e.mock.On("MergeCoins", ctx, req)} -} - -func (_c *ISuiAPI_MergeCoins_Call) Run(run func(ctx context.Context, req models.MergeCoinsRequest)) *ISuiAPI_MergeCoins_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.MergeCoinsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_MergeCoins_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_MergeCoins_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_MergeCoins_Call) RunAndReturn(run func(context.Context, models.MergeCoinsRequest) (models.TxnMetaData, error)) *ISuiAPI_MergeCoins_Call { - _c.Call.Return(run) - return _c -} - -// MoveCall provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) MoveCall(ctx context.Context, req models.MoveCallRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for MoveCall") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.MoveCallRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.MoveCallRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.MoveCallRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_MoveCall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MoveCall' -type ISuiAPI_MoveCall_Call struct { - *mock.Call -} - -// MoveCall is a helper method to define mock.On call -// - ctx context.Context -// - req models.MoveCallRequest -func (_e *ISuiAPI_Expecter) MoveCall(ctx interface{}, req interface{}) *ISuiAPI_MoveCall_Call { - return &ISuiAPI_MoveCall_Call{Call: _e.mock.On("MoveCall", ctx, req)} -} - -func (_c *ISuiAPI_MoveCall_Call) Run(run func(ctx context.Context, req models.MoveCallRequest)) *ISuiAPI_MoveCall_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.MoveCallRequest)) - }) - return _c -} - -func (_c *ISuiAPI_MoveCall_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_MoveCall_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_MoveCall_Call) RunAndReturn(run func(context.Context, models.MoveCallRequest) (models.TxnMetaData, error)) *ISuiAPI_MoveCall_Call { - _c.Call.Return(run) - return _c -} - -// Pay provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) Pay(ctx context.Context, req models.PayRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for Pay") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.PayRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.PayRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.PayRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_Pay_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pay' -type ISuiAPI_Pay_Call struct { - *mock.Call -} - -// Pay is a helper method to define mock.On call -// - ctx context.Context -// - req models.PayRequest -func (_e *ISuiAPI_Expecter) Pay(ctx interface{}, req interface{}) *ISuiAPI_Pay_Call { - return &ISuiAPI_Pay_Call{Call: _e.mock.On("Pay", ctx, req)} -} - -func (_c *ISuiAPI_Pay_Call) Run(run func(ctx context.Context, req models.PayRequest)) *ISuiAPI_Pay_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.PayRequest)) - }) - return _c -} - -func (_c *ISuiAPI_Pay_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_Pay_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_Pay_Call) RunAndReturn(run func(context.Context, models.PayRequest) (models.TxnMetaData, error)) *ISuiAPI_Pay_Call { - _c.Call.Return(run) - return _c -} - -// PayAllSui provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) PayAllSui(ctx context.Context, req models.PayAllSuiRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for PayAllSui") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.PayAllSuiRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.PayAllSuiRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.PayAllSuiRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_PayAllSui_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PayAllSui' -type ISuiAPI_PayAllSui_Call struct { - *mock.Call -} - -// PayAllSui is a helper method to define mock.On call -// - ctx context.Context -// - req models.PayAllSuiRequest -func (_e *ISuiAPI_Expecter) PayAllSui(ctx interface{}, req interface{}) *ISuiAPI_PayAllSui_Call { - return &ISuiAPI_PayAllSui_Call{Call: _e.mock.On("PayAllSui", ctx, req)} -} - -func (_c *ISuiAPI_PayAllSui_Call) Run(run func(ctx context.Context, req models.PayAllSuiRequest)) *ISuiAPI_PayAllSui_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.PayAllSuiRequest)) - }) - return _c -} - -func (_c *ISuiAPI_PayAllSui_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_PayAllSui_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_PayAllSui_Call) RunAndReturn(run func(context.Context, models.PayAllSuiRequest) (models.TxnMetaData, error)) *ISuiAPI_PayAllSui_Call { - _c.Call.Return(run) - return _c -} - -// PaySui provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) PaySui(ctx context.Context, req models.PaySuiRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for PaySui") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.PaySuiRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.PaySuiRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.PaySuiRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_PaySui_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PaySui' -type ISuiAPI_PaySui_Call struct { - *mock.Call -} - -// PaySui is a helper method to define mock.On call -// - ctx context.Context -// - req models.PaySuiRequest -func (_e *ISuiAPI_Expecter) PaySui(ctx interface{}, req interface{}) *ISuiAPI_PaySui_Call { - return &ISuiAPI_PaySui_Call{Call: _e.mock.On("PaySui", ctx, req)} -} - -func (_c *ISuiAPI_PaySui_Call) Run(run func(ctx context.Context, req models.PaySuiRequest)) *ISuiAPI_PaySui_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.PaySuiRequest)) - }) - return _c -} - -func (_c *ISuiAPI_PaySui_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_PaySui_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_PaySui_Call) RunAndReturn(run func(context.Context, models.PaySuiRequest) (models.TxnMetaData, error)) *ISuiAPI_PaySui_Call { - _c.Call.Return(run) - return _c -} - -// Publish provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) Publish(ctx context.Context, req models.PublishRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for Publish") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.PublishRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.PublishRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.PublishRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish' -type ISuiAPI_Publish_Call struct { - *mock.Call -} - -// Publish is a helper method to define mock.On call -// - ctx context.Context -// - req models.PublishRequest -func (_e *ISuiAPI_Expecter) Publish(ctx interface{}, req interface{}) *ISuiAPI_Publish_Call { - return &ISuiAPI_Publish_Call{Call: _e.mock.On("Publish", ctx, req)} -} - -func (_c *ISuiAPI_Publish_Call) Run(run func(ctx context.Context, req models.PublishRequest)) *ISuiAPI_Publish_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.PublishRequest)) - }) - return _c -} - -func (_c *ISuiAPI_Publish_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_Publish_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_Publish_Call) RunAndReturn(run func(context.Context, models.PublishRequest) (models.TxnMetaData, error)) *ISuiAPI_Publish_Call { - _c.Call.Return(run) - return _c -} - -// RequestAddStake provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) RequestAddStake(ctx context.Context, req models.AddStakeRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for RequestAddStake") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.AddStakeRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.AddStakeRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.AddStakeRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_RequestAddStake_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestAddStake' -type ISuiAPI_RequestAddStake_Call struct { - *mock.Call -} - -// RequestAddStake is a helper method to define mock.On call -// - ctx context.Context -// - req models.AddStakeRequest -func (_e *ISuiAPI_Expecter) RequestAddStake(ctx interface{}, req interface{}) *ISuiAPI_RequestAddStake_Call { - return &ISuiAPI_RequestAddStake_Call{Call: _e.mock.On("RequestAddStake", ctx, req)} -} - -func (_c *ISuiAPI_RequestAddStake_Call) Run(run func(ctx context.Context, req models.AddStakeRequest)) *ISuiAPI_RequestAddStake_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.AddStakeRequest)) - }) - return _c -} - -func (_c *ISuiAPI_RequestAddStake_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_RequestAddStake_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_RequestAddStake_Call) RunAndReturn(run func(context.Context, models.AddStakeRequest) (models.TxnMetaData, error)) *ISuiAPI_RequestAddStake_Call { - _c.Call.Return(run) - return _c -} - -// RequestWithdrawStake provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) RequestWithdrawStake(ctx context.Context, req models.WithdrawStakeRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for RequestWithdrawStake") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.WithdrawStakeRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.WithdrawStakeRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.WithdrawStakeRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_RequestWithdrawStake_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestWithdrawStake' -type ISuiAPI_RequestWithdrawStake_Call struct { - *mock.Call -} - -// RequestWithdrawStake is a helper method to define mock.On call -// - ctx context.Context -// - req models.WithdrawStakeRequest -func (_e *ISuiAPI_Expecter) RequestWithdrawStake(ctx interface{}, req interface{}) *ISuiAPI_RequestWithdrawStake_Call { - return &ISuiAPI_RequestWithdrawStake_Call{Call: _e.mock.On("RequestWithdrawStake", ctx, req)} -} - -func (_c *ISuiAPI_RequestWithdrawStake_Call) Run(run func(ctx context.Context, req models.WithdrawStakeRequest)) *ISuiAPI_RequestWithdrawStake_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.WithdrawStakeRequest)) - }) - return _c -} - -func (_c *ISuiAPI_RequestWithdrawStake_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_RequestWithdrawStake_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_RequestWithdrawStake_Call) RunAndReturn(run func(context.Context, models.WithdrawStakeRequest) (models.TxnMetaData, error)) *ISuiAPI_RequestWithdrawStake_Call { - _c.Call.Return(run) - return _c -} - -// SignAndExecuteTransactionBlock provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SignAndExecuteTransactionBlock(ctx context.Context, req models.SignAndExecuteTransactionBlockRequest) (models.SuiTransactionBlockResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SignAndExecuteTransactionBlock") - } - - var r0 models.SuiTransactionBlockResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SignAndExecuteTransactionBlockRequest) (models.SuiTransactionBlockResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SignAndExecuteTransactionBlockRequest) models.SuiTransactionBlockResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.SuiTransactionBlockResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SignAndExecuteTransactionBlockRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SignAndExecuteTransactionBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignAndExecuteTransactionBlock' -type ISuiAPI_SignAndExecuteTransactionBlock_Call struct { - *mock.Call -} - -// SignAndExecuteTransactionBlock is a helper method to define mock.On call -// - ctx context.Context -// - req models.SignAndExecuteTransactionBlockRequest -func (_e *ISuiAPI_Expecter) SignAndExecuteTransactionBlock(ctx interface{}, req interface{}) *ISuiAPI_SignAndExecuteTransactionBlock_Call { - return &ISuiAPI_SignAndExecuteTransactionBlock_Call{Call: _e.mock.On("SignAndExecuteTransactionBlock", ctx, req)} -} - -func (_c *ISuiAPI_SignAndExecuteTransactionBlock_Call) Run(run func(ctx context.Context, req models.SignAndExecuteTransactionBlockRequest)) *ISuiAPI_SignAndExecuteTransactionBlock_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SignAndExecuteTransactionBlockRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SignAndExecuteTransactionBlock_Call) Return(_a0 models.SuiTransactionBlockResponse, _a1 error) *ISuiAPI_SignAndExecuteTransactionBlock_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SignAndExecuteTransactionBlock_Call) RunAndReturn(run func(context.Context, models.SignAndExecuteTransactionBlockRequest) (models.SuiTransactionBlockResponse, error)) *ISuiAPI_SignAndExecuteTransactionBlock_Call { - _c.Call.Return(run) - return _c -} - -// SplitCoin provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SplitCoin(ctx context.Context, req models.SplitCoinRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SplitCoin") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SplitCoinRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SplitCoinRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SplitCoinRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SplitCoin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SplitCoin' -type ISuiAPI_SplitCoin_Call struct { - *mock.Call -} - -// SplitCoin is a helper method to define mock.On call -// - ctx context.Context -// - req models.SplitCoinRequest -func (_e *ISuiAPI_Expecter) SplitCoin(ctx interface{}, req interface{}) *ISuiAPI_SplitCoin_Call { - return &ISuiAPI_SplitCoin_Call{Call: _e.mock.On("SplitCoin", ctx, req)} -} - -func (_c *ISuiAPI_SplitCoin_Call) Run(run func(ctx context.Context, req models.SplitCoinRequest)) *ISuiAPI_SplitCoin_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SplitCoinRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SplitCoin_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_SplitCoin_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SplitCoin_Call) RunAndReturn(run func(context.Context, models.SplitCoinRequest) (models.TxnMetaData, error)) *ISuiAPI_SplitCoin_Call { - _c.Call.Return(run) - return _c -} - -// SplitCoinEqual provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SplitCoinEqual(ctx context.Context, req models.SplitCoinEqualRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SplitCoinEqual") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SplitCoinEqualRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SplitCoinEqualRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SplitCoinEqualRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SplitCoinEqual_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SplitCoinEqual' -type ISuiAPI_SplitCoinEqual_Call struct { - *mock.Call -} - -// SplitCoinEqual is a helper method to define mock.On call -// - ctx context.Context -// - req models.SplitCoinEqualRequest -func (_e *ISuiAPI_Expecter) SplitCoinEqual(ctx interface{}, req interface{}) *ISuiAPI_SplitCoinEqual_Call { - return &ISuiAPI_SplitCoinEqual_Call{Call: _e.mock.On("SplitCoinEqual", ctx, req)} -} - -func (_c *ISuiAPI_SplitCoinEqual_Call) Run(run func(ctx context.Context, req models.SplitCoinEqualRequest)) *ISuiAPI_SplitCoinEqual_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SplitCoinEqualRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SplitCoinEqual_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_SplitCoinEqual_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SplitCoinEqual_Call) RunAndReturn(run func(context.Context, models.SplitCoinEqualRequest) (models.TxnMetaData, error)) *ISuiAPI_SplitCoinEqual_Call { - _c.Call.Return(run) - return _c -} - -// SuiCall provides a mock function with given fields: ctx, method, params -func (_m *ISuiAPI) SuiCall(ctx context.Context, method string, params ...interface{}) (interface{}, error) { - var _ca []interface{} - _ca = append(_ca, ctx, method) - _ca = append(_ca, params...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for SuiCall") - } - - var r0 interface{} - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (interface{}, error)); ok { - return rf(ctx, method, params...) - } - if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) interface{}); ok { - r0 = rf(ctx, method, params...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { - r1 = rf(ctx, method, params...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiCall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiCall' -type ISuiAPI_SuiCall_Call struct { - *mock.Call -} - -// SuiCall is a helper method to define mock.On call -// - ctx context.Context -// - method string -// - params ...interface{} -func (_e *ISuiAPI_Expecter) SuiCall(ctx interface{}, method interface{}, params ...interface{}) *ISuiAPI_SuiCall_Call { - return &ISuiAPI_SuiCall_Call{Call: _e.mock.On("SuiCall", - append([]interface{}{ctx, method}, params...)...)} -} - -func (_c *ISuiAPI_SuiCall_Call) Run(run func(ctx context.Context, method string, params ...interface{})) *ISuiAPI_SuiCall_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]interface{}, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(interface{}) - } - } - run(args[0].(context.Context), args[1].(string), variadicArgs...) - }) - return _c -} - -func (_c *ISuiAPI_SuiCall_Call) Return(_a0 interface{}, _a1 error) *ISuiAPI_SuiCall_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiCall_Call) RunAndReturn(run func(context.Context, string, ...interface{}) (interface{}, error)) *ISuiAPI_SuiCall_Call { - _c.Call.Return(run) - return _c -} - -// SuiDevInspectTransactionBlock provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiDevInspectTransactionBlock(ctx context.Context, req models.SuiDevInspectTransactionBlockRequest) (models.SuiTransactionBlockResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiDevInspectTransactionBlock") - } - - var r0 models.SuiTransactionBlockResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiDevInspectTransactionBlockRequest) (models.SuiTransactionBlockResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiDevInspectTransactionBlockRequest) models.SuiTransactionBlockResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.SuiTransactionBlockResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiDevInspectTransactionBlockRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiDevInspectTransactionBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiDevInspectTransactionBlock' -type ISuiAPI_SuiDevInspectTransactionBlock_Call struct { - *mock.Call -} - -// SuiDevInspectTransactionBlock is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiDevInspectTransactionBlockRequest -func (_e *ISuiAPI_Expecter) SuiDevInspectTransactionBlock(ctx interface{}, req interface{}) *ISuiAPI_SuiDevInspectTransactionBlock_Call { - return &ISuiAPI_SuiDevInspectTransactionBlock_Call{Call: _e.mock.On("SuiDevInspectTransactionBlock", ctx, req)} -} - -func (_c *ISuiAPI_SuiDevInspectTransactionBlock_Call) Run(run func(ctx context.Context, req models.SuiDevInspectTransactionBlockRequest)) *ISuiAPI_SuiDevInspectTransactionBlock_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiDevInspectTransactionBlockRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiDevInspectTransactionBlock_Call) Return(_a0 models.SuiTransactionBlockResponse, _a1 error) *ISuiAPI_SuiDevInspectTransactionBlock_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiDevInspectTransactionBlock_Call) RunAndReturn(run func(context.Context, models.SuiDevInspectTransactionBlockRequest) (models.SuiTransactionBlockResponse, error)) *ISuiAPI_SuiDevInspectTransactionBlock_Call { - _c.Call.Return(run) - return _c -} - -// SuiDryRunTransactionBlock provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiDryRunTransactionBlock(ctx context.Context, req models.SuiDryRunTransactionBlockRequest) (models.SuiTransactionBlockResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiDryRunTransactionBlock") - } - - var r0 models.SuiTransactionBlockResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiDryRunTransactionBlockRequest) (models.SuiTransactionBlockResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiDryRunTransactionBlockRequest) models.SuiTransactionBlockResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.SuiTransactionBlockResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiDryRunTransactionBlockRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiDryRunTransactionBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiDryRunTransactionBlock' -type ISuiAPI_SuiDryRunTransactionBlock_Call struct { - *mock.Call -} - -// SuiDryRunTransactionBlock is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiDryRunTransactionBlockRequest -func (_e *ISuiAPI_Expecter) SuiDryRunTransactionBlock(ctx interface{}, req interface{}) *ISuiAPI_SuiDryRunTransactionBlock_Call { - return &ISuiAPI_SuiDryRunTransactionBlock_Call{Call: _e.mock.On("SuiDryRunTransactionBlock", ctx, req)} -} - -func (_c *ISuiAPI_SuiDryRunTransactionBlock_Call) Run(run func(ctx context.Context, req models.SuiDryRunTransactionBlockRequest)) *ISuiAPI_SuiDryRunTransactionBlock_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiDryRunTransactionBlockRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiDryRunTransactionBlock_Call) Return(_a0 models.SuiTransactionBlockResponse, _a1 error) *ISuiAPI_SuiDryRunTransactionBlock_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiDryRunTransactionBlock_Call) RunAndReturn(run func(context.Context, models.SuiDryRunTransactionBlockRequest) (models.SuiTransactionBlockResponse, error)) *ISuiAPI_SuiDryRunTransactionBlock_Call { - _c.Call.Return(run) - return _c -} - -// SuiExecuteTransactionBlock provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiExecuteTransactionBlock(ctx context.Context, req models.SuiExecuteTransactionBlockRequest) (models.SuiTransactionBlockResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiExecuteTransactionBlock") - } - - var r0 models.SuiTransactionBlockResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiExecuteTransactionBlockRequest) (models.SuiTransactionBlockResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiExecuteTransactionBlockRequest) models.SuiTransactionBlockResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.SuiTransactionBlockResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiExecuteTransactionBlockRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiExecuteTransactionBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiExecuteTransactionBlock' -type ISuiAPI_SuiExecuteTransactionBlock_Call struct { - *mock.Call -} - -// SuiExecuteTransactionBlock is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiExecuteTransactionBlockRequest -func (_e *ISuiAPI_Expecter) SuiExecuteTransactionBlock(ctx interface{}, req interface{}) *ISuiAPI_SuiExecuteTransactionBlock_Call { - return &ISuiAPI_SuiExecuteTransactionBlock_Call{Call: _e.mock.On("SuiExecuteTransactionBlock", ctx, req)} -} - -func (_c *ISuiAPI_SuiExecuteTransactionBlock_Call) Run(run func(ctx context.Context, req models.SuiExecuteTransactionBlockRequest)) *ISuiAPI_SuiExecuteTransactionBlock_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiExecuteTransactionBlockRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiExecuteTransactionBlock_Call) Return(_a0 models.SuiTransactionBlockResponse, _a1 error) *ISuiAPI_SuiExecuteTransactionBlock_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiExecuteTransactionBlock_Call) RunAndReturn(run func(context.Context, models.SuiExecuteTransactionBlockRequest) (models.SuiTransactionBlockResponse, error)) *ISuiAPI_SuiExecuteTransactionBlock_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetChainIdentifier provides a mock function with given fields: ctx -func (_m *ISuiAPI) SuiGetChainIdentifier(ctx context.Context) (string, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for SuiGetChainIdentifier") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) string); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetChainIdentifier_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetChainIdentifier' -type ISuiAPI_SuiGetChainIdentifier_Call struct { - *mock.Call -} - -// SuiGetChainIdentifier is a helper method to define mock.On call -// - ctx context.Context -func (_e *ISuiAPI_Expecter) SuiGetChainIdentifier(ctx interface{}) *ISuiAPI_SuiGetChainIdentifier_Call { - return &ISuiAPI_SuiGetChainIdentifier_Call{Call: _e.mock.On("SuiGetChainIdentifier", ctx)} -} - -func (_c *ISuiAPI_SuiGetChainIdentifier_Call) Run(run func(ctx context.Context)) *ISuiAPI_SuiGetChainIdentifier_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetChainIdentifier_Call) Return(_a0 string, _a1 error) *ISuiAPI_SuiGetChainIdentifier_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetChainIdentifier_Call) RunAndReturn(run func(context.Context) (string, error)) *ISuiAPI_SuiGetChainIdentifier_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetCheckpoint provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetCheckpoint(ctx context.Context, req models.SuiGetCheckpointRequest) (models.CheckpointResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetCheckpoint") - } - - var r0 models.CheckpointResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetCheckpointRequest) (models.CheckpointResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetCheckpointRequest) models.CheckpointResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.CheckpointResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiGetCheckpointRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetCheckpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetCheckpoint' -type ISuiAPI_SuiGetCheckpoint_Call struct { - *mock.Call -} - -// SuiGetCheckpoint is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiGetCheckpointRequest -func (_e *ISuiAPI_Expecter) SuiGetCheckpoint(ctx interface{}, req interface{}) *ISuiAPI_SuiGetCheckpoint_Call { - return &ISuiAPI_SuiGetCheckpoint_Call{Call: _e.mock.On("SuiGetCheckpoint", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetCheckpoint_Call) Run(run func(ctx context.Context, req models.SuiGetCheckpointRequest)) *ISuiAPI_SuiGetCheckpoint_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiGetCheckpointRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetCheckpoint_Call) Return(_a0 models.CheckpointResponse, _a1 error) *ISuiAPI_SuiGetCheckpoint_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetCheckpoint_Call) RunAndReturn(run func(context.Context, models.SuiGetCheckpointRequest) (models.CheckpointResponse, error)) *ISuiAPI_SuiGetCheckpoint_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetCheckpoints provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetCheckpoints(ctx context.Context, req models.SuiGetCheckpointsRequest) (models.PaginatedCheckpointsResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetCheckpoints") - } - - var r0 models.PaginatedCheckpointsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetCheckpointsRequest) (models.PaginatedCheckpointsResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetCheckpointsRequest) models.PaginatedCheckpointsResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.PaginatedCheckpointsResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiGetCheckpointsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetCheckpoints_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetCheckpoints' -type ISuiAPI_SuiGetCheckpoints_Call struct { - *mock.Call -} - -// SuiGetCheckpoints is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiGetCheckpointsRequest -func (_e *ISuiAPI_Expecter) SuiGetCheckpoints(ctx interface{}, req interface{}) *ISuiAPI_SuiGetCheckpoints_Call { - return &ISuiAPI_SuiGetCheckpoints_Call{Call: _e.mock.On("SuiGetCheckpoints", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetCheckpoints_Call) Run(run func(ctx context.Context, req models.SuiGetCheckpointsRequest)) *ISuiAPI_SuiGetCheckpoints_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiGetCheckpointsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetCheckpoints_Call) Return(_a0 models.PaginatedCheckpointsResponse, _a1 error) *ISuiAPI_SuiGetCheckpoints_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetCheckpoints_Call) RunAndReturn(run func(context.Context, models.SuiGetCheckpointsRequest) (models.PaginatedCheckpointsResponse, error)) *ISuiAPI_SuiGetCheckpoints_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetEvents provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetEvents(ctx context.Context, req models.SuiGetEventsRequest) (models.GetEventsResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetEvents") - } - - var r0 models.GetEventsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetEventsRequest) (models.GetEventsResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetEventsRequest) models.GetEventsResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(models.GetEventsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiGetEventsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetEvents' -type ISuiAPI_SuiGetEvents_Call struct { - *mock.Call -} - -// SuiGetEvents is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiGetEventsRequest -func (_e *ISuiAPI_Expecter) SuiGetEvents(ctx interface{}, req interface{}) *ISuiAPI_SuiGetEvents_Call { - return &ISuiAPI_SuiGetEvents_Call{Call: _e.mock.On("SuiGetEvents", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetEvents_Call) Run(run func(ctx context.Context, req models.SuiGetEventsRequest)) *ISuiAPI_SuiGetEvents_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiGetEventsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetEvents_Call) Return(_a0 models.GetEventsResponse, _a1 error) *ISuiAPI_SuiGetEvents_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetEvents_Call) RunAndReturn(run func(context.Context, models.SuiGetEventsRequest) (models.GetEventsResponse, error)) *ISuiAPI_SuiGetEvents_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetLatestCheckpointSequenceNumber provides a mock function with given fields: ctx -func (_m *ISuiAPI) SuiGetLatestCheckpointSequenceNumber(ctx context.Context) (uint64, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for SuiGetLatestCheckpointSequenceNumber") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetLatestCheckpointSequenceNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetLatestCheckpointSequenceNumber' -type ISuiAPI_SuiGetLatestCheckpointSequenceNumber_Call struct { - *mock.Call -} - -// SuiGetLatestCheckpointSequenceNumber is a helper method to define mock.On call -// - ctx context.Context -func (_e *ISuiAPI_Expecter) SuiGetLatestCheckpointSequenceNumber(ctx interface{}) *ISuiAPI_SuiGetLatestCheckpointSequenceNumber_Call { - return &ISuiAPI_SuiGetLatestCheckpointSequenceNumber_Call{Call: _e.mock.On("SuiGetLatestCheckpointSequenceNumber", ctx)} -} - -func (_c *ISuiAPI_SuiGetLatestCheckpointSequenceNumber_Call) Run(run func(ctx context.Context)) *ISuiAPI_SuiGetLatestCheckpointSequenceNumber_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetLatestCheckpointSequenceNumber_Call) Return(_a0 uint64, _a1 error) *ISuiAPI_SuiGetLatestCheckpointSequenceNumber_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetLatestCheckpointSequenceNumber_Call) RunAndReturn(run func(context.Context) (uint64, error)) *ISuiAPI_SuiGetLatestCheckpointSequenceNumber_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetLoadedChildObjects provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetLoadedChildObjects(ctx context.Context, req models.SuiGetLoadedChildObjectsRequest) (models.ChildObjectsResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetLoadedChildObjects") - } - - var r0 models.ChildObjectsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetLoadedChildObjectsRequest) (models.ChildObjectsResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetLoadedChildObjectsRequest) models.ChildObjectsResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.ChildObjectsResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiGetLoadedChildObjectsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetLoadedChildObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetLoadedChildObjects' -type ISuiAPI_SuiGetLoadedChildObjects_Call struct { - *mock.Call -} - -// SuiGetLoadedChildObjects is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiGetLoadedChildObjectsRequest -func (_e *ISuiAPI_Expecter) SuiGetLoadedChildObjects(ctx interface{}, req interface{}) *ISuiAPI_SuiGetLoadedChildObjects_Call { - return &ISuiAPI_SuiGetLoadedChildObjects_Call{Call: _e.mock.On("SuiGetLoadedChildObjects", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetLoadedChildObjects_Call) Run(run func(ctx context.Context, req models.SuiGetLoadedChildObjectsRequest)) *ISuiAPI_SuiGetLoadedChildObjects_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiGetLoadedChildObjectsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetLoadedChildObjects_Call) Return(_a0 models.ChildObjectsResponse, _a1 error) *ISuiAPI_SuiGetLoadedChildObjects_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetLoadedChildObjects_Call) RunAndReturn(run func(context.Context, models.SuiGetLoadedChildObjectsRequest) (models.ChildObjectsResponse, error)) *ISuiAPI_SuiGetLoadedChildObjects_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetMoveFunctionArgTypes provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetMoveFunctionArgTypes(ctx context.Context, req models.GetMoveFunctionArgTypesRequest) (models.GetMoveFunctionArgTypesResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetMoveFunctionArgTypes") - } - - var r0 models.GetMoveFunctionArgTypesResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.GetMoveFunctionArgTypesRequest) (models.GetMoveFunctionArgTypesResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.GetMoveFunctionArgTypesRequest) models.GetMoveFunctionArgTypesResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(models.GetMoveFunctionArgTypesResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, models.GetMoveFunctionArgTypesRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetMoveFunctionArgTypes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetMoveFunctionArgTypes' -type ISuiAPI_SuiGetMoveFunctionArgTypes_Call struct { - *mock.Call -} - -// SuiGetMoveFunctionArgTypes is a helper method to define mock.On call -// - ctx context.Context -// - req models.GetMoveFunctionArgTypesRequest -func (_e *ISuiAPI_Expecter) SuiGetMoveFunctionArgTypes(ctx interface{}, req interface{}) *ISuiAPI_SuiGetMoveFunctionArgTypes_Call { - return &ISuiAPI_SuiGetMoveFunctionArgTypes_Call{Call: _e.mock.On("SuiGetMoveFunctionArgTypes", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetMoveFunctionArgTypes_Call) Run(run func(ctx context.Context, req models.GetMoveFunctionArgTypesRequest)) *ISuiAPI_SuiGetMoveFunctionArgTypes_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.GetMoveFunctionArgTypesRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetMoveFunctionArgTypes_Call) Return(_a0 models.GetMoveFunctionArgTypesResponse, _a1 error) *ISuiAPI_SuiGetMoveFunctionArgTypes_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetMoveFunctionArgTypes_Call) RunAndReturn(run func(context.Context, models.GetMoveFunctionArgTypesRequest) (models.GetMoveFunctionArgTypesResponse, error)) *ISuiAPI_SuiGetMoveFunctionArgTypes_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetNormalizedMoveFunction provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetNormalizedMoveFunction(ctx context.Context, req models.GetNormalizedMoveFunctionRequest) (models.GetNormalizedMoveFunctionResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetNormalizedMoveFunction") - } - - var r0 models.GetNormalizedMoveFunctionResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.GetNormalizedMoveFunctionRequest) (models.GetNormalizedMoveFunctionResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.GetNormalizedMoveFunctionRequest) models.GetNormalizedMoveFunctionResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.GetNormalizedMoveFunctionResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.GetNormalizedMoveFunctionRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetNormalizedMoveFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetNormalizedMoveFunction' -type ISuiAPI_SuiGetNormalizedMoveFunction_Call struct { - *mock.Call -} - -// SuiGetNormalizedMoveFunction is a helper method to define mock.On call -// - ctx context.Context -// - req models.GetNormalizedMoveFunctionRequest -func (_e *ISuiAPI_Expecter) SuiGetNormalizedMoveFunction(ctx interface{}, req interface{}) *ISuiAPI_SuiGetNormalizedMoveFunction_Call { - return &ISuiAPI_SuiGetNormalizedMoveFunction_Call{Call: _e.mock.On("SuiGetNormalizedMoveFunction", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveFunction_Call) Run(run func(ctx context.Context, req models.GetNormalizedMoveFunctionRequest)) *ISuiAPI_SuiGetNormalizedMoveFunction_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.GetNormalizedMoveFunctionRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveFunction_Call) Return(_a0 models.GetNormalizedMoveFunctionResponse, _a1 error) *ISuiAPI_SuiGetNormalizedMoveFunction_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveFunction_Call) RunAndReturn(run func(context.Context, models.GetNormalizedMoveFunctionRequest) (models.GetNormalizedMoveFunctionResponse, error)) *ISuiAPI_SuiGetNormalizedMoveFunction_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetNormalizedMoveModule provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetNormalizedMoveModule(ctx context.Context, req models.GetNormalizedMoveModuleRequest) (models.GetNormalizedMoveModuleResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetNormalizedMoveModule") - } - - var r0 models.GetNormalizedMoveModuleResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.GetNormalizedMoveModuleRequest) (models.GetNormalizedMoveModuleResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.GetNormalizedMoveModuleRequest) models.GetNormalizedMoveModuleResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.GetNormalizedMoveModuleResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.GetNormalizedMoveModuleRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetNormalizedMoveModule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetNormalizedMoveModule' -type ISuiAPI_SuiGetNormalizedMoveModule_Call struct { - *mock.Call -} - -// SuiGetNormalizedMoveModule is a helper method to define mock.On call -// - ctx context.Context -// - req models.GetNormalizedMoveModuleRequest -func (_e *ISuiAPI_Expecter) SuiGetNormalizedMoveModule(ctx interface{}, req interface{}) *ISuiAPI_SuiGetNormalizedMoveModule_Call { - return &ISuiAPI_SuiGetNormalizedMoveModule_Call{Call: _e.mock.On("SuiGetNormalizedMoveModule", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveModule_Call) Run(run func(ctx context.Context, req models.GetNormalizedMoveModuleRequest)) *ISuiAPI_SuiGetNormalizedMoveModule_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.GetNormalizedMoveModuleRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveModule_Call) Return(_a0 models.GetNormalizedMoveModuleResponse, _a1 error) *ISuiAPI_SuiGetNormalizedMoveModule_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveModule_Call) RunAndReturn(run func(context.Context, models.GetNormalizedMoveModuleRequest) (models.GetNormalizedMoveModuleResponse, error)) *ISuiAPI_SuiGetNormalizedMoveModule_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetNormalizedMoveModulesByPackage provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetNormalizedMoveModulesByPackage(ctx context.Context, req models.GetNormalizedMoveModulesByPackageRequest) (models.GetNormalizedMoveModulesByPackageResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetNormalizedMoveModulesByPackage") - } - - var r0 models.GetNormalizedMoveModulesByPackageResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.GetNormalizedMoveModulesByPackageRequest) (models.GetNormalizedMoveModulesByPackageResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.GetNormalizedMoveModulesByPackageRequest) models.GetNormalizedMoveModulesByPackageResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(models.GetNormalizedMoveModulesByPackageResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, models.GetNormalizedMoveModulesByPackageRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetNormalizedMoveModulesByPackage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetNormalizedMoveModulesByPackage' -type ISuiAPI_SuiGetNormalizedMoveModulesByPackage_Call struct { - *mock.Call -} - -// SuiGetNormalizedMoveModulesByPackage is a helper method to define mock.On call -// - ctx context.Context -// - req models.GetNormalizedMoveModulesByPackageRequest -func (_e *ISuiAPI_Expecter) SuiGetNormalizedMoveModulesByPackage(ctx interface{}, req interface{}) *ISuiAPI_SuiGetNormalizedMoveModulesByPackage_Call { - return &ISuiAPI_SuiGetNormalizedMoveModulesByPackage_Call{Call: _e.mock.On("SuiGetNormalizedMoveModulesByPackage", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveModulesByPackage_Call) Run(run func(ctx context.Context, req models.GetNormalizedMoveModulesByPackageRequest)) *ISuiAPI_SuiGetNormalizedMoveModulesByPackage_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.GetNormalizedMoveModulesByPackageRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveModulesByPackage_Call) Return(_a0 models.GetNormalizedMoveModulesByPackageResponse, _a1 error) *ISuiAPI_SuiGetNormalizedMoveModulesByPackage_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveModulesByPackage_Call) RunAndReturn(run func(context.Context, models.GetNormalizedMoveModulesByPackageRequest) (models.GetNormalizedMoveModulesByPackageResponse, error)) *ISuiAPI_SuiGetNormalizedMoveModulesByPackage_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetNormalizedMoveStruct provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetNormalizedMoveStruct(ctx context.Context, req models.GetNormalizedMoveStructRequest) (models.GetNormalizedMoveStructResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetNormalizedMoveStruct") - } - - var r0 models.GetNormalizedMoveStructResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.GetNormalizedMoveStructRequest) (models.GetNormalizedMoveStructResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.GetNormalizedMoveStructRequest) models.GetNormalizedMoveStructResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.GetNormalizedMoveStructResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.GetNormalizedMoveStructRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetNormalizedMoveStruct_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetNormalizedMoveStruct' -type ISuiAPI_SuiGetNormalizedMoveStruct_Call struct { - *mock.Call -} - -// SuiGetNormalizedMoveStruct is a helper method to define mock.On call -// - ctx context.Context -// - req models.GetNormalizedMoveStructRequest -func (_e *ISuiAPI_Expecter) SuiGetNormalizedMoveStruct(ctx interface{}, req interface{}) *ISuiAPI_SuiGetNormalizedMoveStruct_Call { - return &ISuiAPI_SuiGetNormalizedMoveStruct_Call{Call: _e.mock.On("SuiGetNormalizedMoveStruct", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveStruct_Call) Run(run func(ctx context.Context, req models.GetNormalizedMoveStructRequest)) *ISuiAPI_SuiGetNormalizedMoveStruct_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.GetNormalizedMoveStructRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveStruct_Call) Return(_a0 models.GetNormalizedMoveStructResponse, _a1 error) *ISuiAPI_SuiGetNormalizedMoveStruct_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetNormalizedMoveStruct_Call) RunAndReturn(run func(context.Context, models.GetNormalizedMoveStructRequest) (models.GetNormalizedMoveStructResponse, error)) *ISuiAPI_SuiGetNormalizedMoveStruct_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetObject provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetObject(ctx context.Context, req models.SuiGetObjectRequest) (models.SuiObjectResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetObject") - } - - var r0 models.SuiObjectResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetObjectRequest) (models.SuiObjectResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetObjectRequest) models.SuiObjectResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.SuiObjectResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiGetObjectRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetObject' -type ISuiAPI_SuiGetObject_Call struct { - *mock.Call -} - -// SuiGetObject is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiGetObjectRequest -func (_e *ISuiAPI_Expecter) SuiGetObject(ctx interface{}, req interface{}) *ISuiAPI_SuiGetObject_Call { - return &ISuiAPI_SuiGetObject_Call{Call: _e.mock.On("SuiGetObject", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetObject_Call) Run(run func(ctx context.Context, req models.SuiGetObjectRequest)) *ISuiAPI_SuiGetObject_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiGetObjectRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetObject_Call) Return(_a0 models.SuiObjectResponse, _a1 error) *ISuiAPI_SuiGetObject_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetObject_Call) RunAndReturn(run func(context.Context, models.SuiGetObjectRequest) (models.SuiObjectResponse, error)) *ISuiAPI_SuiGetObject_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetProtocolConfig provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetProtocolConfig(ctx context.Context, req models.SuiGetProtocolConfigRequest) (models.ProtocolConfigResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetProtocolConfig") - } - - var r0 models.ProtocolConfigResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetProtocolConfigRequest) (models.ProtocolConfigResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetProtocolConfigRequest) models.ProtocolConfigResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.ProtocolConfigResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiGetProtocolConfigRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetProtocolConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetProtocolConfig' -type ISuiAPI_SuiGetProtocolConfig_Call struct { - *mock.Call -} - -// SuiGetProtocolConfig is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiGetProtocolConfigRequest -func (_e *ISuiAPI_Expecter) SuiGetProtocolConfig(ctx interface{}, req interface{}) *ISuiAPI_SuiGetProtocolConfig_Call { - return &ISuiAPI_SuiGetProtocolConfig_Call{Call: _e.mock.On("SuiGetProtocolConfig", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetProtocolConfig_Call) Run(run func(ctx context.Context, req models.SuiGetProtocolConfigRequest)) *ISuiAPI_SuiGetProtocolConfig_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiGetProtocolConfigRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetProtocolConfig_Call) Return(_a0 models.ProtocolConfigResponse, _a1 error) *ISuiAPI_SuiGetProtocolConfig_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetProtocolConfig_Call) RunAndReturn(run func(context.Context, models.SuiGetProtocolConfigRequest) (models.ProtocolConfigResponse, error)) *ISuiAPI_SuiGetProtocolConfig_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetTotalTransactionBlocks provides a mock function with given fields: ctx -func (_m *ISuiAPI) SuiGetTotalTransactionBlocks(ctx context.Context) (uint64, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for SuiGetTotalTransactionBlocks") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetTotalTransactionBlocks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetTotalTransactionBlocks' -type ISuiAPI_SuiGetTotalTransactionBlocks_Call struct { - *mock.Call -} - -// SuiGetTotalTransactionBlocks is a helper method to define mock.On call -// - ctx context.Context -func (_e *ISuiAPI_Expecter) SuiGetTotalTransactionBlocks(ctx interface{}) *ISuiAPI_SuiGetTotalTransactionBlocks_Call { - return &ISuiAPI_SuiGetTotalTransactionBlocks_Call{Call: _e.mock.On("SuiGetTotalTransactionBlocks", ctx)} -} - -func (_c *ISuiAPI_SuiGetTotalTransactionBlocks_Call) Run(run func(ctx context.Context)) *ISuiAPI_SuiGetTotalTransactionBlocks_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetTotalTransactionBlocks_Call) Return(_a0 uint64, _a1 error) *ISuiAPI_SuiGetTotalTransactionBlocks_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetTotalTransactionBlocks_Call) RunAndReturn(run func(context.Context) (uint64, error)) *ISuiAPI_SuiGetTotalTransactionBlocks_Call { - _c.Call.Return(run) - return _c -} - -// SuiGetTransactionBlock provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiGetTransactionBlock(ctx context.Context, req models.SuiGetTransactionBlockRequest) (models.SuiTransactionBlockResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiGetTransactionBlock") - } - - var r0 models.SuiTransactionBlockResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetTransactionBlockRequest) (models.SuiTransactionBlockResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiGetTransactionBlockRequest) models.SuiTransactionBlockResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.SuiTransactionBlockResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiGetTransactionBlockRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiGetTransactionBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiGetTransactionBlock' -type ISuiAPI_SuiGetTransactionBlock_Call struct { - *mock.Call -} - -// SuiGetTransactionBlock is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiGetTransactionBlockRequest -func (_e *ISuiAPI_Expecter) SuiGetTransactionBlock(ctx interface{}, req interface{}) *ISuiAPI_SuiGetTransactionBlock_Call { - return &ISuiAPI_SuiGetTransactionBlock_Call{Call: _e.mock.On("SuiGetTransactionBlock", ctx, req)} -} - -func (_c *ISuiAPI_SuiGetTransactionBlock_Call) Run(run func(ctx context.Context, req models.SuiGetTransactionBlockRequest)) *ISuiAPI_SuiGetTransactionBlock_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiGetTransactionBlockRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiGetTransactionBlock_Call) Return(_a0 models.SuiTransactionBlockResponse, _a1 error) *ISuiAPI_SuiGetTransactionBlock_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiGetTransactionBlock_Call) RunAndReturn(run func(context.Context, models.SuiGetTransactionBlockRequest) (models.SuiTransactionBlockResponse, error)) *ISuiAPI_SuiGetTransactionBlock_Call { - _c.Call.Return(run) - return _c -} - -// SuiMultiGetObjects provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiMultiGetObjects(ctx context.Context, req models.SuiMultiGetObjectsRequest) ([]*models.SuiObjectResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiMultiGetObjects") - } - - var r0 []*models.SuiObjectResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiMultiGetObjectsRequest) ([]*models.SuiObjectResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiMultiGetObjectsRequest) []*models.SuiObjectResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*models.SuiObjectResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiMultiGetObjectsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiMultiGetObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiMultiGetObjects' -type ISuiAPI_SuiMultiGetObjects_Call struct { - *mock.Call -} - -// SuiMultiGetObjects is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiMultiGetObjectsRequest -func (_e *ISuiAPI_Expecter) SuiMultiGetObjects(ctx interface{}, req interface{}) *ISuiAPI_SuiMultiGetObjects_Call { - return &ISuiAPI_SuiMultiGetObjects_Call{Call: _e.mock.On("SuiMultiGetObjects", ctx, req)} -} - -func (_c *ISuiAPI_SuiMultiGetObjects_Call) Run(run func(ctx context.Context, req models.SuiMultiGetObjectsRequest)) *ISuiAPI_SuiMultiGetObjects_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiMultiGetObjectsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiMultiGetObjects_Call) Return(_a0 []*models.SuiObjectResponse, _a1 error) *ISuiAPI_SuiMultiGetObjects_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiMultiGetObjects_Call) RunAndReturn(run func(context.Context, models.SuiMultiGetObjectsRequest) ([]*models.SuiObjectResponse, error)) *ISuiAPI_SuiMultiGetObjects_Call { - _c.Call.Return(run) - return _c -} - -// SuiMultiGetTransactionBlocks provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiMultiGetTransactionBlocks(ctx context.Context, req models.SuiMultiGetTransactionBlocksRequest) (models.SuiMultiGetTransactionBlocksResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiMultiGetTransactionBlocks") - } - - var r0 models.SuiMultiGetTransactionBlocksResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiMultiGetTransactionBlocksRequest) (models.SuiMultiGetTransactionBlocksResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiMultiGetTransactionBlocksRequest) models.SuiMultiGetTransactionBlocksResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(models.SuiMultiGetTransactionBlocksResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiMultiGetTransactionBlocksRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiMultiGetTransactionBlocks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiMultiGetTransactionBlocks' -type ISuiAPI_SuiMultiGetTransactionBlocks_Call struct { - *mock.Call -} - -// SuiMultiGetTransactionBlocks is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiMultiGetTransactionBlocksRequest -func (_e *ISuiAPI_Expecter) SuiMultiGetTransactionBlocks(ctx interface{}, req interface{}) *ISuiAPI_SuiMultiGetTransactionBlocks_Call { - return &ISuiAPI_SuiMultiGetTransactionBlocks_Call{Call: _e.mock.On("SuiMultiGetTransactionBlocks", ctx, req)} -} - -func (_c *ISuiAPI_SuiMultiGetTransactionBlocks_Call) Run(run func(ctx context.Context, req models.SuiMultiGetTransactionBlocksRequest)) *ISuiAPI_SuiMultiGetTransactionBlocks_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiMultiGetTransactionBlocksRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiMultiGetTransactionBlocks_Call) Return(_a0 models.SuiMultiGetTransactionBlocksResponse, _a1 error) *ISuiAPI_SuiMultiGetTransactionBlocks_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiMultiGetTransactionBlocks_Call) RunAndReturn(run func(context.Context, models.SuiMultiGetTransactionBlocksRequest) (models.SuiMultiGetTransactionBlocksResponse, error)) *ISuiAPI_SuiMultiGetTransactionBlocks_Call { - _c.Call.Return(run) - return _c -} - -// SuiTryGetPastObject provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiTryGetPastObject(ctx context.Context, req models.SuiTryGetPastObjectRequest) (models.PastObjectResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiTryGetPastObject") - } - - var r0 models.PastObjectResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiTryGetPastObjectRequest) (models.PastObjectResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiTryGetPastObjectRequest) models.PastObjectResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.PastObjectResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiTryGetPastObjectRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiTryGetPastObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiTryGetPastObject' -type ISuiAPI_SuiTryGetPastObject_Call struct { - *mock.Call -} - -// SuiTryGetPastObject is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiTryGetPastObjectRequest -func (_e *ISuiAPI_Expecter) SuiTryGetPastObject(ctx interface{}, req interface{}) *ISuiAPI_SuiTryGetPastObject_Call { - return &ISuiAPI_SuiTryGetPastObject_Call{Call: _e.mock.On("SuiTryGetPastObject", ctx, req)} -} - -func (_c *ISuiAPI_SuiTryGetPastObject_Call) Run(run func(ctx context.Context, req models.SuiTryGetPastObjectRequest)) *ISuiAPI_SuiTryGetPastObject_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiTryGetPastObjectRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiTryGetPastObject_Call) Return(_a0 models.PastObjectResponse, _a1 error) *ISuiAPI_SuiTryGetPastObject_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiTryGetPastObject_Call) RunAndReturn(run func(context.Context, models.SuiTryGetPastObjectRequest) (models.PastObjectResponse, error)) *ISuiAPI_SuiTryGetPastObject_Call { - _c.Call.Return(run) - return _c -} - -// SuiTryMultiGetPastObjects provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiTryMultiGetPastObjects(ctx context.Context, req models.SuiTryMultiGetPastObjectsRequest) ([]*models.PastObjectResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiTryMultiGetPastObjects") - } - - var r0 []*models.PastObjectResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiTryMultiGetPastObjectsRequest) ([]*models.PastObjectResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiTryMultiGetPastObjectsRequest) []*models.PastObjectResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*models.PastObjectResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiTryMultiGetPastObjectsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiTryMultiGetPastObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiTryMultiGetPastObjects' -type ISuiAPI_SuiTryMultiGetPastObjects_Call struct { - *mock.Call -} - -// SuiTryMultiGetPastObjects is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiTryMultiGetPastObjectsRequest -func (_e *ISuiAPI_Expecter) SuiTryMultiGetPastObjects(ctx interface{}, req interface{}) *ISuiAPI_SuiTryMultiGetPastObjects_Call { - return &ISuiAPI_SuiTryMultiGetPastObjects_Call{Call: _e.mock.On("SuiTryMultiGetPastObjects", ctx, req)} -} - -func (_c *ISuiAPI_SuiTryMultiGetPastObjects_Call) Run(run func(ctx context.Context, req models.SuiTryMultiGetPastObjectsRequest)) *ISuiAPI_SuiTryMultiGetPastObjects_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiTryMultiGetPastObjectsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiTryMultiGetPastObjects_Call) Return(_a0 []*models.PastObjectResponse, _a1 error) *ISuiAPI_SuiTryMultiGetPastObjects_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiTryMultiGetPastObjects_Call) RunAndReturn(run func(context.Context, models.SuiTryMultiGetPastObjectsRequest) ([]*models.PastObjectResponse, error)) *ISuiAPI_SuiTryMultiGetPastObjects_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetAllBalance provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetAllBalance(ctx context.Context, req models.SuiXGetAllBalanceRequest) (models.CoinAllBalanceResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetAllBalance") - } - - var r0 models.CoinAllBalanceResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetAllBalanceRequest) (models.CoinAllBalanceResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetAllBalanceRequest) models.CoinAllBalanceResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(models.CoinAllBalanceResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetAllBalanceRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetAllBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetAllBalance' -type ISuiAPI_SuiXGetAllBalance_Call struct { - *mock.Call -} - -// SuiXGetAllBalance is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetAllBalanceRequest -func (_e *ISuiAPI_Expecter) SuiXGetAllBalance(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetAllBalance_Call { - return &ISuiAPI_SuiXGetAllBalance_Call{Call: _e.mock.On("SuiXGetAllBalance", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetAllBalance_Call) Run(run func(ctx context.Context, req models.SuiXGetAllBalanceRequest)) *ISuiAPI_SuiXGetAllBalance_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetAllBalanceRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetAllBalance_Call) Return(_a0 models.CoinAllBalanceResponse, _a1 error) *ISuiAPI_SuiXGetAllBalance_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetAllBalance_Call) RunAndReturn(run func(context.Context, models.SuiXGetAllBalanceRequest) (models.CoinAllBalanceResponse, error)) *ISuiAPI_SuiXGetAllBalance_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetAllCoins provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetAllCoins(ctx context.Context, req models.SuiXGetAllCoinsRequest) (models.PaginatedCoinsResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetAllCoins") - } - - var r0 models.PaginatedCoinsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetAllCoinsRequest) (models.PaginatedCoinsResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetAllCoinsRequest) models.PaginatedCoinsResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.PaginatedCoinsResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetAllCoinsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetAllCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetAllCoins' -type ISuiAPI_SuiXGetAllCoins_Call struct { - *mock.Call -} - -// SuiXGetAllCoins is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetAllCoinsRequest -func (_e *ISuiAPI_Expecter) SuiXGetAllCoins(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetAllCoins_Call { - return &ISuiAPI_SuiXGetAllCoins_Call{Call: _e.mock.On("SuiXGetAllCoins", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetAllCoins_Call) Run(run func(ctx context.Context, req models.SuiXGetAllCoinsRequest)) *ISuiAPI_SuiXGetAllCoins_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetAllCoinsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetAllCoins_Call) Return(_a0 models.PaginatedCoinsResponse, _a1 error) *ISuiAPI_SuiXGetAllCoins_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetAllCoins_Call) RunAndReturn(run func(context.Context, models.SuiXGetAllCoinsRequest) (models.PaginatedCoinsResponse, error)) *ISuiAPI_SuiXGetAllCoins_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetBalance provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetBalance(ctx context.Context, req models.SuiXGetBalanceRequest) (models.CoinBalanceResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetBalance") - } - - var r0 models.CoinBalanceResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetBalanceRequest) (models.CoinBalanceResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetBalanceRequest) models.CoinBalanceResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.CoinBalanceResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetBalanceRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetBalance' -type ISuiAPI_SuiXGetBalance_Call struct { - *mock.Call -} - -// SuiXGetBalance is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetBalanceRequest -func (_e *ISuiAPI_Expecter) SuiXGetBalance(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetBalance_Call { - return &ISuiAPI_SuiXGetBalance_Call{Call: _e.mock.On("SuiXGetBalance", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetBalance_Call) Run(run func(ctx context.Context, req models.SuiXGetBalanceRequest)) *ISuiAPI_SuiXGetBalance_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetBalanceRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetBalance_Call) Return(_a0 models.CoinBalanceResponse, _a1 error) *ISuiAPI_SuiXGetBalance_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetBalance_Call) RunAndReturn(run func(context.Context, models.SuiXGetBalanceRequest) (models.CoinBalanceResponse, error)) *ISuiAPI_SuiXGetBalance_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetCoinMetadata provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetCoinMetadata(ctx context.Context, req models.SuiXGetCoinMetadataRequest) (models.CoinMetadataResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetCoinMetadata") - } - - var r0 models.CoinMetadataResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetCoinMetadataRequest) (models.CoinMetadataResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetCoinMetadataRequest) models.CoinMetadataResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.CoinMetadataResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetCoinMetadataRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetCoinMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetCoinMetadata' -type ISuiAPI_SuiXGetCoinMetadata_Call struct { - *mock.Call -} - -// SuiXGetCoinMetadata is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetCoinMetadataRequest -func (_e *ISuiAPI_Expecter) SuiXGetCoinMetadata(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetCoinMetadata_Call { - return &ISuiAPI_SuiXGetCoinMetadata_Call{Call: _e.mock.On("SuiXGetCoinMetadata", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetCoinMetadata_Call) Run(run func(ctx context.Context, req models.SuiXGetCoinMetadataRequest)) *ISuiAPI_SuiXGetCoinMetadata_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetCoinMetadataRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetCoinMetadata_Call) Return(_a0 models.CoinMetadataResponse, _a1 error) *ISuiAPI_SuiXGetCoinMetadata_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetCoinMetadata_Call) RunAndReturn(run func(context.Context, models.SuiXGetCoinMetadataRequest) (models.CoinMetadataResponse, error)) *ISuiAPI_SuiXGetCoinMetadata_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetCoins provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetCoins(ctx context.Context, req models.SuiXGetCoinsRequest) (models.PaginatedCoinsResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetCoins") - } - - var r0 models.PaginatedCoinsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetCoinsRequest) (models.PaginatedCoinsResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetCoinsRequest) models.PaginatedCoinsResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.PaginatedCoinsResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetCoinsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetCoins' -type ISuiAPI_SuiXGetCoins_Call struct { - *mock.Call -} - -// SuiXGetCoins is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetCoinsRequest -func (_e *ISuiAPI_Expecter) SuiXGetCoins(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetCoins_Call { - return &ISuiAPI_SuiXGetCoins_Call{Call: _e.mock.On("SuiXGetCoins", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetCoins_Call) Run(run func(ctx context.Context, req models.SuiXGetCoinsRequest)) *ISuiAPI_SuiXGetCoins_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetCoinsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetCoins_Call) Return(_a0 models.PaginatedCoinsResponse, _a1 error) *ISuiAPI_SuiXGetCoins_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetCoins_Call) RunAndReturn(run func(context.Context, models.SuiXGetCoinsRequest) (models.PaginatedCoinsResponse, error)) *ISuiAPI_SuiXGetCoins_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetCommitteeInfo provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetCommitteeInfo(ctx context.Context, req models.SuiXGetCommitteeInfoRequest) (models.SuiXGetCommitteeInfoResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetCommitteeInfo") - } - - var r0 models.SuiXGetCommitteeInfoResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetCommitteeInfoRequest) (models.SuiXGetCommitteeInfoResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetCommitteeInfoRequest) models.SuiXGetCommitteeInfoResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.SuiXGetCommitteeInfoResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetCommitteeInfoRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetCommitteeInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetCommitteeInfo' -type ISuiAPI_SuiXGetCommitteeInfo_Call struct { - *mock.Call -} - -// SuiXGetCommitteeInfo is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetCommitteeInfoRequest -func (_e *ISuiAPI_Expecter) SuiXGetCommitteeInfo(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetCommitteeInfo_Call { - return &ISuiAPI_SuiXGetCommitteeInfo_Call{Call: _e.mock.On("SuiXGetCommitteeInfo", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetCommitteeInfo_Call) Run(run func(ctx context.Context, req models.SuiXGetCommitteeInfoRequest)) *ISuiAPI_SuiXGetCommitteeInfo_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetCommitteeInfoRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetCommitteeInfo_Call) Return(_a0 models.SuiXGetCommitteeInfoResponse, _a1 error) *ISuiAPI_SuiXGetCommitteeInfo_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetCommitteeInfo_Call) RunAndReturn(run func(context.Context, models.SuiXGetCommitteeInfoRequest) (models.SuiXGetCommitteeInfoResponse, error)) *ISuiAPI_SuiXGetCommitteeInfo_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetCurrentEpoch provides a mock function with given fields: ctx -func (_m *ISuiAPI) SuiXGetCurrentEpoch(ctx context.Context) (models.EpochInfo, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetCurrentEpoch") - } - - var r0 models.EpochInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (models.EpochInfo, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) models.EpochInfo); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(models.EpochInfo) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetCurrentEpoch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetCurrentEpoch' -type ISuiAPI_SuiXGetCurrentEpoch_Call struct { - *mock.Call -} - -// SuiXGetCurrentEpoch is a helper method to define mock.On call -// - ctx context.Context -func (_e *ISuiAPI_Expecter) SuiXGetCurrentEpoch(ctx interface{}) *ISuiAPI_SuiXGetCurrentEpoch_Call { - return &ISuiAPI_SuiXGetCurrentEpoch_Call{Call: _e.mock.On("SuiXGetCurrentEpoch", ctx)} -} - -func (_c *ISuiAPI_SuiXGetCurrentEpoch_Call) Run(run func(ctx context.Context)) *ISuiAPI_SuiXGetCurrentEpoch_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetCurrentEpoch_Call) Return(_a0 models.EpochInfo, _a1 error) *ISuiAPI_SuiXGetCurrentEpoch_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetCurrentEpoch_Call) RunAndReturn(run func(context.Context) (models.EpochInfo, error)) *ISuiAPI_SuiXGetCurrentEpoch_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetDynamicField provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetDynamicField(ctx context.Context, req models.SuiXGetDynamicFieldRequest) (models.PaginatedDynamicFieldInfoResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetDynamicField") - } - - var r0 models.PaginatedDynamicFieldInfoResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetDynamicFieldRequest) (models.PaginatedDynamicFieldInfoResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetDynamicFieldRequest) models.PaginatedDynamicFieldInfoResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.PaginatedDynamicFieldInfoResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetDynamicFieldRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetDynamicField_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetDynamicField' -type ISuiAPI_SuiXGetDynamicField_Call struct { - *mock.Call -} - -// SuiXGetDynamicField is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetDynamicFieldRequest -func (_e *ISuiAPI_Expecter) SuiXGetDynamicField(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetDynamicField_Call { - return &ISuiAPI_SuiXGetDynamicField_Call{Call: _e.mock.On("SuiXGetDynamicField", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetDynamicField_Call) Run(run func(ctx context.Context, req models.SuiXGetDynamicFieldRequest)) *ISuiAPI_SuiXGetDynamicField_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetDynamicFieldRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetDynamicField_Call) Return(_a0 models.PaginatedDynamicFieldInfoResponse, _a1 error) *ISuiAPI_SuiXGetDynamicField_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetDynamicField_Call) RunAndReturn(run func(context.Context, models.SuiXGetDynamicFieldRequest) (models.PaginatedDynamicFieldInfoResponse, error)) *ISuiAPI_SuiXGetDynamicField_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetDynamicFieldObject provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetDynamicFieldObject(ctx context.Context, req models.SuiXGetDynamicFieldObjectRequest) (models.SuiObjectResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetDynamicFieldObject") - } - - var r0 models.SuiObjectResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetDynamicFieldObjectRequest) (models.SuiObjectResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetDynamicFieldObjectRequest) models.SuiObjectResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.SuiObjectResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetDynamicFieldObjectRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetDynamicFieldObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetDynamicFieldObject' -type ISuiAPI_SuiXGetDynamicFieldObject_Call struct { - *mock.Call -} - -// SuiXGetDynamicFieldObject is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetDynamicFieldObjectRequest -func (_e *ISuiAPI_Expecter) SuiXGetDynamicFieldObject(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetDynamicFieldObject_Call { - return &ISuiAPI_SuiXGetDynamicFieldObject_Call{Call: _e.mock.On("SuiXGetDynamicFieldObject", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetDynamicFieldObject_Call) Run(run func(ctx context.Context, req models.SuiXGetDynamicFieldObjectRequest)) *ISuiAPI_SuiXGetDynamicFieldObject_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetDynamicFieldObjectRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetDynamicFieldObject_Call) Return(_a0 models.SuiObjectResponse, _a1 error) *ISuiAPI_SuiXGetDynamicFieldObject_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetDynamicFieldObject_Call) RunAndReturn(run func(context.Context, models.SuiXGetDynamicFieldObjectRequest) (models.SuiObjectResponse, error)) *ISuiAPI_SuiXGetDynamicFieldObject_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetEpochs provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetEpochs(ctx context.Context, req models.SuiXGetEpochsRequest) (models.PaginatedEpochInfoResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetEpochs") - } - - var r0 models.PaginatedEpochInfoResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetEpochsRequest) (models.PaginatedEpochInfoResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetEpochsRequest) models.PaginatedEpochInfoResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.PaginatedEpochInfoResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetEpochsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetEpochs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetEpochs' -type ISuiAPI_SuiXGetEpochs_Call struct { - *mock.Call -} - -// SuiXGetEpochs is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetEpochsRequest -func (_e *ISuiAPI_Expecter) SuiXGetEpochs(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetEpochs_Call { - return &ISuiAPI_SuiXGetEpochs_Call{Call: _e.mock.On("SuiXGetEpochs", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetEpochs_Call) Run(run func(ctx context.Context, req models.SuiXGetEpochsRequest)) *ISuiAPI_SuiXGetEpochs_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetEpochsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetEpochs_Call) Return(_a0 models.PaginatedEpochInfoResponse, _a1 error) *ISuiAPI_SuiXGetEpochs_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetEpochs_Call) RunAndReturn(run func(context.Context, models.SuiXGetEpochsRequest) (models.PaginatedEpochInfoResponse, error)) *ISuiAPI_SuiXGetEpochs_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetLatestSuiSystemState provides a mock function with given fields: ctx -func (_m *ISuiAPI) SuiXGetLatestSuiSystemState(ctx context.Context) (models.SuiSystemStateSummary, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetLatestSuiSystemState") - } - - var r0 models.SuiSystemStateSummary - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (models.SuiSystemStateSummary, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) models.SuiSystemStateSummary); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(models.SuiSystemStateSummary) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetLatestSuiSystemState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetLatestSuiSystemState' -type ISuiAPI_SuiXGetLatestSuiSystemState_Call struct { - *mock.Call -} - -// SuiXGetLatestSuiSystemState is a helper method to define mock.On call -// - ctx context.Context -func (_e *ISuiAPI_Expecter) SuiXGetLatestSuiSystemState(ctx interface{}) *ISuiAPI_SuiXGetLatestSuiSystemState_Call { - return &ISuiAPI_SuiXGetLatestSuiSystemState_Call{Call: _e.mock.On("SuiXGetLatestSuiSystemState", ctx)} -} - -func (_c *ISuiAPI_SuiXGetLatestSuiSystemState_Call) Run(run func(ctx context.Context)) *ISuiAPI_SuiXGetLatestSuiSystemState_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetLatestSuiSystemState_Call) Return(_a0 models.SuiSystemStateSummary, _a1 error) *ISuiAPI_SuiXGetLatestSuiSystemState_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetLatestSuiSystemState_Call) RunAndReturn(run func(context.Context) (models.SuiSystemStateSummary, error)) *ISuiAPI_SuiXGetLatestSuiSystemState_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetOwnedObjects provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetOwnedObjects(ctx context.Context, req models.SuiXGetOwnedObjectsRequest) (models.PaginatedObjectsResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetOwnedObjects") - } - - var r0 models.PaginatedObjectsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetOwnedObjectsRequest) (models.PaginatedObjectsResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetOwnedObjectsRequest) models.PaginatedObjectsResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.PaginatedObjectsResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetOwnedObjectsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetOwnedObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetOwnedObjects' -type ISuiAPI_SuiXGetOwnedObjects_Call struct { - *mock.Call -} - -// SuiXGetOwnedObjects is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetOwnedObjectsRequest -func (_e *ISuiAPI_Expecter) SuiXGetOwnedObjects(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetOwnedObjects_Call { - return &ISuiAPI_SuiXGetOwnedObjects_Call{Call: _e.mock.On("SuiXGetOwnedObjects", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetOwnedObjects_Call) Run(run func(ctx context.Context, req models.SuiXGetOwnedObjectsRequest)) *ISuiAPI_SuiXGetOwnedObjects_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetOwnedObjectsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetOwnedObjects_Call) Return(_a0 models.PaginatedObjectsResponse, _a1 error) *ISuiAPI_SuiXGetOwnedObjects_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetOwnedObjects_Call) RunAndReturn(run func(context.Context, models.SuiXGetOwnedObjectsRequest) (models.PaginatedObjectsResponse, error)) *ISuiAPI_SuiXGetOwnedObjects_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetReferenceGasPrice provides a mock function with given fields: ctx -func (_m *ISuiAPI) SuiXGetReferenceGasPrice(ctx context.Context) (uint64, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetReferenceGasPrice") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetReferenceGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetReferenceGasPrice' -type ISuiAPI_SuiXGetReferenceGasPrice_Call struct { - *mock.Call -} - -// SuiXGetReferenceGasPrice is a helper method to define mock.On call -// - ctx context.Context -func (_e *ISuiAPI_Expecter) SuiXGetReferenceGasPrice(ctx interface{}) *ISuiAPI_SuiXGetReferenceGasPrice_Call { - return &ISuiAPI_SuiXGetReferenceGasPrice_Call{Call: _e.mock.On("SuiXGetReferenceGasPrice", ctx)} -} - -func (_c *ISuiAPI_SuiXGetReferenceGasPrice_Call) Run(run func(ctx context.Context)) *ISuiAPI_SuiXGetReferenceGasPrice_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetReferenceGasPrice_Call) Return(_a0 uint64, _a1 error) *ISuiAPI_SuiXGetReferenceGasPrice_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetReferenceGasPrice_Call) RunAndReturn(run func(context.Context) (uint64, error)) *ISuiAPI_SuiXGetReferenceGasPrice_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetStakes provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetStakes(ctx context.Context, req models.SuiXGetStakesRequest) ([]*models.DelegatedStakesResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetStakes") - } - - var r0 []*models.DelegatedStakesResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetStakesRequest) ([]*models.DelegatedStakesResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetStakesRequest) []*models.DelegatedStakesResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*models.DelegatedStakesResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetStakesRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetStakes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetStakes' -type ISuiAPI_SuiXGetStakes_Call struct { - *mock.Call -} - -// SuiXGetStakes is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetStakesRequest -func (_e *ISuiAPI_Expecter) SuiXGetStakes(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetStakes_Call { - return &ISuiAPI_SuiXGetStakes_Call{Call: _e.mock.On("SuiXGetStakes", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetStakes_Call) Run(run func(ctx context.Context, req models.SuiXGetStakesRequest)) *ISuiAPI_SuiXGetStakes_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetStakesRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetStakes_Call) Return(_a0 []*models.DelegatedStakesResponse, _a1 error) *ISuiAPI_SuiXGetStakes_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetStakes_Call) RunAndReturn(run func(context.Context, models.SuiXGetStakesRequest) ([]*models.DelegatedStakesResponse, error)) *ISuiAPI_SuiXGetStakes_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetStakesByIds provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetStakesByIds(ctx context.Context, req models.SuiXGetStakesByIdsRequest) ([]*models.DelegatedStakesResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetStakesByIds") - } - - var r0 []*models.DelegatedStakesResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetStakesByIdsRequest) ([]*models.DelegatedStakesResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetStakesByIdsRequest) []*models.DelegatedStakesResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*models.DelegatedStakesResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetStakesByIdsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetStakesByIds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetStakesByIds' -type ISuiAPI_SuiXGetStakesByIds_Call struct { - *mock.Call -} - -// SuiXGetStakesByIds is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetStakesByIdsRequest -func (_e *ISuiAPI_Expecter) SuiXGetStakesByIds(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetStakesByIds_Call { - return &ISuiAPI_SuiXGetStakesByIds_Call{Call: _e.mock.On("SuiXGetStakesByIds", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetStakesByIds_Call) Run(run func(ctx context.Context, req models.SuiXGetStakesByIdsRequest)) *ISuiAPI_SuiXGetStakesByIds_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetStakesByIdsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetStakesByIds_Call) Return(_a0 []*models.DelegatedStakesResponse, _a1 error) *ISuiAPI_SuiXGetStakesByIds_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetStakesByIds_Call) RunAndReturn(run func(context.Context, models.SuiXGetStakesByIdsRequest) ([]*models.DelegatedStakesResponse, error)) *ISuiAPI_SuiXGetStakesByIds_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetTotalSupply provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXGetTotalSupply(ctx context.Context, req models.SuiXGetTotalSupplyRequest) (models.TotalSupplyResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetTotalSupply") - } - - var r0 models.TotalSupplyResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetTotalSupplyRequest) (models.TotalSupplyResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXGetTotalSupplyRequest) models.TotalSupplyResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TotalSupplyResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXGetTotalSupplyRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetTotalSupply_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetTotalSupply' -type ISuiAPI_SuiXGetTotalSupply_Call struct { - *mock.Call -} - -// SuiXGetTotalSupply is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXGetTotalSupplyRequest -func (_e *ISuiAPI_Expecter) SuiXGetTotalSupply(ctx interface{}, req interface{}) *ISuiAPI_SuiXGetTotalSupply_Call { - return &ISuiAPI_SuiXGetTotalSupply_Call{Call: _e.mock.On("SuiXGetTotalSupply", ctx, req)} -} - -func (_c *ISuiAPI_SuiXGetTotalSupply_Call) Run(run func(ctx context.Context, req models.SuiXGetTotalSupplyRequest)) *ISuiAPI_SuiXGetTotalSupply_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXGetTotalSupplyRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetTotalSupply_Call) Return(_a0 models.TotalSupplyResponse, _a1 error) *ISuiAPI_SuiXGetTotalSupply_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetTotalSupply_Call) RunAndReturn(run func(context.Context, models.SuiXGetTotalSupplyRequest) (models.TotalSupplyResponse, error)) *ISuiAPI_SuiXGetTotalSupply_Call { - _c.Call.Return(run) - return _c -} - -// SuiXGetValidatorsApy provides a mock function with given fields: ctx -func (_m *ISuiAPI) SuiXGetValidatorsApy(ctx context.Context) (models.ValidatorsApy, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for SuiXGetValidatorsApy") - } - - var r0 models.ValidatorsApy - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (models.ValidatorsApy, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) models.ValidatorsApy); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(models.ValidatorsApy) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXGetValidatorsApy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXGetValidatorsApy' -type ISuiAPI_SuiXGetValidatorsApy_Call struct { - *mock.Call -} - -// SuiXGetValidatorsApy is a helper method to define mock.On call -// - ctx context.Context -func (_e *ISuiAPI_Expecter) SuiXGetValidatorsApy(ctx interface{}) *ISuiAPI_SuiXGetValidatorsApy_Call { - return &ISuiAPI_SuiXGetValidatorsApy_Call{Call: _e.mock.On("SuiXGetValidatorsApy", ctx)} -} - -func (_c *ISuiAPI_SuiXGetValidatorsApy_Call) Run(run func(ctx context.Context)) *ISuiAPI_SuiXGetValidatorsApy_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXGetValidatorsApy_Call) Return(_a0 models.ValidatorsApy, _a1 error) *ISuiAPI_SuiXGetValidatorsApy_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXGetValidatorsApy_Call) RunAndReturn(run func(context.Context) (models.ValidatorsApy, error)) *ISuiAPI_SuiXGetValidatorsApy_Call { - _c.Call.Return(run) - return _c -} - -// SuiXQueryEvents provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXQueryEvents(ctx context.Context, req models.SuiXQueryEventsRequest) (models.PaginatedEventsResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXQueryEvents") - } - - var r0 models.PaginatedEventsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXQueryEventsRequest) (models.PaginatedEventsResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXQueryEventsRequest) models.PaginatedEventsResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.PaginatedEventsResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXQueryEventsRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXQueryEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXQueryEvents' -type ISuiAPI_SuiXQueryEvents_Call struct { - *mock.Call -} - -// SuiXQueryEvents is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXQueryEventsRequest -func (_e *ISuiAPI_Expecter) SuiXQueryEvents(ctx interface{}, req interface{}) *ISuiAPI_SuiXQueryEvents_Call { - return &ISuiAPI_SuiXQueryEvents_Call{Call: _e.mock.On("SuiXQueryEvents", ctx, req)} -} - -func (_c *ISuiAPI_SuiXQueryEvents_Call) Run(run func(ctx context.Context, req models.SuiXQueryEventsRequest)) *ISuiAPI_SuiXQueryEvents_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXQueryEventsRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXQueryEvents_Call) Return(_a0 models.PaginatedEventsResponse, _a1 error) *ISuiAPI_SuiXQueryEvents_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXQueryEvents_Call) RunAndReturn(run func(context.Context, models.SuiXQueryEventsRequest) (models.PaginatedEventsResponse, error)) *ISuiAPI_SuiXQueryEvents_Call { - _c.Call.Return(run) - return _c -} - -// SuiXQueryTransactionBlocks provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXQueryTransactionBlocks(ctx context.Context, req models.SuiXQueryTransactionBlocksRequest) (models.SuiXQueryTransactionBlocksResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXQueryTransactionBlocks") - } - - var r0 models.SuiXQueryTransactionBlocksResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXQueryTransactionBlocksRequest) (models.SuiXQueryTransactionBlocksResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXQueryTransactionBlocksRequest) models.SuiXQueryTransactionBlocksResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.SuiXQueryTransactionBlocksResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXQueryTransactionBlocksRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXQueryTransactionBlocks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXQueryTransactionBlocks' -type ISuiAPI_SuiXQueryTransactionBlocks_Call struct { - *mock.Call -} - -// SuiXQueryTransactionBlocks is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXQueryTransactionBlocksRequest -func (_e *ISuiAPI_Expecter) SuiXQueryTransactionBlocks(ctx interface{}, req interface{}) *ISuiAPI_SuiXQueryTransactionBlocks_Call { - return &ISuiAPI_SuiXQueryTransactionBlocks_Call{Call: _e.mock.On("SuiXQueryTransactionBlocks", ctx, req)} -} - -func (_c *ISuiAPI_SuiXQueryTransactionBlocks_Call) Run(run func(ctx context.Context, req models.SuiXQueryTransactionBlocksRequest)) *ISuiAPI_SuiXQueryTransactionBlocks_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXQueryTransactionBlocksRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXQueryTransactionBlocks_Call) Return(_a0 models.SuiXQueryTransactionBlocksResponse, _a1 error) *ISuiAPI_SuiXQueryTransactionBlocks_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXQueryTransactionBlocks_Call) RunAndReturn(run func(context.Context, models.SuiXQueryTransactionBlocksRequest) (models.SuiXQueryTransactionBlocksResponse, error)) *ISuiAPI_SuiXQueryTransactionBlocks_Call { - _c.Call.Return(run) - return _c -} - -// SuiXResolveNameServiceAddress provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXResolveNameServiceAddress(ctx context.Context, req models.SuiXResolveNameServiceAddressRequest) (string, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXResolveNameServiceAddress") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXResolveNameServiceAddressRequest) (string, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXResolveNameServiceAddressRequest) string); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXResolveNameServiceAddressRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXResolveNameServiceAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXResolveNameServiceAddress' -type ISuiAPI_SuiXResolveNameServiceAddress_Call struct { - *mock.Call -} - -// SuiXResolveNameServiceAddress is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXResolveNameServiceAddressRequest -func (_e *ISuiAPI_Expecter) SuiXResolveNameServiceAddress(ctx interface{}, req interface{}) *ISuiAPI_SuiXResolveNameServiceAddress_Call { - return &ISuiAPI_SuiXResolveNameServiceAddress_Call{Call: _e.mock.On("SuiXResolveNameServiceAddress", ctx, req)} -} - -func (_c *ISuiAPI_SuiXResolveNameServiceAddress_Call) Run(run func(ctx context.Context, req models.SuiXResolveNameServiceAddressRequest)) *ISuiAPI_SuiXResolveNameServiceAddress_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXResolveNameServiceAddressRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXResolveNameServiceAddress_Call) Return(_a0 string, _a1 error) *ISuiAPI_SuiXResolveNameServiceAddress_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXResolveNameServiceAddress_Call) RunAndReturn(run func(context.Context, models.SuiXResolveNameServiceAddressRequest) (string, error)) *ISuiAPI_SuiXResolveNameServiceAddress_Call { - _c.Call.Return(run) - return _c -} - -// SuiXResolveNameServiceNames provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) SuiXResolveNameServiceNames(ctx context.Context, req models.SuiXResolveNameServiceNamesRequest) (models.SuiXResolveNameServiceNamesResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for SuiXResolveNameServiceNames") - } - - var r0 models.SuiXResolveNameServiceNamesResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXResolveNameServiceNamesRequest) (models.SuiXResolveNameServiceNamesResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.SuiXResolveNameServiceNamesRequest) models.SuiXResolveNameServiceNamesResponse); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.SuiXResolveNameServiceNamesResponse) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.SuiXResolveNameServiceNamesRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_SuiXResolveNameServiceNames_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuiXResolveNameServiceNames' -type ISuiAPI_SuiXResolveNameServiceNames_Call struct { - *mock.Call -} - -// SuiXResolveNameServiceNames is a helper method to define mock.On call -// - ctx context.Context -// - req models.SuiXResolveNameServiceNamesRequest -func (_e *ISuiAPI_Expecter) SuiXResolveNameServiceNames(ctx interface{}, req interface{}) *ISuiAPI_SuiXResolveNameServiceNames_Call { - return &ISuiAPI_SuiXResolveNameServiceNames_Call{Call: _e.mock.On("SuiXResolveNameServiceNames", ctx, req)} -} - -func (_c *ISuiAPI_SuiXResolveNameServiceNames_Call) Run(run func(ctx context.Context, req models.SuiXResolveNameServiceNamesRequest)) *ISuiAPI_SuiXResolveNameServiceNames_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.SuiXResolveNameServiceNamesRequest)) - }) - return _c -} - -func (_c *ISuiAPI_SuiXResolveNameServiceNames_Call) Return(_a0 models.SuiXResolveNameServiceNamesResponse, _a1 error) *ISuiAPI_SuiXResolveNameServiceNames_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_SuiXResolveNameServiceNames_Call) RunAndReturn(run func(context.Context, models.SuiXResolveNameServiceNamesRequest) (models.SuiXResolveNameServiceNamesResponse, error)) *ISuiAPI_SuiXResolveNameServiceNames_Call { - _c.Call.Return(run) - return _c -} - -// TransferObject provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) TransferObject(ctx context.Context, req models.TransferObjectRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for TransferObject") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.TransferObjectRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.TransferObjectRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.TransferObjectRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_TransferObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferObject' -type ISuiAPI_TransferObject_Call struct { - *mock.Call -} - -// TransferObject is a helper method to define mock.On call -// - ctx context.Context -// - req models.TransferObjectRequest -func (_e *ISuiAPI_Expecter) TransferObject(ctx interface{}, req interface{}) *ISuiAPI_TransferObject_Call { - return &ISuiAPI_TransferObject_Call{Call: _e.mock.On("TransferObject", ctx, req)} -} - -func (_c *ISuiAPI_TransferObject_Call) Run(run func(ctx context.Context, req models.TransferObjectRequest)) *ISuiAPI_TransferObject_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.TransferObjectRequest)) - }) - return _c -} - -func (_c *ISuiAPI_TransferObject_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_TransferObject_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_TransferObject_Call) RunAndReturn(run func(context.Context, models.TransferObjectRequest) (models.TxnMetaData, error)) *ISuiAPI_TransferObject_Call { - _c.Call.Return(run) - return _c -} - -// TransferSui provides a mock function with given fields: ctx, req -func (_m *ISuiAPI) TransferSui(ctx context.Context, req models.TransferSuiRequest) (models.TxnMetaData, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for TransferSui") - } - - var r0 models.TxnMetaData - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, models.TransferSuiRequest) (models.TxnMetaData, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, models.TransferSuiRequest) models.TxnMetaData); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Get(0).(models.TxnMetaData) - } - - if rf, ok := ret.Get(1).(func(context.Context, models.TransferSuiRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ISuiAPI_TransferSui_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferSui' -type ISuiAPI_TransferSui_Call struct { - *mock.Call -} - -// TransferSui is a helper method to define mock.On call -// - ctx context.Context -// - req models.TransferSuiRequest -func (_e *ISuiAPI_Expecter) TransferSui(ctx interface{}, req interface{}) *ISuiAPI_TransferSui_Call { - return &ISuiAPI_TransferSui_Call{Call: _e.mock.On("TransferSui", ctx, req)} -} - -func (_c *ISuiAPI_TransferSui_Call) Run(run func(ctx context.Context, req models.TransferSuiRequest)) *ISuiAPI_TransferSui_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(models.TransferSuiRequest)) - }) - return _c -} - -func (_c *ISuiAPI_TransferSui_Call) Return(_a0 models.TxnMetaData, _a1 error) *ISuiAPI_TransferSui_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ISuiAPI_TransferSui_Call) RunAndReturn(run func(context.Context, models.TransferSuiRequest) (models.TxnMetaData, error)) *ISuiAPI_TransferSui_Call { - _c.Call.Return(run) - return _c -} - -// NewISuiAPI creates a new instance of ISuiAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewISuiAPI(t interface { - mock.TestingT - Cleanup(func()) -}) *ISuiAPI { - mock := &ISuiAPI{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/sdk/sui/timelock_executor.go b/sdk/sui/timelock_executor.go index 4352daeb0..9d316410d 100644 --- a/sdk/sui/timelock_executor.go +++ b/sdk/sui/timelock_executor.go @@ -6,12 +6,12 @@ import ( "fmt" "github.com/block-vision/sui-go-sdk/models" - "github.com/block-vision/sui-go-sdk/sui" "github.com/block-vision/sui-go-sdk/transaction" "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/chainlink-sui/bindings/bind" bindutils "github.com/smartcontractkit/chainlink-sui/bindings/utils" + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" chainsel "github.com/smartcontractkit/chain-selectors" @@ -24,20 +24,20 @@ var _ sdk.TimelockExecutor = (*TimelockExecutor)(nil) // TimelockExecutor is an Executor implementation for Sui, for accessing the MCMS-Timelock type TimelockExecutor struct { TimelockInspector - client sui.ISuiAPI + client cslclient.BindingsClient signer bindutils.SuiSigner mcmsPackageID string registryObj string accountObj string // ExecutePTB function for dependency injection and testing - ExecutePTB func(ctx context.Context, opts *bind.CallOpts, client sui.ISuiAPI, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) + ExecutePTB func(ctx context.Context, opts *bind.CallOpts, client cslclient.BindingsClient, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) executingCallbackParams ExecutingCallbackAppender } // NewTimelockExecutor creates a new TimelockExecutor -func NewTimelockExecutor(client sui.ISuiAPI, signer bindutils.SuiSigner, entrypointEncoder EntrypointArgEncoder, mcmsPackageID string, registryObj string, accountObj string) (*TimelockExecutor, error) { +func NewTimelockExecutor(client cslclient.BindingsClient, signer bindutils.SuiSigner, entrypointEncoder EntrypointArgEncoder, mcmsPackageID string, registryObj string, accountObj string) (*TimelockExecutor, error) { timelockInspector, err := NewTimelockInspector(client, signer, mcmsPackageID) if err != nil { return nil, err diff --git a/sdk/sui/timelock_executor_test.go b/sdk/sui/timelock_executor_test.go index 029695d7a..fd4da4c2d 100644 --- a/sdk/sui/timelock_executor_test.go +++ b/sdk/sui/timelock_executor_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/block-vision/sui-go-sdk/models" - "github.com/block-vision/sui-go-sdk/sui" "github.com/block-vision/sui-go-sdk/transaction" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" @@ -15,6 +14,7 @@ import ( chainsel "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/chainlink-sui/bindings/bind" + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" mockbindutils "github.com/smartcontractkit/mcms/sdk/sui/mocks/bindutils" mockmcms "github.com/smartcontractkit/mcms/sdk/sui/mocks/mcms" @@ -24,7 +24,7 @@ import ( // testExecutingCallbackParams is a test implementation that mocks the AppendPTB method type testExecutingCallbackParams struct { - client sui.ISuiAPI + client cslclient.BindingsClient mcms *mockmcms.IMcms mcmsPackageID string registryObj string @@ -42,7 +42,7 @@ var _ ExecutingCallbackAppender = (*testExecutingCallbackParams)(nil) func TestNewTimelockExecutor(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mcmsPackageID := "0x123456789abcdef" @@ -63,7 +63,7 @@ func TestNewTimelockExecutor(t *testing.T) { func TestTimelockExecutor_Properties(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mcmsPackageID := "0x123456789abcdef" @@ -94,7 +94,7 @@ func TestTimelockExecutor_Execute_Success(t *testing.T) { t.Parallel() ctx := context.Background() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcmsContract := mockmcms.NewIMcms(t) mockEncoder := mockmcms.NewMcmsEncoder(t) @@ -123,7 +123,7 @@ func TestTimelockExecutor_Execute_Success(t *testing.T) { registryObj: registryObj, accountObj: accountObj, // Mock ExecutePTB function - ExecutePTB: func(ctx context.Context, opts *bind.CallOpts, client sui.ISuiAPI, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { + ExecutePTB: func(ctx context.Context, opts *bind.CallOpts, client cslclient.BindingsClient, ptb *transaction.Transaction) (*models.SuiTransactionBlockResponse, error) { return &models.SuiTransactionBlockResponse{ Digest: "9WzSXdwbky8tNbH7juvyaui4QzMUYEjdCEKMrMgLhXHT", Transaction: models.SuiTransactionBlock{ @@ -205,7 +205,7 @@ func TestTimelockExecutor_Execute_InvalidAdditionalFields(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcmsContract := mockmcms.NewIMcms(t) @@ -249,7 +249,7 @@ func TestTimelockExecutor_Execute_InvalidTargetAddress(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcmsContract := mockmcms.NewIMcms(t) @@ -305,7 +305,7 @@ func TestTimelockExecutor_Execute_TimelockExecuteBatchFailure(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcmsContract := mockmcms.NewIMcms(t) mockEncoder := mockmcms.NewMcmsEncoder(t) @@ -386,7 +386,7 @@ func TestTimelockExecutor_Execute_AppendPTBFailure(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mockmcmsContract := mockmcms.NewIMcms(t) mockEncoder := mockmcms.NewMcmsEncoder(t) diff --git a/sdk/sui/timelock_inspector.go b/sdk/sui/timelock_inspector.go index ee61371e4..e99c4b02a 100644 --- a/sdk/sui/timelock_inspector.go +++ b/sdk/sui/timelock_inspector.go @@ -5,11 +5,10 @@ import ( "errors" "fmt" - "github.com/block-vision/sui-go-sdk/sui" - "github.com/smartcontractkit/chainlink-sui/bindings/bind" modulemcms "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms" bindutils "github.com/smartcontractkit/chainlink-sui/bindings/utils" + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" "github.com/smartcontractkit/mcms/sdk" ) @@ -18,14 +17,14 @@ var _ sdk.TimelockInspector = (*TimelockInspector)(nil) // TimelockInspector is an Inspector implementation for Sui, for accessing the MCMS-Timelock contract type TimelockInspector struct { - client sui.ISuiAPI + client cslclient.BindingsClient signer bindutils.SuiSigner mcmsPackageID string mcms modulemcms.IMcms } // NewTimelockInspector creates a new TimelockInspector -func NewTimelockInspector(client sui.ISuiAPI, signer bindutils.SuiSigner, mcmsPackageID string) (*TimelockInspector, error) { +func NewTimelockInspector(client cslclient.BindingsClient, signer bindutils.SuiSigner, mcmsPackageID string) (*TimelockInspector, error) { mcms, err := modulemcms.NewMcms(mcmsPackageID, client) if err != nil { return nil, err diff --git a/sdk/sui/timelock_inspector_test.go b/sdk/sui/timelock_inspector_test.go index 787f6d96a..400b663ec 100644 --- a/sdk/sui/timelock_inspector_test.go +++ b/sdk/sui/timelock_inspector_test.go @@ -14,7 +14,7 @@ import ( func TestNewTimelockInspector(t *testing.T) { t.Parallel() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) mcmsPackageID := "0x123456789abcdef" @@ -31,7 +31,7 @@ func TestTimelockInspector_GetProposers(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) inspector, err := NewTimelockInspector(mockClient, mockSigner, "0x123456789abcdef") @@ -47,7 +47,7 @@ func TestTimelockInspector_GetExecutors(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) inspector, err := NewTimelockInspector(mockClient, mockSigner, "0x123456789abcdef") @@ -63,7 +63,7 @@ func TestTimelockInspector_GetBypassers(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) inspector, err := NewTimelockInspector(mockClient, mockSigner, "0x123456789abcdef") @@ -79,7 +79,7 @@ func TestTimelockInspector_GetCancellers(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) inspector, err := NewTimelockInspector(mockClient, mockSigner, "0x123456789abcdef") @@ -95,7 +95,7 @@ func TestTimelockInspector_GetMinDelay(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) // Create a mock MCMS contract @@ -129,7 +129,7 @@ func TestTimelockInspector_IsOperation(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) // Create a mock MCMS contract @@ -165,7 +165,7 @@ func TestTimelockInspector_IsOperationPending(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) // Create a mock MCMS contract @@ -201,7 +201,7 @@ func TestTimelockInspector_IsOperationReady(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) // Create a mock MCMS contract @@ -238,7 +238,7 @@ func TestTimelockInspector_IsOperationDone(t *testing.T) { t.Parallel() ctx := t.Context() - mockClient := mocksui.NewISuiAPI(t) + mockClient := mocksui.NewBindingsClient(t) mockSigner := mockbindutils.NewSuiSigner(t) // Create a mock MCMS contract From da0bd7da623d87b14b165c4175d2341234b311b5 Mon Sep 17 00:00:00 2001 From: faisal-link Date: Thu, 4 Jun 2026 22:15:44 +0400 Subject: [PATCH 02/12] update Sui mocks and regenerate --- .mockery.yaml | 4 + chainwrappers/mocks/chain_accessor.go | 43 +- go.mod | 2 +- sdk/aptos/mocks/aptos/rpcclient.go | 5 +- sdk/aptos/mocks/aptos/transactionsigner.go | 1 - sdk/aptos/mocks/mcms/mcms.go | 7 +- sdk/aptos/mocks/mcms/mcms/mcms.go | 9 +- sdk/aptos/mocks/mcms/mcms/mcms_encoder.go | 5 +- .../mocks/mcms/mcms_executor/mcms_executor.go | 9 +- .../bindings/mocks/call_proxy_interface.go | 8 +- .../mocks/many_chain_multi_sig_interface.go | 8 +- .../bindings/mocks/rbac_timelock_interface.go | 8 +- sdk/evm/mocks/contract_deploy_backend.go | 6 +- sdk/mocks/decoder.go | 3 +- sdk/mocks/executor.go | 1 - sdk/mocks/inspector.go | 1 - sdk/mocks/operation_id.go | 98 + sdk/mocks/simulator.go | 1 - sdk/mocks/timelock_configurer.go | 96 + sdk/mocks/timelock_converter.go | 1 - sdk/mocks/timelock_executor.go | 1 - sdk/solana/mocks/jsonrpcclient.go | 1 - sdk/sui/mocks/bindutils/iboundcontract.go | 7 +- sdk/sui/mocks/feequoter/feequoterencoder.go | 3 +- sdk/sui/mocks/mcms/imcms.go | 7 +- sdk/sui/mocks/mcms/imcmsdevinspect.go | 4 +- sdk/sui/mocks/mcms/mcmsencoder.go | 3 +- sdk/sui/mocks/mcmsdeployer/imcmsdeployer.go | 7 +- sdk/sui/mocks/sui/bindingsclient.go | 450 +++- sdk/sui/mocks/sui/suiptbclient.go | 1979 +++++++++++++++++ sdk/ton/mocks/api.go | 13 +- sdk/ton/mocks/wallet.go | 5 +- taskfiles/generate/Taskfile.yml | 2 +- 33 files changed, 2604 insertions(+), 194 deletions(-) create mode 100644 sdk/mocks/operation_id.go create mode 100644 sdk/mocks/timelock_configurer.go create mode 100644 sdk/sui/mocks/sui/suiptbclient.go diff --git a/.mockery.yaml b/.mockery.yaml index 0ee965856..7df58c172 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -103,6 +103,10 @@ packages: config: dir: "./sdk/sui/mocks/sui" filename: "bindingsclient.go" + SuiPTBClient: + config: + dir: "./sdk/sui/mocks/sui" + filename: "suiptbclient.go" github.com/smartcontractkit/chainlink-sui/bindings/utils: config: all: false diff --git a/chainwrappers/mocks/chain_accessor.go b/chainwrappers/mocks/chain_accessor.go index 2a11823c2..9e2a73cf4 100644 --- a/chainwrappers/mocks/chain_accessor.go +++ b/chainwrappers/mocks/chain_accessor.go @@ -6,20 +6,13 @@ import ( aptos "github.com/aptos-labs/aptos-go-sdk" bind "github.com/ethereum/go-ethereum/accounts/abi/bind/v2" + solana "github.com/gagliardetto/solana-go" + rpc "github.com/gagliardetto/solana-go/rpc" + client "github.com/smartcontractkit/chainlink-sui/relayer/client" evm "github.com/smartcontractkit/mcms/sdk/evm" - + sui "github.com/smartcontractkit/mcms/sdk/sui" mock "github.com/stretchr/testify/mock" - - rpc "github.com/gagliardetto/solana-go/rpc" - - sdksui "github.com/smartcontractkit/mcms/sdk/sui" - - solana "github.com/gagliardetto/solana-go" - - cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" - ton "github.com/xssnick/tonutils-go/ton" - wallet "github.com/xssnick/tonutils-go/ton/wallet" ) @@ -432,23 +425,23 @@ func (_c *ChainAccessor_SolanaSigner_Call) RunAndReturn(run func(uint64) (*solan } // SuiClient provides a mock function with given fields: selector -func (_m *ChainAccessor) SuiClient(selector uint64) (cslclient.BindingsClient, bool) { +func (_m *ChainAccessor) SuiClient(selector uint64) (client.BindingsClient, bool) { ret := _m.Called(selector) if len(ret) == 0 { panic("no return value specified for SuiClient") } - var r0 cslclient.BindingsClient + var r0 client.BindingsClient var r1 bool - if rf, ok := ret.Get(0).(func(uint64) (cslclient.BindingsClient, bool)); ok { + if rf, ok := ret.Get(0).(func(uint64) (client.BindingsClient, bool)); ok { return rf(selector) } - if rf, ok := ret.Get(0).(func(uint64) cslclient.BindingsClient); ok { + if rf, ok := ret.Get(0).(func(uint64) client.BindingsClient); ok { r0 = rf(selector) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(cslclient.BindingsClient) + r0 = ret.Get(0).(client.BindingsClient) } } @@ -479,34 +472,34 @@ func (_c *ChainAccessor_SuiClient_Call) Run(run func(selector uint64)) *ChainAcc return _c } -func (_c *ChainAccessor_SuiClient_Call) Return(_a0 cslclient.BindingsClient, _a1 bool) *ChainAccessor_SuiClient_Call { +func (_c *ChainAccessor_SuiClient_Call) Return(_a0 client.BindingsClient, _a1 bool) *ChainAccessor_SuiClient_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *ChainAccessor_SuiClient_Call) RunAndReturn(run func(uint64) (cslclient.BindingsClient, bool)) *ChainAccessor_SuiClient_Call { +func (_c *ChainAccessor_SuiClient_Call) RunAndReturn(run func(uint64) (client.BindingsClient, bool)) *ChainAccessor_SuiClient_Call { _c.Call.Return(run) return _c } // SuiSigner provides a mock function with given fields: selector -func (_m *ChainAccessor) SuiSigner(selector uint64) (sdksui.SuiSigner, bool) { +func (_m *ChainAccessor) SuiSigner(selector uint64) (sui.SuiSigner, bool) { ret := _m.Called(selector) if len(ret) == 0 { panic("no return value specified for SuiSigner") } - var r0 sdksui.SuiSigner + var r0 sui.SuiSigner var r1 bool - if rf, ok := ret.Get(0).(func(uint64) (sdksui.SuiSigner, bool)); ok { + if rf, ok := ret.Get(0).(func(uint64) (sui.SuiSigner, bool)); ok { return rf(selector) } - if rf, ok := ret.Get(0).(func(uint64) sdksui.SuiSigner); ok { + if rf, ok := ret.Get(0).(func(uint64) sui.SuiSigner); ok { r0 = rf(selector) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(sdksui.SuiSigner) + r0 = ret.Get(0).(sui.SuiSigner) } } @@ -537,12 +530,12 @@ func (_c *ChainAccessor_SuiSigner_Call) Run(run func(selector uint64)) *ChainAcc return _c } -func (_c *ChainAccessor_SuiSigner_Call) Return(_a0 sdksui.SuiSigner, _a1 bool) *ChainAccessor_SuiSigner_Call { +func (_c *ChainAccessor_SuiSigner_Call) Return(_a0 sui.SuiSigner, _a1 bool) *ChainAccessor_SuiSigner_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *ChainAccessor_SuiSigner_Call) RunAndReturn(run func(uint64) (sdksui.SuiSigner, bool)) *ChainAccessor_SuiSigner_Call { +func (_c *ChainAccessor_SuiSigner_Call) RunAndReturn(run func(uint64) (sui.SuiSigner, bool)) *ChainAccessor_SuiSigner_Call { _c.Call.Return(run) return _c } diff --git a/go.mod b/go.mod index 6edd2985a..65f8ac997 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,7 @@ require ( github.com/google/go-cmp v0.7.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.100 github.com/smartcontractkit/chainlink-aptos v0.0.0-20260428085939-5c70de12dbfc @@ -190,7 +191,6 @@ require ( github.com/oklog/run v1.2.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect - github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.3.0 // indirect github.com/pion/dtls/v2 v2.2.12 // indirect diff --git a/sdk/aptos/mocks/aptos/rpcclient.go b/sdk/aptos/mocks/aptos/rpcclient.go index 6331b5083..e018a1e19 100644 --- a/sdk/aptos/mocks/aptos/rpcclient.go +++ b/sdk/aptos/mocks/aptos/rpcclient.go @@ -3,12 +3,11 @@ package mock_aptossdk import ( + time "time" + aptos "github.com/aptos-labs/aptos-go-sdk" api "github.com/aptos-labs/aptos-go-sdk/api" - mock "github.com/stretchr/testify/mock" - - time "time" ) // AptosRpcClient is an autogenerated mock type for the AptosRpcClient type diff --git a/sdk/aptos/mocks/aptos/transactionsigner.go b/sdk/aptos/mocks/aptos/transactionsigner.go index ee880ac1c..03d7532b7 100644 --- a/sdk/aptos/mocks/aptos/transactionsigner.go +++ b/sdk/aptos/mocks/aptos/transactionsigner.go @@ -5,7 +5,6 @@ package mock_aptossdk import ( aptos "github.com/aptos-labs/aptos-go-sdk" crypto "github.com/aptos-labs/aptos-go-sdk/crypto" - mock "github.com/stretchr/testify/mock" ) diff --git a/sdk/aptos/mocks/mcms/mcms.go b/sdk/aptos/mocks/mcms/mcms.go index 60ef397e4..c081a43b0 100644 --- a/sdk/aptos/mocks/mcms/mcms.go +++ b/sdk/aptos/mocks/mcms/mcms.go @@ -5,17 +5,12 @@ package mock_mcms import ( aptos "github.com/aptos-labs/aptos-go-sdk" - mock "github.com/stretchr/testify/mock" - module_mcms "github.com/smartcontractkit/chainlink-aptos/bindings/mcms/mcms" - module_mcms_account "github.com/smartcontractkit/chainlink-aptos/bindings/mcms/mcms_account" - module_mcms_deployer "github.com/smartcontractkit/chainlink-aptos/bindings/mcms/mcms_deployer" - module_mcms_executor "github.com/smartcontractkit/chainlink-aptos/bindings/mcms/mcms_executor" - module_mcms_registry "github.com/smartcontractkit/chainlink-aptos/bindings/mcms/mcms_registry" + mock "github.com/stretchr/testify/mock" ) // MCMS is an autogenerated mock type for the MCMS type diff --git a/sdk/aptos/mocks/mcms/mcms/mcms.go b/sdk/aptos/mocks/mcms/mcms/mcms.go index 782051452..b37edfab7 100644 --- a/sdk/aptos/mocks/mcms/mcms/mcms.go +++ b/sdk/aptos/mocks/mcms/mcms/mcms.go @@ -3,16 +3,13 @@ package mock_module_mcms import ( - aptos "github.com/aptos-labs/aptos-go-sdk" - api "github.com/aptos-labs/aptos-go-sdk/api" - big "math/big" + aptos "github.com/aptos-labs/aptos-go-sdk" + api "github.com/aptos-labs/aptos-go-sdk/api" bind "github.com/smartcontractkit/chainlink-aptos/bindings/bind" - - mock "github.com/stretchr/testify/mock" - module_mcms "github.com/smartcontractkit/chainlink-aptos/bindings/mcms/mcms" + mock "github.com/stretchr/testify/mock" ) // MCMSInterface is an autogenerated mock type for the MCMSInterface type diff --git a/sdk/aptos/mocks/mcms/mcms/mcms_encoder.go b/sdk/aptos/mocks/mcms/mcms/mcms_encoder.go index 87e1c8e18..cff304741 100644 --- a/sdk/aptos/mocks/mcms/mcms/mcms_encoder.go +++ b/sdk/aptos/mocks/mcms/mcms/mcms_encoder.go @@ -6,12 +6,9 @@ import ( big "math/big" aptos "github.com/aptos-labs/aptos-go-sdk" - bind "github.com/smartcontractkit/chainlink-aptos/bindings/bind" - - mock "github.com/stretchr/testify/mock" - module_mcms "github.com/smartcontractkit/chainlink-aptos/bindings/mcms/mcms" + mock "github.com/stretchr/testify/mock" ) // MCMSEncoder is an autogenerated mock type for the MCMSEncoder type diff --git a/sdk/aptos/mocks/mcms/mcms_executor/mcms_executor.go b/sdk/aptos/mocks/mcms/mcms_executor/mcms_executor.go index f84548aa3..6f6ffdf1c 100644 --- a/sdk/aptos/mocks/mcms/mcms_executor/mcms_executor.go +++ b/sdk/aptos/mocks/mcms/mcms_executor/mcms_executor.go @@ -3,16 +3,13 @@ package mock_module_mcms_executor import ( - aptos "github.com/aptos-labs/aptos-go-sdk" - api "github.com/aptos-labs/aptos-go-sdk/api" - big "math/big" + aptos "github.com/aptos-labs/aptos-go-sdk" + api "github.com/aptos-labs/aptos-go-sdk/api" bind "github.com/smartcontractkit/chainlink-aptos/bindings/bind" - - mock "github.com/stretchr/testify/mock" - module_mcms_executor "github.com/smartcontractkit/chainlink-aptos/bindings/mcms/mcms_executor" + mock "github.com/stretchr/testify/mock" ) // MCMSExecutorInterface is an autogenerated mock type for the MCMSExecutorInterface type diff --git a/sdk/evm/bindings/mocks/call_proxy_interface.go b/sdk/evm/bindings/mocks/call_proxy_interface.go index 47699ab0c..980a62cce 100644 --- a/sdk/evm/bindings/mocks/call_proxy_interface.go +++ b/sdk/evm/bindings/mocks/call_proxy_interface.go @@ -4,15 +4,11 @@ package mocks import ( bind "github.com/ethereum/go-ethereum/accounts/abi/bind/v2" - bindings "github.com/smartcontractkit/mcms/sdk/evm/bindings" - common "github.com/ethereum/go-ethereum/common" - + types "github.com/ethereum/go-ethereum/core/types" event "github.com/ethereum/go-ethereum/event" - + bindings "github.com/smartcontractkit/mcms/sdk/evm/bindings" mock "github.com/stretchr/testify/mock" - - types "github.com/ethereum/go-ethereum/core/types" ) // CallProxyInterface is an autogenerated mock type for the CallProxyInterface type diff --git a/sdk/evm/bindings/mocks/many_chain_multi_sig_interface.go b/sdk/evm/bindings/mocks/many_chain_multi_sig_interface.go index 1b824824a..903ba406c 100644 --- a/sdk/evm/bindings/mocks/many_chain_multi_sig_interface.go +++ b/sdk/evm/bindings/mocks/many_chain_multi_sig_interface.go @@ -6,15 +6,11 @@ import ( big "math/big" bind "github.com/ethereum/go-ethereum/accounts/abi/bind/v2" - bindings "github.com/smartcontractkit/mcms/sdk/evm/bindings" - common "github.com/ethereum/go-ethereum/common" - + types "github.com/ethereum/go-ethereum/core/types" event "github.com/ethereum/go-ethereum/event" - + bindings "github.com/smartcontractkit/mcms/sdk/evm/bindings" mock "github.com/stretchr/testify/mock" - - types "github.com/ethereum/go-ethereum/core/types" ) // ManyChainMultiSigInterface is an autogenerated mock type for the ManyChainMultiSigInterface type diff --git a/sdk/evm/bindings/mocks/rbac_timelock_interface.go b/sdk/evm/bindings/mocks/rbac_timelock_interface.go index 511fa3ae1..e89053853 100644 --- a/sdk/evm/bindings/mocks/rbac_timelock_interface.go +++ b/sdk/evm/bindings/mocks/rbac_timelock_interface.go @@ -6,15 +6,11 @@ import ( big "math/big" bind "github.com/ethereum/go-ethereum/accounts/abi/bind/v2" - bindings "github.com/smartcontractkit/mcms/sdk/evm/bindings" - common "github.com/ethereum/go-ethereum/common" - + types "github.com/ethereum/go-ethereum/core/types" event "github.com/ethereum/go-ethereum/event" - + bindings "github.com/smartcontractkit/mcms/sdk/evm/bindings" mock "github.com/stretchr/testify/mock" - - types "github.com/ethereum/go-ethereum/core/types" ) // RBACTimelockInterface is an autogenerated mock type for the RBACTimelockInterface type diff --git a/sdk/evm/mocks/contract_deploy_backend.go b/sdk/evm/mocks/contract_deploy_backend.go index fd248d1be..d189137f4 100644 --- a/sdk/evm/mocks/contract_deploy_backend.go +++ b/sdk/evm/mocks/contract_deploy_backend.go @@ -6,13 +6,11 @@ import ( context "context" big "math/big" - common "github.com/ethereum/go-ethereum/common" - ethereum "github.com/ethereum/go-ethereum" - - mock "github.com/stretchr/testify/mock" + common "github.com/ethereum/go-ethereum/common" types "github.com/ethereum/go-ethereum/core/types" + mock "github.com/stretchr/testify/mock" ) // ContractDeployBackend is an autogenerated mock type for the ContractDeployBackend type diff --git a/sdk/mocks/decoder.go b/sdk/mocks/decoder.go index 1df1d42ca..0a627a8aa 100644 --- a/sdk/mocks/decoder.go +++ b/sdk/mocks/decoder.go @@ -4,9 +4,8 @@ package mocks import ( sdk "github.com/smartcontractkit/mcms/sdk" - mock "github.com/stretchr/testify/mock" - types "github.com/smartcontractkit/mcms/types" + mock "github.com/stretchr/testify/mock" ) // Decoder is an autogenerated mock type for the Decoder type diff --git a/sdk/mocks/executor.go b/sdk/mocks/executor.go index cd4f26998..596cf7ee2 100644 --- a/sdk/mocks/executor.go +++ b/sdk/mocks/executor.go @@ -6,7 +6,6 @@ import ( context "context" common "github.com/ethereum/go-ethereum/common" - mock "github.com/stretchr/testify/mock" types "github.com/smartcontractkit/mcms/types" diff --git a/sdk/mocks/inspector.go b/sdk/mocks/inspector.go index 68632be6b..a20598f40 100644 --- a/sdk/mocks/inspector.go +++ b/sdk/mocks/inspector.go @@ -6,7 +6,6 @@ import ( context "context" common "github.com/ethereum/go-ethereum/common" - mock "github.com/stretchr/testify/mock" types "github.com/smartcontractkit/mcms/types" diff --git a/sdk/mocks/operation_id.go b/sdk/mocks/operation_id.go new file mode 100644 index 000000000..8a54a3b96 --- /dev/null +++ b/sdk/mocks/operation_id.go @@ -0,0 +1,98 @@ +// Code generated by mockery v2.53.5. DO NOT EDIT. + +package mocks + +import ( + common "github.com/ethereum/go-ethereum/common" + mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/mcms/types" +) + +// OperationID is an autogenerated mock type for the OperationID type +type OperationID struct { + mock.Mock +} + +type OperationID_Expecter struct { + mock *mock.Mock +} + +func (_m *OperationID) EXPECT() *OperationID_Expecter { + return &OperationID_Expecter{mock: &_m.Mock} +} + +// Execute provides a mock function with given fields: _a0, _a1, _a2, _a3 +func (_m *OperationID) Execute(_a0 types.BatchOperation, _a1 types.TimelockAction, _a2 common.Hash, _a3 common.Hash) (common.Hash, error) { + ret := _m.Called(_a0, _a1, _a2, _a3) + + if len(ret) == 0 { + panic("no return value specified for Execute") + } + + var r0 common.Hash + var r1 error + if rf, ok := ret.Get(0).(func(types.BatchOperation, types.TimelockAction, common.Hash, common.Hash) (common.Hash, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } + if rf, ok := ret.Get(0).(func(types.BatchOperation, types.TimelockAction, common.Hash, common.Hash) common.Hash); ok { + r0 = rf(_a0, _a1, _a2, _a3) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Hash) + } + } + + if rf, ok := ret.Get(1).(func(types.BatchOperation, types.TimelockAction, common.Hash, common.Hash) error); ok { + r1 = rf(_a0, _a1, _a2, _a3) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OperationID_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' +type OperationID_Execute_Call struct { + *mock.Call +} + +// Execute is a helper method to define mock.On call +// - _a0 types.BatchOperation +// - _a1 types.TimelockAction +// - _a2 common.Hash +// - _a3 common.Hash +func (_e *OperationID_Expecter) Execute(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *OperationID_Execute_Call { + return &OperationID_Execute_Call{Call: _e.mock.On("Execute", _a0, _a1, _a2, _a3)} +} + +func (_c *OperationID_Execute_Call) Run(run func(_a0 types.BatchOperation, _a1 types.TimelockAction, _a2 common.Hash, _a3 common.Hash)) *OperationID_Execute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.BatchOperation), args[1].(types.TimelockAction), args[2].(common.Hash), args[3].(common.Hash)) + }) + return _c +} + +func (_c *OperationID_Execute_Call) Return(_a0 common.Hash, _a1 error) *OperationID_Execute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OperationID_Execute_Call) RunAndReturn(run func(types.BatchOperation, types.TimelockAction, common.Hash, common.Hash) (common.Hash, error)) *OperationID_Execute_Call { + _c.Call.Return(run) + return _c +} + +// NewOperationID creates a new instance of OperationID. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewOperationID(t interface { + mock.TestingT + Cleanup(func()) +}) *OperationID { + mock := &OperationID{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/sdk/mocks/simulator.go b/sdk/mocks/simulator.go index 9f3dda3e2..866898dd4 100644 --- a/sdk/mocks/simulator.go +++ b/sdk/mocks/simulator.go @@ -6,7 +6,6 @@ import ( context "context" common "github.com/ethereum/go-ethereum/common" - mock "github.com/stretchr/testify/mock" types "github.com/smartcontractkit/mcms/types" diff --git a/sdk/mocks/timelock_configurer.go b/sdk/mocks/timelock_configurer.go new file mode 100644 index 000000000..feed7dc34 --- /dev/null +++ b/sdk/mocks/timelock_configurer.go @@ -0,0 +1,96 @@ +// Code generated by mockery v2.53.5. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/mcms/types" +) + +// TimelockConfigurer is an autogenerated mock type for the TimelockConfigurer type +type TimelockConfigurer struct { + mock.Mock +} + +type TimelockConfigurer_Expecter struct { + mock *mock.Mock +} + +func (_m *TimelockConfigurer) EXPECT() *TimelockConfigurer_Expecter { + return &TimelockConfigurer_Expecter{mock: &_m.Mock} +} + +// UpdateDelay provides a mock function with given fields: ctx, timelockAddress, newDelay +func (_m *TimelockConfigurer) UpdateDelay(ctx context.Context, timelockAddress string, newDelay uint64) (types.TransactionResult, error) { + ret := _m.Called(ctx, timelockAddress, newDelay) + + if len(ret) == 0 { + panic("no return value specified for UpdateDelay") + } + + var r0 types.TransactionResult + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, uint64) (types.TransactionResult, error)); ok { + return rf(ctx, timelockAddress, newDelay) + } + if rf, ok := ret.Get(0).(func(context.Context, string, uint64) types.TransactionResult); ok { + r0 = rf(ctx, timelockAddress, newDelay) + } else { + r0 = ret.Get(0).(types.TransactionResult) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, uint64) error); ok { + r1 = rf(ctx, timelockAddress, newDelay) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TimelockConfigurer_UpdateDelay_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDelay' +type TimelockConfigurer_UpdateDelay_Call struct { + *mock.Call +} + +// UpdateDelay is a helper method to define mock.On call +// - ctx context.Context +// - timelockAddress string +// - newDelay uint64 +func (_e *TimelockConfigurer_Expecter) UpdateDelay(ctx interface{}, timelockAddress interface{}, newDelay interface{}) *TimelockConfigurer_UpdateDelay_Call { + return &TimelockConfigurer_UpdateDelay_Call{Call: _e.mock.On("UpdateDelay", ctx, timelockAddress, newDelay)} +} + +func (_c *TimelockConfigurer_UpdateDelay_Call) Run(run func(ctx context.Context, timelockAddress string, newDelay uint64)) *TimelockConfigurer_UpdateDelay_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(uint64)) + }) + return _c +} + +func (_c *TimelockConfigurer_UpdateDelay_Call) Return(_a0 types.TransactionResult, _a1 error) *TimelockConfigurer_UpdateDelay_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TimelockConfigurer_UpdateDelay_Call) RunAndReturn(run func(context.Context, string, uint64) (types.TransactionResult, error)) *TimelockConfigurer_UpdateDelay_Call { + _c.Call.Return(run) + return _c +} + +// NewTimelockConfigurer creates a new instance of TimelockConfigurer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewTimelockConfigurer(t interface { + mock.TestingT + Cleanup(func()) +}) *TimelockConfigurer { + mock := &TimelockConfigurer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/sdk/mocks/timelock_converter.go b/sdk/mocks/timelock_converter.go index 0689c0bdb..341bcedb1 100644 --- a/sdk/mocks/timelock_converter.go +++ b/sdk/mocks/timelock_converter.go @@ -6,7 +6,6 @@ import ( context "context" common "github.com/ethereum/go-ethereum/common" - mock "github.com/stretchr/testify/mock" types "github.com/smartcontractkit/mcms/types" diff --git a/sdk/mocks/timelock_executor.go b/sdk/mocks/timelock_executor.go index bd509ac7c..69dc95f9d 100644 --- a/sdk/mocks/timelock_executor.go +++ b/sdk/mocks/timelock_executor.go @@ -6,7 +6,6 @@ import ( context "context" common "github.com/ethereum/go-ethereum/common" - mock "github.com/stretchr/testify/mock" types "github.com/smartcontractkit/mcms/types" diff --git a/sdk/solana/mocks/jsonrpcclient.go b/sdk/solana/mocks/jsonrpcclient.go index 2523cca1b..d7e02b8a0 100644 --- a/sdk/solana/mocks/jsonrpcclient.go +++ b/sdk/solana/mocks/jsonrpcclient.go @@ -7,7 +7,6 @@ import ( http "net/http" jsonrpc "github.com/gagliardetto/solana-go/rpc/jsonrpc" - mock "github.com/stretchr/testify/mock" ) diff --git a/sdk/sui/mocks/bindutils/iboundcontract.go b/sdk/sui/mocks/bindutils/iboundcontract.go index 9e271ab3d..24c686224 100644 --- a/sdk/sui/mocks/bindutils/iboundcontract.go +++ b/sdk/sui/mocks/bindutils/iboundcontract.go @@ -5,13 +5,10 @@ package mock_bindutils import ( context "context" - bind "github.com/smartcontractkit/chainlink-sui/bindings/bind" - - mock "github.com/stretchr/testify/mock" - models "github.com/block-vision/sui-go-sdk/models" - transaction "github.com/block-vision/sui-go-sdk/transaction" + bind "github.com/smartcontractkit/chainlink-sui/bindings/bind" + mock "github.com/stretchr/testify/mock" ) // IBoundContract is an autogenerated mock type for the IBoundContract type diff --git a/sdk/sui/mocks/feequoter/feequoterencoder.go b/sdk/sui/mocks/feequoter/feequoterencoder.go index 4b0d1472f..5eba3f506 100644 --- a/sdk/sui/mocks/feequoter/feequoterencoder.go +++ b/sdk/sui/mocks/feequoter/feequoterencoder.go @@ -6,9 +6,8 @@ import ( big "math/big" bind "github.com/smartcontractkit/chainlink-sui/bindings/bind" - mock "github.com/stretchr/testify/mock" - module_fee_quoter "github.com/smartcontractkit/chainlink-sui/bindings/generated/ccip/ccip/fee_quoter" + mock "github.com/stretchr/testify/mock" ) // FeeQuoterEncoder is an autogenerated mock type for the FeeQuoterEncoder type diff --git a/sdk/sui/mocks/mcms/imcms.go b/sdk/sui/mocks/mcms/imcms.go index 55ff6629e..2d1bb5c03 100644 --- a/sdk/sui/mocks/mcms/imcms.go +++ b/sdk/sui/mocks/mcms/imcms.go @@ -6,13 +6,10 @@ import ( context "context" big "math/big" - bind "github.com/smartcontractkit/chainlink-sui/bindings/bind" - - mock "github.com/stretchr/testify/mock" - models "github.com/block-vision/sui-go-sdk/models" - + bind "github.com/smartcontractkit/chainlink-sui/bindings/bind" module_mcms "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms" + mock "github.com/stretchr/testify/mock" ) // IMcms is an autogenerated mock type for the IMcms type diff --git a/sdk/sui/mocks/mcms/imcmsdevinspect.go b/sdk/sui/mocks/mcms/imcmsdevinspect.go index 59190724b..aabd60195 100644 --- a/sdk/sui/mocks/mcms/imcmsdevinspect.go +++ b/sdk/sui/mocks/mcms/imcmsdevinspect.go @@ -7,10 +7,8 @@ import ( big "math/big" bind "github.com/smartcontractkit/chainlink-sui/bindings/bind" - - mock "github.com/stretchr/testify/mock" - module_mcms "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms" + mock "github.com/stretchr/testify/mock" ) // IMcmsDevInspect is an autogenerated mock type for the IMcmsDevInspect type diff --git a/sdk/sui/mocks/mcms/mcmsencoder.go b/sdk/sui/mocks/mcms/mcmsencoder.go index dcf2be7ea..3d637b2e2 100644 --- a/sdk/sui/mocks/mcms/mcmsencoder.go +++ b/sdk/sui/mocks/mcms/mcmsencoder.go @@ -6,9 +6,8 @@ import ( big "math/big" bind "github.com/smartcontractkit/chainlink-sui/bindings/bind" - mock "github.com/stretchr/testify/mock" - module_mcms "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms" + mock "github.com/stretchr/testify/mock" ) // McmsEncoder is an autogenerated mock type for the McmsEncoder type diff --git a/sdk/sui/mocks/mcmsdeployer/imcmsdeployer.go b/sdk/sui/mocks/mcmsdeployer/imcmsdeployer.go index 40e6274aa..69a3c76fc 100644 --- a/sdk/sui/mocks/mcmsdeployer/imcmsdeployer.go +++ b/sdk/sui/mocks/mcmsdeployer/imcmsdeployer.go @@ -5,13 +5,10 @@ package mock_module_mcmsdeployer import ( context "context" - bind "github.com/smartcontractkit/chainlink-sui/bindings/bind" - - mock "github.com/stretchr/testify/mock" - models "github.com/block-vision/sui-go-sdk/models" - + bind "github.com/smartcontractkit/chainlink-sui/bindings/bind" module_mcms_deployer "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms_deployer" + mock "github.com/stretchr/testify/mock" ) // IMcmsDeployer is an autogenerated mock type for the IMcmsDeployer type diff --git a/sdk/sui/mocks/sui/bindingsclient.go b/sdk/sui/mocks/sui/bindingsclient.go index 23a1e780d..7427d5783 100644 --- a/sdk/sui/mocks/sui/bindingsclient.go +++ b/sdk/sui/mocks/sui/bindingsclient.go @@ -1,20 +1,19 @@ -// Code generated manually for BindingsClient gRPC migration. DO NOT EDIT. +// Code generated by mockery v2.53.5. DO NOT EDIT. package mock_sui import ( - "context" - "math/big" + context "context" + big "math/big" - suirpcv2 "github.com/block-vision/sui-go-sdk/pb/sui/rpc/v2" - suigosigner "github.com/block-vision/sui-go-sdk/signer" - "github.com/block-vision/sui-go-sdk/transaction" + v2 "github.com/block-vision/sui-go-sdk/pb/sui/rpc/v2" + signer "github.com/block-vision/sui-go-sdk/signer" + transaction "github.com/block-vision/sui-go-sdk/transaction" + client "github.com/smartcontractkit/chainlink-sui/relayer/client" mock "github.com/stretchr/testify/mock" - - "github.com/smartcontractkit/chainlink-sui/relayer/client" ) -// BindingsClient is a mock type for client.BindingsClient. +// BindingsClient is an autogenerated mock type for the BindingsClient type type BindingsClient struct { mock.Mock } @@ -27,130 +26,429 @@ func (_m *BindingsClient) EXPECT() *BindingsClient_Expecter { return &BindingsClient_Expecter{mock: &_m.Mock} } -func (_m *BindingsClient) ReadObjectId(ctx context.Context, objectId string) (*suirpcv2.Object, error) { - ret := _m.Called(ctx, objectId) +// FinishPTBAndSend provides a mock function with given fields: ctx, _a1, tx, requestType +func (_m *BindingsClient) FinishPTBAndSend(ctx context.Context, _a1 *signer.Signer, tx *transaction.Transaction, requestType client.TransactionRequestType) (*v2.ExecuteTransactionResponse, error) { + ret := _m.Called(ctx, _a1, tx, requestType) + if len(ret) == 0 { - panic("no return value specified for ReadObjectId") + panic("no return value specified for FinishPTBAndSend") } - var r0 *suirpcv2.Object + + var r0 *v2.ExecuteTransactionResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*suirpcv2.Object, error)); ok { - return rf(ctx, objectId) + if rf, ok := ret.Get(0).(func(context.Context, *signer.Signer, *transaction.Transaction, client.TransactionRequestType) (*v2.ExecuteTransactionResponse, error)); ok { + return rf(ctx, _a1, tx, requestType) } - if ret.Get(0) != nil { - r0 = ret.Get(0).(*suirpcv2.Object) + if rf, ok := ret.Get(0).(func(context.Context, *signer.Signer, *transaction.Transaction, client.TransactionRequestType) *v2.ExecuteTransactionResponse); ok { + r0 = rf(ctx, _a1, tx, requestType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v2.ExecuteTransactionResponse) + } } - r1 = ret.Error(1) - return r0, r1 -} -func (_m *BindingsClient) QueryCoinsByAddress(ctx context.Context, address string, coinType string) ([]*suirpcv2.Object, error) { - ret := _m.Called(ctx, address, coinType) - if len(ret) == 0 { - panic("no return value specified for QueryCoinsByAddress") - } - var r0 []*suirpcv2.Object - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]*suirpcv2.Object, error)); ok { - return rf(ctx, address, coinType) + if rf, ok := ret.Get(1).(func(context.Context, *signer.Signer, *transaction.Transaction, client.TransactionRequestType) error); ok { + r1 = rf(ctx, _a1, tx, requestType) + } else { + r1 = ret.Error(1) } - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*suirpcv2.Object) - } - r1 = ret.Error(1) + return r0, r1 } +// BindingsClient_FinishPTBAndSend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinishPTBAndSend' +type BindingsClient_FinishPTBAndSend_Call struct { + *mock.Call +} + +// FinishPTBAndSend is a helper method to define mock.On call +// - ctx context.Context +// - _a1 *signer.Signer +// - tx *transaction.Transaction +// - requestType client.TransactionRequestType +func (_e *BindingsClient_Expecter) FinishPTBAndSend(ctx interface{}, _a1 interface{}, tx interface{}, requestType interface{}) *BindingsClient_FinishPTBAndSend_Call { + return &BindingsClient_FinishPTBAndSend_Call{Call: _e.mock.On("FinishPTBAndSend", ctx, _a1, tx, requestType)} +} + +func (_c *BindingsClient_FinishPTBAndSend_Call) Run(run func(ctx context.Context, _a1 *signer.Signer, tx *transaction.Transaction, requestType client.TransactionRequestType)) *BindingsClient_FinishPTBAndSend_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*signer.Signer), args[2].(*transaction.Transaction), args[3].(client.TransactionRequestType)) + }) + return _c +} + +func (_c *BindingsClient_FinishPTBAndSend_Call) Return(_a0 *v2.ExecuteTransactionResponse, _a1 error) *BindingsClient_FinishPTBAndSend_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BindingsClient_FinishPTBAndSend_Call) RunAndReturn(run func(context.Context, *signer.Signer, *transaction.Transaction, client.TransactionRequestType) (*v2.ExecuteTransactionResponse, error)) *BindingsClient_FinishPTBAndSend_Call { + _c.Call.Return(run) + return _c +} + +// GetReferenceGasPrice provides a mock function with given fields: ctx func (_m *BindingsClient) GetReferenceGasPrice(ctx context.Context) (*big.Int, error) { ret := _m.Called(ctx) + if len(ret) == 0 { panic("no return value specified for GetReferenceGasPrice") } + var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { return rf(ctx) } - if ret.Get(0) != nil { - r0 = ret.Get(0).(*big.Int) + if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) } - r1 = ret.Error(1) + return r0, r1 } -func (_m *BindingsClient) SimulatePTB(ctx context.Context, bcsBytes []byte) ([]any, error) { - ret := _m.Called(ctx, bcsBytes) +// BindingsClient_GetReferenceGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetReferenceGasPrice' +type BindingsClient_GetReferenceGasPrice_Call struct { + *mock.Call +} + +// GetReferenceGasPrice is a helper method to define mock.On call +// - ctx context.Context +func (_e *BindingsClient_Expecter) GetReferenceGasPrice(ctx interface{}) *BindingsClient_GetReferenceGasPrice_Call { + return &BindingsClient_GetReferenceGasPrice_Call{Call: _e.mock.On("GetReferenceGasPrice", ctx)} +} + +func (_c *BindingsClient_GetReferenceGasPrice_Call) Run(run func(ctx context.Context)) *BindingsClient_GetReferenceGasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *BindingsClient_GetReferenceGasPrice_Call) Return(_a0 *big.Int, _a1 error) *BindingsClient_GetReferenceGasPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BindingsClient_GetReferenceGasPrice_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *BindingsClient_GetReferenceGasPrice_Call { + _c.Call.Return(run) + return _c +} + +// GetTransactionStatus provides a mock function with given fields: ctx, digest +func (_m *BindingsClient) GetTransactionStatus(ctx context.Context, digest string) (client.TransactionResult, error) { + ret := _m.Called(ctx, digest) + if len(ret) == 0 { - panic("no return value specified for SimulatePTB") + panic("no return value specified for GetTransactionStatus") } - var r0 []any + + var r0 client.TransactionResult var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []byte) ([]any, error)); ok { - return rf(ctx, bcsBytes) + if rf, ok := ret.Get(0).(func(context.Context, string) (client.TransactionResult, error)); ok { + return rf(ctx, digest) } - if ret.Get(0) != nil { - r0 = ret.Get(0).([]any) + if rf, ok := ret.Get(0).(func(context.Context, string) client.TransactionResult); ok { + r0 = rf(ctx, digest) + } else { + r0 = ret.Get(0).(client.TransactionResult) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, digest) + } else { + r1 = ret.Error(1) } - r1 = ret.Error(1) + return r0, r1 } -func (_m *BindingsClient) SendTransaction(ctx context.Context, req *suirpcv2.ExecuteTransactionRequest) (*suirpcv2.ExecuteTransactionResponse, error) { - ret := _m.Called(ctx, req) +// BindingsClient_GetTransactionStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransactionStatus' +type BindingsClient_GetTransactionStatus_Call struct { + *mock.Call +} + +// GetTransactionStatus is a helper method to define mock.On call +// - ctx context.Context +// - digest string +func (_e *BindingsClient_Expecter) GetTransactionStatus(ctx interface{}, digest interface{}) *BindingsClient_GetTransactionStatus_Call { + return &BindingsClient_GetTransactionStatus_Call{Call: _e.mock.On("GetTransactionStatus", ctx, digest)} +} + +func (_c *BindingsClient_GetTransactionStatus_Call) Run(run func(ctx context.Context, digest string)) *BindingsClient_GetTransactionStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *BindingsClient_GetTransactionStatus_Call) Return(_a0 client.TransactionResult, _a1 error) *BindingsClient_GetTransactionStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BindingsClient_GetTransactionStatus_Call) RunAndReturn(run func(context.Context, string) (client.TransactionResult, error)) *BindingsClient_GetTransactionStatus_Call { + _c.Call.Return(run) + return _c +} + +// QueryCoinsByAddress provides a mock function with given fields: ctx, address, coinType +func (_m *BindingsClient) QueryCoinsByAddress(ctx context.Context, address string, coinType string) ([]*v2.Object, error) { + ret := _m.Called(ctx, address, coinType) + if len(ret) == 0 { - panic("no return value specified for SendTransaction") + panic("no return value specified for QueryCoinsByAddress") } - var r0 *suirpcv2.ExecuteTransactionResponse + + var r0 []*v2.Object var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *suirpcv2.ExecuteTransactionRequest) (*suirpcv2.ExecuteTransactionResponse, error)); ok { - return rf(ctx, req) + if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]*v2.Object, error)); ok { + return rf(ctx, address, coinType) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) []*v2.Object); ok { + r0 = rf(ctx, address, coinType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v2.Object) + } } - if ret.Get(0) != nil { - r0 = ret.Get(0).(*suirpcv2.ExecuteTransactionResponse) + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, address, coinType) + } else { + r1 = ret.Error(1) } - r1 = ret.Error(1) + return r0, r1 } -func (_m *BindingsClient) GetTransactionStatus(ctx context.Context, digest string) (client.TransactionResult, error) { - ret := _m.Called(ctx, digest) +// BindingsClient_QueryCoinsByAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryCoinsByAddress' +type BindingsClient_QueryCoinsByAddress_Call struct { + *mock.Call +} + +// QueryCoinsByAddress is a helper method to define mock.On call +// - ctx context.Context +// - address string +// - coinType string +func (_e *BindingsClient_Expecter) QueryCoinsByAddress(ctx interface{}, address interface{}, coinType interface{}) *BindingsClient_QueryCoinsByAddress_Call { + return &BindingsClient_QueryCoinsByAddress_Call{Call: _e.mock.On("QueryCoinsByAddress", ctx, address, coinType)} +} + +func (_c *BindingsClient_QueryCoinsByAddress_Call) Run(run func(ctx context.Context, address string, coinType string)) *BindingsClient_QueryCoinsByAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *BindingsClient_QueryCoinsByAddress_Call) Return(_a0 []*v2.Object, _a1 error) *BindingsClient_QueryCoinsByAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BindingsClient_QueryCoinsByAddress_Call) RunAndReturn(run func(context.Context, string, string) ([]*v2.Object, error)) *BindingsClient_QueryCoinsByAddress_Call { + _c.Call.Return(run) + return _c +} + +// ReadObjectId provides a mock function with given fields: ctx, objectId +func (_m *BindingsClient) ReadObjectId(ctx context.Context, objectId string) (*v2.Object, error) { + ret := _m.Called(ctx, objectId) + if len(ret) == 0 { - panic("no return value specified for GetTransactionStatus") + panic("no return value specified for ReadObjectId") } - var r0 client.TransactionResult + + var r0 *v2.Object var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (client.TransactionResult, error)); ok { - return rf(ctx, digest) + if rf, ok := ret.Get(0).(func(context.Context, string) (*v2.Object, error)); ok { + return rf(ctx, objectId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *v2.Object); ok { + r0 = rf(ctx, objectId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v2.Object) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, objectId) + } else { + r1 = ret.Error(1) } - r0 = ret.Get(0).(client.TransactionResult) - r1 = ret.Error(1) + return r0, r1 } -func (_m *BindingsClient) FinishPTBAndSend(ctx context.Context, txnSigner *suigosigner.Signer, tx *transaction.Transaction, requestType client.TransactionRequestType) (*suirpcv2.ExecuteTransactionResponse, error) { - ret := _m.Called(ctx, txnSigner, tx, requestType) +// BindingsClient_ReadObjectId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadObjectId' +type BindingsClient_ReadObjectId_Call struct { + *mock.Call +} + +// ReadObjectId is a helper method to define mock.On call +// - ctx context.Context +// - objectId string +func (_e *BindingsClient_Expecter) ReadObjectId(ctx interface{}, objectId interface{}) *BindingsClient_ReadObjectId_Call { + return &BindingsClient_ReadObjectId_Call{Call: _e.mock.On("ReadObjectId", ctx, objectId)} +} + +func (_c *BindingsClient_ReadObjectId_Call) Run(run func(ctx context.Context, objectId string)) *BindingsClient_ReadObjectId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *BindingsClient_ReadObjectId_Call) Return(_a0 *v2.Object, _a1 error) *BindingsClient_ReadObjectId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BindingsClient_ReadObjectId_Call) RunAndReturn(run func(context.Context, string) (*v2.Object, error)) *BindingsClient_ReadObjectId_Call { + _c.Call.Return(run) + return _c +} + +// SendTransaction provides a mock function with given fields: ctx, req +func (_m *BindingsClient) SendTransaction(ctx context.Context, req *v2.ExecuteTransactionRequest) (*v2.ExecuteTransactionResponse, error) { + ret := _m.Called(ctx, req) + if len(ret) == 0 { - panic("no return value specified for FinishPTBAndSend") + panic("no return value specified for SendTransaction") } - var r0 *suirpcv2.ExecuteTransactionResponse + + var r0 *v2.ExecuteTransactionResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *suigosigner.Signer, *transaction.Transaction, client.TransactionRequestType) (*suirpcv2.ExecuteTransactionResponse, error)); ok { - return rf(ctx, txnSigner, tx, requestType) + if rf, ok := ret.Get(0).(func(context.Context, *v2.ExecuteTransactionRequest) (*v2.ExecuteTransactionResponse, error)); ok { + return rf(ctx, req) } - if ret.Get(0) != nil { - r0 = ret.Get(0).(*suirpcv2.ExecuteTransactionResponse) + if rf, ok := ret.Get(0).(func(context.Context, *v2.ExecuteTransactionRequest) *v2.ExecuteTransactionResponse); ok { + r0 = rf(ctx, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v2.ExecuteTransactionResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v2.ExecuteTransactionRequest) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) } - r1 = ret.Error(1) + return r0, r1 } -// NewBindingsClient creates a new instance of BindingsClient. +// BindingsClient_SendTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTransaction' +type BindingsClient_SendTransaction_Call struct { + *mock.Call +} + +// SendTransaction is a helper method to define mock.On call +// - ctx context.Context +// - req *v2.ExecuteTransactionRequest +func (_e *BindingsClient_Expecter) SendTransaction(ctx interface{}, req interface{}) *BindingsClient_SendTransaction_Call { + return &BindingsClient_SendTransaction_Call{Call: _e.mock.On("SendTransaction", ctx, req)} +} + +func (_c *BindingsClient_SendTransaction_Call) Run(run func(ctx context.Context, req *v2.ExecuteTransactionRequest)) *BindingsClient_SendTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*v2.ExecuteTransactionRequest)) + }) + return _c +} + +func (_c *BindingsClient_SendTransaction_Call) Return(_a0 *v2.ExecuteTransactionResponse, _a1 error) *BindingsClient_SendTransaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BindingsClient_SendTransaction_Call) RunAndReturn(run func(context.Context, *v2.ExecuteTransactionRequest) (*v2.ExecuteTransactionResponse, error)) *BindingsClient_SendTransaction_Call { + _c.Call.Return(run) + return _c +} + +// SimulatePTB provides a mock function with given fields: ctx, bcsBytes +func (_m *BindingsClient) SimulatePTB(ctx context.Context, bcsBytes []byte) ([]interface{}, error) { + ret := _m.Called(ctx, bcsBytes) + + if len(ret) == 0 { + panic("no return value specified for SimulatePTB") + } + + var r0 []interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []byte) ([]interface{}, error)); ok { + return rf(ctx, bcsBytes) + } + if rf, ok := ret.Get(0).(func(context.Context, []byte) []interface{}); ok { + r0 = rf(ctx, bcsBytes) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]interface{}) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, []byte) error); ok { + r1 = rf(ctx, bcsBytes) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BindingsClient_SimulatePTB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SimulatePTB' +type BindingsClient_SimulatePTB_Call struct { + *mock.Call +} + +// SimulatePTB is a helper method to define mock.On call +// - ctx context.Context +// - bcsBytes []byte +func (_e *BindingsClient_Expecter) SimulatePTB(ctx interface{}, bcsBytes interface{}) *BindingsClient_SimulatePTB_Call { + return &BindingsClient_SimulatePTB_Call{Call: _e.mock.On("SimulatePTB", ctx, bcsBytes)} +} + +func (_c *BindingsClient_SimulatePTB_Call) Run(run func(ctx context.Context, bcsBytes []byte)) *BindingsClient_SimulatePTB_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte)) + }) + return _c +} + +func (_c *BindingsClient_SimulatePTB_Call) Return(_a0 []interface{}, _a1 error) *BindingsClient_SimulatePTB_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BindingsClient_SimulatePTB_Call) RunAndReturn(run func(context.Context, []byte) ([]interface{}, error)) *BindingsClient_SimulatePTB_Call { + _c.Call.Return(run) + return _c +} + +// NewBindingsClient creates a new instance of BindingsClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. func NewBindingsClient(t interface { mock.TestingT Cleanup(func()) }) *BindingsClient { - mockClient := &BindingsClient{} - mockClient.Mock.Test(t) - t.Cleanup(func() { mockClient.AssertExpectations(t) }) - return mockClient + mock := &BindingsClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock } diff --git a/sdk/sui/mocks/sui/suiptbclient.go b/sdk/sui/mocks/sui/suiptbclient.go new file mode 100644 index 000000000..febac22ff --- /dev/null +++ b/sdk/sui/mocks/sui/suiptbclient.go @@ -0,0 +1,1979 @@ +// Code generated by mockery v2.53.5. DO NOT EDIT. + +package mock_sui + +import ( + context "context" + big "math/big" + + models "github.com/block-vision/sui-go-sdk/models" + v2 "github.com/block-vision/sui-go-sdk/pb/sui/rpc/v2" + signer "github.com/block-vision/sui-go-sdk/signer" + transaction "github.com/block-vision/sui-go-sdk/transaction" + cache "github.com/patrickmn/go-cache" + client "github.com/smartcontractkit/chainlink-sui/relayer/client" + mock "github.com/stretchr/testify/mock" +) + +// SuiPTBClient is an autogenerated mock type for the SuiPTBClient type +type SuiPTBClient struct { + mock.Mock +} + +type SuiPTBClient_Expecter struct { + mock *mock.Mock +} + +func (_m *SuiPTBClient) EXPECT() *SuiPTBClient_Expecter { + return &SuiPTBClient_Expecter{mock: &_m.Mock} +} + +// EstimateGas provides a mock function with given fields: ctx, tx +func (_m *SuiPTBClient) EstimateGas(ctx context.Context, tx *transaction.Transaction) (uint64, error) { + ret := _m.Called(ctx, tx) + + if len(ret) == 0 { + panic("no return value specified for EstimateGas") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *transaction.Transaction) (uint64, error)); ok { + return rf(ctx, tx) + } + if rf, ok := ret.Get(0).(func(context.Context, *transaction.Transaction) uint64); ok { + r0 = rf(ctx, tx) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(context.Context, *transaction.Transaction) error); ok { + r1 = rf(ctx, tx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_EstimateGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateGas' +type SuiPTBClient_EstimateGas_Call struct { + *mock.Call +} + +// EstimateGas is a helper method to define mock.On call +// - ctx context.Context +// - tx *transaction.Transaction +func (_e *SuiPTBClient_Expecter) EstimateGas(ctx interface{}, tx interface{}) *SuiPTBClient_EstimateGas_Call { + return &SuiPTBClient_EstimateGas_Call{Call: _e.mock.On("EstimateGas", ctx, tx)} +} + +func (_c *SuiPTBClient_EstimateGas_Call) Run(run func(ctx context.Context, tx *transaction.Transaction)) *SuiPTBClient_EstimateGas_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*transaction.Transaction)) + }) + return _c +} + +func (_c *SuiPTBClient_EstimateGas_Call) Return(_a0 uint64, _a1 error) *SuiPTBClient_EstimateGas_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_EstimateGas_Call) RunAndReturn(run func(context.Context, *transaction.Transaction) (uint64, error)) *SuiPTBClient_EstimateGas_Call { + _c.Call.Return(run) + return _c +} + +// FinishPTBAndSend provides a mock function with given fields: ctx, txnSigner, tx, requestType +func (_m *SuiPTBClient) FinishPTBAndSend(ctx context.Context, txnSigner *signer.Signer, tx *transaction.Transaction, requestType client.TransactionRequestType) (*v2.ExecuteTransactionResponse, error) { + ret := _m.Called(ctx, txnSigner, tx, requestType) + + if len(ret) == 0 { + panic("no return value specified for FinishPTBAndSend") + } + + var r0 *v2.ExecuteTransactionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *signer.Signer, *transaction.Transaction, client.TransactionRequestType) (*v2.ExecuteTransactionResponse, error)); ok { + return rf(ctx, txnSigner, tx, requestType) + } + if rf, ok := ret.Get(0).(func(context.Context, *signer.Signer, *transaction.Transaction, client.TransactionRequestType) *v2.ExecuteTransactionResponse); ok { + r0 = rf(ctx, txnSigner, tx, requestType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v2.ExecuteTransactionResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *signer.Signer, *transaction.Transaction, client.TransactionRequestType) error); ok { + r1 = rf(ctx, txnSigner, tx, requestType) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_FinishPTBAndSend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinishPTBAndSend' +type SuiPTBClient_FinishPTBAndSend_Call struct { + *mock.Call +} + +// FinishPTBAndSend is a helper method to define mock.On call +// - ctx context.Context +// - txnSigner *signer.Signer +// - tx *transaction.Transaction +// - requestType client.TransactionRequestType +func (_e *SuiPTBClient_Expecter) FinishPTBAndSend(ctx interface{}, txnSigner interface{}, tx interface{}, requestType interface{}) *SuiPTBClient_FinishPTBAndSend_Call { + return &SuiPTBClient_FinishPTBAndSend_Call{Call: _e.mock.On("FinishPTBAndSend", ctx, txnSigner, tx, requestType)} +} + +func (_c *SuiPTBClient_FinishPTBAndSend_Call) Run(run func(ctx context.Context, txnSigner *signer.Signer, tx *transaction.Transaction, requestType client.TransactionRequestType)) *SuiPTBClient_FinishPTBAndSend_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*signer.Signer), args[2].(*transaction.Transaction), args[3].(client.TransactionRequestType)) + }) + return _c +} + +func (_c *SuiPTBClient_FinishPTBAndSend_Call) Return(_a0 *v2.ExecuteTransactionResponse, _a1 error) *SuiPTBClient_FinishPTBAndSend_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_FinishPTBAndSend_Call) RunAndReturn(run func(context.Context, *signer.Signer, *transaction.Transaction, client.TransactionRequestType) (*v2.ExecuteTransactionResponse, error)) *SuiPTBClient_FinishPTBAndSend_Call { + _c.Call.Return(run) + return _c +} + +// GetBlockById provides a mock function with given fields: ctx, checkpointDigest +func (_m *SuiPTBClient) GetBlockById(ctx context.Context, checkpointDigest string) (*v2.Checkpoint, error) { + ret := _m.Called(ctx, checkpointDigest) + + if len(ret) == 0 { + panic("no return value specified for GetBlockById") + } + + var r0 *v2.Checkpoint + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*v2.Checkpoint, error)); ok { + return rf(ctx, checkpointDigest) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *v2.Checkpoint); ok { + r0 = rf(ctx, checkpointDigest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v2.Checkpoint) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, checkpointDigest) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetBlockById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockById' +type SuiPTBClient_GetBlockById_Call struct { + *mock.Call +} + +// GetBlockById is a helper method to define mock.On call +// - ctx context.Context +// - checkpointDigest string +func (_e *SuiPTBClient_Expecter) GetBlockById(ctx interface{}, checkpointDigest interface{}) *SuiPTBClient_GetBlockById_Call { + return &SuiPTBClient_GetBlockById_Call{Call: _e.mock.On("GetBlockById", ctx, checkpointDigest)} +} + +func (_c *SuiPTBClient_GetBlockById_Call) Run(run func(ctx context.Context, checkpointDigest string)) *SuiPTBClient_GetBlockById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetBlockById_Call) Return(_a0 *v2.Checkpoint, _a1 error) *SuiPTBClient_GetBlockById_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetBlockById_Call) RunAndReturn(run func(context.Context, string) (*v2.Checkpoint, error)) *SuiPTBClient_GetBlockById_Call { + _c.Call.Return(run) + return _c +} + +// GetCCIPPackageID provides a mock function with given fields: ctx, offRampPackageID +func (_m *SuiPTBClient) GetCCIPPackageID(ctx context.Context, offRampPackageID string) (string, error) { + ret := _m.Called(ctx, offRampPackageID) + + if len(ret) == 0 { + panic("no return value specified for GetCCIPPackageID") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, offRampPackageID) + } + if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { + r0 = rf(ctx, offRampPackageID) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, offRampPackageID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetCCIPPackageID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCCIPPackageID' +type SuiPTBClient_GetCCIPPackageID_Call struct { + *mock.Call +} + +// GetCCIPPackageID is a helper method to define mock.On call +// - ctx context.Context +// - offRampPackageID string +func (_e *SuiPTBClient_Expecter) GetCCIPPackageID(ctx interface{}, offRampPackageID interface{}) *SuiPTBClient_GetCCIPPackageID_Call { + return &SuiPTBClient_GetCCIPPackageID_Call{Call: _e.mock.On("GetCCIPPackageID", ctx, offRampPackageID)} +} + +func (_c *SuiPTBClient_GetCCIPPackageID_Call) Run(run func(ctx context.Context, offRampPackageID string)) *SuiPTBClient_GetCCIPPackageID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetCCIPPackageID_Call) Return(_a0 string, _a1 error) *SuiPTBClient_GetCCIPPackageID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetCCIPPackageID_Call) RunAndReturn(run func(context.Context, string) (string, error)) *SuiPTBClient_GetCCIPPackageID_Call { + _c.Call.Return(run) + return _c +} + +// GetCache provides a mock function with no fields +func (_m *SuiPTBClient) GetCache() *cache.Cache { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetCache") + } + + var r0 *cache.Cache + if rf, ok := ret.Get(0).(func() *cache.Cache); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cache.Cache) + } + } + + return r0 +} + +// SuiPTBClient_GetCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCache' +type SuiPTBClient_GetCache_Call struct { + *mock.Call +} + +// GetCache is a helper method to define mock.On call +func (_e *SuiPTBClient_Expecter) GetCache() *SuiPTBClient_GetCache_Call { + return &SuiPTBClient_GetCache_Call{Call: _e.mock.On("GetCache")} +} + +func (_c *SuiPTBClient_GetCache_Call) Run(run func()) *SuiPTBClient_GetCache_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SuiPTBClient_GetCache_Call) Return(_a0 *cache.Cache) *SuiPTBClient_GetCache_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SuiPTBClient_GetCache_Call) RunAndReturn(run func() *cache.Cache) *SuiPTBClient_GetCache_Call { + _c.Call.Return(run) + return _c +} + +// GetCachedValue provides a mock function with given fields: key +func (_m *SuiPTBClient) GetCachedValue(key string) (interface{}, bool) { + ret := _m.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetCachedValue") + } + + var r0 interface{} + var r1 bool + if rf, ok := ret.Get(0).(func(string) (interface{}, bool)); ok { + return rf(key) + } + if rf, ok := ret.Get(0).(func(string) interface{}); ok { + r0 = rf(key) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + + if rf, ok := ret.Get(1).(func(string) bool); ok { + r1 = rf(key) + } else { + r1 = ret.Get(1).(bool) + } + + return r0, r1 +} + +// SuiPTBClient_GetCachedValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCachedValue' +type SuiPTBClient_GetCachedValue_Call struct { + *mock.Call +} + +// GetCachedValue is a helper method to define mock.On call +// - key string +func (_e *SuiPTBClient_Expecter) GetCachedValue(key interface{}) *SuiPTBClient_GetCachedValue_Call { + return &SuiPTBClient_GetCachedValue_Call{Call: _e.mock.On("GetCachedValue", key)} +} + +func (_c *SuiPTBClient_GetCachedValue_Call) Run(run func(key string)) *SuiPTBClient_GetCachedValue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetCachedValue_Call) Return(_a0 interface{}, _a1 bool) *SuiPTBClient_GetCachedValue_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetCachedValue_Call) RunAndReturn(run func(string) (interface{}, bool)) *SuiPTBClient_GetCachedValue_Call { + _c.Call.Return(run) + return _c +} + +// GetCachedValues provides a mock function with given fields: keys +func (_m *SuiPTBClient) GetCachedValues(keys []string) (map[string]interface{}, bool) { + ret := _m.Called(keys) + + if len(ret) == 0 { + panic("no return value specified for GetCachedValues") + } + + var r0 map[string]interface{} + var r1 bool + if rf, ok := ret.Get(0).(func([]string) (map[string]interface{}, bool)); ok { + return rf(keys) + } + if rf, ok := ret.Get(0).(func([]string) map[string]interface{}); ok { + r0 = rf(keys) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]interface{}) + } + } + + if rf, ok := ret.Get(1).(func([]string) bool); ok { + r1 = rf(keys) + } else { + r1 = ret.Get(1).(bool) + } + + return r0, r1 +} + +// SuiPTBClient_GetCachedValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCachedValues' +type SuiPTBClient_GetCachedValues_Call struct { + *mock.Call +} + +// GetCachedValues is a helper method to define mock.On call +// - keys []string +func (_e *SuiPTBClient_Expecter) GetCachedValues(keys interface{}) *SuiPTBClient_GetCachedValues_Call { + return &SuiPTBClient_GetCachedValues_Call{Call: _e.mock.On("GetCachedValues", keys)} +} + +func (_c *SuiPTBClient_GetCachedValues_Call) Run(run func(keys []string)) *SuiPTBClient_GetCachedValues_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetCachedValues_Call) Return(_a0 map[string]interface{}, _a1 bool) *SuiPTBClient_GetCachedValues_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetCachedValues_Call) RunAndReturn(run func([]string) (map[string]interface{}, bool)) *SuiPTBClient_GetCachedValues_Call { + _c.Call.Return(run) + return _c +} + +// GetCheckpointData provides a mock function with given fields: ctx, checkpointSequenceNumber +func (_m *SuiPTBClient) GetCheckpointData(ctx context.Context, checkpointSequenceNumber uint64) (*client.CheckpointData, error) { + ret := _m.Called(ctx, checkpointSequenceNumber) + + if len(ret) == 0 { + panic("no return value specified for GetCheckpointData") + } + + var r0 *client.CheckpointData + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (*client.CheckpointData, error)); ok { + return rf(ctx, checkpointSequenceNumber) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64) *client.CheckpointData); ok { + r0 = rf(ctx, checkpointSequenceNumber) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*client.CheckpointData) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { + r1 = rf(ctx, checkpointSequenceNumber) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetCheckpointData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCheckpointData' +type SuiPTBClient_GetCheckpointData_Call struct { + *mock.Call +} + +// GetCheckpointData is a helper method to define mock.On call +// - ctx context.Context +// - checkpointSequenceNumber uint64 +func (_e *SuiPTBClient_Expecter) GetCheckpointData(ctx interface{}, checkpointSequenceNumber interface{}) *SuiPTBClient_GetCheckpointData_Call { + return &SuiPTBClient_GetCheckpointData_Call{Call: _e.mock.On("GetCheckpointData", ctx, checkpointSequenceNumber)} +} + +func (_c *SuiPTBClient_GetCheckpointData_Call) Run(run func(ctx context.Context, checkpointSequenceNumber uint64)) *SuiPTBClient_GetCheckpointData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *SuiPTBClient_GetCheckpointData_Call) Return(_a0 *client.CheckpointData, _a1 error) *SuiPTBClient_GetCheckpointData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetCheckpointData_Call) RunAndReturn(run func(context.Context, uint64) (*client.CheckpointData, error)) *SuiPTBClient_GetCheckpointData_Call { + _c.Call.Return(run) + return _c +} + +// GetCoinMetadata provides a mock function with given fields: ctx, coinType +func (_m *SuiPTBClient) GetCoinMetadata(ctx context.Context, coinType string) (models.CoinMetadataResponse, error) { + ret := _m.Called(ctx, coinType) + + if len(ret) == 0 { + panic("no return value specified for GetCoinMetadata") + } + + var r0 models.CoinMetadataResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (models.CoinMetadataResponse, error)); ok { + return rf(ctx, coinType) + } + if rf, ok := ret.Get(0).(func(context.Context, string) models.CoinMetadataResponse); ok { + r0 = rf(ctx, coinType) + } else { + r0 = ret.Get(0).(models.CoinMetadataResponse) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, coinType) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetCoinMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCoinMetadata' +type SuiPTBClient_GetCoinMetadata_Call struct { + *mock.Call +} + +// GetCoinMetadata is a helper method to define mock.On call +// - ctx context.Context +// - coinType string +func (_e *SuiPTBClient_Expecter) GetCoinMetadata(ctx interface{}, coinType interface{}) *SuiPTBClient_GetCoinMetadata_Call { + return &SuiPTBClient_GetCoinMetadata_Call{Call: _e.mock.On("GetCoinMetadata", ctx, coinType)} +} + +func (_c *SuiPTBClient_GetCoinMetadata_Call) Run(run func(ctx context.Context, coinType string)) *SuiPTBClient_GetCoinMetadata_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetCoinMetadata_Call) Return(_a0 models.CoinMetadataResponse, _a1 error) *SuiPTBClient_GetCoinMetadata_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetCoinMetadata_Call) RunAndReturn(run func(context.Context, string) (models.CoinMetadataResponse, error)) *SuiPTBClient_GetCoinMetadata_Call { + _c.Call.Return(run) + return _c +} + +// GetCoinsByAddress provides a mock function with given fields: ctx, address +func (_m *SuiPTBClient) GetCoinsByAddress(ctx context.Context, address string) ([]*v2.Object, error) { + ret := _m.Called(ctx, address) + + if len(ret) == 0 { + panic("no return value specified for GetCoinsByAddress") + } + + var r0 []*v2.Object + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) ([]*v2.Object, error)); ok { + return rf(ctx, address) + } + if rf, ok := ret.Get(0).(func(context.Context, string) []*v2.Object); ok { + r0 = rf(ctx, address) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v2.Object) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, address) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetCoinsByAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCoinsByAddress' +type SuiPTBClient_GetCoinsByAddress_Call struct { + *mock.Call +} + +// GetCoinsByAddress is a helper method to define mock.On call +// - ctx context.Context +// - address string +func (_e *SuiPTBClient_Expecter) GetCoinsByAddress(ctx interface{}, address interface{}) *SuiPTBClient_GetCoinsByAddress_Call { + return &SuiPTBClient_GetCoinsByAddress_Call{Call: _e.mock.On("GetCoinsByAddress", ctx, address)} +} + +func (_c *SuiPTBClient_GetCoinsByAddress_Call) Run(run func(ctx context.Context, address string)) *SuiPTBClient_GetCoinsByAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetCoinsByAddress_Call) Return(_a0 []*v2.Object, _a1 error) *SuiPTBClient_GetCoinsByAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetCoinsByAddress_Call) RunAndReturn(run func(context.Context, string) ([]*v2.Object, error)) *SuiPTBClient_GetCoinsByAddress_Call { + _c.Call.Return(run) + return _c +} + +// GetLatestCheckpoint provides a mock function with given fields: ctx +func (_m *SuiPTBClient) GetLatestCheckpoint(ctx context.Context) (*v2.Checkpoint, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetLatestCheckpoint") + } + + var r0 *v2.Checkpoint + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*v2.Checkpoint, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *v2.Checkpoint); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v2.Checkpoint) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetLatestCheckpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestCheckpoint' +type SuiPTBClient_GetLatestCheckpoint_Call struct { + *mock.Call +} + +// GetLatestCheckpoint is a helper method to define mock.On call +// - ctx context.Context +func (_e *SuiPTBClient_Expecter) GetLatestCheckpoint(ctx interface{}) *SuiPTBClient_GetLatestCheckpoint_Call { + return &SuiPTBClient_GetLatestCheckpoint_Call{Call: _e.mock.On("GetLatestCheckpoint", ctx)} +} + +func (_c *SuiPTBClient_GetLatestCheckpoint_Call) Run(run func(ctx context.Context)) *SuiPTBClient_GetLatestCheckpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *SuiPTBClient_GetLatestCheckpoint_Call) Return(_a0 *v2.Checkpoint, _a1 error) *SuiPTBClient_GetLatestCheckpoint_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetLatestCheckpoint_Call) RunAndReturn(run func(context.Context) (*v2.Checkpoint, error)) *SuiPTBClient_GetLatestCheckpoint_Call { + _c.Call.Return(run) + return _c +} + +// GetLatestEpoch provides a mock function with given fields: ctx +func (_m *SuiPTBClient) GetLatestEpoch(ctx context.Context) (*v2.Epoch, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetLatestEpoch") + } + + var r0 *v2.Epoch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*v2.Epoch, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *v2.Epoch); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v2.Epoch) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetLatestEpoch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestEpoch' +type SuiPTBClient_GetLatestEpoch_Call struct { + *mock.Call +} + +// GetLatestEpoch is a helper method to define mock.On call +// - ctx context.Context +func (_e *SuiPTBClient_Expecter) GetLatestEpoch(ctx interface{}) *SuiPTBClient_GetLatestEpoch_Call { + return &SuiPTBClient_GetLatestEpoch_Call{Call: _e.mock.On("GetLatestEpoch", ctx)} +} + +func (_c *SuiPTBClient_GetLatestEpoch_Call) Run(run func(ctx context.Context)) *SuiPTBClient_GetLatestEpoch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *SuiPTBClient_GetLatestEpoch_Call) Return(_a0 *v2.Epoch, _a1 error) *SuiPTBClient_GetLatestEpoch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetLatestEpoch_Call) RunAndReturn(run func(context.Context) (*v2.Epoch, error)) *SuiPTBClient_GetLatestEpoch_Call { + _c.Call.Return(run) + return _c +} + +// GetLatestPackageId provides a mock function with given fields: ctx, packageId, module +func (_m *SuiPTBClient) GetLatestPackageId(ctx context.Context, packageId string, module string) (string, error) { + ret := _m.Called(ctx, packageId, module) + + if len(ret) == 0 { + panic("no return value specified for GetLatestPackageId") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok { + return rf(ctx, packageId, module) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) string); ok { + r0 = rf(ctx, packageId, module) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, packageId, module) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetLatestPackageId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestPackageId' +type SuiPTBClient_GetLatestPackageId_Call struct { + *mock.Call +} + +// GetLatestPackageId is a helper method to define mock.On call +// - ctx context.Context +// - packageId string +// - module string +func (_e *SuiPTBClient_Expecter) GetLatestPackageId(ctx interface{}, packageId interface{}, module interface{}) *SuiPTBClient_GetLatestPackageId_Call { + return &SuiPTBClient_GetLatestPackageId_Call{Call: _e.mock.On("GetLatestPackageId", ctx, packageId, module)} +} + +func (_c *SuiPTBClient_GetLatestPackageId_Call) Run(run func(ctx context.Context, packageId string, module string)) *SuiPTBClient_GetLatestPackageId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetLatestPackageId_Call) Return(_a0 string, _a1 error) *SuiPTBClient_GetLatestPackageId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetLatestPackageId_Call) RunAndReturn(run func(context.Context, string, string) (string, error)) *SuiPTBClient_GetLatestPackageId_Call { + _c.Call.Return(run) + return _c +} + +// GetNormalizedModule provides a mock function with given fields: ctx, packageId, moduleId +func (_m *SuiPTBClient) GetNormalizedModule(ctx context.Context, packageId string, moduleId string) (models.GetNormalizedMoveModuleResponse, error) { + ret := _m.Called(ctx, packageId, moduleId) + + if len(ret) == 0 { + panic("no return value specified for GetNormalizedModule") + } + + var r0 models.GetNormalizedMoveModuleResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (models.GetNormalizedMoveModuleResponse, error)); ok { + return rf(ctx, packageId, moduleId) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) models.GetNormalizedMoveModuleResponse); ok { + r0 = rf(ctx, packageId, moduleId) + } else { + r0 = ret.Get(0).(models.GetNormalizedMoveModuleResponse) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, packageId, moduleId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetNormalizedModule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNormalizedModule' +type SuiPTBClient_GetNormalizedModule_Call struct { + *mock.Call +} + +// GetNormalizedModule is a helper method to define mock.On call +// - ctx context.Context +// - packageId string +// - moduleId string +func (_e *SuiPTBClient_Expecter) GetNormalizedModule(ctx interface{}, packageId interface{}, moduleId interface{}) *SuiPTBClient_GetNormalizedModule_Call { + return &SuiPTBClient_GetNormalizedModule_Call{Call: _e.mock.On("GetNormalizedModule", ctx, packageId, moduleId)} +} + +func (_c *SuiPTBClient_GetNormalizedModule_Call) Run(run func(ctx context.Context, packageId string, moduleId string)) *SuiPTBClient_GetNormalizedModule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetNormalizedModule_Call) Return(_a0 models.GetNormalizedMoveModuleResponse, _a1 error) *SuiPTBClient_GetNormalizedModule_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetNormalizedModule_Call) RunAndReturn(run func(context.Context, string, string) (models.GetNormalizedMoveModuleResponse, error)) *SuiPTBClient_GetNormalizedModule_Call { + _c.Call.Return(run) + return _c +} + +// GetParentObjectID provides a mock function with given fields: ctx, packageID, moduleID, pointerObjectName +func (_m *SuiPTBClient) GetParentObjectID(ctx context.Context, packageID string, moduleID string, pointerObjectName string) (string, error) { + ret := _m.Called(ctx, packageID, moduleID, pointerObjectName) + + if len(ret) == 0 { + panic("no return value specified for GetParentObjectID") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (string, error)); ok { + return rf(ctx, packageID, moduleID, pointerObjectName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) string); ok { + r0 = rf(ctx, packageID, moduleID, pointerObjectName) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { + r1 = rf(ctx, packageID, moduleID, pointerObjectName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetParentObjectID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentObjectID' +type SuiPTBClient_GetParentObjectID_Call struct { + *mock.Call +} + +// GetParentObjectID is a helper method to define mock.On call +// - ctx context.Context +// - packageID string +// - moduleID string +// - pointerObjectName string +func (_e *SuiPTBClient_Expecter) GetParentObjectID(ctx interface{}, packageID interface{}, moduleID interface{}, pointerObjectName interface{}) *SuiPTBClient_GetParentObjectID_Call { + return &SuiPTBClient_GetParentObjectID_Call{Call: _e.mock.On("GetParentObjectID", ctx, packageID, moduleID, pointerObjectName)} +} + +func (_c *SuiPTBClient_GetParentObjectID_Call) Run(run func(ctx context.Context, packageID string, moduleID string, pointerObjectName string)) *SuiPTBClient_GetParentObjectID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetParentObjectID_Call) Return(_a0 string, _a1 error) *SuiPTBClient_GetParentObjectID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetParentObjectID_Call) RunAndReturn(run func(context.Context, string, string, string) (string, error)) *SuiPTBClient_GetParentObjectID_Call { + _c.Call.Return(run) + return _c +} + +// GetReferenceGasPrice provides a mock function with given fields: ctx +func (_m *SuiPTBClient) GetReferenceGasPrice(ctx context.Context) (*big.Int, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetReferenceGasPrice") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetReferenceGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetReferenceGasPrice' +type SuiPTBClient_GetReferenceGasPrice_Call struct { + *mock.Call +} + +// GetReferenceGasPrice is a helper method to define mock.On call +// - ctx context.Context +func (_e *SuiPTBClient_Expecter) GetReferenceGasPrice(ctx interface{}) *SuiPTBClient_GetReferenceGasPrice_Call { + return &SuiPTBClient_GetReferenceGasPrice_Call{Call: _e.mock.On("GetReferenceGasPrice", ctx)} +} + +func (_c *SuiPTBClient_GetReferenceGasPrice_Call) Run(run func(ctx context.Context)) *SuiPTBClient_GetReferenceGasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *SuiPTBClient_GetReferenceGasPrice_Call) Return(_a0 *big.Int, _a1 error) *SuiPTBClient_GetReferenceGasPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetReferenceGasPrice_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *SuiPTBClient_GetReferenceGasPrice_Call { + _c.Call.Return(run) + return _c +} + +// GetSUIBalance provides a mock function with given fields: ctx, address +func (_m *SuiPTBClient) GetSUIBalance(ctx context.Context, address string) (*v2.Balance, error) { + ret := _m.Called(ctx, address) + + if len(ret) == 0 { + panic("no return value specified for GetSUIBalance") + } + + var r0 *v2.Balance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*v2.Balance, error)); ok { + return rf(ctx, address) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *v2.Balance); ok { + r0 = rf(ctx, address) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v2.Balance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, address) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetSUIBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSUIBalance' +type SuiPTBClient_GetSUIBalance_Call struct { + *mock.Call +} + +// GetSUIBalance is a helper method to define mock.On call +// - ctx context.Context +// - address string +func (_e *SuiPTBClient_Expecter) GetSUIBalance(ctx interface{}, address interface{}) *SuiPTBClient_GetSUIBalance_Call { + return &SuiPTBClient_GetSUIBalance_Call{Call: _e.mock.On("GetSUIBalance", ctx, address)} +} + +func (_c *SuiPTBClient_GetSUIBalance_Call) Run(run func(ctx context.Context, address string)) *SuiPTBClient_GetSUIBalance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetSUIBalance_Call) Return(_a0 *v2.Balance, _a1 error) *SuiPTBClient_GetSUIBalance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetSUIBalance_Call) RunAndReturn(run func(context.Context, string) (*v2.Balance, error)) *SuiPTBClient_GetSUIBalance_Call { + _c.Call.Return(run) + return _c +} + +// GetTransactionStatus provides a mock function with given fields: ctx, digest +func (_m *SuiPTBClient) GetTransactionStatus(ctx context.Context, digest string) (client.TransactionResult, error) { + ret := _m.Called(ctx, digest) + + if len(ret) == 0 { + panic("no return value specified for GetTransactionStatus") + } + + var r0 client.TransactionResult + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (client.TransactionResult, error)); ok { + return rf(ctx, digest) + } + if rf, ok := ret.Get(0).(func(context.Context, string) client.TransactionResult); ok { + r0 = rf(ctx, digest) + } else { + r0 = ret.Get(0).(client.TransactionResult) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, digest) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetTransactionStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransactionStatus' +type SuiPTBClient_GetTransactionStatus_Call struct { + *mock.Call +} + +// GetTransactionStatus is a helper method to define mock.On call +// - ctx context.Context +// - digest string +func (_e *SuiPTBClient_Expecter) GetTransactionStatus(ctx interface{}, digest interface{}) *SuiPTBClient_GetTransactionStatus_Call { + return &SuiPTBClient_GetTransactionStatus_Call{Call: _e.mock.On("GetTransactionStatus", ctx, digest)} +} + +func (_c *SuiPTBClient_GetTransactionStatus_Call) Run(run func(ctx context.Context, digest string)) *SuiPTBClient_GetTransactionStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetTransactionStatus_Call) Return(_a0 client.TransactionResult, _a1 error) *SuiPTBClient_GetTransactionStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetTransactionStatus_Call) RunAndReturn(run func(context.Context, string) (client.TransactionResult, error)) *SuiPTBClient_GetTransactionStatus_Call { + _c.Call.Return(run) + return _c +} + +// GetValuesFromPackageOwnedObjectField provides a mock function with given fields: ctx, packageID, moduleID, objectName, fieldKeys +func (_m *SuiPTBClient) GetValuesFromPackageOwnedObjectField(ctx context.Context, packageID string, moduleID string, objectName string, fieldKeys []string) (map[string]string, error) { + ret := _m.Called(ctx, packageID, moduleID, objectName, fieldKeys) + + if len(ret) == 0 { + panic("no return value specified for GetValuesFromPackageOwnedObjectField") + } + + var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, []string) (map[string]string, error)); ok { + return rf(ctx, packageID, moduleID, objectName, fieldKeys) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, []string) map[string]string); ok { + r0 = rf(ctx, packageID, moduleID, objectName, fieldKeys) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, []string) error); ok { + r1 = rf(ctx, packageID, moduleID, objectName, fieldKeys) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_GetValuesFromPackageOwnedObjectField_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValuesFromPackageOwnedObjectField' +type SuiPTBClient_GetValuesFromPackageOwnedObjectField_Call struct { + *mock.Call +} + +// GetValuesFromPackageOwnedObjectField is a helper method to define mock.On call +// - ctx context.Context +// - packageID string +// - moduleID string +// - objectName string +// - fieldKeys []string +func (_e *SuiPTBClient_Expecter) GetValuesFromPackageOwnedObjectField(ctx interface{}, packageID interface{}, moduleID interface{}, objectName interface{}, fieldKeys interface{}) *SuiPTBClient_GetValuesFromPackageOwnedObjectField_Call { + return &SuiPTBClient_GetValuesFromPackageOwnedObjectField_Call{Call: _e.mock.On("GetValuesFromPackageOwnedObjectField", ctx, packageID, moduleID, objectName, fieldKeys)} +} + +func (_c *SuiPTBClient_GetValuesFromPackageOwnedObjectField_Call) Run(run func(ctx context.Context, packageID string, moduleID string, objectName string, fieldKeys []string)) *SuiPTBClient_GetValuesFromPackageOwnedObjectField_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].([]string)) + }) + return _c +} + +func (_c *SuiPTBClient_GetValuesFromPackageOwnedObjectField_Call) Return(_a0 map[string]string, _a1 error) *SuiPTBClient_GetValuesFromPackageOwnedObjectField_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_GetValuesFromPackageOwnedObjectField_Call) RunAndReturn(run func(context.Context, string, string, string, []string) (map[string]string, error)) *SuiPTBClient_GetValuesFromPackageOwnedObjectField_Call { + _c.Call.Return(run) + return _c +} + +// HashTxBytes provides a mock function with given fields: txBytes +func (_m *SuiPTBClient) HashTxBytes(txBytes []byte) []byte { + ret := _m.Called(txBytes) + + if len(ret) == 0 { + panic("no return value specified for HashTxBytes") + } + + var r0 []byte + if rf, ok := ret.Get(0).(func([]byte) []byte); ok { + r0 = rf(txBytes) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + return r0 +} + +// SuiPTBClient_HashTxBytes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTxBytes' +type SuiPTBClient_HashTxBytes_Call struct { + *mock.Call +} + +// HashTxBytes is a helper method to define mock.On call +// - txBytes []byte +func (_e *SuiPTBClient_Expecter) HashTxBytes(txBytes interface{}) *SuiPTBClient_HashTxBytes_Call { + return &SuiPTBClient_HashTxBytes_Call{Call: _e.mock.On("HashTxBytes", txBytes)} +} + +func (_c *SuiPTBClient_HashTxBytes_Call) Run(run func(txBytes []byte)) *SuiPTBClient_HashTxBytes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *SuiPTBClient_HashTxBytes_Call) Return(_a0 []byte) *SuiPTBClient_HashTxBytes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SuiPTBClient_HashTxBytes_Call) RunAndReturn(run func([]byte) []byte) *SuiPTBClient_HashTxBytes_Call { + _c.Call.Return(run) + return _c +} + +// LoadModulePackageIds provides a mock function with given fields: ctx, packageId, module +func (_m *SuiPTBClient) LoadModulePackageIds(ctx context.Context, packageId string, module string) ([]string, error) { + ret := _m.Called(ctx, packageId, module) + + if len(ret) == 0 { + panic("no return value specified for LoadModulePackageIds") + } + + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]string, error)); ok { + return rf(ctx, packageId, module) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) []string); ok { + r0 = rf(ctx, packageId, module) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, packageId, module) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_LoadModulePackageIds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadModulePackageIds' +type SuiPTBClient_LoadModulePackageIds_Call struct { + *mock.Call +} + +// LoadModulePackageIds is a helper method to define mock.On call +// - ctx context.Context +// - packageId string +// - module string +func (_e *SuiPTBClient_Expecter) LoadModulePackageIds(ctx interface{}, packageId interface{}, module interface{}) *SuiPTBClient_LoadModulePackageIds_Call { + return &SuiPTBClient_LoadModulePackageIds_Call{Call: _e.mock.On("LoadModulePackageIds", ctx, packageId, module)} +} + +func (_c *SuiPTBClient_LoadModulePackageIds_Call) Run(run func(ctx context.Context, packageId string, module string)) *SuiPTBClient_LoadModulePackageIds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_LoadModulePackageIds_Call) Return(_a0 []string, _a1 error) *SuiPTBClient_LoadModulePackageIds_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_LoadModulePackageIds_Call) RunAndReturn(run func(context.Context, string, string) ([]string, error)) *SuiPTBClient_LoadModulePackageIds_Call { + _c.Call.Return(run) + return _c +} + +// MoveCall provides a mock function with given fields: ctx, req +func (_m *SuiPTBClient) MoveCall(ctx context.Context, req client.MoveCallRequest) (client.TxnMetaData, error) { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for MoveCall") + } + + var r0 client.TxnMetaData + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, client.MoveCallRequest) (client.TxnMetaData, error)); ok { + return rf(ctx, req) + } + if rf, ok := ret.Get(0).(func(context.Context, client.MoveCallRequest) client.TxnMetaData); ok { + r0 = rf(ctx, req) + } else { + r0 = ret.Get(0).(client.TxnMetaData) + } + + if rf, ok := ret.Get(1).(func(context.Context, client.MoveCallRequest) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_MoveCall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MoveCall' +type SuiPTBClient_MoveCall_Call struct { + *mock.Call +} + +// MoveCall is a helper method to define mock.On call +// - ctx context.Context +// - req client.MoveCallRequest +func (_e *SuiPTBClient_Expecter) MoveCall(ctx interface{}, req interface{}) *SuiPTBClient_MoveCall_Call { + return &SuiPTBClient_MoveCall_Call{Call: _e.mock.On("MoveCall", ctx, req)} +} + +func (_c *SuiPTBClient_MoveCall_Call) Run(run func(ctx context.Context, req client.MoveCallRequest)) *SuiPTBClient_MoveCall_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(client.MoveCallRequest)) + }) + return _c +} + +func (_c *SuiPTBClient_MoveCall_Call) Return(_a0 client.TxnMetaData, _a1 error) *SuiPTBClient_MoveCall_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_MoveCall_Call) RunAndReturn(run func(context.Context, client.MoveCallRequest) (client.TxnMetaData, error)) *SuiPTBClient_MoveCall_Call { + _c.Call.Return(run) + return _c +} + +// QueryCoinsByAddress provides a mock function with given fields: ctx, address, coinType +func (_m *SuiPTBClient) QueryCoinsByAddress(ctx context.Context, address string, coinType string) ([]*v2.Object, error) { + ret := _m.Called(ctx, address, coinType) + + if len(ret) == 0 { + panic("no return value specified for QueryCoinsByAddress") + } + + var r0 []*v2.Object + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]*v2.Object, error)); ok { + return rf(ctx, address, coinType) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) []*v2.Object); ok { + r0 = rf(ctx, address, coinType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v2.Object) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, address, coinType) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_QueryCoinsByAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryCoinsByAddress' +type SuiPTBClient_QueryCoinsByAddress_Call struct { + *mock.Call +} + +// QueryCoinsByAddress is a helper method to define mock.On call +// - ctx context.Context +// - address string +// - coinType string +func (_e *SuiPTBClient_Expecter) QueryCoinsByAddress(ctx interface{}, address interface{}, coinType interface{}) *SuiPTBClient_QueryCoinsByAddress_Call { + return &SuiPTBClient_QueryCoinsByAddress_Call{Call: _e.mock.On("QueryCoinsByAddress", ctx, address, coinType)} +} + +func (_c *SuiPTBClient_QueryCoinsByAddress_Call) Run(run func(ctx context.Context, address string, coinType string)) *SuiPTBClient_QueryCoinsByAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_QueryCoinsByAddress_Call) Return(_a0 []*v2.Object, _a1 error) *SuiPTBClient_QueryCoinsByAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_QueryCoinsByAddress_Call) RunAndReturn(run func(context.Context, string, string) ([]*v2.Object, error)) *SuiPTBClient_QueryCoinsByAddress_Call { + _c.Call.Return(run) + return _c +} + +// QueryEvents provides a mock function with given fields: ctx, filter, limit, cursor, sortOptions +func (_m *SuiPTBClient) QueryEvents(ctx context.Context, filter client.EventFilterByMoveEventModule, limit *uint, cursor *client.EventId, sortOptions *client.QuerySortOptions) (*models.PaginatedEventsResponse, error) { + ret := _m.Called(ctx, filter, limit, cursor, sortOptions) + + if len(ret) == 0 { + panic("no return value specified for QueryEvents") + } + + var r0 *models.PaginatedEventsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, client.EventFilterByMoveEventModule, *uint, *client.EventId, *client.QuerySortOptions) (*models.PaginatedEventsResponse, error)); ok { + return rf(ctx, filter, limit, cursor, sortOptions) + } + if rf, ok := ret.Get(0).(func(context.Context, client.EventFilterByMoveEventModule, *uint, *client.EventId, *client.QuerySortOptions) *models.PaginatedEventsResponse); ok { + r0 = rf(ctx, filter, limit, cursor, sortOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*models.PaginatedEventsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, client.EventFilterByMoveEventModule, *uint, *client.EventId, *client.QuerySortOptions) error); ok { + r1 = rf(ctx, filter, limit, cursor, sortOptions) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_QueryEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryEvents' +type SuiPTBClient_QueryEvents_Call struct { + *mock.Call +} + +// QueryEvents is a helper method to define mock.On call +// - ctx context.Context +// - filter client.EventFilterByMoveEventModule +// - limit *uint +// - cursor *client.EventId +// - sortOptions *client.QuerySortOptions +func (_e *SuiPTBClient_Expecter) QueryEvents(ctx interface{}, filter interface{}, limit interface{}, cursor interface{}, sortOptions interface{}) *SuiPTBClient_QueryEvents_Call { + return &SuiPTBClient_QueryEvents_Call{Call: _e.mock.On("QueryEvents", ctx, filter, limit, cursor, sortOptions)} +} + +func (_c *SuiPTBClient_QueryEvents_Call) Run(run func(ctx context.Context, filter client.EventFilterByMoveEventModule, limit *uint, cursor *client.EventId, sortOptions *client.QuerySortOptions)) *SuiPTBClient_QueryEvents_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(client.EventFilterByMoveEventModule), args[2].(*uint), args[3].(*client.EventId), args[4].(*client.QuerySortOptions)) + }) + return _c +} + +func (_c *SuiPTBClient_QueryEvents_Call) Return(_a0 *models.PaginatedEventsResponse, _a1 error) *SuiPTBClient_QueryEvents_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_QueryEvents_Call) RunAndReturn(run func(context.Context, client.EventFilterByMoveEventModule, *uint, *client.EventId, *client.QuerySortOptions) (*models.PaginatedEventsResponse, error)) *SuiPTBClient_QueryEvents_Call { + _c.Call.Return(run) + return _c +} + +// QueryTransactions provides a mock function with given fields: ctx, fromAddress, cursor, limit +func (_m *SuiPTBClient) QueryTransactions(ctx context.Context, fromAddress string, cursor *v2.Checkpoint, limit *uint64) ([]*v2.ExecutedTransaction, error) { + ret := _m.Called(ctx, fromAddress, cursor, limit) + + if len(ret) == 0 { + panic("no return value specified for QueryTransactions") + } + + var r0 []*v2.ExecutedTransaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *v2.Checkpoint, *uint64) ([]*v2.ExecutedTransaction, error)); ok { + return rf(ctx, fromAddress, cursor, limit) + } + if rf, ok := ret.Get(0).(func(context.Context, string, *v2.Checkpoint, *uint64) []*v2.ExecutedTransaction); ok { + r0 = rf(ctx, fromAddress, cursor, limit) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v2.ExecutedTransaction) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, *v2.Checkpoint, *uint64) error); ok { + r1 = rf(ctx, fromAddress, cursor, limit) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_QueryTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryTransactions' +type SuiPTBClient_QueryTransactions_Call struct { + *mock.Call +} + +// QueryTransactions is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress string +// - cursor *v2.Checkpoint +// - limit *uint64 +func (_e *SuiPTBClient_Expecter) QueryTransactions(ctx interface{}, fromAddress interface{}, cursor interface{}, limit interface{}) *SuiPTBClient_QueryTransactions_Call { + return &SuiPTBClient_QueryTransactions_Call{Call: _e.mock.On("QueryTransactions", ctx, fromAddress, cursor, limit)} +} + +func (_c *SuiPTBClient_QueryTransactions_Call) Run(run func(ctx context.Context, fromAddress string, cursor *v2.Checkpoint, limit *uint64)) *SuiPTBClient_QueryTransactions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*v2.Checkpoint), args[3].(*uint64)) + }) + return _c +} + +func (_c *SuiPTBClient_QueryTransactions_Call) Return(_a0 []*v2.ExecutedTransaction, _a1 error) *SuiPTBClient_QueryTransactions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_QueryTransactions_Call) RunAndReturn(run func(context.Context, string, *v2.Checkpoint, *uint64) ([]*v2.ExecutedTransaction, error)) *SuiPTBClient_QueryTransactions_Call { + _c.Call.Return(run) + return _c +} + +// ReadFilterOwnedObjectIds provides a mock function with given fields: ctx, ownerAddress, structType, cursor +func (_m *SuiPTBClient) ReadFilterOwnedObjectIds(ctx context.Context, ownerAddress string, structType string, cursor []byte) ([]*v2.Object, error) { + ret := _m.Called(ctx, ownerAddress, structType, cursor) + + if len(ret) == 0 { + panic("no return value specified for ReadFilterOwnedObjectIds") + } + + var r0 []*v2.Object + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, []byte) ([]*v2.Object, error)); ok { + return rf(ctx, ownerAddress, structType, cursor) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, []byte) []*v2.Object); ok { + r0 = rf(ctx, ownerAddress, structType, cursor) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v2.Object) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, []byte) error); ok { + r1 = rf(ctx, ownerAddress, structType, cursor) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_ReadFilterOwnedObjectIds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadFilterOwnedObjectIds' +type SuiPTBClient_ReadFilterOwnedObjectIds_Call struct { + *mock.Call +} + +// ReadFilterOwnedObjectIds is a helper method to define mock.On call +// - ctx context.Context +// - ownerAddress string +// - structType string +// - cursor []byte +func (_e *SuiPTBClient_Expecter) ReadFilterOwnedObjectIds(ctx interface{}, ownerAddress interface{}, structType interface{}, cursor interface{}) *SuiPTBClient_ReadFilterOwnedObjectIds_Call { + return &SuiPTBClient_ReadFilterOwnedObjectIds_Call{Call: _e.mock.On("ReadFilterOwnedObjectIds", ctx, ownerAddress, structType, cursor)} +} + +func (_c *SuiPTBClient_ReadFilterOwnedObjectIds_Call) Run(run func(ctx context.Context, ownerAddress string, structType string, cursor []byte)) *SuiPTBClient_ReadFilterOwnedObjectIds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].([]byte)) + }) + return _c +} + +func (_c *SuiPTBClient_ReadFilterOwnedObjectIds_Call) Return(_a0 []*v2.Object, _a1 error) *SuiPTBClient_ReadFilterOwnedObjectIds_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_ReadFilterOwnedObjectIds_Call) RunAndReturn(run func(context.Context, string, string, []byte) ([]*v2.Object, error)) *SuiPTBClient_ReadFilterOwnedObjectIds_Call { + _c.Call.Return(run) + return _c +} + +// ReadFunction provides a mock function with given fields: ctx, packageId, module, function, args, argTypes, typeArgs +func (_m *SuiPTBClient) ReadFunction(ctx context.Context, packageId string, module string, function string, args []interface{}, argTypes []string, typeArgs []string) ([]interface{}, error) { + ret := _m.Called(ctx, packageId, module, function, args, argTypes, typeArgs) + + if len(ret) == 0 { + panic("no return value specified for ReadFunction") + } + + var r0 []interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, []interface{}, []string, []string) ([]interface{}, error)); ok { + return rf(ctx, packageId, module, function, args, argTypes, typeArgs) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, []interface{}, []string, []string) []interface{}); ok { + r0 = rf(ctx, packageId, module, function, args, argTypes, typeArgs) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]interface{}) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, []interface{}, []string, []string) error); ok { + r1 = rf(ctx, packageId, module, function, args, argTypes, typeArgs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_ReadFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadFunction' +type SuiPTBClient_ReadFunction_Call struct { + *mock.Call +} + +// ReadFunction is a helper method to define mock.On call +// - ctx context.Context +// - packageId string +// - module string +// - function string +// - args []interface{} +// - argTypes []string +// - typeArgs []string +func (_e *SuiPTBClient_Expecter) ReadFunction(ctx interface{}, packageId interface{}, module interface{}, function interface{}, args interface{}, argTypes interface{}, typeArgs interface{}) *SuiPTBClient_ReadFunction_Call { + return &SuiPTBClient_ReadFunction_Call{Call: _e.mock.On("ReadFunction", ctx, packageId, module, function, args, argTypes, typeArgs)} +} + +func (_c *SuiPTBClient_ReadFunction_Call) Run(run func(ctx context.Context, packageId string, module string, function string, args []interface{}, argTypes []string, typeArgs []string)) *SuiPTBClient_ReadFunction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].([]interface{}), args[5].([]string), args[6].([]string)) + }) + return _c +} + +func (_c *SuiPTBClient_ReadFunction_Call) Return(_a0 []interface{}, _a1 error) *SuiPTBClient_ReadFunction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_ReadFunction_Call) RunAndReturn(run func(context.Context, string, string, string, []interface{}, []string, []string) ([]interface{}, error)) *SuiPTBClient_ReadFunction_Call { + _c.Call.Return(run) + return _c +} + +// ReadObjectId provides a mock function with given fields: ctx, objectId +func (_m *SuiPTBClient) ReadObjectId(ctx context.Context, objectId string) (*v2.Object, error) { + ret := _m.Called(ctx, objectId) + + if len(ret) == 0 { + panic("no return value specified for ReadObjectId") + } + + var r0 *v2.Object + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*v2.Object, error)); ok { + return rf(ctx, objectId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *v2.Object); ok { + r0 = rf(ctx, objectId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v2.Object) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, objectId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_ReadObjectId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadObjectId' +type SuiPTBClient_ReadObjectId_Call struct { + *mock.Call +} + +// ReadObjectId is a helper method to define mock.On call +// - ctx context.Context +// - objectId string +func (_e *SuiPTBClient_Expecter) ReadObjectId(ctx interface{}, objectId interface{}) *SuiPTBClient_ReadObjectId_Call { + return &SuiPTBClient_ReadObjectId_Call{Call: _e.mock.On("ReadObjectId", ctx, objectId)} +} + +func (_c *SuiPTBClient_ReadObjectId_Call) Run(run func(ctx context.Context, objectId string)) *SuiPTBClient_ReadObjectId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *SuiPTBClient_ReadObjectId_Call) Return(_a0 *v2.Object, _a1 error) *SuiPTBClient_ReadObjectId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_ReadObjectId_Call) RunAndReturn(run func(context.Context, string) (*v2.Object, error)) *SuiPTBClient_ReadObjectId_Call { + _c.Call.Return(run) + return _c +} + +// ReadOwnedObjects provides a mock function with given fields: ctx, ownerAddress, cursor +func (_m *SuiPTBClient) ReadOwnedObjects(ctx context.Context, ownerAddress string, cursor []byte) ([]*v2.Object, error) { + ret := _m.Called(ctx, ownerAddress, cursor) + + if len(ret) == 0 { + panic("no return value specified for ReadOwnedObjects") + } + + var r0 []*v2.Object + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, []byte) ([]*v2.Object, error)); ok { + return rf(ctx, ownerAddress, cursor) + } + if rf, ok := ret.Get(0).(func(context.Context, string, []byte) []*v2.Object); ok { + r0 = rf(ctx, ownerAddress, cursor) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v2.Object) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, []byte) error); ok { + r1 = rf(ctx, ownerAddress, cursor) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_ReadOwnedObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadOwnedObjects' +type SuiPTBClient_ReadOwnedObjects_Call struct { + *mock.Call +} + +// ReadOwnedObjects is a helper method to define mock.On call +// - ctx context.Context +// - ownerAddress string +// - cursor []byte +func (_e *SuiPTBClient_Expecter) ReadOwnedObjects(ctx interface{}, ownerAddress interface{}, cursor interface{}) *SuiPTBClient_ReadOwnedObjects_Call { + return &SuiPTBClient_ReadOwnedObjects_Call{Call: _e.mock.On("ReadOwnedObjects", ctx, ownerAddress, cursor)} +} + +func (_c *SuiPTBClient_ReadOwnedObjects_Call) Run(run func(ctx context.Context, ownerAddress string, cursor []byte)) *SuiPTBClient_ReadOwnedObjects_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte)) + }) + return _c +} + +func (_c *SuiPTBClient_ReadOwnedObjects_Call) Return(_a0 []*v2.Object, _a1 error) *SuiPTBClient_ReadOwnedObjects_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_ReadOwnedObjects_Call) RunAndReturn(run func(context.Context, string, []byte) ([]*v2.Object, error)) *SuiPTBClient_ReadOwnedObjects_Call { + _c.Call.Return(run) + return _c +} + +// SendTransaction provides a mock function with given fields: ctx, execRequest +func (_m *SuiPTBClient) SendTransaction(ctx context.Context, execRequest *v2.ExecuteTransactionRequest) (*v2.ExecuteTransactionResponse, error) { + ret := _m.Called(ctx, execRequest) + + if len(ret) == 0 { + panic("no return value specified for SendTransaction") + } + + var r0 *v2.ExecuteTransactionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v2.ExecuteTransactionRequest) (*v2.ExecuteTransactionResponse, error)); ok { + return rf(ctx, execRequest) + } + if rf, ok := ret.Get(0).(func(context.Context, *v2.ExecuteTransactionRequest) *v2.ExecuteTransactionResponse); ok { + r0 = rf(ctx, execRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v2.ExecuteTransactionResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v2.ExecuteTransactionRequest) error); ok { + r1 = rf(ctx, execRequest) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_SendTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTransaction' +type SuiPTBClient_SendTransaction_Call struct { + *mock.Call +} + +// SendTransaction is a helper method to define mock.On call +// - ctx context.Context +// - execRequest *v2.ExecuteTransactionRequest +func (_e *SuiPTBClient_Expecter) SendTransaction(ctx interface{}, execRequest interface{}) *SuiPTBClient_SendTransaction_Call { + return &SuiPTBClient_SendTransaction_Call{Call: _e.mock.On("SendTransaction", ctx, execRequest)} +} + +func (_c *SuiPTBClient_SendTransaction_Call) Run(run func(ctx context.Context, execRequest *v2.ExecuteTransactionRequest)) *SuiPTBClient_SendTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*v2.ExecuteTransactionRequest)) + }) + return _c +} + +func (_c *SuiPTBClient_SendTransaction_Call) Return(_a0 *v2.ExecuteTransactionResponse, _a1 error) *SuiPTBClient_SendTransaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_SendTransaction_Call) RunAndReturn(run func(context.Context, *v2.ExecuteTransactionRequest) (*v2.ExecuteTransactionResponse, error)) *SuiPTBClient_SendTransaction_Call { + _c.Call.Return(run) + return _c +} + +// SetCachedValue provides a mock function with given fields: key, value +func (_m *SuiPTBClient) SetCachedValue(key string, value interface{}) { + _m.Called(key, value) +} + +// SuiPTBClient_SetCachedValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCachedValue' +type SuiPTBClient_SetCachedValue_Call struct { + *mock.Call +} + +// SetCachedValue is a helper method to define mock.On call +// - key string +// - value interface{} +func (_e *SuiPTBClient_Expecter) SetCachedValue(key interface{}, value interface{}) *SuiPTBClient_SetCachedValue_Call { + return &SuiPTBClient_SetCachedValue_Call{Call: _e.mock.On("SetCachedValue", key, value)} +} + +func (_c *SuiPTBClient_SetCachedValue_Call) Run(run func(key string, value interface{})) *SuiPTBClient_SetCachedValue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *SuiPTBClient_SetCachedValue_Call) Return() *SuiPTBClient_SetCachedValue_Call { + _c.Call.Return() + return _c +} + +func (_c *SuiPTBClient_SetCachedValue_Call) RunAndReturn(run func(string, interface{})) *SuiPTBClient_SetCachedValue_Call { + _c.Run(run) + return _c +} + +// SetCachedValues provides a mock function with given fields: keyValues +func (_m *SuiPTBClient) SetCachedValues(keyValues map[string]interface{}) { + _m.Called(keyValues) +} + +// SuiPTBClient_SetCachedValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCachedValues' +type SuiPTBClient_SetCachedValues_Call struct { + *mock.Call +} + +// SetCachedValues is a helper method to define mock.On call +// - keyValues map[string]interface{} +func (_e *SuiPTBClient_Expecter) SetCachedValues(keyValues interface{}) *SuiPTBClient_SetCachedValues_Call { + return &SuiPTBClient_SetCachedValues_Call{Call: _e.mock.On("SetCachedValues", keyValues)} +} + +func (_c *SuiPTBClient_SetCachedValues_Call) Run(run func(keyValues map[string]interface{})) *SuiPTBClient_SetCachedValues_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(map[string]interface{})) + }) + return _c +} + +func (_c *SuiPTBClient_SetCachedValues_Call) Return() *SuiPTBClient_SetCachedValues_Call { + _c.Call.Return() + return _c +} + +func (_c *SuiPTBClient_SetCachedValues_Call) RunAndReturn(run func(map[string]interface{})) *SuiPTBClient_SetCachedValues_Call { + _c.Run(run) + return _c +} + +// SignAndSendTransaction provides a mock function with given fields: ctx, txBytesRaw, signerPublicKey +func (_m *SuiPTBClient) SignAndSendTransaction(ctx context.Context, txBytesRaw string, signerPublicKey []byte) (*v2.ExecuteTransactionResponse, error) { + ret := _m.Called(ctx, txBytesRaw, signerPublicKey) + + if len(ret) == 0 { + panic("no return value specified for SignAndSendTransaction") + } + + var r0 *v2.ExecuteTransactionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, []byte) (*v2.ExecuteTransactionResponse, error)); ok { + return rf(ctx, txBytesRaw, signerPublicKey) + } + if rf, ok := ret.Get(0).(func(context.Context, string, []byte) *v2.ExecuteTransactionResponse); ok { + r0 = rf(ctx, txBytesRaw, signerPublicKey) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v2.ExecuteTransactionResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, []byte) error); ok { + r1 = rf(ctx, txBytesRaw, signerPublicKey) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_SignAndSendTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignAndSendTransaction' +type SuiPTBClient_SignAndSendTransaction_Call struct { + *mock.Call +} + +// SignAndSendTransaction is a helper method to define mock.On call +// - ctx context.Context +// - txBytesRaw string +// - signerPublicKey []byte +func (_e *SuiPTBClient_Expecter) SignAndSendTransaction(ctx interface{}, txBytesRaw interface{}, signerPublicKey interface{}) *SuiPTBClient_SignAndSendTransaction_Call { + return &SuiPTBClient_SignAndSendTransaction_Call{Call: _e.mock.On("SignAndSendTransaction", ctx, txBytesRaw, signerPublicKey)} +} + +func (_c *SuiPTBClient_SignAndSendTransaction_Call) Run(run func(ctx context.Context, txBytesRaw string, signerPublicKey []byte)) *SuiPTBClient_SignAndSendTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte)) + }) + return _c +} + +func (_c *SuiPTBClient_SignAndSendTransaction_Call) Return(_a0 *v2.ExecuteTransactionResponse, _a1 error) *SuiPTBClient_SignAndSendTransaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_SignAndSendTransaction_Call) RunAndReturn(run func(context.Context, string, []byte) (*v2.ExecuteTransactionResponse, error)) *SuiPTBClient_SignAndSendTransaction_Call { + _c.Call.Return(run) + return _c +} + +// SimulatePTB provides a mock function with given fields: ctx, bcsBytes +func (_m *SuiPTBClient) SimulatePTB(ctx context.Context, bcsBytes []byte) ([]interface{}, error) { + ret := _m.Called(ctx, bcsBytes) + + if len(ret) == 0 { + panic("no return value specified for SimulatePTB") + } + + var r0 []interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []byte) ([]interface{}, error)); ok { + return rf(ctx, bcsBytes) + } + if rf, ok := ret.Get(0).(func(context.Context, []byte) []interface{}); ok { + r0 = rf(ctx, bcsBytes) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]interface{}) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, []byte) error); ok { + r1 = rf(ctx, bcsBytes) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuiPTBClient_SimulatePTB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SimulatePTB' +type SuiPTBClient_SimulatePTB_Call struct { + *mock.Call +} + +// SimulatePTB is a helper method to define mock.On call +// - ctx context.Context +// - bcsBytes []byte +func (_e *SuiPTBClient_Expecter) SimulatePTB(ctx interface{}, bcsBytes interface{}) *SuiPTBClient_SimulatePTB_Call { + return &SuiPTBClient_SimulatePTB_Call{Call: _e.mock.On("SimulatePTB", ctx, bcsBytes)} +} + +func (_c *SuiPTBClient_SimulatePTB_Call) Run(run func(ctx context.Context, bcsBytes []byte)) *SuiPTBClient_SimulatePTB_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte)) + }) + return _c +} + +func (_c *SuiPTBClient_SimulatePTB_Call) Return(_a0 []interface{}, _a1 error) *SuiPTBClient_SimulatePTB_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SuiPTBClient_SimulatePTB_Call) RunAndReturn(run func(context.Context, []byte) ([]interface{}, error)) *SuiPTBClient_SimulatePTB_Call { + _c.Call.Return(run) + return _c +} + +// NewSuiPTBClient creates a new instance of SuiPTBClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSuiPTBClient(t interface { + mock.TestingT + Cleanup(func()) +}) *SuiPTBClient { + mock := &SuiPTBClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/sdk/ton/mocks/api.go b/sdk/ton/mocks/api.go index f37411f17..85b8fef11 100644 --- a/sdk/ton/mocks/api.go +++ b/sdk/ton/mocks/api.go @@ -3,20 +3,15 @@ package mock_ton import ( - address "github.com/xssnick/tonutils-go/address" - cell "github.com/xssnick/tonutils-go/tvm/cell" - context "context" - - liteclient "github.com/xssnick/tonutils-go/liteclient" - - mock "github.com/stretchr/testify/mock" - time "time" + mock "github.com/stretchr/testify/mock" + address "github.com/xssnick/tonutils-go/address" + liteclient "github.com/xssnick/tonutils-go/liteclient" tlb "github.com/xssnick/tonutils-go/tlb" - ton "github.com/xssnick/tonutils-go/ton" + cell "github.com/xssnick/tonutils-go/tvm/cell" ) // APIClientWrapped is an autogenerated mock type for the APIClientWrapped type diff --git a/sdk/ton/mocks/wallet.go b/sdk/ton/mocks/wallet.go index f70937e22..a870e87e8 100644 --- a/sdk/ton/mocks/wallet.go +++ b/sdk/ton/mocks/wallet.go @@ -5,12 +5,9 @@ package mock_ton import ( context "context" - address "github.com/xssnick/tonutils-go/address" - mock "github.com/stretchr/testify/mock" - + address "github.com/xssnick/tonutils-go/address" tlb "github.com/xssnick/tonutils-go/tlb" - ton "github.com/xssnick/tonutils-go/ton" ) diff --git a/taskfiles/generate/Taskfile.yml b/taskfiles/generate/Taskfile.yml index b05eacd1b..b1130c573 100644 --- a/taskfiles/generate/Taskfile.yml +++ b/taskfiles/generate/Taskfile.yml @@ -9,4 +9,4 @@ tasks: mocks: desc: Generate mocks for interfaces cmds: - - mockery \ No newline at end of file + - mockery From 1cbe3494a7ceab77cb77d3481ecfb3f9baf6f090 Mon Sep 17 00:00:00 2001 From: faisal-link Date: Mon, 8 Jun 2026 18:52:46 +0400 Subject: [PATCH 03/12] update chainlink-sui ref --- go.mod | 4 +--- go.sum | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 65f8ac997..45869399f 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,6 @@ go 1.26.2 //nolint:gomoddirectives // allow replace directive replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 -replace github.com/smartcontractkit/chainlink-sui => ../chainlink-sui - require ( github.com/Masterminds/semver/v3 v3.4.0 github.com/aptos-labs/aptos-go-sdk v1.13.0 @@ -25,7 +23,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 github.com/smartcontractkit/chainlink-common v0.11.2-0.20260506120607-7f10be016c89 - github.com/smartcontractkit/chainlink-sui v0.0.0-20260527160341-aa3adc0abf67 + github.com/smartcontractkit/chainlink-sui v0.0.0-20260605165559-eb9893a9718c github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.3 github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260514223130-48bc90aca745 github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad diff --git a/go.sum b/go.sum index f4d6b9252..3b7b1f827 100644 --- a/go.sum +++ b/go.sum @@ -624,6 +624,8 @@ github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-202510021 github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260211172625-dff40e83b3c9 h1:hhevsu8k7tlDRrYZmgAh7V4avGQDMvus1bwIlial3Ps= github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260211172625-dff40e83b3c9/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= +github.com/smartcontractkit/chainlink-sui v0.0.0-20260605165559-eb9893a9718c h1:yxtijM3BzD82Pw/CtCRhjWih2SdEtmCyhFwMgNa265w= +github.com/smartcontractkit/chainlink-sui v0.0.0-20260605165559-eb9893a9718c/go.mod h1:Y2kTVIsAUjqqSNGiEQomsaVH5XsBJzxov4j07MaDJOw= github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.3 h1:y3dFPfouGziisDJa0JbY6DE7/JjoSCP/5aebzHcj4jA= github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.3/go.mod h1:W+X9xaRulD8dD87QOB0njHkBKkmYxB4E0osfpe9808I= github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260514223130-48bc90aca745 h1:eieKLvYuzwBPh/FdbUS1gnIanI86zgWby1L10o90g4o= From 2708f040b1c3e7cdb9057baae4738866bd3f2115 Mon Sep 17 00:00:00 2001 From: faisal-link Date: Mon, 8 Jun 2026 19:05:18 +0400 Subject: [PATCH 04/12] tidy --- go.mod | 3 ++- go.sum | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 147341c2d..fce18499a 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,8 @@ require ( github.com/smartcontractkit/chainlink-canton v0.0.0-20260602133237-99f834640c9d 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-20260605165559-eb9893a9718c + github.com/smartcontractkit/chainlink-common v0.11.2-0.20260506120607-7f10be016c89 + github.com/smartcontractkit/chainlink-sui v0.0.0-20260605165559-eb9893a9718c github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4 github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260514223130-48bc90aca745 github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad diff --git a/go.sum b/go.sum index 80852fe64..94fe8f7f2 100644 --- a/go.sum +++ b/go.sum @@ -688,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-20260602133237-99f834640c9d h1:aBQYdlGQvqftkcUo0GIgtaLDs/84FQzBYpF4tZUfPA0= github.com/smartcontractkit/chainlink-canton v0.0.0-20260602133237-99f834640c9d/go.mod h1:/oTkN9bVrQ1ROUNtIJJSNdffl3NReClq+qINNkGAwlY= +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= From dd102024eaa85c0809a5856980477ac23d9e1528 Mon Sep 17 00:00:00 2001 From: faisal-link Date: Mon, 8 Jun 2026 19:07:15 +0400 Subject: [PATCH 05/12] typo --- chainwrappers/chainaccessor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chainwrappers/chainaccessor.go b/chainwrappers/chainaccessor.go index 1ebc81d39..7d14e518e 100644 --- a/chainwrappers/chainaccessor.go +++ b/chainwrappers/chainaccessor.go @@ -23,7 +23,7 @@ type ChainAccessor interface { AptosClient(selector uint64) (aptoslib.AptosRpcClient, bool) AptosSigner(selector uint64) (aptoslib.TransactionSigner, bool) SuiClient(selector uint64) (cslclient.BindingsClient, bool) - SuiSigner(selector uint64) (suisuisdk.SuiSigner, bool) + SuiSigner(selector uint64) (suisdk.SuiSigner, bool) TonClient(selector uint64) (ton.APIClientWrapped, bool) TonSigner(selector uint64) (*tonwallet.Wallet, bool) CantonChain(selector uint64) (cantonsdk.Chain, bool) From 50bf251a7bd6a8b772d8a2a35f2c7cff5267c9bc Mon Sep 17 00:00:00 2001 From: faisal-link Date: Mon, 8 Jun 2026 19:57:42 +0400 Subject: [PATCH 06/12] formatting --- e2e/tests/setup.go | 3 ++- sdk/sui/client_helper.go | 7 +++++-- sdk/sui/executing_callback_test.go | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/e2e/tests/setup.go b/e2e/tests/setup.go index b37380f44..b773ed7d2 100644 --- a/e2e/tests/setup.go +++ b/e2e/tests/setup.go @@ -19,8 +19,9 @@ import ( "github.com/stretchr/testify/require" "github.com/xssnick/tonutils-go/ton" - tonchain "github.com/smartcontractkit/chainlink-ton/pkg/ton/chain" "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" diff --git a/sdk/sui/client_helper.go b/sdk/sui/client_helper.go index 31997968e..687a7f783 100644 --- a/sdk/sui/client_helper.go +++ b/sdk/sui/client_helper.go @@ -12,6 +12,8 @@ import ( ) const defaultSuiGrpcToken = "test" +const defaultSuiGrpcTimeout = 30 * time.Second +const defaultSuiGrpcMaxConcurrentRequests = 50 // NewBindingsClientFromNodeURL creates a gRPC-backed bindings client from an HTTP RPC URL. // Local Sui nodes expose gRPC on the same host:port as JSON-RPC. @@ -27,8 +29,8 @@ func NewBindingsClientFromNodeURL(log logger.Logger, nodeURL string, grpcToken s return cslclient.NewPTBClient(log, cslclient.PTBClientConfig{ GrpcTarget: grpcTarget, GrpcToken: grpcToken, - TransactionTimeout: 30 * time.Second, - MaxConcurrentRequests: 50, + TransactionTimeout: defaultSuiGrpcTimeout, + MaxConcurrentRequests: defaultSuiGrpcMaxConcurrentRequests, DefaultRequestType: cslclient.WaitForEffectsCert, }) } @@ -54,5 +56,6 @@ func grpcTargetFromNodeURL(nodeURL string) (string, error) { if strings.Contains(host, ":") && !strings.HasPrefix(host, "[") { return fmt.Sprintf("[%s]:%s", host, port), nil } + return fmt.Sprintf("%s:%s", host, port), nil } diff --git a/sdk/sui/executing_callback_test.go b/sdk/sui/executing_callback_test.go index 774dc880b..f4085dfb7 100644 --- a/sdk/sui/executing_callback_test.go +++ b/sdk/sui/executing_callback_test.go @@ -15,8 +15,8 @@ import ( "github.com/block-vision/sui-go-sdk/transaction" "github.com/smartcontractkit/chainlink-sui/bindings/bind" - cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" module_mcms_deployer "github.com/smartcontractkit/chainlink-sui/bindings/generated/mcms/mcms_deployer" + cslclient "github.com/smartcontractkit/chainlink-sui/relayer/client" mockbindutils "github.com/smartcontractkit/mcms/sdk/sui/mocks/bindutils" mockfeequoter "github.com/smartcontractkit/mcms/sdk/sui/mocks/feequoter" From d355bc31ed0c9bd9d8421f476bd926614a7a2154 Mon Sep 17 00:00:00 2001 From: faisal-link Date: Tue, 9 Jun 2026 19:28:14 +0400 Subject: [PATCH 07/12] update chainlink-sui dep ref --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index fce18499a..6c717e8c4 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( 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-common v0.11.2-0.20260506120607-7f10be016c89 - github.com/smartcontractkit/chainlink-sui v0.0.0-20260605165559-eb9893a9718c + github.com/smartcontractkit/chainlink-sui v0.0.0-20260609152527-ee3b47c5ba2f github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4 github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260514223130-48bc90aca745 github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad diff --git a/go.sum b/go.sum index 94fe8f7f2..ac341698b 100644 --- a/go.sum +++ b/go.sum @@ -710,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-20260605165559-eb9893a9718c h1:yxtijM3BzD82Pw/CtCRhjWih2SdEtmCyhFwMgNa265w= -github.com/smartcontractkit/chainlink-sui v0.0.0-20260605165559-eb9893a9718c/go.mod h1:Y2kTVIsAUjqqSNGiEQomsaVH5XsBJzxov4j07MaDJOw= +github.com/smartcontractkit/chainlink-sui v0.0.0-20260609152527-ee3b47c5ba2f h1:dEcSmYUdIXovKUk3vmQFphpOLJftY2bFgWQOG6RNBNo= +github.com/smartcontractkit/chainlink-sui v0.0.0-20260609152527-ee3b47c5ba2f/go.mod h1:Y2kTVIsAUjqqSNGiEQomsaVH5XsBJzxov4j07MaDJOw= github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4 h1:8M+2pA0qx9rXaxmpKouUHj983vQCGzztHkG0XjE5Eew= github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4/go.mod h1:nyOjn4ADJGqRMe3+4ZXSV+J/7nWb1H2Vx8Qk57eLRYA= github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.5 h1:RwZXxdIAOyjp6cwc9Quxgr38k8r7ACz+Lxh9o/A6oH0= From 31b72a62d982ebaa11ea3c31657c1443497b06ba Mon Sep 17 00:00:00 2001 From: faisal-link Date: Tue, 9 Jun 2026 19:53:24 +0400 Subject: [PATCH 08/12] update chainlink-sui dep ref --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6c717e8c4..99ef75da2 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( 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-common v0.11.2-0.20260506120607-7f10be016c89 - github.com/smartcontractkit/chainlink-sui v0.0.0-20260609152527-ee3b47c5ba2f + github.com/smartcontractkit/chainlink-sui v0.0.0-20260609155232-bd02f5344b30 github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4 github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260514223130-48bc90aca745 github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad diff --git a/go.sum b/go.sum index ac341698b..0d49910ef 100644 --- a/go.sum +++ b/go.sum @@ -710,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-20260609152527-ee3b47c5ba2f h1:dEcSmYUdIXovKUk3vmQFphpOLJftY2bFgWQOG6RNBNo= -github.com/smartcontractkit/chainlink-sui v0.0.0-20260609152527-ee3b47c5ba2f/go.mod h1:Y2kTVIsAUjqqSNGiEQomsaVH5XsBJzxov4j07MaDJOw= +github.com/smartcontractkit/chainlink-sui v0.0.0-20260609155232-bd02f5344b30 h1:cJLJso0E6f/BS/QL4EvWjomaOwbQpPESkLCse00/A9w= +github.com/smartcontractkit/chainlink-sui v0.0.0-20260609155232-bd02f5344b30/go.mod h1:Y2kTVIsAUjqqSNGiEQomsaVH5XsBJzxov4j07MaDJOw= github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4 h1:8M+2pA0qx9rXaxmpKouUHj983vQCGzztHkG0XjE5Eew= github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4/go.mod h1:nyOjn4ADJGqRMe3+4ZXSV+J/7nWb1H2Vx8Qk57eLRYA= github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.5 h1:RwZXxdIAOyjp6cwc9Quxgr38k8r7ACz+Lxh9o/A6oH0= From 2e33fc6eb369a33541cb4181df31cda1463a8f42 Mon Sep 17 00:00:00 2001 From: faisal-link Date: Tue, 9 Jun 2026 20:12:31 +0400 Subject: [PATCH 09/12] update chainlink-sui dep ref --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 99ef75da2..f7d527cd5 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( 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-common v0.11.2-0.20260506120607-7f10be016c89 - github.com/smartcontractkit/chainlink-sui v0.0.0-20260609155232-bd02f5344b30 + github.com/smartcontractkit/chainlink-sui v0.0.0-20260609161114-b771e8901720 github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4 github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260514223130-48bc90aca745 github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad diff --git a/go.sum b/go.sum index 0d49910ef..a2237da76 100644 --- a/go.sum +++ b/go.sum @@ -710,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-20260609155232-bd02f5344b30 h1:cJLJso0E6f/BS/QL4EvWjomaOwbQpPESkLCse00/A9w= -github.com/smartcontractkit/chainlink-sui v0.0.0-20260609155232-bd02f5344b30/go.mod h1:Y2kTVIsAUjqqSNGiEQomsaVH5XsBJzxov4j07MaDJOw= +github.com/smartcontractkit/chainlink-sui v0.0.0-20260609161114-b771e8901720 h1:eiyOUn7If5QDoO3JnkEd3Do7WarB83iFj0h2ZEnYdlU= +github.com/smartcontractkit/chainlink-sui v0.0.0-20260609161114-b771e8901720/go.mod h1:Y2kTVIsAUjqqSNGiEQomsaVH5XsBJzxov4j07MaDJOw= github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4 h1:8M+2pA0qx9rXaxmpKouUHj983vQCGzztHkG0XjE5Eew= github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4/go.mod h1:nyOjn4ADJGqRMe3+4ZXSV+J/7nWb1H2Vx8Qk57eLRYA= github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.5 h1:RwZXxdIAOyjp6cwc9Quxgr38k8r7ACz+Lxh9o/A6oH0= From 60a69a2c8ff5f626dcca610f7443b9e3ce9192d2 Mon Sep 17 00:00:00 2001 From: faisal-link Date: Thu, 11 Jun 2026 00:22:49 +0400 Subject: [PATCH 10/12] remove chainlink-sui dep commit hash ref --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f7d527cd5..c8fb31daf 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( 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-common v0.11.2-0.20260506120607-7f10be016c89 - github.com/smartcontractkit/chainlink-sui v0.0.0-20260609161114-b771e8901720 + github.com/smartcontractkit/chainlink-sui v0.0.0-20260610194843-349ea43d69ce github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4 github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260514223130-48bc90aca745 github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad diff --git a/go.sum b/go.sum index a2237da76..6ec44d594 100644 --- a/go.sum +++ b/go.sum @@ -710,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-20260609161114-b771e8901720 h1:eiyOUn7If5QDoO3JnkEd3Do7WarB83iFj0h2ZEnYdlU= -github.com/smartcontractkit/chainlink-sui v0.0.0-20260609161114-b771e8901720/go.mod h1:Y2kTVIsAUjqqSNGiEQomsaVH5XsBJzxov4j07MaDJOw= +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.4 h1:8M+2pA0qx9rXaxmpKouUHj983vQCGzztHkG0XjE5Eew= github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.4/go.mod h1:nyOjn4ADJGqRMe3+4ZXSV+J/7nWb1H2Vx8Qk57eLRYA= github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.5 h1:RwZXxdIAOyjp6cwc9Quxgr38k8r7ACz+Lxh9o/A6oH0= From 53dd5b17ca8161d6f8f371e091613fc56b71b68c Mon Sep 17 00:00:00 2001 From: faisal-link Date: Thu, 11 Jun 2026 00:25:13 +0400 Subject: [PATCH 11/12] tidy --- go.sum | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/go.sum b/go.sum index 0e5453a7b..b85b4ebcd 100644 --- a/go.sum +++ b/go.sum @@ -688,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= @@ -708,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= From 96a82c436324a16f99314257e9c789e1ae45c019 Mon Sep 17 00:00:00 2001 From: faisal-link Date: Thu, 11 Jun 2026 00:55:24 +0400 Subject: [PATCH 12/12] add client helper test --- sdk/sui/client_helper_test.go | 104 ++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sdk/sui/client_helper_test.go diff --git a/sdk/sui/client_helper_test.go b/sdk/sui/client_helper_test.go new file mode 100644 index 000000000..99051891e --- /dev/null +++ b/sdk/sui/client_helper_test.go @@ -0,0 +1,104 @@ +package sui + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" +) + +func TestGrpcTargetFromNodeURL(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + nodeURL string + want string + wantErr string + }{ + { + name: "http with explicit port", + nodeURL: "http://localhost:9000", + want: "localhost:9000", + }, + { + name: "http without port defaults to 9000", + nodeURL: "http://example.com", + want: "example.com:9000", + }, + { + name: "https without port defaults to 443", + nodeURL: "https://example.com", + want: "example.com:443", + }, + { + name: "ipv4 with explicit port", + nodeURL: "http://1.2.3.4:8080", + want: "1.2.3.4:8080", + }, + { + name: "ipv6 unbracketed host gets bracketed", + nodeURL: "http://[::1]:9001", + want: "[::1]:9001", + }, + { + name: "ipv6 without port defaults and stays bracketed", + nodeURL: "https://[2001:db8::1]", + want: "[2001:db8::1]:443", + }, + { + name: "scheme-only URL has no host", + nodeURL: "http://", + wantErr: "has no host", + }, + { + name: "unparseable URL", + nodeURL: "http://[::1", + wantErr: "parse node URL", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + got, err := grpcTargetFromNodeURL(tt.nodeURL) + if tt.wantErr != "" { + require.Error(t, err) + assert.Contains(t, err.Error(), tt.wantErr) + assert.Empty(t, got) + + return + } + require.NoError(t, err) + assert.Equal(t, tt.want, got) + }) + } +} + +func TestNewBindingsClientFromNodeURL(t *testing.T) { + t.Parallel() + + t.Run("success with explicit token", func(t *testing.T) { + t.Parallel() + client, err := NewBindingsClientFromNodeURL(logger.Test(t), "http://localhost:9000", "my-token") + require.NoError(t, err) + assert.NotNil(t, client) + }) + + t.Run("success with empty token uses default", func(t *testing.T) { + t.Parallel() + client, err := NewBindingsClientFromNodeURL(logger.Test(t), "http://localhost:9000", "") + require.NoError(t, err) + assert.NotNil(t, client) + }) + + t.Run("error propagated from invalid node URL", func(t *testing.T) { + t.Parallel() + client, err := NewBindingsClientFromNodeURL(logger.Test(t), "http://", "my-token") + require.Error(t, err) + assert.Contains(t, err.Error(), "has no host") + assert.Nil(t, client) + }) +}