diff --git a/mmgen/proto/eth/contract.py b/mmgen/proto/eth/contract.py index 4c3a46b5..752503a9 100755 --- a/mmgen/proto/eth/contract.py +++ b/mmgen/proto/eth/contract.py @@ -125,7 +125,6 @@ class Token(Contract): return int(ret, 16) except: msg(f'RPC call to decimals() failed (returned {ret!r})') - return None async def get_total_supply(self): return await self.do_call('totalSupply()', toUnit=True) @@ -170,7 +169,7 @@ class Token(Contract): 'nonce': nonce, 'data': bytes.fromhex(data)} - # used for token deployment only: + # used for testing only: async def transfer( self, *, diff --git a/mmgen/proto/eth/tw/addresses.py b/mmgen/proto/eth/tw/addresses.py index e1cc7546..568b5cfe 100755 --- a/mmgen/proto/eth/tw/addresses.py +++ b/mmgen/proto/eth/tw/addresses.py @@ -75,7 +75,7 @@ class EthereumTwAddresses(TwAddresses, EthereumTwView, EthereumTwRPC): 'addr': e.coinaddr, 'amt': bal, 'recvd': bal, # since it’s nearly impossible to empty an Ethereum account, - # we consider a used account to be any account with a balance + # we consider a used account to be any account with a balance 'confs': 0, 'lbl': e.label} self.total += bal diff --git a/mmgen/proto/eth/tx/base.py b/mmgen/proto/eth/tx/base.py index 720df5a5..0cf1ab35 100755 --- a/mmgen/proto/eth/tx/base.py +++ b/mmgen/proto/eth/tx/base.py @@ -54,6 +54,7 @@ class Base(TxBase): def is_replaceable(self): return True + # used for testing only: async def get_receipt(self, txid): rx = await self.rpc.call('eth_getTransactionReceipt', '0x'+txid) # -> null if pending if not rx: diff --git a/test/cmdtest_d/ct_automount_eth.py b/test/cmdtest_d/ct_automount_eth.py index 885b9ab8..9d15c4a0 100755 --- a/test/cmdtest_d/ct_automount_eth.py +++ b/test/cmdtest_d/ct_automount_eth.py @@ -121,6 +121,7 @@ class CmdTestAutosignETH(CmdTestAutosignThreaded, CmdTestEthdev): return self.token_bal(pat=r':E:11\s+998.76544\s+54.318\d+\s+.*:E:12\s+1\.23456\s+') def token_bal(self, pat): + self.mining_delay() t = self.spawn('mmgen-tool', ['--regtest=1', '--token=mm1', 'twview', 'wide=1']) text = t.read(strip_color=True) assert re.search(pat, text, re.DOTALL), f'output failed to match regex {pat}' diff --git a/test/cmdtest_d/ct_ethdev.py b/test/cmdtest_d/ct_ethdev.py index 4dc4e350..fb64e635 100755 --- a/test/cmdtest_d/ct_ethdev.py +++ b/test/cmdtest_d/ct_ethdev.py @@ -472,7 +472,7 @@ class CmdTestEthdev(CmdTestBase, CmdTestShared): def mining_delay(self): # workaround for mining race condition in dev mode if self.daemon.id == 'reth': - time.sleep(0.5) + time.sleep(1) async def setup(self): self.spawn(msg_only=True) diff --git a/test/cmdtest_d/ct_ethswap.py b/test/cmdtest_d/ct_ethswap.py index e209a398..2b23995c 100755 --- a/test/cmdtest_d/ct_ethswap.py +++ b/test/cmdtest_d/ct_ethswap.py @@ -210,6 +210,7 @@ class CmdTestEthSwapEth(CmdTestEthdev, CmdTestSwapMethods): return self._swaptxsend() def swaptxstatus1(self): + self.mining_delay() return self._swaptxsend(add_opts=['--verbose', '--status'], status=True) def bal1(self):