Пример #1
0
 def eth(self):
     if 'ethereum' not in config:
         raise Exception("Missing ethereum configuration")
     if not hasattr(self, '_eth_jsonrpc_client'):
         self._eth_jsonrpc_client = prepare_ethereum_jsonrpc_client(
             config['ethereum'])
     return self._eth_jsonrpc_client
Пример #2
0
    async def test_bootnodes(self):

        """Tests that starting two parity instances giving one the first's
        node address as it's bootnode, the two instances communicate"""

        p1 = ParityServer()
        # set the app url so the faucet mixin uses p1
        config['ethereum'] = {'url': p1.dsn()['url']}

        p2 = ParityServer(bootnodes=p1.dsn()['node'])

        p2jsonrpc = prepare_ethereum_jsonrpc_client(p2.dsn())

        addr = '0x39bf9e501e61440b4b268d7b2e9aa2458dd201bb'
        val = 761751855997712

        filter_id = await p2jsonrpc.eth_newPendingTransactionFilter()

        faucet_tx_hash = await self.faucet(addr, val, wait_on_confirmation=False)

        # wait to find if the tx shows up on p2
        found = False
        while not found:
            res = await p2jsonrpc.eth_getFilterChanges(filter_id)
            for tx_hash in res:
                if tx_hash == faucet_tx_hash:
                    found = True
                    break
            else:
                await asyncio.sleep(1)
Пример #3
0
 def eth(self):
     if not hasattr(self, '_eth_jsonrpc_client'):
         self._eth_jsonrpc_client = prepare_ethereum_jsonrpc_client(
             config['ethereum'])
     return self._eth_jsonrpc_client