Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions integration-tests/deployment/ccip/cs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func TestDeployCCIP(t *testing.T) {
{0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
{0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
}

configDigest := [32]byte{1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
env, _, err = commonchangeset.ApplyChangesets(t, env, []commonchangeset.ConfiguredChangeSet{
commonchangeset.Configure(tonops.SetOCR3Config{}, tonops.SetOCR3OffRampConfig{
Expand Down
4 changes: 0 additions & 4 deletions pkg/ccip/bindings/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ func (c CrossChainAddress) ToCell() (*cell.Cell, error) {
return nil, fmt.Errorf("crosschain address length %d exceeds maximum of %d bytes", len(c), CrossChainAddressMaxLength)
}

if addrLength == 0 {
return nil, errors.New("crosschain address is empty")
}

builder := cell.BeginCell()
err := builder.StoreSlice([]byte{uint8(addrLength)}, 8) // store the first byte as length
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

When addrLength is 0 (empty address), this will store a zero-length byte, but the subsequent StoreSlice(c, addrLength*8) call on the next line will attempt to store 0 bits. Verify that the cell builder correctly handles storing an empty slice and that downstream consumers can properly interpret a cross-chain address with length 0.

Copilot uses AI. Check for mistakes.
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccip/bindings/common/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestCrossChainAddress_ToCell(t *testing.T) {
addr CrossChainAddress
expectErr bool
}{
{"empty address", CrossChainAddress{}, true},
{"empty address", CrossChainAddress{}, false},
{"too short", CrossChainAddress{0x05}, false},
{"valid address", CrossChainAddress{0x01, 0xFF}, false},
{"too long", CrossChainAddress(make([]byte, 66)), true},
Expand Down
Loading