Revert "interop: use All flags for management deploy and update calls"

This reverts commit 37ca96c20b and a part of
7945097543, we need 0.98.2 release to be
3.1.0-compatible and this one breaks the testnet.
This commit is contained in:
Roman Khimov 2022-03-21 14:28:28 +03:00
parent ad1dd3ebb7
commit 526c423a61
2 changed files with 8 additions and 8 deletions

View file

@ -80,27 +80,27 @@ func newManagement() *Management {
desc = newDescriptor("deploy", smartcontract.ArrayType,
manifest.NewParameter("nefFile", smartcontract.ByteArrayType),
manifest.NewParameter("manifest", smartcontract.ByteArrayType))
md = newMethodAndPrice(m.deploy, 0, callflag.All)
md = newMethodAndPrice(m.deploy, 0, callflag.States|callflag.AllowNotify)
m.AddMethod(md, desc)
desc = newDescriptor("deploy", smartcontract.ArrayType,
manifest.NewParameter("nefFile", smartcontract.ByteArrayType),
manifest.NewParameter("manifest", smartcontract.ByteArrayType),
manifest.NewParameter("data", smartcontract.AnyType))
md = newMethodAndPrice(m.deployWithData, 0, callflag.All)
md = newMethodAndPrice(m.deployWithData, 0, callflag.States|callflag.AllowNotify)
m.AddMethod(md, desc)
desc = newDescriptor("update", smartcontract.VoidType,
manifest.NewParameter("nefFile", smartcontract.ByteArrayType),
manifest.NewParameter("manifest", smartcontract.ByteArrayType))
md = newMethodAndPrice(m.update, 0, callflag.All)
md = newMethodAndPrice(m.update, 0, callflag.States|callflag.AllowNotify)
m.AddMethod(md, desc)
desc = newDescriptor("update", smartcontract.VoidType,
manifest.NewParameter("nefFile", smartcontract.ByteArrayType),
manifest.NewParameter("manifest", smartcontract.ByteArrayType),
manifest.NewParameter("data", smartcontract.AnyType))
md = newMethodAndPrice(m.updateWithData, 0, callflag.All)
md = newMethodAndPrice(m.updateWithData, 0, callflag.States|callflag.AllowNotify)
m.AddMethod(md, desc)
desc = newDescriptor("destroy", smartcontract.VoidType)

View file

@ -16,13 +16,13 @@ const Hash = "\xfd\xa3\xfa\x43\x46\xea\x53\x2a\x25\x8f\xc4\x97\xdd\xad\xdb\x64\x
// Deploy represents `deploy` method of Management native contract.
func Deploy(script, manifest []byte) *Contract {
return neogointernal.CallWithToken(Hash, "deploy",
int(contract.All), script, manifest).(*Contract)
int(contract.States|contract.AllowNotify), script, manifest).(*Contract)
}
// DeployWithData represents `deploy` method of Management native contract.
func DeployWithData(script, manifest []byte, data interface{}) *Contract {
return neogointernal.CallWithToken(Hash, "deploy",
int(contract.All), script, manifest, data).(*Contract)
int(contract.States|contract.AllowNotify), script, manifest, data).(*Contract)
}
// Destroy represents `destroy` method of Management native contract.
@ -48,11 +48,11 @@ func SetMinimumDeploymentFee(value int) {
// Update represents `update` method of Management native contract.
func Update(script, manifest []byte) {
neogointernal.CallWithTokenNoRet(Hash, "update",
int(contract.All), script, manifest)
int(contract.States|contract.AllowNotify), script, manifest)
}
// UpdateWithData represents `update` method of Management native contract.
func UpdateWithData(script, manifest []byte, data interface{}) {
neogointernal.CallWithTokenNoRet(Hash, "update",
int(contract.All), script, manifest, data)
int(contract.States|contract.AllowNotify), script, manifest, data)
}