core: fix native method call flags

Replace `WriteStates` with `States`.

Follow neo-project/neo#2339.
Close #1775.
Related #1725.
This commit is contained in:
Evgeniy Stratonikov 2021-02-25 18:04:46 +03:00
parent 492a89eb02
commit cbda20aca3
18 changed files with 68 additions and 72 deletions

View file

@ -260,11 +260,7 @@ func testContractCall(t *testing.T, hash util.Uint160, md interop.MethodAndPrice
require.Equal(t, md.MD.Name, method)
fs := callflag.CallFlag(int32(v.Estack().Pop().BigInt().Int64()))
extended := md.RequiredFlags // In some (all?) cases it's desirable to have Read permissions where Write is also allowed.
if md.RequiredFlags&callflag.WriteStates != 0 {
extended |= callflag.ReadStates
}
require.True(t, fs == md.RequiredFlags || fs == extended)
require.Equal(t, fs, md.RequiredFlags)
args := v.Estack().Pop().Array()
require.Equal(t, len(md.MD.Parameters), len(args))