Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3261478
extend cldf proposal conversion logic
huangzhen1997 Dec 9, 2025
ce292f9
fix goimport
huangzhen1997 Dec 10, 2025
76f7941
rm redundant wallet funds
huangzhen1997 Dec 10, 2025
6b03e06
remove unused fundwallet func
huangzhen1997 Dec 10, 2025
bb6622b
add test coverage
huangzhen1997 Dec 12, 2025
564f880
update test
huangzhen1997 Dec 12, 2025
fa6aa6c
Merge branch 'main' into NONEVM-3069/extend-cldf-proposal-logic-suppo…
huangzhen1997 Dec 12, 2025
580e5c7
update
huangzhen1997 Dec 12, 2025
d139579
bump version
huangzhen1997 Dec 16, 2025
e0493eb
bump mcms version
huangzhen1997 Dec 16, 2025
8c9b9ff
Merge branch 'main' into NONEVM-3069/extend-cldf-proposal-logic-suppo…
huangzhen1997 Dec 16, 2025
b703c08
fix make
huangzhen1997 Dec 16, 2025
a68db89
Merge branch 'NONEVM-3069/extend-cldf-proposal-logic-support-ton-time…
huangzhen1997 Dec 16, 2025
d440c1d
Merge branch 'main' into NONEVM-3069/extend-cldf-proposal-logic-suppo…
huangzhen1997 Jan 22, 2026
060c95e
fix make
huangzhen1997 Jan 22, 2026
4a13173
fix lint
huangzhen1997 Jan 22, 2026
5f800a9
update test
huangzhen1997 Jan 23, 2026
02d0258
fix test
huangzhen1997 Jan 23, 2026
588016c
update test
huangzhen1997 Jan 23, 2026
3d3a6ba
fix test
huangzhen1997 Jan 23, 2026
95337bb
fix test
huangzhen1997 Jan 23, 2026
c434940
remove duplicate test
huangzhen1997 Jan 23, 2026
781a16b
fix
huangzhen1997 Jan 23, 2026
284e77e
more test coverage
huangzhen1997 Jan 23, 2026
2e6c227
update test
huangzhen1997 Jan 23, 2026
06dd941
refactor for test coverage
huangzhen1997 Jan 23, 2026
4168b5e
revert
huangzhen1997 Jan 23, 2026
120f23b
update
huangzhen1997 Jan 23, 2026
d58f919
minor
huangzhen1997 Jan 24, 2026
ad23d0e
lint
huangzhen1997 Jan 24, 2026
8dcbd7a
remove amount from chain
huangzhen1997 Jan 27, 2026
022e0df
Merge branch 'main' into NONEVM-3069/extend-cldf-proposal-logic-suppo…
huangzhen1997 Jan 27, 2026
075de4e
minor
huangzhen1997 Jan 27, 2026
e5efbd0
Merge branch 'NONEVM-3069/extend-cldf-proposal-logic-support-ton-time…
huangzhen1997 Jan 27, 2026
b25e6bc
rm buildChain
huangzhen1997 Jan 27, 2026
42d488c
fix lint
huangzhen1997 Jan 27, 2026
ced4bfd
Merge branch 'main' into NONEVM-3069/extend-cldf-proposal-logic-suppo…
huangzhen1997 Jan 27, 2026
62b9727
Merge branch 'main' into NONEVM-3069/extend-cldf-proposal-logic-suppo…
huangzhen1997 Jan 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 8 additions & 57 deletions chain/ton/provider/ctf_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/avast/retry-go/v4"
"github.com/testcontainers/testcontainers-go"

"github.com/xssnick/tonutils-go/address"
"github.com/xssnick/tonutils-go/tlb"
Comment thread
huangzhen1997 marked this conversation as resolved.
Outdated
"github.com/xssnick/tonutils-go/ton"
"github.com/xssnick/tonutils-go/ton/wallet"
Expand All @@ -34,6 +33,9 @@ const (

// supportedTONImageRepository is the only supported Docker image repository for TON localnet.
supportedTONImageRepository = "ghcr.io/neodix42/mylocalton-docker"

// defaultTxTONAmount is the default amount of TON to use for transactions.
defaultTxTONAmount = "0.1"
)

