Remove spurious error in debug ui mode.
Some checks are pending
lint / build (3.12) (push) Waiting to run

This commit is contained in:
tecnovert 2024-10-01 19:37:28 +02:00
parent dbdb89cd10
commit f954822d74
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93
2 changed files with 10 additions and 9 deletions

View file

@ -1880,12 +1880,12 @@ class BasicSwap(BaseApp):
return self.grindForEd25519Key(coin_type, evkey, key_path_base)
def getPathKey(self, coin_from, coin_to, offer_created_at: int, contract_count: int, key_no: int, for_ed25519: bool = False) -> bytes:
def getPathKey(self, coin_from, coin_to, bid_created_at: int, contract_count: int, key_no: int, for_ed25519: bool = False) -> bytes:
evkey = self.callcoinrpc(Coins.PART, 'extkey', ['account', 'default', 'true'])['evkey']
ci = self.ci(coin_to)
days = offer_created_at // 86400
secs = offer_created_at - days * 86400
days = bid_created_at // 86400
secs = bid_created_at - days * 86400
key_path_base = '44445555h/999999/{}/{}/{}/{}/{}/{}'.format(int(coin_from), int(coin_to), days, secs, contract_count, key_no)
if not for_ed25519:
@ -1917,7 +1917,7 @@ class BasicSwap(BaseApp):
pubkey = self.callcoinrpc(Coins.PART, 'extkey', ['info', extkey])['key_info']['pubkey']
return bytes.fromhex(pubkey)
def getContractPrivkey(self, date, contract_count):
def getContractPrivkey(self, date: dt.datetime, contract_count: int) -> bytes:
# Derive an address to use for a contract
evkey = self.callcoinrpc(Coins.PART, 'extkey', ['account', 'default', 'true'])['evkey']
@ -1932,7 +1932,7 @@ class BasicSwap(BaseApp):
raw = raw[:32]
return raw
def getContractSecret(self, date, contract_count):
def getContractSecret(self, date: dt.datetime, contract_count: int) -> bytes:
# Derive a key to use for a contract secret
evkey = self.callcoinrpc(Coins.PART, 'extkey', ['account', 'default', 'true'])['evkey']

View file

@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020-2023 tecnovert
# Copyright (c) 2020-2024 tecnovert
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
import json
import struct
import traceback
from basicswap.util import (
make_int,
format_timestamp,
@ -330,12 +329,14 @@ def describeBid(swap_client, bid, xmr_swap, offer, xmr_offer, bid_events, edit_b
if swap_client.debug_ui:
try:
data['xmr_b_half_privatekey'] = getChainBSplitKey(swap_client, bid, xmr_swap, offer)
except Exception as e:
swap_client.log.debug('Unable to get xmr_b_half_privatekey for bid: {}'.format(bid.bid_id.hex()))
try:
remote_split_key = getChainBRemoteSplitKey(swap_client, bid, xmr_swap, offer)
if remote_split_key:
data['xmr_b_half_privatekey_remote'] = remote_split_key
except Exception as e:
swap_client.log.error(traceback.format_exc())
swap_client.log.debug('Unable to get xmr_b_half_privatekey_remote for bid: {}'.format(bid.bid_id.hex()))
if show_lock_transfers:
if xmr_swap.pkbs: