fix flake8-bugbear B023
B023 Function definition does not bind loop variable 'already_selected_buckets_value_sum'
in keepkey/qt.py, looks like this was an actual bug
(fixed in trezor plugin already: 52a4810752 )
This commit is contained in:
@@ -410,7 +410,11 @@ class CoinChooserRandom(CoinChooserBase):
|
||||
|
||||
for bkts_choose_from in bucket_sets:
|
||||
try:
|
||||
def sfunds(bkts, *, bucket_value_sum):
|
||||
def sfunds(
|
||||
bkts, *, bucket_value_sum,
|
||||
already_selected_buckets_value_sum=already_selected_buckets_value_sum,
|
||||
already_selected_buckets=already_selected_buckets,
|
||||
):
|
||||
bucket_value_sum += already_selected_buckets_value_sum
|
||||
return sufficient_funds(already_selected_buckets + bkts,
|
||||
bucket_value_sum=bucket_value_sum)
|
||||
|
||||
@@ -110,6 +110,7 @@ def request(config: SimpleConfig, endpoint, args=(), timeout=60):
|
||||
lockfile = get_lockfile(config)
|
||||
while True:
|
||||
create_time = None
|
||||
path = None
|
||||
try:
|
||||
with open(lockfile) as f:
|
||||
socktype, address, create_time = ast.literal_eval(f.read())
|
||||
@@ -127,7 +128,9 @@ def request(config: SimpleConfig, endpoint, args=(), timeout=60):
|
||||
server_url = 'http://%s:%d' % (host, port)
|
||||
auth = aiohttp.BasicAuth(login=rpc_user, password=rpc_password)
|
||||
loop = util.get_asyncio_loop()
|
||||
async def request_coroutine():
|
||||
async def request_coroutine(
|
||||
*, socktype=socktype, path=path, auth=auth, server_url=server_url, endpoint=endpoint,
|
||||
):
|
||||
if socktype == 'unix':
|
||||
connector = aiohttp.UnixConnector(path=path)
|
||||
elif socktype == 'tcp':
|
||||
|
||||
@@ -201,7 +201,7 @@ class QtPlugin(QtPluginBase):
|
||||
return
|
||||
for keystore in wallet.get_keystores():
|
||||
if type(keystore) == self.keystore_class:
|
||||
def show_address():
|
||||
def show_address(keystore=keystore):
|
||||
keystore.thread.add(partial(self.show_address, wallet, addrs[0], keystore))
|
||||
device_name = "{} ({})".format(self.device, keystore.label)
|
||||
menu.addAction(_("Show on {}").format(device_name), show_address)
|
||||
|
||||
@@ -1171,7 +1171,7 @@ class Ledger_Client_New(Ledger_Client):
|
||||
registered_hmac,
|
||||
)
|
||||
else:
|
||||
def process_origin(origin: KeyOriginInfo) -> None:
|
||||
def process_origin(origin: KeyOriginInfo, *, script_addrtype=script_addrtype) -> None:
|
||||
if is_standard_path(origin.path, script_addrtype, get_chain()):
|
||||
# these policies do not need to be registered
|
||||
policy = self.get_singlesig_default_wallet_policy(script_addrtype, origin.path[2])
|
||||
|
||||
Reference in New Issue
Block a user