All FrostFS contracts aside netmap have simple update routine which is defined in if isUpdate branch of _deploy function.
Netmap contract have mandatory system config update and it requires specific arguments format for update function.
|
var args = data.(struct { |
|
notaryDisabled bool |
|
addrBalance interop.Hash160 |
|
addrContainer interop.Hash160 |
|
keys []interop.PublicKey |
|
config [][]byte |
|
version int |
|
}) |
|
|
|
ln := len(args.config) |
|
if ln%2 != 0 { |
|
panic("bad configuration") |
|
} |
|
|
|
for i := 0; i < ln/2; i++ { |
|
key := args.config[i*2] |
|
val := args.config[i*2+1] |
|
|
|
setConfig(ctx, key, val) |
|
} |
It looks to me as outdated code and it would be nice to have more flexibility in update arguments format for netmap contract. So my propose is to move if isUpdate branch before argument parsing and setConfig call.
All FrostFS contracts aside netmap have simple update routine which is defined in
if isUpdatebranch of_deployfunction.Netmap contract have mandatory system config update and it requires specific arguments format for update function.
frostfs-contract/netmap/netmap_contract.go
Lines 74 to 93 in 4f3c08f
It looks to me as outdated code and it would be nice to have more flexibility in update arguments format for netmap contract. So my propose is to move
if isUpdatebranch before argument parsing andsetConfigcall.