// CTFChainProviderConfig holds the configuration to initialize the CTFChainProvider.
Expand Down Expand Up @@ -122,18 +124,15 @@ func (p *CTFChainProvider) Initialize(ctx context.Context) (chain.BlockChain, er
return nil, fmt.Errorf("failed to create wallet: %w", err)
}

// airdrop the deployer wallet
ferr := fundTonWallets(ctx, nodeClient, []*address.Address{tonWallet.Address()}, []tlb.Coins{tlb.MustFromTON("1000")})
if ferr != nil {
return nil, fmt.Errorf("failed to fund wallet: %w", ferr)
}
Comment on lines -129 to -133
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omitting fund logic from network setup makes sense to me(if I am reading it right), but just a reminder that integration tests in core and chainlink-ton are relying on the deployer wallet to fund transmitters:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, think we removed this as we discussed that the integration tests already funded the deployer wallet


p.chain = &cldf_ton.Chain{
ChainMetadata: cldf_ton.ChainMetadata{Selector: p.selector},
Client: nodeClient,
Comment thread
huangzhen1997 marked this conversation as resolved.
Wallet: tonWallet,
WalletAddress: tonWallet.Address(),
WalletAddress: tonWallet.WalletAddress(),
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from tonWallet.Address() to tonWallet.WalletAddress() lacks test coverage. The existing test in ctf_provider_test.go only checks that WalletAddress is not empty but doesn't verify the correct method is being called or that the address value is as expected.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot This is not true, it's tested in rpc_provider_test.go line 276

Copy link
Copy Markdown
Contributor

@jadepark-dev jadepark-dev Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR but I wonder if we need to apply this change to the rest of the codebase. Any context on bounceable address?

// Address - returns old (bounce) version of wallet address
// DEPRECATED: because of address reform, use WalletAddress,
// it will return UQ format
func (w *Wallet) Address() *address.Address {
	return w.addr
}

// WalletAddress - returns new standard non bounce address
func (w *Wallet) WalletAddress() *address.Address {
	return w.addr.Bounce(false)
}

Copy link
Copy Markdown
Contributor Author

@huangzhen1997 huangzhen1997 Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to switch to the new WalletAddress() to have non-bounceable, but the underlying address data is identical, just the string rep could be different. Do you see any risk with this change ?

Comment thread
huangzhen1997 marked this conversation as resolved.
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code previously called tonWallet.Address() and now calls tonWallet.WalletAddress(). If these methods return different values or have different behaviors, this could break existing functionality. Verify that WalletAddress() returns the same address format as the previous Address() method.

Suggested change
WalletAddress: tonWallet.WalletAddress(),
WalletAddress: tonWallet.Address(),

Copilot uses AI. Check for mistakes.
URL: url,
TxOps: cldf_ton.TxOps{
Wallet: tonWallet,
Amount: tlb.MustFromTON(defaultTxTONAmount), // default amount for transactions
Comment thread
krebernisak marked this conversation as resolved.
Outdated
},
Comment thread
jadepark-dev marked this conversation as resolved.
Outdated
}

return *p.chain, nil
Expand Down Expand Up @@ -220,54 +219,6 @@ func createTonWallet(client ton.APIClientWrapped, versionConfig wallet.VersionCo
return pw, nil
}

func fundTonWallets(ctx context.Context, client ton.APIClientWrapped, recipients []*address.Address, amounts []tlb.Coins) error {
if len(amounts) != len(recipients) {
return errors.New("recipients and amounts must have the same length")
}

// initialize the prefunded wallet(Highload-V2), for other wallets, see https://github.com/neodix42/mylocalton-docker#pre-installed-wallets
version := wallet.HighloadV2Verified //nolint:staticcheck // SA1019: only available option in mylocalton-docker
rawHlWallet, err := wallet.FromSeed(client, strings.Fields(blockchain.DefaultTonHlWalletMnemonic), version)
if err != nil {
return fmt.Errorf("failed to create wallet from seed: %w", err)
}

mcFunderWallet, err := wallet.FromPrivateKeyWithOptions(client, rawHlWallet.PrivateKey(), version, wallet.WithWorkchain(-1))
if err != nil {
return fmt.Errorf("failed to create wallet from private key: %w", err)
}

funder, err := mcFunderWallet.GetSubwallet(uint32(42))
if err != nil {
return fmt.Errorf("failed to get subwallet: %w", err)
}

// double check funder address
if funder.Address().StringRaw() != blockchain.DefaultTonHlWalletAddress {
return fmt.Errorf("funder address mismatch: %s != %s", funder.Address().StringRaw(), blockchain.DefaultTonHlWalletAddress)
}

// create transfer messages for each recipient
messages := make([]*wallet.Message, len(recipients))
for i, addr := range recipients {
transfer, terr := funder.BuildTransfer(addr, amounts[i], false, "")
if terr != nil {
return fmt.Errorf("failed to build transfer: %w", terr)
}
messages[i] = transfer
}

// we don't wait for the transaction to be confirmed here, as it may take some time
// the name SendManyWaitTransaction is misleading, it doesn't wait for the transaction to be confirmed,
// it just sends the transactions(TON has asynchronous transactions)
_, _, txerr := funder.SendManyWaitTransaction(ctx, messages)
if txerr != nil {
return fmt.Errorf("failed to send many wait transaction: %w", txerr)
}

return nil
}

func getMasterchainBlockID(ctx context.Context, client ton.APIClientWrapped) (*ton.BlockIDExt, error) {
var masterchainBlockID *ton.BlockIDExt
// check connection, CTFv2 handles the readiness
Expand Down
2 changes: 1 addition & 1 deletion chain/ton/provider/ctf_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func Test_CTFChainProvider_Initialize(t *testing.T) {
require.True(t, ok, "expected got to be of type ton.Chain")
assert.Equal(t, tt.giveSelector, gotChain.Selector)
assert.NotEmpty(t, gotChain.Client)
assert.NotEmpty(t, gotChain.Wallet)
assert.NotEmpty(t, gotChain.TxOps)
assert.NotEmpty(t, gotChain.WalletAddress)
}
})
Expand Down
22 changes: 17 additions & 5 deletions chain/ton/provider/rpc_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"

"github.com/xssnick/tonutils-go/liteclient"
"github.com/xssnick/tonutils-go/tlb"
tonlib "github.com/xssnick/tonutils-go/ton"
"github.com/xssnick/tonutils-go/ton/wallet"

Expand All @@ -22,6 +23,8 @@ const (
WalletVersionV4R2 WalletVersion = "V4R2"
WalletVersionV5R1 WalletVersion = "V5R1"
WalletVersionDefault WalletVersion = ""

defaultAmountTonString = "0.1" // Default amount in TON for transactions
Comment thread
huangzhen1997 marked this conversation as resolved.
Outdated
)

// RPCChainProviderConfig holds the configuration to initialize the RPCChainProvider.
Expand Down Expand Up @@ -173,17 +176,26 @@ func (p *RPCChainProvider) Initialize(ctx context.Context) (chain.BlockChain, er
return nil, err
}

p.chain = &ton.Chain{
p.chain = buildChain(p.selector, api, tonWallet, p.config.HTTPURL)

return *p.chain, nil
}

// buildChain creates a ton.Chain with the given parameters and default TxOps amount.
func buildChain(selector uint64, api *tonlib.APIClient, tonWallet *wallet.Wallet, httpURL string) *ton.Chain {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what's the purpose of this method, which just instantiates the type vs just doing it without the method? Then we also have a Test_buildChain test for this method? Seems we could do without.

return &ton.Chain{
ChainMetadata: ton.ChainMetadata{
Selector: p.selector,
Selector: selector,
},
Client: api,
Wallet: tonWallet,
WalletAddress: tonWallet.WalletAddress(),
URL: p.config.HTTPURL,
URL: httpURL,
TxOps: ton.TxOps{
Wallet: tonWallet,
Amount: tlb.MustFromTON(defaultAmountTonString),
},
}

return *p.chain, nil
}

// createLiteclientConnectionPool creates connection pool returning concrete type for production use
Expand Down
47 changes: 47 additions & 0 deletions chain/ton/provider/rpc_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/xssnick/tonutils-go/tlb"
"github.com/xssnick/tonutils-go/ton/wallet"
Comment thread
huangzhen1997 marked this conversation as resolved.
Outdated

tonchain "github.com/smartcontractkit/chainlink-deployments-framework/chain/ton"
)
Expand Down Expand Up @@ -89,6 +91,22 @@ func Test_RPCChainProvider_Initialize(t *testing.T) {
assert.Equal(t, existingChain.Selector, gotChain.Selector)
}

func Test_RPCChainProvider_Initialize_InvalidConfig(t *testing.T) {
t.Parallel()

p := &RPCChainProvider{
selector: 123,
config: RPCChainProviderConfig{
HTTPURL: "", // invalid - missing URL
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says 'invalid - missing URL' but an empty string is technically a valid Go string value. Consider clarifying that this is testing validation logic for an empty/missing URL configuration.

Suggested change
HTTPURL: "", // invalid - missing URL
HTTPURL: "", // invalid: empty URL to test validation of missing/empty configuration

Copilot uses AI. Check for mistakes.
DeployerSignerGen: PrivateKeyRandom(),
},
}

_, err := p.Initialize(t.Context())
require.Error(t, err)
assert.Contains(t, err.Error(), "failed to validate provider config")
}
Comment thread
huangzhen1997 marked this conversation as resolved.

func Test_RPCChainProvider_Name(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -278,6 +296,35 @@ func Test_createWallet(t *testing.T) {
}
}

func Test_buildChain(t *testing.T) {
t.Parallel()

// Create a test wallet using a fixed private key
privateKey := make([]byte, 32)
for i := range privateKey {
privateKey[i] = byte(i)
}
testWallet, err := wallet.FromPrivateKeyWithOptions(nil, privateKey, wallet.V4R2, wallet.WithWorkchain(0))
require.NoError(t, err)

selector := uint64(789)
httpURL := "liteserver://publickey@localhost:8080"

chain := buildChain(selector, nil, testWallet, httpURL)

require.NotNil(t, chain)
assert.Equal(t, selector, chain.Selector)
assert.Equal(t, httpURL, chain.URL)
assert.Nil(t, chain.Client)
assert.Equal(t, testWallet, chain.Wallet)
assert.Equal(t, testWallet.WalletAddress(), chain.WalletAddress)

// Verify TxOps uses the default amount (0.1 TON)
expectedAmount := tlb.MustFromTON("0.1")
assert.Equal(t, expectedAmount, chain.TxOps.Amount)
assert.Equal(t, testWallet, chain.TxOps.Wallet)
}

