Skip to content

Netmap contract update routine #11

@alexvanin

Description

@alexvanin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionTalking about something in order to reach a decision or to exchange ideas

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions