core: rename call flags

Also new States flag is added and ReadOnly flag is adjusted.
This commit is contained in:
Anna Shaleva 2020-12-11 10:34:01 +03:00
parent 3bbf7642ea
commit fadbae8997
16 changed files with 95 additions and 91 deletions

View file

@ -120,44 +120,44 @@ func newNEO() *NEO {
desc := newDescriptor("unclaimedGas", smartcontract.IntegerType,
manifest.NewParameter("account", smartcontract.Hash160Type),
manifest.NewParameter("end", smartcontract.IntegerType))
md := newMethodAndPrice(n.unclaimedGas, 3000000, smartcontract.AllowStates)
md := newMethodAndPrice(n.unclaimedGas, 3000000, smartcontract.ReadStates)
n.AddMethod(md, desc)
desc = newDescriptor("registerCandidate", smartcontract.BoolType,
manifest.NewParameter("pubkey", smartcontract.PublicKeyType))
md = newMethodAndPrice(n.registerCandidate, 5000000, smartcontract.AllowModifyStates)
md = newMethodAndPrice(n.registerCandidate, 5000000, smartcontract.WriteStates)
n.AddMethod(md, desc)
desc = newDescriptor("unregisterCandidate", smartcontract.BoolType,
manifest.NewParameter("pubkey", smartcontract.PublicKeyType))
md = newMethodAndPrice(n.unregisterCandidate, 5000000, smartcontract.AllowModifyStates)
md = newMethodAndPrice(n.unregisterCandidate, 5000000, smartcontract.WriteStates)
n.AddMethod(md, desc)
desc = newDescriptor("vote", smartcontract.BoolType,
manifest.NewParameter("account", smartcontract.Hash160Type),
manifest.NewParameter("pubkey", smartcontract.PublicKeyType))
md = newMethodAndPrice(n.vote, 5000000, smartcontract.AllowModifyStates)
md = newMethodAndPrice(n.vote, 5000000, smartcontract.WriteStates)
n.AddMethod(md, desc)
desc = newDescriptor("getCandidates", smartcontract.ArrayType)
md = newMethodAndPrice(n.getCandidatesCall, 100000000, smartcontract.AllowStates)
md = newMethodAndPrice(n.getCandidatesCall, 100000000, smartcontract.ReadStates)
n.AddMethod(md, desc)
desc = newDescriptor("getСommittee", smartcontract.ArrayType)
md = newMethodAndPrice(n.getCommittee, 100000000, smartcontract.AllowStates)
md = newMethodAndPrice(n.getCommittee, 100000000, smartcontract.ReadStates)
n.AddMethod(md, desc)
desc = newDescriptor("getNextBlockValidators", smartcontract.ArrayType)
md = newMethodAndPrice(n.getNextBlockValidators, 100000000, smartcontract.AllowStates)
md = newMethodAndPrice(n.getNextBlockValidators, 100000000, smartcontract.ReadStates)
n.AddMethod(md, desc)
desc = newDescriptor("getGasPerBlock", smartcontract.IntegerType)
md = newMethodAndPrice(n.getGASPerBlock, 100_0000, smartcontract.AllowStates)
md = newMethodAndPrice(n.getGASPerBlock, 100_0000, smartcontract.ReadStates)
n.AddMethod(md, desc)
desc = newDescriptor("setGasPerBlock", smartcontract.BoolType,
manifest.NewParameter("gasPerBlock", smartcontract.IntegerType))
md = newMethodAndPrice(n.setGASPerBlock, 500_0000, smartcontract.AllowModifyStates)
md = newMethodAndPrice(n.setGASPerBlock, 500_0000, smartcontract.WriteStates)
n.AddMethod(md, desc)
return n