From a1fee6989267d66e35a7fa6158096133dd7b6d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Tue, 24 Feb 2026 11:22:23 +0900 Subject: [PATCH 1/4] Implement the test receiver interface --- deployment/testadapter/test_adapter.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/deployment/testadapter/test_adapter.go b/deployment/testadapter/test_adapter.go index c853890c2..5953f8f46 100644 --- a/deployment/testadapter/test_adapter.go +++ b/deployment/testadapter/test_adapter.go @@ -137,6 +137,29 @@ func (a *TONAdapter) CCIPReceiver() []byte { } return receiver } +func (a *TONAdapter) SetReceiverRejectAll(ctx context.Context, rejectAll bool) error { + receiverAddr, err := a.getAddress("Receiver") + if err != nil { + return err + } + + bodyCell := cell. + BeginCell(). + MustStoreBoolBit(rejectAll). + EndCell() + + _, _, err = a.Wallet.SendWaitTransaction(ctx, &wallet.Message{ + Mode: wallet.PayGasSeparately | wallet.IgnoreErrors, + InternalMessage: &tlb.InternalMessage{ + IHRDisabled: true, + Bounce: true, + DstAddr: &receiverAddr, + Amount: tlb.MustFromTON("0.1"), + Body: bodyCell, + }, + }) + return err +} func (a *TONAdapter) NativeFeeToken() string { return tvm.TonTokenAddr.String() From acaf964e4a55f533e225c337ac2de089b47d6b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Tue, 24 Feb 2026 11:22:41 +0900 Subject: [PATCH 2/4] Support passing custom extra args --- deployment/testadapter/test_adapter.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/deployment/testadapter/test_adapter.go b/deployment/testadapter/test_adapter.go index 5953f8f46..fbc5227ec 100644 --- a/deployment/testadapter/test_adapter.go +++ b/deployment/testadapter/test_adapter.go @@ -165,13 +165,30 @@ func (a *TONAdapter) NativeFeeToken() string { return tvm.TonTokenAddr.String() } +// TODO: use constants from chainlink-ccip once merged +const EXTRA_ARG_GAS_LIMIT = "gasLimit|computeUnits" +const EXTRA_ARG_OOO = "outOfOrderExecutionEnabled" + func (a *TONAdapter) GetExtraArgs(receiver []byte, sourceFamily string, opts ...testadapters.ExtraArgOpt) ([]byte, error) { switch sourceFamily { case chain_selectors.FamilyEVM: - return ccipcommon.SerializeClientGenericExtraArgsV2(msg_hasher163.ClientGenericExtraArgsV2{ + // defaults + extraArgs := msg_hasher163.ClientGenericExtraArgsV2{ GasLimit: new(big.Int).SetUint64(100_000_000), AllowOutOfOrderExecution: true, - }) + } + // override via options + for _, opt := range opts { + switch opt.Name { + case EXTRA_ARG_GAS_LIMIT: + extraArgs.GasLimit = opt.Value.(*big.Int) + case EXTRA_ARG_OOO: + extraArgs.AllowOutOfOrderExecution = opt.Value.(bool) + default: + // unsupported arg + } + } + return ccipcommon.SerializeClientGenericExtraArgsV2(extraArgs) case chain_selectors.FamilyTon: return nil, nil case chain_selectors.FamilySolana: From f7cd2dec3984352d67e6266210e024833cce1f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Tue, 24 Feb 2026 14:04:35 +0900 Subject: [PATCH 3/4] fix lint --- deployment/testadapter/test_adapter.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deployment/testadapter/test_adapter.go b/deployment/testadapter/test_adapter.go index fbc5227ec..80f08beae 100644 --- a/deployment/testadapter/test_adapter.go +++ b/deployment/testadapter/test_adapter.go @@ -166,8 +166,8 @@ func (a *TONAdapter) NativeFeeToken() string { } // TODO: use constants from chainlink-ccip once merged -const EXTRA_ARG_GAS_LIMIT = "gasLimit|computeUnits" -const EXTRA_ARG_OOO = "outOfOrderExecutionEnabled" +const ExtraArgGasLimit = "gasLimit|computeUnits" +const ExtraArgOOO = "outOfOrderExecutionEnabled" func (a *TONAdapter) GetExtraArgs(receiver []byte, sourceFamily string, opts ...testadapters.ExtraArgOpt) ([]byte, error) { switch sourceFamily { @@ -180,9 +180,9 @@ func (a *TONAdapter) GetExtraArgs(receiver []byte, sourceFamily string, opts ... // override via options for _, opt := range opts { switch opt.Name { - case EXTRA_ARG_GAS_LIMIT: + case ExtraArgGasLimit: extraArgs.GasLimit = opt.Value.(*big.Int) - case EXTRA_ARG_OOO: + case ExtraArgOOO: extraArgs.AllowOutOfOrderExecution = opt.Value.(bool) default: // unsupported arg From 21dad847d379dc568dfa1fcc9c41b9cbc59e3b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 27 Feb 2026 00:12:28 +0900 Subject: [PATCH 4/4] Fix receiver.UpdateBehavior serialization --- deployment/testadapter/test_adapter.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/deployment/testadapter/test_adapter.go b/deployment/testadapter/test_adapter.go index 80f08beae..3c03b8eeb 100644 --- a/deployment/testadapter/test_adapter.go +++ b/deployment/testadapter/test_adapter.go @@ -142,12 +142,19 @@ func (a *TONAdapter) SetReceiverRejectAll(ctx context.Context, rejectAll bool) e if err != nil { return err } + type updateBehavior struct { + _ tlb.Magic `tlb:"#e7fabde3" json:"-"` //nolint:revive // (opcode) should stay uninitialized + Behavior uint8 `tlb:"## 8"` + } + var behavior uint8 + if rejectAll { + behavior = 1 + } - bodyCell := cell. - BeginCell(). - MustStoreBoolBit(rejectAll). - EndCell() - + bodyCell, err := tlb.ToCell(updateBehavior{Behavior: behavior}) + if err != nil { + return err + } _, _, err = a.Wallet.SendWaitTransaction(ctx, &wallet.Message{ Mode: wallet.PayGasSeparately | wallet.IgnoreErrors, InternalMessage: &tlb.InternalMessage{