forked from TrueCloudLab/frostfs-contract
[#130] Panic at contract update failures
There is no practical cases not to panic at contract update routine. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
b555e200f4
commit
edd4864e39
10 changed files with 20 additions and 50 deletions
|
@ -50,18 +50,15 @@ func _deploy(data interface{}, isUpdate bool) {
|
|||
|
||||
// Update method updates contract source code and manifest. Can be invoked
|
||||
// only by contract owner.
|
||||
func Update(script []byte, manifest []byte, data interface{}) bool {
|
||||
func Update(script []byte, manifest []byte, data interface{}) {
|
||||
ctx := storage.GetReadOnlyContext()
|
||||
|
||||
if !common.HasUpdateAccess(ctx) {
|
||||
runtime.Log("only owner can update contract")
|
||||
return false
|
||||
panic("only owner can update contract")
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update", contract.All, script, manifest, data)
|
||||
runtime.Log("proxy contract updated")
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// Verify method returns true if transaction contains valid multi signature of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue