From 4db5ef05f830c656a87204cc90dbb6f67ea86830 Mon Sep 17 00:00:00 2001 From: Evgeniy Stratonikov Date: Thu, 25 Feb 2021 18:12:36 +0300 Subject: [PATCH] core: fix call flags for `System.Contract.Call` Follow neo-project/neo#2292. --- pkg/compiler/interop_test.go | 2 +- pkg/core/interops.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/compiler/interop_test.go b/pkg/compiler/interop_test.go index 8f91cfca1..4fe4c25e0 100644 --- a/pkg/compiler/interop_test.go +++ b/pkg/compiler/interop_test.go @@ -197,7 +197,7 @@ func TestAppCall(t *testing.T) { }) t.Run("callEx, valid", func(t *testing.T) { - src := getCallExScript(fmt.Sprintf("%#v", ih.BytesBE()), "contract.AllowCall") + src := getCallExScript(fmt.Sprintf("%#v", ih.BytesBE()), "contract.ReadStates|contract.AllowCall") v := spawnVM(t, ic, src) require.NoError(t, v.Run()) diff --git a/pkg/core/interops.go b/pkg/core/interops.go index 021dbb725..32559c663 100644 --- a/pkg/core/interops.go +++ b/pkg/core/interops.go @@ -41,7 +41,7 @@ var systemInterops = []interop.Function{ {Name: interopnames.SystemBinaryItoa, Func: binary.Itoa, Price: 1 << 12, ParamCount: 2}, {Name: interopnames.SystemBinarySerialize, Func: binary.Serialize, Price: 1 << 12, ParamCount: 1}, {Name: interopnames.SystemContractCall, Func: contract.Call, Price: 1 << 15, - RequiredFlags: callflag.AllowCall, ParamCount: 4}, + RequiredFlags: callflag.ReadStates | callflag.AllowCall, ParamCount: 4}, {Name: interopnames.SystemContractCallNative, Func: native.Call, Price: 0, ParamCount: 1}, {Name: interopnames.SystemContractCreateMultisigAccount, Func: contractCreateMultisigAccount, Price: 1 << 8, ParamCount: 1}, {Name: interopnames.SystemContractCreateStandardAccount, Func: contractCreateStandardAccount, Price: 1 << 8, ParamCount: 1},