fix some tests

This commit is contained in:
jerryfletcher21 2024-06-15 17:25:17 +02:00
parent 10f88e3b5d
commit e9c25dbe65
No known key found for this signature in database
GPG Key ID: 6FA7713E574EDEC3
3 changed files with 9 additions and 8 deletions

View File

@ -736,9 +736,10 @@ class Logics:
valid = cls.create_onchain_payment(
order, user, preliminary_amount=context["invoice_amount"]
)
order.log(
f"Suggested mining fee is {order.payout_tx.suggested_mining_fee_rate} Sats/vbyte, the swap fee rate is {order.payout_tx.swap_fee_rate}%"
)
if order.payout_tx is not None:
order.log(
f"Suggested mining fee is {order.payout_tx.suggested_mining_fee_rate} Sats/vbyte, the swap fee rate is {order.payout_tx.swap_fee_rate}%"
)
if not valid:
context["swap_allowed"] = False
context[

View File

@ -1012,8 +1012,8 @@ class TradeTest(BaseAPITestCase):
invoice = add_invoice("robot", response.json()["earned_rewards"])
signed_payout_invoice = sign_message(
invoice,
passphrase_path=f"tests/robots/{trade.taker_index}/token",
private_key_path=f"tests/robots/{trade.taker_index}/enc_priv_key",
passphrase_path=f"tests/robots/{trade.maker_index}/token",
private_key_path=f"tests/robots/{trade.maker_index}/enc_priv_key",
)
body = {
"invoice": signed_payout_invoice,

View File

@ -10,11 +10,11 @@ def sign_message(message, private_key_path, passphrase_path):
with open(passphrase_path, "r") as f:
passphrase = f.read()
gpg.import_keys(private_key, passphrase=passphrase)
import_result = gpg.import_keys(private_key, passphrase=passphrase)
# keyid=import_result.fingerprints[0]
signed_message = gpg.sign(
message, passphrase=passphrase, extra_args=["--digest-algo", "SHA512"]
message, keyid=import_result.fingerprints[0], passphrase=passphrase,
extra_args=["--digest-algo", "SHA512"]
)
# [print(name, getattr(signed_message, name)) for name in dir(signed_message) if not callable(getattr(signed_message, name))]