From 13336f9dba548bada049038ed436dc1be37acc22 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 3 Aug 2020 16:09:10 +0300 Subject: [PATCH] core: adjust calling flags of native Policy methods --- pkg/core/native/policy.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/core/native/policy.go b/pkg/core/native/policy.go index 221a94de6..73d5fc457 100644 --- a/pkg/core/native/policy.go +++ b/pkg/core/native/policy.go @@ -65,44 +65,44 @@ func newPolicy() *Policy { p.Manifest.Features |= smartcontract.HasStorage desc := newDescriptor("getMaxTransactionsPerBlock", smartcontract.IntegerType) - md := newMethodAndPrice(p.getMaxTransactionsPerBlock, 1000000, smartcontract.NoneFlag) + md := newMethodAndPrice(p.getMaxTransactionsPerBlock, 1000000, smartcontract.AllowStates) p.AddMethod(md, desc, true) desc = newDescriptor("getMaxBlockSize", smartcontract.IntegerType) - md = newMethodAndPrice(p.getMaxBlockSize, 1000000, smartcontract.NoneFlag) + md = newMethodAndPrice(p.getMaxBlockSize, 1000000, smartcontract.AllowStates) p.AddMethod(md, desc, true) desc = newDescriptor("getFeePerByte", smartcontract.IntegerType) - md = newMethodAndPrice(p.getFeePerByte, 1000000, smartcontract.NoneFlag) + md = newMethodAndPrice(p.getFeePerByte, 1000000, smartcontract.AllowStates) p.AddMethod(md, desc, true) desc = newDescriptor("getBlockedAccounts", smartcontract.ArrayType) - md = newMethodAndPrice(p.getBlockedAccounts, 1000000, smartcontract.NoneFlag) + md = newMethodAndPrice(p.getBlockedAccounts, 1000000, smartcontract.AllowStates) p.AddMethod(md, desc, true) desc = newDescriptor("setMaxBlockSize", smartcontract.BoolType, manifest.NewParameter("value", smartcontract.IntegerType)) - md = newMethodAndPrice(p.setMaxBlockSize, 3000000, smartcontract.NoneFlag) + md = newMethodAndPrice(p.setMaxBlockSize, 3000000, smartcontract.AllowModifyStates) p.AddMethod(md, desc, false) desc = newDescriptor("setMaxTransactionsPerBlock", smartcontract.BoolType, manifest.NewParameter("value", smartcontract.IntegerType)) - md = newMethodAndPrice(p.setMaxTransactionsPerBlock, 3000000, smartcontract.NoneFlag) + md = newMethodAndPrice(p.setMaxTransactionsPerBlock, 3000000, smartcontract.AllowModifyStates) p.AddMethod(md, desc, false) desc = newDescriptor("setFeePerByte", smartcontract.BoolType, manifest.NewParameter("value", smartcontract.IntegerType)) - md = newMethodAndPrice(p.setFeePerByte, 3000000, smartcontract.NoneFlag) + md = newMethodAndPrice(p.setFeePerByte, 3000000, smartcontract.AllowModifyStates) p.AddMethod(md, desc, false) desc = newDescriptor("blockAccount", smartcontract.BoolType, manifest.NewParameter("account", smartcontract.Hash160Type)) - md = newMethodAndPrice(p.blockAccount, 3000000, smartcontract.NoneFlag) + md = newMethodAndPrice(p.blockAccount, 3000000, smartcontract.AllowModifyStates) p.AddMethod(md, desc, false) desc = newDescriptor("unblockAccount", smartcontract.BoolType, manifest.NewParameter("account", smartcontract.Hash160Type)) - md = newMethodAndPrice(p.unblockAccount, 3000000, smartcontract.NoneFlag) + md = newMethodAndPrice(p.unblockAccount, 3000000, smartcontract.AllowModifyStates) p.AddMethod(md, desc, false) desc = newDescriptor("onPersist", smartcontract.VoidType)