func Test_createLiteclientConnectionPool_InvalidURL(t *testing.T) {
t.Parallel()

Expand Down
9 changes: 9 additions & 0 deletions chain/ton/ton_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,25 @@ import (
"github.com/xssnick/tonutils-go/ton"
"github.com/xssnick/tonutils-go/ton/wallet"

"github.com/xssnick/tonutils-go/tlb"

"github.com/smartcontractkit/chainlink-deployments-framework/chain/internal/common"
)

type ChainMetadata = common.ChainMetadata

// TxOps holds configuration for transaction operations.
type TxOps struct {
Wallet *wallet.Wallet // Wallet abstraction (signing, sending)
Amount tlb.Coins // Default amount for msg transfers
}

// Chain represents a TON chain.
type Chain struct {
ChainMetadata // Contains canonical chain identifier
Client *ton.APIClient // APIClient for Lite Server connection
Wallet *wallet.Wallet // Wallet abstraction (signing, sending)
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Wallet field is duplicated in both the Chain struct and the TxOps struct. This duplication could lead to maintenance issues and potential inconsistencies if the wallet reference needs to be updated. Consider removing the top-level Wallet field and accessing it through TxOps.Wallet instead, or document why both references are needed.

Suggested change
Wallet *wallet.Wallet // Wallet abstraction (signing, sending)

Copilot uses AI. Check for mistakes.
WalletAddress *address.Address // Address of deployer wallet
URL string // Liteserver URL
TxOps TxOps // Transaction operations configuration
}
49 changes: 33 additions & 16 deletions engine/cld/legacy/cli/mcmsv2/mcms_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/smartcontractkit/mcms/sdk/evm/bindings"
"github.com/smartcontractkit/mcms/sdk/solana"
"github.com/smartcontractkit/mcms/sdk/sui"
"github.com/smartcontractkit/mcms/sdk/ton"
"github.com/smartcontractkit/mcms/types"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -1183,6 +1184,8 @@ func newCfgv2(lggr logger.Logger, cmd *cobra.Command, domain cldf_domain.Domain,
if err != nil {
return nil, fmt.Errorf("error creating Sui timelock converter: %w", err)
}
case chainsel.FamilyTon:
converter = ton.NewTimelockConverter()
default:
return nil, fmt.Errorf("unsupported chain family %s", fam)
}
Expand Down Expand Up @@ -1489,18 +1492,18 @@ func getExecutorWithChainOverride(cfg *cfgv2, chainSelector types.ChainSelector)
if !ok {
return nil, fmt.Errorf("invalid encoder type: %T", encoder)
}
chain := cfg.blockchains.EVMChains()[uint64(chainSelector)]
c := cfg.blockchains.EVMChains()[uint64(chainSelector)]
Comment thread
gustavogama-cll marked this conversation as resolved.

return evm.NewExecutor(evmEncoder, chain.Client, chain.DeployerKey), nil
return evm.NewExecutor(evmEncoder, c.Client, c.DeployerKey), nil

case chainsel.FamilySolana:
solanaEncoder, ok := encoder.(*solana.Encoder)
if !ok {
return nil, fmt.Errorf("invalid encoder type: %T", encoder)
}
chain := cfg.blockchains.SolanaChains()[uint64(chainSelector)]
c := cfg.blockchains.SolanaChains()[uint64(chainSelector)]

return solana.NewExecutor(solanaEncoder, chain.Client, *chain.DeployerKey), nil
return solana.NewExecutor(solanaEncoder, c.Client, *c.DeployerKey), nil

case chainsel.FamilyAptos:
encoder, ok := encoder.(*aptos.Encoder)
Expand All @@ -1511,9 +1514,9 @@ func getExecutorWithChainOverride(cfg *cfgv2, chainSelector types.ChainSelector)
if err != nil {
return nil, fmt.Errorf("error getting aptos role from proposal: %w", err)
}
chain := cfg.blockchains.AptosChains()[uint64(chainSelector)]
c := cfg.blockchains.AptosChains()[uint64(chainSelector)]

return aptos.NewExecutor(chain.Client, chain.DeployerSigner, encoder, *role), nil
return aptos.NewExecutor(c.Client, c.DeployerSigner, encoder, *role), nil

case chainsel.FamilySui:
encoder, ok := encoder.(*sui.Encoder)
Expand All @@ -1524,10 +1527,18 @@ func getExecutorWithChainOverride(cfg *cfgv2, chainSelector types.ChainSelector)
if err != nil {
return nil, fmt.Errorf("error getting sui metadata from proposal: %w", err)
}
chain := cfg.blockchains.SuiChains()[uint64(chainSelector)]
c := cfg.blockchains.SuiChains()[uint64(chainSelector)]
entrypointEncoder := suibindings.NewCCIPEntrypointArgEncoder(metadata.RegistryObj, metadata.DeployerStateObj)

return sui.NewExecutor(chain.Client, chain.Signer, encoder, entrypointEncoder, metadata.McmsPackageID, metadata.Role, cfg.timelockProposal.ChainMetadata[chainSelector].MCMAddress, metadata.AccountObj, metadata.RegistryObj, metadata.TimelockObj)
return sui.NewExecutor(c.Client, c.Signer, encoder, entrypointEncoder, metadata.McmsPackageID, metadata.Role, cfg.timelockProposal.ChainMetadata[chainSelector].MCMAddress, metadata.AccountObj, metadata.RegistryObj, metadata.TimelockObj)
case chainsel.FamilyTon:
encoder, ok := encoder.(*ton.Encoder)
if !ok {
return nil, fmt.Errorf("error getting encoder for chain %d", cfg.chainSelector)
Comment thread
huangzhen1997 marked this conversation as resolved.
Outdated
Comment thread
huangzhen1997 marked this conversation as resolved.
Outdated
Comment thread
gustavogama-cll marked this conversation as resolved.
Outdated
}
c := cfg.blockchains.TonChains()[uint64(chainSelector)]

return ton.NewExecutor(encoder, c.Client, c.TxOps.Wallet, c.TxOps.Amount)
Comment thread
huangzhen1997 marked this conversation as resolved.
Outdated
default:
return nil, fmt.Errorf("unsupported chain family %s", family)
}
Expand Down Expand Up @@ -1557,26 +1568,29 @@ func getTimelockExecutorWithChainOverride(cfg *cfgv2, chainSelector types.ChainS
var executor sdk.TimelockExecutor
switch family {
case chainsel.FamilyEVM:
chain := cfg.blockchains.EVMChains()[uint64(chainSelector)]
c := cfg.blockchains.EVMChains()[uint64(chainSelector)]

executor = evm.NewTimelockExecutor(chain.Client, chain.DeployerKey)
executor = evm.NewTimelockExecutor(c.Client, c.DeployerKey)
case chainsel.FamilySolana:
chain := cfg.blockchains.SolanaChains()[uint64(chainSelector)]
executor = solana.NewTimelockExecutor(chain.Client, *chain.DeployerKey)
c := cfg.blockchains.SolanaChains()[uint64(chainSelector)]
executor = solana.NewTimelockExecutor(c.Client, *c.DeployerKey)
case chainsel.FamilyAptos:
chain := cfg.blockchains.AptosChains()[uint64(chainSelector)]
executor = aptos.NewTimelockExecutor(chain.Client, chain.DeployerSigner)
c := cfg.blockchains.AptosChains()[uint64(chainSelector)]
executor = aptos.NewTimelockExecutor(c.Client, c.DeployerSigner)
case chainsel.FamilySui:
chain := cfg.blockchains.SuiChains()[uint64(chainSelector)]
c := cfg.blockchains.SuiChains()[uint64(chainSelector)]
Comment thread
github-code-quality[bot] marked this conversation as resolved.
Fixed
metadata, err := suiMetadataFromProposal(chainSelector, cfg.timelockProposal)
if err != nil {
return nil, fmt.Errorf("error getting sui metadata from proposal: %w", err)
}
entrypointEncoder := suibindings.NewCCIPEntrypointArgEncoder(metadata.AccountObj, metadata.DeployerStateObj)
executor, err = sui.NewTimelockExecutor(chain.Client, chain.Signer, entrypointEncoder, metadata.McmsPackageID, metadata.RegistryObj, metadata.AccountObj)
executor, err = sui.NewTimelockExecutor(c.Client, c.Signer, entrypointEncoder, metadata.McmsPackageID, metadata.RegistryObj, metadata.AccountObj)
if err != nil {
return nil, fmt.Errorf("error creating sui timelock executor: %w", err)
}
case chainsel.FamilyTon:
c := cfg.blockchains.TonChains()[uint64(chainSelector)]
return ton.NewTimelockExecutor(c.Client, c.TxOps.Wallet, c.TxOps.Amount)
Comment thread
huangzhen1997 marked this conversation as resolved.
Outdated
Comment thread
huangzhen1997 marked this conversation as resolved.
Outdated
default:
return nil, fmt.Errorf("unsupported chain family %s", family)
}
Expand Down Expand Up @@ -1631,6 +1645,9 @@ var getInspectorFromChainSelector = func(cfg cfgv2) (sdk.Inspector, error) {
if err != nil {
return nil, fmt.Errorf("error creating sui inspector: %w", err)
}
case chainsel.FamilyTon:
chain := cfg.blockchains.TonChains()[cfg.chainSelector]
inspector = ton.NewInspector(chain.Client)
Comment thread
huangzhen1997 marked this conversation as resolved.
Comment thread
huangzhen1997 marked this conversation as resolved.
Comment thread
huangzhen1997 marked this conversation as resolved.
Comment on lines +1619 to +1620
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable 'chain' should be renamed to 'c' for consistency with the naming pattern used in the same function for other chain families (lines 1535, 1539, 1542, 1545).

Suggested change
chain := cfg.blockchains.TonChains()[cfg.chainSelector]
inspector = ton.NewInspector(chain.Client)
c := cfg.blockchains.TonChains()[cfg.chainSelector]
inspector = ton.NewInspector(c.Client)

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TON inspector creation in getInspectorFromChainSelector lacks test coverage. Add test cases to verify the inspector is created correctly for TON chains.

Copilot uses AI. Check for mistakes.
Comment thread
huangzhen1997 marked this conversation as resolved.
default:
return nil, fmt.Errorf("unsupported chain family %s", fam)
}
Expand Down
Loading
Loading