minor fixes, cleanups, whitespace
This commit is contained in:
parent
0a72cc83f7
commit
9652e3e3da
6 changed files with 6 additions and 4 deletions
|
|
@ -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,
|
||||
*,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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}'
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue