From 4f184498bc4270f1acd88b5b5775869dad665ebc Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 13 Jul 2022 17:54:17 +0300 Subject: [PATCH] interop: add management.HasMethod() --- pkg/interop/native/management/management.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/interop/native/management/management.go b/pkg/interop/native/management/management.go index 0f3fbe20f..8e392a2c7 100644 --- a/pkg/interop/native/management/management.go +++ b/pkg/interop/native/management/management.go @@ -40,6 +40,12 @@ func GetMinimumDeploymentFee() int { return neogointernal.CallWithToken(Hash, "getMinimumDeploymentFee", int(contract.ReadStates)).(int) } +// HasMethod represents `hasMethod` method of Management native contract. It allows to check +// if the "hash" contract has a method named "method" with parameters number equal to "pcount". +func HasMethod(hash interop.Hash160, method string, pcount int) bool { + return neogointernal.CallWithToken(Hash, "hasMethod", int(contract.ReadStates), hash, method, pcount).(bool) +} + // SetMinimumDeploymentFee represents `setMinimumDeploymentFee` method of Management native contract. func SetMinimumDeploymentFee(value int) { neogointernal.CallWithTokenNoRet(Hash, "setMinimumDeploymentFee", int(contract.States), value)