Skip to content

Commit

Permalink
Merge #376: Test sigs fetching for secure vaults
Browse files Browse the repository at this point in the history
6b5af94 Add test to check sigs fetching for secured vaults (edouard)

Pull request description:

  Test when a vault is secured and a user starts
  signing the unvault tx, every other participants
  retrieve and store the signature.

ACKs for top commit:
  darosior:
    utACK 6b5af94

Tree-SHA512: dcc8558750e5de2585910f972fdd19f50ae1ed2630f609c38ac56fbddf0bd2431bea48b20177aef26994874b3e0cb6dc830d79979942efb8a2eeb1e10e0ca377
  • Loading branch information
darosior committed Mar 18, 2022
2 parents 746201c + 6b5af94 commit d014e66
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,45 @@ def test_sigfetcher_coordinator_dead(revault_network, bitcoind):
stk.wait_for_secured_vaults([deposit])


@pytest.mark.skipif(not POSTGRES_IS_SETUP, reason="Needs Postgres for servers db")
def test_sigfetcher_secured_vaults(revault_network, bitcoind):
"""
Test that unvault sigs are retrieved and stored for secured vault even if the
daemon user did not start activating it or is not a stakeholder.
"""
rn = revault_network
rn.deploy(
3,
1,
csv=1,
with_cosigs=False,
with_watchtowers=False,
)
vault = rn.fund(1)
rn.secure_vault(vault)
stks = rn.stks()

outpoint = f"{vault['txid']}:{vault['vout']}"
unvault_psbt = stks[0].rpc.getunvaulttx(outpoint)["unvault_tx"]
unvault_psbt = stks[0].stk_keychain.sign_unvault_psbt(
unvault_psbt, vault["derivation_index"]
)
stks[0].rpc.unvaulttx(outpoint, unvault_psbt)

for stk in rn.participants():
stk.wait_for_logs(
[
"Syncing Unvault signature",
]
)
wait_for(
lambda: stk.rpc.listpresignedtransactions([outpoint])[
"presigned_transactions"
][0]["unvault"]["psbt"]
== unvault_psbt
)


@pytest.mark.skipif(not POSTGRES_IS_SETUP, reason="Needs Postgres for servers db")
def test_stkman_only(revault_network, bitcoind):
"""Test a setup with only stakehodlers-managers"""
Expand Down

0 comments on commit d014e66

Please sign in to comment.