From 24c8e8b2ddb73e8c82d1264241e3577c0f1c9ced Mon Sep 17 00:00:00 2001 From: tecnovert Date: Wed, 27 May 2026 23:51:51 +0200 Subject: [PATCH] refactor: remove duplicate method --- basicswap/basicswap.py | 4 ++-- basicswap/interface/base.py | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index a08cbe8..2c27b18 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -3965,7 +3965,7 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp): def isValidSwapDest(self, ci, dest: bytes): ensure(isinstance(dest, bytes), "Swap destination must be bytes") if ci.coin_type() in (Coins.PART_BLIND,): - return ci.isValidPubkey(dest) + return ci.verifyPubkey(dest) # TODO: allow p2wsh return ci.isValidAddressHash(dest) @@ -10905,7 +10905,7 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp): ) ensure( ci_from.isValidAddressHash(bid_data.dest_af) - or ci_from.isValidPubkey(bid_data.dest_af), + or ci_from.verifyPubkey(bid_data.dest_af), "Invalid destination address", ) diff --git a/basicswap/interface/base.py b/basicswap/interface/base.py index 295e9d7..9ed10ef 100644 --- a/basicswap/interface/base.py +++ b/basicswap/interface/base.py @@ -220,12 +220,6 @@ class Secp256k1Interface(CoinInterface, AdaptorSigInterface): if hash_len == 20: return True - def isValidPubkey(self, pubkey: bytes) -> bool: - try: - return self.verifyPubkey(pubkey) - except Exception: - return False - def verifySig(self, pubkey: bytes, signed_hash: bytes, sig: bytes) -> bool: pubkey = PublicKey(pubkey) return pubkey.verify(sig, signed_hash, hasher=None)