From 5b18f5974fe3bca89011a577e23a250780de41db Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 19 Mar 2021 18:57:00 +0300 Subject: [PATCH] core: fix storage.Delete price --- pkg/core/interop_system.go | 1 - pkg/core/interops.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/core/interop_system.go b/pkg/core/interop_system.go index b20e8a7da..6cbb2109e 100644 --- a/pkg/core/interop_system.go +++ b/pkg/core/interop_system.go @@ -69,7 +69,6 @@ func storageDelete(ic *interop.Context) error { if stc.ReadOnly { return errors.New("StorageContext is read only") } - ic.VM.AddGas(ic.Chain.GetPolicer().GetStoragePrice()) key := ic.VM.Estack().Pop().Bytes() return ic.DAO.DeleteStorageItem(stc.ID, key) } diff --git a/pkg/core/interops.go b/pkg/core/interops.go index ee99b9eed..6b4e88ac9 100644 --- a/pkg/core/interops.go +++ b/pkg/core/interops.go @@ -57,7 +57,7 @@ var systemInterops = []interop.Function{ {Name: interopnames.SystemRuntimeNotify, Func: runtime.Notify, Price: 1 << 15, RequiredFlags: callflag.AllowNotify, ParamCount: 2}, {Name: interopnames.SystemRuntimePlatform, Func: runtime.Platform, Price: 1 << 3}, - {Name: interopnames.SystemStorageDelete, Func: storageDelete, Price: 0, + {Name: interopnames.SystemStorageDelete, Func: storageDelete, Price: 1 << 15, RequiredFlags: callflag.WriteStates, ParamCount: 2}, {Name: interopnames.SystemStorageFind, Func: storageFind, Price: 1 << 15, RequiredFlags: callflag.ReadStates, ParamCount: 3},