Exemplo n.º 1
0
    def discovery(self, discovery_address: Address) -> Discovery:
        """ Return a proxy to interact with the discovery. """
        if not is_binary_address(discovery_address):
            raise ValueError('discovery_address must be a valid address')

        if discovery_address not in self.address_to_discovery:
            self.address_to_discovery[discovery_address] = Discovery(
                self.client,
                discovery_address,
            )

        return self.address_to_discovery[discovery_address]
Exemplo n.º 2
0
    def discovery(self, discovery_address: Address) -> Discovery:
        """ Return a proxy to interact with the discovery. """
        if not is_binary_address(discovery_address):
            raise ValueError('discovery_address must be a valid address')

        with self._discovery_creation_lock:
            if discovery_address not in self.address_to_discovery:
                self.address_to_discovery[discovery_address] = Discovery(
                    jsonrpc_client=self.client,
                    discovery_address=discovery_address,
                    contract_manager=self.contract_manager,
                )

        return self.address_to_discovery[discovery_address]
Exemplo n.º 3
0
    def discovery(self, discovery_address: bytes) -> Discovery:
        """ Return a proxy to interact with the discovery. """
        if not isaddress(discovery_address):
            raise ValueError('discovery_address must be a valid address')

        if discovery_address not in self.address_to_discovery:
            self.address_to_discovery[discovery_address] = Discovery(
                self.client,
                discovery_address,
                self.startgas,
                self.gasprice,
                self.poll_timeout,
            )

        return self.address_to_discovery[discovery_address]