from typing import Dict

from boa3.model.builtin.interop.nativecontract import ContractManagementMethod
from boa3.model.variable import Variable


class HasMethod(ContractManagementMethod):

    def __init__(self):
        from boa3.model.type.collection.sequence.uint160type import UInt160Type
        from boa3.model.type.type import Type

        identifier = 'has_method'
        syscall = 'hasMethod'
        args: Dict[str, Variable] = {
            'hash': Variable(UInt160Type.build()),
            'method': Variable(Type.str),
            'parameter_count': Variable(Type.int)
        }

        super().__init__(identifier, syscall, args, return_type=Type.bool)
