diff --git a/pkg/core/native/native_neo.go b/pkg/core/native/native_neo.go index 9978e0b97a..d4e507826e 100644 --- a/pkg/core/native/native_neo.go +++ b/pkg/core/native/native_neo.go @@ -192,18 +192,27 @@ func newNEO(cfg config.ProtocolConfiguration) *NEO { desc = newDescriptor("registerCandidate", smartcontract.BoolType, manifest.NewParameter("pubkey", smartcontract.PublicKeyType)) - md = newMethodAndPrice(n.registerCandidate, 0, callflag.States) + md = newMethodAndPrice(n.registerCandidate, 0, callflag.States, config.HFDefault, config.HFEchidna) + n.AddMethod(md, desc) + + md = newMethodAndPrice(n.registerCandidate, 0, callflag.States|callflag.AllowNotify, config.HFEchidna) n.AddMethod(md, desc) desc = newDescriptor("unregisterCandidate", smartcontract.BoolType, manifest.NewParameter("pubkey", smartcontract.PublicKeyType)) - md = newMethodAndPrice(n.unregisterCandidate, 1<<16, callflag.States) + md = newMethodAndPrice(n.unregisterCandidate, 1<<16, callflag.States, config.HFDefault, config.HFEchidna) + n.AddMethod(md, desc) + + md = newMethodAndPrice(n.unregisterCandidate, 1<<16, callflag.States|callflag.AllowNotify, config.HFEchidna) n.AddMethod(md, desc) desc = newDescriptor("vote", smartcontract.BoolType, manifest.NewParameter("account", smartcontract.Hash160Type), manifest.NewParameter("voteTo", smartcontract.PublicKeyType)) - md = newMethodAndPrice(n.vote, 1<<16, callflag.States) + md = newMethodAndPrice(n.vote, 1<<16, callflag.States, config.HFDefault, config.HFEchidna) + n.AddMethod(md, desc) + + md = newMethodAndPrice(n.vote, 1<<16, callflag.States|callflag.AllowNotify, config.HFEchidna) n.AddMethod(md, desc) desc = newDescriptor("getCandidates", smartcontract.ArrayType) diff --git a/pkg/interop/native/neo/neo.go b/pkg/interop/native/neo/neo.go index d536edd741..239ad266af 100644 --- a/pkg/interop/native/neo/neo.go +++ b/pkg/interop/native/neo/neo.go @@ -104,17 +104,17 @@ func SetRegisterPrice(amount int) { // RegisterCandidate represents `registerCandidate` method of NEO native contract. func RegisterCandidate(pub interop.PublicKey) bool { - return neogointernal.CallWithToken(Hash, "registerCandidate", int(contract.States), pub).(bool) + return neogointernal.CallWithToken(Hash, "registerCandidate", int(contract.States|contract.AllowNotify), pub).(bool) } // UnregisterCandidate represents `unregisterCandidate` method of NEO native contract. func UnregisterCandidate(pub interop.PublicKey) bool { - return neogointernal.CallWithToken(Hash, "unregisterCandidate", int(contract.States), pub).(bool) + return neogointernal.CallWithToken(Hash, "unregisterCandidate", int(contract.States|contract.AllowNotify), pub).(bool) } // Vote represents `vote` method of NEO native contract. func Vote(addr interop.Hash160, pub interop.PublicKey) bool { - return neogointernal.CallWithToken(Hash, "vote", int(contract.States), addr, pub).(bool) + return neogointernal.CallWithToken(Hash, "vote", int(contract.States|contract.AllowNotify), addr, pub).(bool) } // UnclaimedGAS represents `unclaimedGas` method of NEO native contract.