tests: Disable test_13_locked_xmr when xmr version >= 0.18.4.

This commit is contained in:
tecnovert
2025-05-12 00:21:37 +02:00
parent 2a8ac051fc
commit f6914d7c30
6 changed files with 167 additions and 104 deletions

View File

@@ -1495,7 +1495,14 @@ class BTCInterface(Secp256k1Interface):
return (weight + wsf - 1) // wsf
def findTxB(
self, kbv, Kbs, cb_swap_value, cb_block_confirmed, restore_height, bid_sender
self,
kbv,
Kbs,
cb_swap_value: int,
cb_block_confirmed: int,
restore_height: int,
bid_sender: bool,
check_amount: bool = True,
):
dest_address = (
self.pubkey_to_segwit_address(Kbs)

View File

@@ -1029,10 +1029,11 @@ class PARTInterfaceBlind(PARTInterface):
self,
kbv,
Kbs,
cb_swap_value,
cb_block_confirmed,
cb_swap_value: int,
cb_block_confirmed: int,
restore_height: int,
bid_sender: bool,
check_amount: bool = True,
):
Kbv = self.getPubkey(kbv)
sx_addr = self.formatStealthAddress(Kbv, Kbs)
@@ -1063,7 +1064,10 @@ class PARTInterfaceBlind(PARTInterface):
) # Should not be possible
ensure(tx["outputs"][0]["type"] == "blind", "Output is not anon")
if self.make_int(tx["outputs"][0]["amount"]) == cb_swap_value:
if (
self.make_int(tx["outputs"][0]["amount"]) == cb_swap_value
or check_amount is False
):
height = 0
if tx["confirmations"] > 0:
chain_height = self.rpc("getblockcount")
@@ -1285,7 +1289,14 @@ class PARTInterfaceAnon(PARTInterface):
return bytes.fromhex(txid)
def findTxB(
self, kbv, Kbs, cb_swap_value, cb_block_confirmed, restore_height, bid_sender
self,
kbv,
Kbs,
cb_swap_value,
cb_block_confirmed,
restore_height,
bid_sender,
check_amount: bool = True,
):
Kbv = self.getPubkey(kbv)
sx_addr = self.formatStealthAddress(Kbv, Kbs)
@@ -1317,7 +1328,10 @@ class PARTInterfaceAnon(PARTInterface):
) # Should not be possible
ensure(tx["outputs"][0]["type"] == "anon", "Output is not anon")
if self.make_int(tx["outputs"][0]["amount"]) == cb_swap_value:
if (
self.make_int(tx["outputs"][0]["amount"]) == cb_swap_value
or check_amount is False
):
height = 0
if tx["confirmations"] > 0:
chain_height = self.rpc("getblockcount")

View File

@@ -455,16 +455,24 @@ class XMRInterface(CoinInterface):
params["priority"] = self._fee_priority
rv = self.rpc_wallet("transfer", params)
self._log.info(
"publishBLockTx %s to address_b58 %s",
self._log.id(rv["tx_hash"]),
self._log.addr(shared_addr),
"publishBLockTx {} to address_b58 {}".format(
self._log.id(rv["tx_hash"]),
self._log.addr(shared_addr),
)
)
tx_hash = bytes.fromhex(rv["tx_hash"])
return tx_hash
def findTxB(
self, kbv, Kbs, cb_swap_value, cb_block_confirmed, restore_height, bid_sender
self,
kbv,
Kbs,
cb_swap_value: int,
cb_block_confirmed: int,
restore_height: int,
bid_sender: bool,
check_amount: bool = True,
):
with self._mx_wallet:
Kbv = self.getPubkey(kbv)
@@ -516,7 +524,7 @@ class XMRInterface(CoinInterface):
)
rv = -1
continue
if transfer["amount"] == cb_swap_value:
if transfer["amount"] == cb_swap_value or check_amount is False:
return {
"txid": transfer["tx_hash"],
"amount": transfer["amount"],