From 35c3518b371c11e0e5a5adbc2b2de0e29927042e Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 19 May 2023 12:55:52 +0300 Subject: [PATCH] examples: fix owner's verification of Runtime example contract `update` and `destroy` methods of the contract should check for owner witness without checking the trigger (and that's the way how Verify method works for this contract). Signed-off-by: Anna Shaleva --- examples/runtime/runtime.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/runtime/runtime.go b/examples/runtime/runtime.go index 4a2616499..a98d39d29 100644 --- a/examples/runtime/runtime.go +++ b/examples/runtime/runtime.go @@ -65,7 +65,7 @@ func Verify() bool { // Destroy destroys the contract, only the owner can do that. func Destroy() { - if !Verify() { + if !CheckWitness() { panic("only owner can destroy") } management.Destroy() @@ -74,7 +74,7 @@ func Destroy() { // Update updates the contract, only the owner can do that. _deploy will be called // after update. func Update(nef, manifest []byte) { - if !Verify() { + if !CheckWitness() { panic("only owner can update") } management.Update(nef, manifest)