From 0dd511bafcf851730adf7a7c7029d506730e9e2b Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Wed, 7 Oct 2026 16:40:39 +0000 Subject: [PATCH] whitespace --- test/cmdtest_d/ethdev.py | 8 ++++---- test/modtest_d/gen.py | 4 ++-- test/objtest_d/btc_mainnet.py | 22 ++++++++++++---------- test/objtest_d/eth_mainnet.py | 29 +++++++++++++++++------------ 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/test/cmdtest_d/ethdev.py b/test/cmdtest_d/ethdev.py index f6e88d54..e44afdeb 100644 --- a/test/cmdtest_d/ethdev.py +++ b/test/cmdtest_d/ethdev.py @@ -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): diff --git a/test/modtest_d/gen.py b/test/modtest_d/gen.py index 6b62cdf9..3cdcf86a 100644 --- a/test/modtest_d/gen.py +++ b/test/modtest_d/gen.py @@ -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 diff --git a/test/objtest_d/btc_mainnet.py b/test/objtest_d/btc_mainnet.py index 6d7e7bbb..75348188 100644 --- a/test/objtest_d/btc_mainnet.py +++ b/test/objtest_d/btc_mainnet.py @@ -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', diff --git a/test/objtest_d/eth_mainnet.py b/test/objtest_d/eth_mainnet.py index dd5c4bb6..040bab0e 100644 --- a/test/objtest_d/eth_mainnet.py +++ b/test/objtest_d/eth_mainnet.py @@ -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'),