whitespace (hanging closing parenthesis [100 files])
This commit is contained in:
parent
75b881a6d3
commit
7df22cecd9
100 changed files with 208 additions and 377 deletions
|
|
@ -72,15 +72,16 @@ async def main(coins):
|
|||
'Version',
|
||||
'Datadir')
|
||||
for coin, rpc in rpcs.items():
|
||||
info = ('Down', '-', '-', '-', '-', '-', '-') if rpc is False else (
|
||||
info = (
|
||||
'Down', '-', '-', '-', '-', '-', '-'
|
||||
) if rpc is False else (
|
||||
'Up',
|
||||
rpc.port,
|
||||
rpc.chain,
|
||||
f'{rpc.blockcount:<8} [{make_timestr(rpc.cur_date)}]',
|
||||
rpc.daemon.coind_name,
|
||||
rpc.daemon_version_str,
|
||||
rpc.daemon.datadir
|
||||
)
|
||||
rpc.daemon.datadir)
|
||||
yield fs.format(coin.upper(), cfgs[coin].network, *info)
|
||||
|
||||
base_cfg._util.stdout_or_pager('\n'.join(gen_output()))
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@ async def main():
|
|||
f'Current block discovery rate (over last {sample_size} blocks): {bdr/60:0.1f} minutes\n'
|
||||
f'Current clock time (UTC): {date(clock_time)}\n'
|
||||
f'Est. halving date (UTC): {date(cur["time"] + t_rem)}\n'
|
||||
f'Est. time until halving: {dhms(cur["time"] + t_rem - clock_time)}\n'
|
||||
)
|
||||
f'Est. time until halving: {dhms(cur["time"] + t_rem - clock_time)}\n')
|
||||
|
||||
async_run(cfg, main)
|
||||
|
|
|
|||
|
|
@ -191,8 +191,7 @@ class CoinInfo:
|
|||
ce('ZetaCoin', 'ZET', 0xe0, (0x50,'Z'), None, False, 0),
|
||||
ce('ZiftrCoin', 'ZRC', 0xd0, (0x50,'Z'), (0x05,'3'), False, 1),
|
||||
ce('ZLiteQubit', 'ZLQ', 0xe0, (0x26,'G'), None, False, 0),
|
||||
ce('Zoomcoin', 'ZOOM', 0xe7, (0x67,'i'), (0x5c,'e'), False, 1),
|
||||
)
|
||||
ce('Zoomcoin', 'ZOOM', 0xe7, (0x67,'i'), (0x5c,'e'), False, 1))
|
||||
|
||||
coin_constants['testnet'] = (
|
||||
ce('Bitcoin', 'BTC', 0xef, (0x6f,('m','n')), (0xc4,'2'), True, 5),
|
||||
|
|
@ -204,8 +203,7 @@ class CoinInfo:
|
|||
ce('Feathercoin', 'FTC', 0xc1, (0x41,'T'), (0xc4,'2'), False, 2),
|
||||
ce('Viacoin', 'VIA', 0xff, (0x7f,'t'), (0xc4,'2'), False, 2),
|
||||
ce('Emercoin', 'EMC', 0xef, (0x6f,('m','n')), (0xc4,'2'), False, 2),
|
||||
ce('Litecoin', 'LTC', 0xef, (0x6f,('m','n')), (0x3a,'Q'), True, 5), # old p2sh: 0xc4
|
||||
)
|
||||
ce('Litecoin', 'LTC', 0xef, (0x6f,('m','n')), (0x3a,'Q'), True, 5)) # old p2sh: 0xc4
|
||||
|
||||
coin_sources = (
|
||||
('BTC', 'https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp'),
|
||||
|
|
@ -252,8 +250,7 @@ class CoinInfo:
|
|||
('OK', 'https://github.com/okcashpro/okcash/blob/master/src/chainparams.cpp'),
|
||||
('DOGED', 'https://github.com/doged/dogedsource/blob/master/src/base58.h'),
|
||||
('EFL', 'https://github.com/Electronic-Gulden-Foundation/egulden/blob/master/src/base58.h'),
|
||||
('POT', 'https://github.com/potcoin/Potcoin/blob/master/src/base58.h'),
|
||||
)
|
||||
('POT', 'https://github.com/potcoin/Potcoin/blob/master/src/base58.h'))
|
||||
|
||||
@classmethod
|
||||
def get_supported_coins(cls, network):
|
||||
|
|
|
|||
|
|
@ -232,8 +232,7 @@ class BipHDNode(Lockable):
|
|||
raise ValueError(
|
||||
'{}: invalid value for ‘{}’ at depth {} ({!r}) (must be {})'.format(
|
||||
val, name, self.depth, self.desc,
|
||||
'None' if getattr(cls, name) is None else f'None or {getattr(cls, name)}')
|
||||
)
|
||||
'None' if getattr(cls, name) is None else f'None or {getattr(cls, name)}'))
|
||||
|
||||
def set_params(self, cfg, idx, *, hardened):
|
||||
self.check_param('idx', idx)
|
||||
|
|
@ -310,8 +309,7 @@ class BipHDNode(Lockable):
|
|||
length = 4,
|
||||
byteorder = 'big')
|
||||
+ self.chaincode
|
||||
+ (self.pubkey_bytes if public else b'\x00' + self.key)
|
||||
)
|
||||
+ (self.pubkey_bytes if public else b'\x00' + self.key))
|
||||
return ret if as_str else Bip32ExtendedKey(ret)
|
||||
|
||||
def derive_public(self, idx=None):
|
||||
|
|
|
|||
|
|
@ -769,11 +769,9 @@ def check_opts(cfg): # Raises exception if any check fails
|
|||
+ (
|
||||
f'parameter for command-line option {fmt_opt(name)!r}'
|
||||
if name in cfg._uopts and cfg._uopt_src == 'cmdline' else
|
||||
f'value for configuration option {name!r}'
|
||||
)
|
||||
f'value for configuration option {name!r}')
|
||||
+ (' from environment' if name in cfg._envopts else '')
|
||||
+ (f' in {cfg._cfgfile_fn!r}' if name in cfg._cfgfile_opts.non_auto else '')
|
||||
)
|
||||
+ (f' in {cfg._cfgfile_fn!r}' if name in cfg._cfgfile_opts.non_auto else ''))
|
||||
|
||||
def display_opt(name, val='', *, beg='For selected', end=':\n'):
|
||||
from .util import msg_r
|
||||
|
|
@ -966,8 +964,7 @@ def conv_type(name, val, refval, *, src, invert_bool=False):
|
|||
ret = (
|
||||
True if v in ('true', 'yes', '1', 'on') else
|
||||
False if v in ('false', 'no', 'none', '0', 'off', '') else
|
||||
None
|
||||
)
|
||||
None)
|
||||
return do_fail() if ret is None else (not ret) if invert_bool else ret
|
||||
elif isinstance(refval, list | tuple):
|
||||
if src == 'cmdline':
|
||||
|
|
|
|||
|
|
@ -140,8 +140,7 @@ FMT CODES:
|
|||
from ..keygen import get_backends
|
||||
from ..addr import MMGenAddrType
|
||||
backends = get_backends(
|
||||
MMGenAddrType(self.proto, self.cfg.type or self.proto.dfl_mmtype).pubkey_type
|
||||
)
|
||||
MMGenAddrType(self.proto, self.cfg.type or self.proto.dfl_mmtype).pubkey_type)
|
||||
return ' '.join('{n}:{k}{t}'.format(n=n, k=k, t=('', ' [default]')[n == 1])
|
||||
for n, k in enumerate(backends, 1))
|
||||
|
||||
|
|
|
|||
|
|
@ -81,8 +81,7 @@ def _check_backend(cfg, backend, pubkey_type, *, desc='keygen backend'):
|
|||
die(1,
|
||||
f'{backend}: {desc} out of range\n' +
|
||||
'Configured backends: ' +
|
||||
' '.join(f'{n}:{k}' for n, k in enumerate(backends, 1))
|
||||
)
|
||||
' '.join(f'{n}:{k}' for n, k in enumerate(backends, 1)))
|
||||
|
||||
cfg._util.qmsg(f'Using backend {backends[int(backend)-1]!r} for public key generation')
|
||||
|
||||
|
|
|
|||
|
|
@ -192,8 +192,7 @@ $ mmgen-msg verify signatures.json
|
|||
},
|
||||
'code': {
|
||||
'notes': lambda help_notes, s: s.format(
|
||||
n_at = help_notes('address_types'),
|
||||
)
|
||||
n_at = help_notes('address_types'))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -124,8 +124,7 @@ EXAMPLES:
|
|||
n_bw = help_notes('brainwallet'),
|
||||
n_pf = help_notes('password_formats'),
|
||||
n_fc = help_notes('fmt_codes'),
|
||||
gc = gc,
|
||||
)
|
||||
gc = gc)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,8 +82,7 @@ For usage examples, see the help screen for the 'mmgen-seedsplit' command.
|
|||
),
|
||||
'notes': lambda cfg, help_notes, s: s.format(
|
||||
n_fc = help_notes('fmt_codes'),
|
||||
n_pw = help_notes('passwd'),
|
||||
)
|
||||
n_pw = help_notes('passwd'))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,8 +98,7 @@ opts_data = {
|
|||
tp = fmt_dict(xmrwallet.tx_priorities, fmt='equal_compact')
|
||||
),
|
||||
'notes': lambda help_mod, s: s.format(
|
||||
n_xw = help_mod('xmrwallet')
|
||||
)
|
||||
n_xw = help_mod('xmrwallet'))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -110,8 +109,7 @@ cmd_args = cfg._args
|
|||
if cmd_args and cfg.autosign and (
|
||||
cmd_args[0].replace('-', '_') in (
|
||||
xmrwallet.kafile_arg_ops
|
||||
+ ('export_outputs', 'export_outputs_sign', 'import_key_images', 'txview', 'txlist')
|
||||
)
|
||||
+ ('export_outputs', 'export_outputs_sign', 'import_key_images', 'txview', 'txlist'))
|
||||
or len(cmd_args) == 1 and cmd_args[0] in ('submit', 'resubmit', 'abort')
|
||||
):
|
||||
cmd_args.insert(1, None)
|
||||
|
|
|
|||
|
|
@ -340,15 +340,13 @@ class coin_msg:
|
|||
get_data_from_file(
|
||||
cfg = self.cfg,
|
||||
infile = infile,
|
||||
desc = self.desc)
|
||||
)
|
||||
desc = self.desc))
|
||||
|
||||
pfx = self.msg_cls.sigdata_pfx
|
||||
self.sigs = {sig_data['addr']: sig_data for sig_data in (
|
||||
[{k: v[len(pfx):] for k, v in e.items()} for e in self.data['signatures']]
|
||||
if pfx else
|
||||
self.data['signatures']
|
||||
)}
|
||||
self.data['signatures'])}
|
||||
|
||||
def _get_obj(clsname, cfg, *args, coin=None, network='mainnet', infile=None, data=None, **kwargs):
|
||||
|
||||
|
|
|
|||
|
|
@ -193,8 +193,7 @@ class MMGenListItem(MMGenObject):
|
|||
self.__dict__['valid_attrs'] = self.valid_attrs or (
|
||||
{e for e in dir(self) if e[0] != '_'}
|
||||
- MMGenListItem.invalid_attrs
|
||||
- self.invalid_attrs
|
||||
)
|
||||
- self.invalid_attrs)
|
||||
|
||||
if args:
|
||||
raise ValueError(f'Non-keyword args not allowed in {type(self).__name__!r} constructor')
|
||||
|
|
|
|||
|
|
@ -183,8 +183,7 @@ def parse_opts(cfg, opts_data, global_opts_data, global_filter_codes, *, need_pr
|
|||
return namedtuple('parsed_cmd_opts', ['user_opts', 'cmd_args', 'opts'])(
|
||||
uopts, # dict
|
||||
uargs, # list, callers can pop
|
||||
tuple(v.name for k, v in opts if len(k) > 1)
|
||||
)
|
||||
tuple(v.name for k, v in opts if len(k) > 1))
|
||||
|
||||
def opt_preproc_debug(po):
|
||||
d = (
|
||||
|
|
@ -192,8 +191,7 @@ def opt_preproc_debug(po):
|
|||
('Filtered opts', po.filtered_opts, False),
|
||||
('User-selected opts', po.user_opts, False),
|
||||
('Cmd args', po.cmd_args, False),
|
||||
('Opts', po.opts, True),
|
||||
)
|
||||
('Opts', po.opts, True))
|
||||
from .util import Msg, fmt_list
|
||||
Msg('\n=== opts.py debug ===')
|
||||
for label, data, pretty in d:
|
||||
|
|
|
|||
|
|
@ -184,8 +184,7 @@ class PasswordList(AddrList):
|
|||
die(1,
|
||||
f'Cannot generate passwords with more entropy than underlying seed! ({len(seed.data)*8} bits)\n' +
|
||||
(f'Re-run the command with --passwd-len={good_pw_len}' if self.pw_fmt in ('bip39', 'hex') else
|
||||
'Re-run the command, specifying a password length of {} or less')
|
||||
)
|
||||
'Re-run the command, specifying a password length of {} or less'))
|
||||
case x if x < seed.byte_len and self.pw_fmt in ('bip39', 'hex'):
|
||||
from .ui import keypress_confirm
|
||||
keypress_confirm(
|
||||
|
|
|
|||
|
|
@ -72,8 +72,7 @@ def cashaddr_encode_addr(addr_type, size, pfx, data):
|
|||
t = namedtuple('encoded_cashaddr', ['addr', 'pfx', 'payload'])
|
||||
payload_bin = (
|
||||
'{:08b}'.format(make_ver_byte(addr_type, size * 8)) +
|
||||
'{:0{w}b}'.format(int.from_bytes(data, 'big'), w=len(data) * 8)
|
||||
)
|
||||
'{:0{w}b}'.format(int.from_bytes(data, 'big'), w=len(data) * 8))
|
||||
payload_vec = bin2vec(payload_bin + '0' * (-len(payload_bin) % 5))
|
||||
chksum_vec = bin2vec('{:040b}'.format(PolyMod(make_polymod_vec(pfx, payload_vec + [0] * 8))))
|
||||
payload = ''.join(b32a[i] for i in payload_vec + chksum_vec)
|
||||
|
|
|
|||
|
|
@ -67,8 +67,7 @@ class bitcoin_core_daemon(CoinDaemon):
|
|||
[f'--rpcuser={self.rpc_user}', self.network == 'regtest'],
|
||||
[f'--rpcpassword={self.rpc_password}', self.network == 'regtest'],
|
||||
['--testnet', self.network == 'testnet'],
|
||||
['--regtest', self.network == 'regtest'],
|
||||
)
|
||||
['--regtest', self.network == 'regtest'])
|
||||
|
||||
self.coind_args = list_gen(
|
||||
['--listen=0'],
|
||||
|
|
@ -81,8 +80,7 @@ class bitcoin_core_daemon(CoinDaemon):
|
|||
['--deprecatedrpc=create_bdb', self.coin == 'BTC' and self.opt.bdb_wallet],
|
||||
['--mempoolreplacement=1', self.coin == 'LTC'],
|
||||
['--txindex=1', self.coin == 'LTC' or self.network == 'regtest'],
|
||||
['--addresstype=bech32', self.coin == 'LTC' and self.network == 'regtest'],
|
||||
)
|
||||
['--addresstype=bech32', self.coin == 'LTC' and self.network == 'regtest'])
|
||||
|
||||
self.lockfile = os.path.join(self.network_datadir, '.cookie')
|
||||
|
||||
|
|
|
|||
|
|
@ -64,8 +64,7 @@ class mainnet(CoinProtocol.Secp256k1): # chainparams.cpp
|
|||
'rpc_password',
|
||||
'tw_name',
|
||||
'max_tx_fee',
|
||||
'cashaddr',
|
||||
)
|
||||
'cashaddr')
|
||||
|
||||
def encode_wif(self, privbytes, pubkey_type, *, compressed): # input is preprocessed
|
||||
assert pubkey_type in self.wif_ver_bytes, f'{pubkey_type!r}: invalid pubkey_type'
|
||||
|
|
|
|||
|
|
@ -240,8 +240,7 @@ class BitcoinRPCClient(RPCClient, metaclass=AsyncInit):
|
|||
('getnetworkinfo', ()),
|
||||
('getblockchaininfo', ()),
|
||||
] + (
|
||||
[('getdeploymentinfo', ())] if 'deployment_info' in self.caps else []
|
||||
)
|
||||
[('getdeploymentinfo', ())] if 'deployment_info' in self.caps else [])
|
||||
|
||||
(
|
||||
self.blockcount,
|
||||
|
|
@ -252,8 +251,7 @@ class BitcoinRPCClient(RPCClient, metaclass=AsyncInit):
|
|||
) = (
|
||||
await self.gathered_call(None, tuple(call_group))
|
||||
) + (
|
||||
[] if 'deployment_info' in self.caps else [None]
|
||||
)
|
||||
[] if 'deployment_info' in self.caps else [None])
|
||||
|
||||
self.daemon_version = self.cached['networkinfo']['version']
|
||||
self.daemon_version_str = self.cached['networkinfo']['subversion']
|
||||
|
|
@ -449,5 +447,4 @@ class BitcoinRPCClient(RPCClient, metaclass=AsyncInit):
|
|||
'signrawtransaction',
|
||||
'signrawtransactionwithkey', # method new to Core v0.17.0
|
||||
'validateaddress',
|
||||
'walletpassphrase',
|
||||
)
|
||||
'walletpassphrase')
|
||||
|
|
|
|||
|
|
@ -87,8 +87,7 @@ class BitcoinTwTransaction:
|
|||
mmid = e.twlabel.twmmid
|
||||
yield (
|
||||
(mmid if mmid.type == 'mmgen' else mmid.split(':', 1)[1]) +
|
||||
('*' if mmid in self.unspent_info else '')
|
||||
)
|
||||
('*' if mmid in self.unspent_info else ''))
|
||||
else:
|
||||
yield e.coin_addr
|
||||
|
||||
|
|
@ -311,15 +310,13 @@ class BitcoinTwTxHistory(BitcoinTwView, TwTxHistory, BitcoinTwRPC):
|
|||
mm_map = {
|
||||
i['address']: (
|
||||
_mmp(TwMMGenID(self.proto, i['twmmid']), TwComment(i['comment']))
|
||||
if i['twmmid'] else _mmp(None, None)
|
||||
)
|
||||
if i['twmmid'] else _mmp(None, None))
|
||||
for i in data if 'address' in i}
|
||||
|
||||
if self.sinceblock: # mapping data may be incomplete for inputs, so update from 'listlabels'
|
||||
mm_map.update(
|
||||
{e.coinaddr: _mmp(e.label.mmid, e.label.comment) if e.label else _mmp(None, None)
|
||||
for e in await self.get_label_addr_pairs()}
|
||||
)
|
||||
for e in await self.get_label_addr_pairs()})
|
||||
|
||||
msg_r('Getting wallet transactions...')
|
||||
_wallet_txs = await self.rpc.gathered_icall(
|
||||
|
|
@ -364,8 +361,7 @@ class BitcoinTwTxHistory(BitcoinTwView, TwTxHistory, BitcoinTwRPC):
|
|||
(data, 'txhist'),
|
||||
(mm_map, 'mmap'),
|
||||
(_prevout_txs, 'prevout-txs'),
|
||||
(txdata, 'txdata'),
|
||||
)
|
||||
(txdata, 'txdata'))
|
||||
|
||||
unspent_info = await self.get_unspent_by_mmid()
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue