Exemplo n.º 1
0
    def get_contract_addresses(self, instance_identifier):
        registrar_data = self.registrar_data
        matching_chain_definitions = get_matching_chain_definitions(
            self.chain.web3,
            registrar_data.get('deployments', {}),
        )

        identifier_exists = any(
            instance_identifier in registrar_data['deployments']
            [chain_definition]
            for chain_definition in matching_chain_definitions)
        if not identifier_exists:
            raise NoKnownAddress(
                "No known address for '{0}'".format(instance_identifier))

        for chain_definition in matching_chain_definitions:
            chain_deployments = registrar_data['deployments'][chain_definition]
            if instance_identifier in chain_deployments:
                yield chain_deployments[instance_identifier]
Exemplo n.º 2
0
    def get_contract_addresses(self, instance_identifier):
        registrar_data = self.registrar_data
        matching_chain_definitions = get_matching_chain_definitions(
            self.chain.web3,
            registrar_data.get('deployments', {}),
        )

        identifier_exists = any(
            instance_identifier in registrar_data['deployments']
            [chain_definition]
            for chain_definition in matching_chain_definitions)
        if not identifier_exists:
            raise NoKnownAddress(
                "No known address for '{0}'".format(instance_identifier))
        for chain_definition in matching_chain_definitions:
            chain_deployments = registrar_data['deployments'][chain_definition]
            if instance_identifier in chain_deployments:
                data = valmap(lambda x: x['timestamp'],
                              chain_deployments[instance_identifier]).items()
                yield tuple(map(lambda args: ContractMeta(*args), data))
Exemplo n.º 3
0
 def get_contract_addresses(self, instance_name):
     if instance_name in self.contract_meta:
         return self.contract_meta[instance_name]
     else:
         raise NoKnownAddress("No known address for '{0}'".format(instance_name))