diff --git a/subnet/subnet_contract.go b/subnet/subnet_contract.go index e3ca891..4e89ce6 100644 --- a/subnet/subnet_contract.go +++ b/subnet/subnet_contract.go @@ -38,6 +38,17 @@ func _deploy(data interface{}, isUpdate bool) { storage.Put(ctx, []byte{notaryDisabledKey}, args.notaryDisabled) } +// Update method updates contract source code and manifest. Can be invoked +// only by committee. +func Update(script []byte, manifest []byte, data interface{}) { + if !common.HasUpdateAccess() { + panic("only committee can update contract") + } + + contract.Call(interop.Hash160(management.Hash), "update", contract.All, script, manifest, data) + runtime.Log("subnet contract updated") +} + // Put creates new subnet with the specified owner and info. func Put(id []byte, ownerKey interop.PublicKey, info []byte) { if len(id) != 4 { @@ -120,17 +131,6 @@ func Delete(id []byte) { storage.Delete(ctx, key) } -// Update method updates contract source code and manifest. Can be invoked -// only by committee. -func Update(script []byte, manifest []byte, data interface{}) { - if !common.HasUpdateAccess() { - panic("only committee can update contract") - } - - contract.Call(interop.Hash160(management.Hash), "update", contract.All, script, manifest, data) - runtime.Log("subnet contract updated") -} - // Version returns version of the contract. func Version() int { return common.Version