refactor: remove duplicate method

This commit is contained in:
tecnovert
2026-05-27 23:51:51 +02:00
parent 7bf3dce974
commit 24c8e8b2dd
2 changed files with 2 additions and 8 deletions
+2 -2
View File
@@ -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",
)
-6
View File
@@ -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)