Skip to content

Commit e96831f

Browse files
authored
fix add allowed modules (#377)
1 parent 974ac24 commit e96831f

9 files changed

Lines changed: 229 additions & 165 deletions

File tree

bindings/mcms_encoder.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ func (e *CCIPEntrypointArgEncoder) EncodeEntryPointArg(executingCallbackParams *
143143
switch function {
144144
case "accept_ownership":
145145
return moduleStateObj.Encoder().McmsAcceptOwnershipWithArgs(stateObj, registryObj, executingCallbackParams)
146+
case "add_allowed_modules":
147+
return moduleStateObj.Encoder().McmsAddAllowedModulesWithArgs(registryObj, executingCallbackParams)
148+
case "remove_allowed_modules":
149+
return moduleStateObj.Encoder().McmsRemoveAllowedModulesWithArgs(registryObj, executingCallbackParams)
146150
}
147151

148152
// OFFRAMP

bindings/mcms_encoder_test.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,49 @@ func TestEncodeEntryPointArg_ManagedToken(t *testing.T) {
958958
}
959959
}
960960

961+
func TestEncodeEntryPointArg_StateObject(t *testing.T) {
962+
encoder := &CCIPEntrypointArgEncoder{
963+
registryObjID: "0x1234567890123456789012345678901234567890123456789012345678901234",
964+
}
965+
966+
target := "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
967+
stateObjID := "0x9999999999999999999999999999999999999999999999999999999999999999"
968+
executingCallbackParams := &transaction.Argument{}
969+
970+
for _, tc := range []struct {
971+
name string
972+
function string
973+
}{
974+
{name: "add_allowed_modules", function: "add_allowed_modules"},
975+
{name: "remove_allowed_modules", function: "remove_allowed_modules"},
976+
} {
977+
t.Run(tc.name, func(t *testing.T) {
978+
data := []byte{}
979+
980+
result, err := encoder.EncodeEntryPointArg(
981+
executingCallbackParams,
982+
target,
983+
"state_object",
984+
tc.function,
985+
stateObjID,
986+
data,
987+
[]string{},
988+
)
989+
990+
require.NoError(t, err)
991+
assert.NotNil(t, result)
992+
assert.Equal(t, "state_object", result.Module.ModuleName)
993+
assert.Equal(t, fmt.Sprintf("mcms_%s", tc.function), result.Function)
994+
// 2 args: registry + executingCallbackParams (no stateObj / ccipRef)
995+
require.Len(t, result.CallArgs, 2, "Expected 2 arguments: registry, executingCallbackParams")
996+
997+
registryFromResult, err := extractObjectID(result.CallArgs[0])
998+
require.NoError(t, err)
999+
assert.Equal(t, encoder.registryObjID, registryFromResult, "First arg should be the registry object")
1000+
})
1001+
}
1002+
}
1003+
9611004
func TestEncodeEntryPointArg_UnknownModule(t *testing.T) {
9621005
encoder := &CCIPEntrypointArgEncoder{
9631006
registryObjID: "0x1234567890123456789012345678901234567890123456789012345678901234",

deployment/go.mod

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ replace github.com/smartcontractkit/chainlink-sui => ../
99

1010
require (
1111
github.com/Masterminds/semver/v3 v3.4.0
12-
github.com/block-vision/sui-go-sdk v1.1.3
12+
github.com/block-vision/sui-go-sdk v1.1.4
1313
github.com/ethereum/go-ethereum v1.17.1
1414
github.com/google/go-cmp v0.7.0
1515
github.com/smartcontractkit/chain-selectors v1.0.97
1616
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260311190822-5cbfc939dd16
1717
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260406055916-9aa6b6c0ae81
1818
github.com/smartcontractkit/chainlink-deployments-framework v0.75.0
19-
github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471
20-
github.com/smartcontractkit/mcms v0.34.0
19+
github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9
20+
github.com/smartcontractkit/mcms v0.40.1
2121
github.com/stretchr/testify v1.11.1
2222
golang.org/x/sync v0.19.0
2323
)
@@ -28,7 +28,7 @@ require (
2828
github.com/Microsoft/go-winio v0.6.2 // indirect
2929
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect
3030
github.com/XSAM/otelsql v0.37.0 // indirect
31-
github.com/aptos-labs/aptos-go-sdk v1.11.0 // indirect
31+
github.com/aptos-labs/aptos-go-sdk v1.12.0 // indirect
3232
github.com/avast/retry-go/v4 v4.6.1 // indirect
3333
github.com/bahlo/generic-list-go v0.2.0 // indirect
3434
github.com/benbjohnson/clock v1.3.5 // indirect
@@ -57,7 +57,7 @@ require (
5757
github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect
5858
github.com/fsnotify/fsnotify v1.9.0 // indirect
5959
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
60-
github.com/gabriel-vasile/mimetype v1.4.10 // indirect
60+
github.com/gabriel-vasile/mimetype v1.4.12 // indirect
6161
github.com/gagliardetto/binary v0.8.0 // indirect
6262
github.com/gagliardetto/solana-go v1.13.0 // indirect
6363
github.com/gagliardetto/treeout v0.1.4 // indirect
@@ -67,8 +67,8 @@ require (
6767
github.com/go-ole/go-ole v1.3.0 // indirect
6868
github.com/go-playground/locales v0.14.1 // indirect
6969
github.com/go-playground/universal-translator v0.18.1 // indirect
70-
github.com/go-playground/validator/v10 v10.28.0 // indirect
71-
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
70+
github.com/go-playground/validator/v10 v10.30.1 // indirect
71+
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
7272
github.com/golang/protobuf v1.5.4 // indirect
7373
github.com/google/uuid v1.6.0 // indirect
7474
github.com/gorilla/websocket v1.5.3 // indirect
@@ -81,7 +81,7 @@ require (
8181
github.com/hashicorp/go-hclog v1.6.3 // indirect
8282
github.com/hashicorp/go-plugin v1.7.0 // indirect
8383
github.com/hashicorp/yamux v0.1.2 // indirect
84-
github.com/hasura/go-graphql-client v0.14.5 // indirect
84+
github.com/hasura/go-graphql-client v0.15.1 // indirect
8585
github.com/hdevalence/ed25519consensus v0.2.0 // indirect
8686
github.com/holiman/uint256 v1.3.2 // indirect
8787
github.com/invopop/jsonschema v0.13.0 // indirect
@@ -117,27 +117,27 @@ require (
117117
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
118118
github.com/pkg/errors v0.9.1 // indirect
119119
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
120-
github.com/prometheus/client_golang v1.23.0 // indirect
120+
github.com/prometheus/client_golang v1.23.2 // indirect
121121
github.com/prometheus/client_model v0.6.2 // indirect
122-
github.com/prometheus/common v0.65.0 // indirect
122+
github.com/prometheus/common v0.66.1 // indirect
123123
github.com/prometheus/procfs v0.16.1 // indirect
124124
github.com/samber/lo v1.52.0 // indirect
125125
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
126126
github.com/scylladb/go-reflectx v1.0.1 // indirect
127127
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
128128
github.com/shopspring/decimal v1.4.0 // indirect
129129
github.com/sigurn/crc16 v0.0.0-20211026045750-20ab5afb07e3 // indirect
130-
github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 // indirect
130+
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260304220149-1006d5f7bd76 // indirect
131131
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d // indirect
132132
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 // indirect
133133
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect
134134
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260326111235-8c09d1a4491f // indirect
135135
github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect
136136
github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect
137137
github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect
138-
github.com/smartcontractkit/chainlink-ton v0.0.0-20260115170733-b16e9683d4d5 // indirect
138+
github.com/smartcontractkit/chainlink-ton v0.0.0-20260219201907-054376f21418 // indirect
139139
github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 // indirect
140-
github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e // indirect
140+
github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad // indirect
141141
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect
142142
github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d // indirect
143143
github.com/spf13/cast v1.10.0 // indirect
@@ -151,7 +151,7 @@ require (
151151
github.com/tklauser/go-sysconf v0.3.15 // indirect
152152
github.com/tklauser/numcpus v0.10.0 // indirect
153153
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
154-
github.com/valyala/fastjson v1.6.4 // indirect
154+
github.com/valyala/fastjson v1.6.10 // indirect
155155
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
156156
github.com/x448/float16 v0.8.4 // indirect
157157
github.com/xssnick/tonutils-go v1.14.1 // indirect
@@ -182,14 +182,15 @@ require (
182182
go.uber.org/multierr v1.11.0 // indirect
183183
go.uber.org/ratelimit v0.3.1 // indirect
184184
go.uber.org/zap v1.27.1 // indirect
185+
go.yaml.in/yaml/v2 v2.4.2 // indirect
185186
golang.org/x/crypto v0.48.0 // indirect
186-
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect
187-
golang.org/x/net v0.49.0 // indirect
187+
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect
188+
golang.org/x/net v0.50.0 // indirect
188189
golang.org/x/sys v0.41.0 // indirect
189190
golang.org/x/term v0.40.0 // indirect
190191
golang.org/x/text v0.34.0 // indirect
191192
golang.org/x/time v0.14.0 // indirect
192-
golang.org/x/tools v0.41.0 // indirect
193+
golang.org/x/tools v0.42.0 // indirect
193194
google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect
194195
google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect
195196
google.golang.org/grpc v1.78.0 // indirect

0 commit comments

Comments
 (0)