minor whitespace
This commit is contained in:
parent
915473cc2d
commit
a50e9383a9
7 changed files with 38 additions and 13 deletions
|
|
@ -182,7 +182,13 @@ class MasterNode(Lockable):
|
|||
|
||||
check_privkey(int.from_bytes(self.key, byteorder='big'))
|
||||
|
||||
def init_cfg(self, coin=None, network=None, addr_type=None, from_path=False, no_path_checks=False):
|
||||
def init_cfg(
|
||||
self,
|
||||
coin = None,
|
||||
network = None,
|
||||
addr_type = None,
|
||||
from_path = False,
|
||||
no_path_checks = False):
|
||||
|
||||
new = BipHDNodeMaster()
|
||||
|
||||
|
|
|
|||
|
|
@ -268,7 +268,8 @@ class BitcoinRPCClient(RPCClient, metaclass=AsyncInit):
|
|||
|
||||
fn = self.get_daemon_cfg_fn()
|
||||
try:
|
||||
lines = get_lines_from_file(self.cfg, fn, 'daemon config file', silent=not self.cfg.verbose)
|
||||
lines = get_lines_from_file(
|
||||
self.cfg, fn, 'daemon config file', silent=not self.cfg.verbose)
|
||||
except:
|
||||
self.cfg._util.vmsg(f'Warning: {fn!r} does not exist or is unreadable')
|
||||
return dict((k, None) for k in req_keys)
|
||||
|
|
@ -287,7 +288,8 @@ class BitcoinRPCClient(RPCClient, metaclass=AsyncInit):
|
|||
|
||||
def get_daemon_auth_cookie(self):
|
||||
fn = self.daemon.auth_cookie_fn
|
||||
return get_lines_from_file(self.cfg, fn, 'cookie', quiet=True)[0] if os.access(fn, os.R_OK) else ''
|
||||
return get_lines_from_file(
|
||||
self.cfg, fn, 'cookie', quiet=True)[0] if os.access(fn, os.R_OK) else ''
|
||||
|
||||
def info(self, info_id):
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class BitcoinTwCtl(TwCtl):
|
|||
raise NotImplementedError('not implemented')
|
||||
|
||||
@write_mode
|
||||
async def import_address(self, addr, label, rescan=False): # rescan is True by default, so set to False
|
||||
async def import_address(self, addr, label, rescan=False):
|
||||
if (await self.rpc.walletinfo).get('descriptors'):
|
||||
return await self.batch_import_address([(addr, label, rescan)])
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -204,7 +204,12 @@ class tool_cmd(tool_cmd_base):
|
|||
await (await TwCtl(self.cfg, self.proto, mode='w')).rescan_blockchain(start_block, stop_block)
|
||||
return True
|
||||
|
||||
async def twexport(self, include_amts=True, pretty=False, prune=False, warn_used=False, force=False):
|
||||
async def twexport(self,
|
||||
include_amts = True,
|
||||
pretty = False,
|
||||
prune = False,
|
||||
warn_used = False,
|
||||
force = False):
|
||||
"""
|
||||
export a tracking wallet to JSON format
|
||||
|
||||
|
|
|
|||
12
mmgen/ui.py
12
mmgen/ui.py
|
|
@ -81,12 +81,12 @@ def line_input(cfg, prompt, echo=True, insert_txt='', hold_protect=True):
|
|||
return reply.strip()
|
||||
|
||||
def keypress_confirm(
|
||||
cfg,
|
||||
prompt,
|
||||
default_yes = False,
|
||||
verbose = False,
|
||||
no_nl = False,
|
||||
complete_prompt = False):
|
||||
cfg,
|
||||
prompt,
|
||||
default_yes = False,
|
||||
verbose = False,
|
||||
no_nl = False,
|
||||
complete_prompt = False):
|
||||
|
||||
if not complete_prompt:
|
||||
prompt = '{} {}: '.format(prompt, '(Y/n)' if default_yes else '(y/N)')
|
||||
|
|
|
|||
|
|
@ -135,7 +135,13 @@ def format_elapsed_days_hr(t, now=None, cached={}):
|
|||
cached[e] = f'{days} day{suf(days)} ' + ('ago' if e > 0 else 'in the future')
|
||||
return cached[e]
|
||||
|
||||
def format_elapsed_hr(t, now=None, cached={}, rel_now=True, show_secs=False, future_msg='in the future'):
|
||||
def format_elapsed_hr(
|
||||
t,
|
||||
now = None,
|
||||
cached = {},
|
||||
rel_now = True,
|
||||
show_secs = False,
|
||||
future_msg = 'in the future'):
|
||||
e = int((now or time.time()) - t)
|
||||
key = f'{e}:{rel_now}:{show_secs}'
|
||||
if not key in cached:
|
||||
|
|
|
|||
|
|
@ -533,7 +533,13 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
return self.walletchk(wf, wcls=wcls, dfl_wallet=dfl_wallet)
|
||||
|
||||
def _write_fake_data_to_file(self, d):
|
||||
write_data_to_file(cfg, self.unspent_data_file, d, 'Unspent outputs', quiet=True, ignore_opt_outdir=True)
|
||||
write_data_to_file(
|
||||
cfg,
|
||||
self.unspent_data_file,
|
||||
d,
|
||||
'Unspent outputs',
|
||||
quiet = True,
|
||||
ignore_opt_outdir = True)
|
||||
if cfg.verbose or cfg.exact_output:
|
||||
sys.stderr.write(f'Fake transaction wallet data written to file {self.unspent_data_file!r}\n')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue