mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-21 23:29:38 +00:00
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 <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
d463bad96f
commit
35c3518b37
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue