smartcontract: rewrite trigger types for NEO3
This commit is contained in:
parent
a3b876d55c
commit
b12add5a78
4 changed files with 32 additions and 51 deletions
|
@ -272,7 +272,7 @@ func checkStorageContext(ic *interop.Context, stc *StorageContext) error {
|
|||
|
||||
// storageDelete deletes stored key-value pair.
|
||||
func storageDelete(ic *interop.Context, v *vm.VM) error {
|
||||
if ic.Trigger != trigger.Application && ic.Trigger != trigger.ApplicationR {
|
||||
if ic.Trigger != trigger.Application {
|
||||
return errors.New("can't delete when the trigger is not application")
|
||||
}
|
||||
stcInterface := v.Estack().Pop().Value()
|
||||
|
@ -337,7 +337,7 @@ func storageGetReadOnlyContext(ic *interop.Context, v *vm.VM) error {
|
|||
}
|
||||
|
||||
func putWithContextAndFlags(ic *interop.Context, stc *StorageContext, key []byte, value []byte, isConst bool) error {
|
||||
if ic.Trigger != trigger.Application && ic.Trigger != trigger.ApplicationR {
|
||||
if ic.Trigger != trigger.Application {
|
||||
return errors.New("can't delete when the trigger is not application")
|
||||
}
|
||||
if len(key) > MaxStorageKeyLen {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue