forked from nspcc-dev/neofs-contract
-
Notifications
You must be signed in to change notification settings - Fork 4
Netmap contract update routine #11
Copy link
Copy link
Open
Labels
discussionTalking about something in order to reach a decision or to exchange ideasTalking about something in order to reach a decision or to exchange ideas
Description
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.
frostfs-contract/netmap/netmap_contract.go
Lines 74 to 93 in 4f3c08f
| 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
discussionTalking about something in order to reach a decision or to exchange ideasTalking about something in order to reach a decision or to exchange ideas