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:
|
for bkts_choose_from in bucket_sets:
|
||||||
try:
|
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
|
bucket_value_sum += already_selected_buckets_value_sum
|
||||||
return sufficient_funds(already_selected_buckets + bkts,
|
return sufficient_funds(already_selected_buckets + bkts,
|
||||||
bucket_value_sum=bucket_value_sum)
|
bucket_value_sum=bucket_value_sum)
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ def request(config: SimpleConfig, endpoint, args=(), timeout=60):
|
|||||||
lockfile = get_lockfile(config)
|
lockfile = get_lockfile(config)
|
||||||
while True:
|
while True:
|
||||||
create_time = None
|
create_time = None
|
||||||
|
path = None
|
||||||
try:
|
try:
|
||||||
with open(lockfile) as f:
|
with open(lockfile) as f:
|
||||||
socktype, address, create_time = ast.literal_eval(f.read())
|
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)
|
server_url = 'http://%s:%d' % (host, port)
|
||||||
auth = aiohttp.BasicAuth(login=rpc_user, password=rpc_password)
|
auth = aiohttp.BasicAuth(login=rpc_user, password=rpc_password)
|
||||||
loop = util.get_asyncio_loop()
|
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':
|
if socktype == 'unix':
|
||||||
connector = aiohttp.UnixConnector(path=path)
|
connector = aiohttp.UnixConnector(path=path)
|
||||||
elif socktype == 'tcp':
|
elif socktype == 'tcp':
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ class QtPlugin(QtPluginBase):
|
|||||||
return
|
return
|
||||||
for keystore in wallet.get_keystores():
|
for keystore in wallet.get_keystores():
|
||||||
if type(keystore) == self.keystore_class:
|
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))
|
keystore.thread.add(partial(self.show_address, wallet, addrs[0], keystore))
|
||||||
device_name = "{} ({})".format(self.device, keystore.label)
|
device_name = "{} ({})".format(self.device, keystore.label)
|
||||||
menu.addAction(_("Show on {}").format(device_name), show_address)
|
menu.addAction(_("Show on {}").format(device_name), show_address)
|
||||||
|
|||||||
@@ -1171,7 +1171,7 @@ class Ledger_Client_New(Ledger_Client):
|
|||||||
registered_hmac,
|
registered_hmac,
|
||||||
)
|
)
|
||||||
else:
|
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()):
|
if is_standard_path(origin.path, script_addrtype, get_chain()):
|
||||||
# these policies do not need to be registered
|
# these policies do not need to be registered
|
||||||
policy = self.get_singlesig_default_wallet_policy(script_addrtype, origin.path[2])
|
policy = self.get_singlesig_default_wallet_policy(script_addrtype, origin.path[2])
|
||||||
|
|||||||
Reference in New Issue
Block a user