mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
core: fix native method call flags
Replace `WriteStates` with `States`. Follow neo-project/neo#2339. Close #1775. Related #1725.
This commit is contained in:
parent
492a89eb02
commit
cbda20aca3
18 changed files with 68 additions and 72 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue