whitespace

This commit is contained in:
The MMGen Project 2026-10-07 16:40:39 +00:00
commit 0dd511bafc
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 35 additions and 28 deletions

View file

@ -809,7 +809,7 @@ class CmdTestEthdev(CmdTestEthdevMethods, CmdTestBase, CmdTestShared):
def keystore_data(self):
if not hasattr(self, '_keystore_data'):
wallet_fn = os.path.join( self.keystore_dir, os.listdir(self.keystore_dir)[0])
wallet_fn = os.path.join(self.keystore_dir, os.listdir(self.keystore_dir)[0])
from mmgen.proto.eth.util import decrypt_geth_keystore
key = decrypt_geth_keystore(
@ -820,7 +820,7 @@ class CmdTestEthdev(CmdTestEthdevMethods, CmdTestBase, CmdTestShared):
with open(wallet_fn) as fh:
res = json.loads(fh.read())
res.update( { 'key': key.hex()})
res.update({'key': key.hex()})
self._keystore_data = res
return self._keystore_data
@ -871,7 +871,7 @@ class CmdTestEthdev(CmdTestEthdevMethods, CmdTestBase, CmdTestShared):
'excessBlobGas': None,
'blobGasUsed': None,
'alloc': {
prealloc_addr: { 'balance': hex(prealloc_amt.toWei())}
prealloc_addr: {'balance': hex(prealloc_amt.toWei())}
}
}
@ -898,7 +898,7 @@ class CmdTestEthdev(CmdTestEthdevMethods, CmdTestBase, CmdTestShared):
imsg(f' Genesis block data: {self.genesis_fn}')
genesis_data = make_genesis(signer_addr, dfl_devaddr)
write_to_file( self.genesis_fn, json.dumps(genesis_data, indent=' ')+'\n')
write_to_file(self.genesis_fn, json.dumps(genesis_data, indent=' ') + '\n')
init_genesis(self.genesis_fn)
def daemon_version(self):

View file

@ -69,7 +69,7 @@ def do_test(proto, wif, addr_chk, addr_type, internal_keccak):
if v and k in ('pubkey', 'viewkey_bytes'):
qmsg(f' {k+":":19} {v.hex()}')
ag = AddrGenerator( cfg, proto, addr_type)
ag = AddrGenerator(cfg, proto, addr_type)
addr = ag.to_addr(data)
qmsg(f' addr: {addr}\n')
@ -78,7 +78,7 @@ def do_test(proto, wif, addr_chk, addr_type, internal_keccak):
cfg.use_internal_keccak_module = False
def do_tests(coin, internal_keccak=False):
proto = init_proto( cfg, coin)
proto = init_proto(cfg, coin)
for wif, addr, addr_type in vectors[coin]:
do_test(proto, wif, addr, addr_type, internal_keccak)
return True

View file

@ -312,16 +312,18 @@ tests = {
'TwComment': {
'exc_name': 'BadTwComment',
'arg1': 's',
'bad': ( utf8_combining[:40],
utf8_ctrl[:40],
text_jp[:41],
text_zh[:41],
gr_uc_w_ctrl,
utf8_text[:81]),
'good': ( utf8_text[:80],
(ru_uc + gr_uc + utf8_text)[:80],
text_jp[:40],
text_zh[:40])
'bad': (
utf8_combining[:40],
utf8_ctrl[:40],
text_jp[:41],
text_zh[:41],
gr_uc_w_ctrl,
utf8_text[:81]),
'good': (
utf8_text[:80],
(ru_uc + gr_uc + utf8_text)[:80],
text_jp[:40],
text_zh[:40])
},
'MMGenTxComment': {
'arg1': 's',

View file

@ -29,18 +29,23 @@ tests = {
),
},
'ETHAmt': {
'bad': ('-3.2', '0.1234567891234567891', 123, '123L',
{'num': '1', 'from_decimal': True},
{'num': 1, 'from_decimal': True},
),
'good': (('123.123456789123456789', Decimal('123.123456789123456789')),
{ 'num': Decimal('1.12345678912345678892345'), # rounding
'from_decimal': True,
'ret': Decimal('1.123456789123456789')},
{'num': Decimal('1.234'), 'from_decimal': True, 'ret': Decimal('1.234')},
{'num': Decimal('0.0'), 'from_decimal': True, 'ret': Decimal(0)},
{'num': 1234, 'from_unit': 'wei', 'ret': Decimal('0.000000000000001234')},
{'num': 1234, 'from_unit': 'Mwei', 'ret': Decimal('0.000000001234')})
'bad': (
'-3.2', '0.1234567891234567891', 123, '123L',
{'num': '1', 'from_decimal': True},
{'num': 1, 'from_decimal': True},
),
'good': (
('123.123456789123456789', Decimal('123.123456789123456789')),
{
'num': Decimal('1.12345678912345678892345'), # rounding
'from_decimal': True,
'ret': Decimal('1.123456789123456789')
},
{'num': Decimal('1.234'), 'from_decimal': True, 'ret': Decimal('1.234')},
{'num': Decimal('0.0'), 'from_decimal': True, 'ret': Decimal(0)},
{'num': 1234, 'from_unit': 'wei', 'ret': Decimal('0.000000000000001234')},
{'num': 1234, 'from_unit': 'Mwei', 'ret': Decimal('0.000000001234')}
),
},
'ETHNonce': {
'bad': ('z', 'я', -1, '-1', 0.0, '0.0'),