From 3814572e1dbe95ae0d528d9d64abcda7146ae898 Mon Sep 17 00:00:00 2001 From: edouard Date: Tue, 5 Jul 2022 17:53:14 +0200 Subject: [PATCH] black tests/test_plugins.py --- tests/test_plugins.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/test_plugins.py b/tests/test_plugins.py index f6573d7..7109d76 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -130,13 +130,13 @@ def test_revault_attempts_without_spend_tx(miradord, bitcoind, coordinator, nois ) miradord.add_plugins([{"path": plugin_path}]) - # Should get us exactly to the max value vaults_txs = [] vaults_outpoints = [] deposit_value = 4 for _ in range(2): deposit_txid, deposit_outpoint = bitcoind.create_utxo( - DEPOSIT_ADDRESS, deposit_value, + DEPOSIT_ADDRESS, + deposit_value, ) bitcoind.generate_block(1, deposit_txid) txs = miradord.watch_vault(deposit_outpoint, deposit_value * COIN, DERIV_INDEX) @@ -145,10 +145,14 @@ def test_revault_attempts_without_spend_tx(miradord, bitcoind, coordinator, nois # We share the spend to the coordinator only for vault #0 spend_tx = b64encode(bytes.fromhex(vaults_txs[0]["spend"]["tx"])).decode() - coordinator.set_spend_tx(noise_keys["manager"].privkey, [vaults_outpoints[0]], spend_tx) + coordinator.set_spend_tx( + noise_keys["manager"].privkey, [vaults_outpoints[0]], spend_tx + ) bitcoind.rpc.sendrawtransaction(vaults_txs[0]["unvault"]["tx"]) - unvault_txid = bitcoind.rpc.decoderawtransaction(vaults_txs[0]["unvault"]["tx"])["txid"] + unvault_txid = bitcoind.rpc.decoderawtransaction(vaults_txs[0]["unvault"]["tx"])[ + "txid" + ] bitcoind.generate_block(1, unvault_txid) miradord.wait_for_logs( [ @@ -157,7 +161,9 @@ def test_revault_attempts_without_spend_tx(miradord, bitcoind, coordinator, nois ] ) bitcoind.rpc.sendrawtransaction(vaults_txs[1]["unvault"]["tx"]) - unvault_txid = bitcoind.rpc.decoderawtransaction(vaults_txs[1]["unvault"]["tx"])["txid"] + unvault_txid = bitcoind.rpc.decoderawtransaction(vaults_txs[1]["unvault"]["tx"])[ + "txid" + ] bitcoind.generate_block(1, unvault_txid) miradord.wait_for_logs( [ @@ -168,7 +174,9 @@ def test_revault_attempts_without_spend_tx(miradord, bitcoind, coordinator, nois # The Cancel transactions has been broadcast because the spend was not # shared to coordinator. - cancel_txid = bitcoind.rpc.decoderawtransaction(vaults_txs[1]["cancel"]["tx"]["20"])["txid"] + cancel_txid = bitcoind.rpc.decoderawtransaction( + vaults_txs[1]["cancel"]["tx"]["20"] + )["txid"] bitcoind.generate_block(1, wait_for_mempool=cancel_txid) miradord.wait_for_log( f"Cancel transaction was confirmed for vault at '{vaults_outpoints[1]}'"