Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
36eca40
Setup env
krebernisak Sep 25, 2025
0ac14d4
Add TON domain - add configurer
krebernisak Sep 25, 2025
ab29df2
Encode SetConfig message
krebernisak Sep 25, 2025
8d4ffc3
Add ton.ConfigTransformer
krebernisak Sep 25, 2025
f13911c
Implement transformer.ToConfig
krebernisak Sep 25, 2025
821891d
Add sdk/ton/encoder.go
krebernisak Sep 26, 2025
6325452
Add TON Encoder.HashMetadata
krebernisak Sep 26, 2025
60bc62a
Add sdk/ton/inspector.go
krebernisak Sep 26, 2025
9e04ccc
Add sdk.Inspector#GetRootMetadata
krebernisak Sep 26, 2025
77a2f90
Add sdk/ton/timelock_inspector.go
krebernisak Sep 28, 2025
e74fda1
Add sdk/ton/transaction.go
krebernisak Sep 28, 2025
d501d4c
Add sdk/ton/timelock_executor.go
krebernisak Oct 22, 2025
cd949ad
Add sdk/ton/timelock_converter.go
krebernisak Oct 22, 2025
9b4480b
Add sdk/ton/executor.go
krebernisak Oct 22, 2025
65a458c
Add signature and proof encoders
krebernisak Oct 22, 2025
b4833c3
Update signatures and proof encoders type
krebernisak Oct 22, 2025
96012a5
Add sdk/ton/decoder.go
krebernisak Oct 28, 2025
7fe80ad
Bump github.com/smartcontractkit/chainlink-ton
krebernisak Oct 29, 2025
da11bcc
Add cselectors.FamilyTon as option
krebernisak Oct 29, 2025
1cea1ff
Add changesets and test entrypoints
krebernisak Oct 29, 2025
ee976cd
Add TON e2e setup + TimelockInspectionTestSuite stub (evm)
krebernisak Oct 29, 2025
63526fd
Add Configurer option to not send transactions (NONEVM-2862) - TON
krebernisak Oct 29, 2025
f3b1fd1
Add sdk/ton/decoded_operation_test.go
krebernisak Oct 29, 2025
ebd0385
Add sdk/ton/decoder_test.go
krebernisak Oct 29, 2025
3250299
Add sdk/ton/encoder_test.go
krebernisak Oct 30, 2025
ab2ff59
Add sdk/ton/config_transformer_test.go
krebernisak Oct 31, 2025
4163a29
Add sdk/ton/timelock_converter_test.go
krebernisak Nov 1, 2025
7903018
Configure mockery v2
krebernisak Nov 2, 2025
645e48c
Bump chainlink-ton
krebernisak Nov 2, 2025
da04273
Add wallet.TonAPI mock
krebernisak Nov 2, 2025
b2b676d
Add sdk/ton/configurer_test.go
krebernisak Nov 2, 2025
2d8d725
Add sdk/ton/executor_test.go
krebernisak Nov 3, 2025
868545a
Add sdk/ton/timelock_executor_test.go
krebernisak Nov 3, 2025
d14c388
Add timelock inspector getRoleMembers helper func
krebernisak Nov 3, 2025
e35bd66
Add sdk/ton/timelock_inspector_test.go
krebernisak Nov 3, 2025
099a18a
Add sdk/ton/timelock_inspector_test.go
krebernisak Nov 4, 2025
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
5 changes: 5 additions & 0 deletions .changeset/long-snakes-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@smartcontractkit/mcms": minor
---

Add TON implementation and unit/e2e tests
2 changes: 2 additions & 0 deletions .envrc
Copy link
Contributor

Choose a reason for hiding this comment

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

is nix mandatory for ton?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey! Nix is added to support dev environments for devs that use Nix.

Nix is also the way to get chainlink-ton packages, in this case I will need the TON contracts package, which I can easily pull from source with Nix. This is required to deploy contracts.

Same as we import Go bindings from a commit with Go,
we import TON contract artifacts from a commit with Nix.

Nix is an orthogonal add-on - this means that folks can use it or set up things manually.

For TON, some tools like Go need to be in a path and TON compiled contracts need to be available on a path defined with an env var. One can just run a prepared Nix shell to get all of that, or set up things manually.

Once I get everything working, I will also document how to get a TON env running manually as well.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
watch_file shell.nix
use flake || use nix
18 changes: 18 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ mockname: "{{.InterfaceName}}"
inpackage: false
outpkg: mocks
packages:
github.com/xssnick/tonutils-go/ton/wallet:
config:
all: false
outpkg: "mock_ton"
interfaces:
TonAPI:
config:
dir: "./sdk/ton/mocks"
filename: "wallet.go"
github.com/xssnick/tonutils-go/ton:
config:
all: false
outpkg: "mock_ton"
interfaces:
APIClientWrapped:
config:
dir: "./sdk/ton/mocks"
filename: "api.go"
github.com/smartcontractkit/mcms/sdk:
github.com/smartcontractkit/mcms/sdk/evm:
github.com/smartcontractkit/mcms/sdk/evm/bindings:
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
golang 1.24.4
golangci-lint 2.1.6
mockery 2.53.4
mockery 2.53.5
nodejs 20.16.0
pnpm 9.6.0
task 3.40.0
Expand Down
10 changes: 10 additions & 0 deletions e2e/config.ton.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
private_keys = [
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d",
"0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"
]

[ton_config]
type = "ton"
image = "ghcr.io/neodix42/mylocalton-docker:v3.7"
5 changes: 5 additions & 0 deletions e2e/tests/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
evme2e "github.com/smartcontractkit/mcms/e2e/tests/evm"
solanae2e "github.com/smartcontractkit/mcms/e2e/tests/solana"
suie2e "github.com/smartcontractkit/mcms/e2e/tests/sui"
tone2e "github.com/smartcontractkit/mcms/e2e/tests/ton"
)

func TestEVMSuite(t *testing.T) {
Expand Down Expand Up @@ -40,3 +41,7 @@ func TestSuiSuite(t *testing.T) {
suite.Run(t, new(suie2e.TimelockCancelProposalTestSuite))
suite.Run(t, new(suie2e.MCMSUserUpgradeTestSuite))
}

func TestTONSuite(t *testing.T) {
suite.Run(t, new(tone2e.TimelockInspectionTestSuite))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd strongly suggest to add the rest e2e tests before merging this one if possible. In past implementations like EVM/Solana they were super helpful to catch errors early. It saved us a lot of time specially when integrating with CLD. I know its a lot of work, so if not possible in this one at least having a followup before releasing the first TON mcms lib version

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure! At this point (1) implementation done, (2) unit test done (EVM parity), (3) e2e tests WIP

}
32 changes: 32 additions & 0 deletions e2e/tests/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import (
"github.com/gagliardetto/solana-go/rpc/ws"
"github.com/joho/godotenv"
"github.com/stretchr/testify/require"
"github.com/xssnick/tonutils-go/ton"

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

"github.com/smartcontractkit/chainlink-testing-framework/framework"
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
Expand All @@ -39,6 +42,7 @@ type Config struct {
SolanaChain *blockchain.Input `toml:"solana_config"`
AptosChain *blockchain.Input `toml:"aptos_config"`
SuiChain *blockchain.Input `toml:"sui_config"`
TonChain *blockchain.Input `toml:"ton_config"`

Settings struct {
PrivateKeys []string `toml:"private_keys"`
Expand All @@ -57,6 +61,8 @@ type TestSetup struct {
AptosBlockchain *blockchain.Output
SuiClient sui.ISuiAPI
SuiBlockchain *blockchain.Output
TonClient *ton.APIClient
TonBlockchain *blockchain.Output
Config
}

Expand Down Expand Up @@ -203,6 +209,30 @@ func InitializeSharedTestSetup(t *testing.T) *TestSetup {
t.Logf("Initialized Sui RPC client @ %s", nodeUrl)
}

var (
tonClient *ton.APIClient
tonBlockchainOutput *blockchain.Output
)
if in.TonChain != nil {
// Use blockchain network setup (fallback)
ports := freeport.GetN(t, 2)
port := ports[0]
faucetPort := ports[1]
in.TonChain.Port = strconv.Itoa(port)
in.TonChain.FaucetPort = strconv.Itoa(faucetPort)

tonBlockchainOutput, err = blockchain.NewBlockchainNetwork(in.TonChain)
require.NoError(t, err, "Failed to initialize TON blockchain")

nodeUrl := tonBlockchainOutput.Nodes[0].ExternalHTTPUrl
pool, err := tonchain.CreateLiteserverConnectionPool(ctx, nodeUrl)
require.NoError(t, err, "Failed to initialize TON client - failed to create liteserver connection pool")
tonClient = ton.NewAPIClient(pool, ton.ProofCheckPolicyFast)

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

sharedSetup = &TestSetup{
ClientA: ethClientA,
ClientB: ethClientB,
Expand All @@ -213,6 +243,8 @@ func InitializeSharedTestSetup(t *testing.T) *TestSetup {
AptosBlockchain: aptosBlockchainOutput,
SuiClient: suiClient,
SuiBlockchain: suiBlockchainOutput,
TonClient: tonClient,
TonBlockchain: tonBlockchainOutput,
Config: *in,
}
})
Expand Down
Loading
Loading