Skip to content

Commit

Permalink
update tests to reflect new response types
Browse files Browse the repository at this point in the history
  • Loading branch information
conduition committed Aug 26, 2024
1 parent a9fb148 commit be81d78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ def mint():

server = UvicornServer(config=config)
server.start()
time.sleep(1)
time.sleep(5)
yield server
server.stop()
14 changes: 7 additions & 7 deletions tests/test_dlc.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ async def test_registration_vanilla_proofs(wallet: Wallet, ledger: Ledger):
response = await ledger.register_dlc(request)
assert len(response.funded) == 1, "Funding proofs len != 1"

funding_proof = response.funded[0]
assert verify_dlc_signature(dlc_root, 64, bytes.fromhex(funding_proof.signature), pubkey),\
ack = response.funded[0]
assert verify_dlc_signature(dlc_root, 64, bytes.fromhex(ack.funding_proof.signature), pubkey),\
"Could not verify funding proof"

@pytest.mark.asyncio
Expand Down Expand Up @@ -345,8 +345,8 @@ async def test_registration_dlc_locked_proofs(wallet: Wallet, ledger: Ledger):
assert response.errors is None, f"Funding proofs error: {response.errors[0].bad_inputs}"
assert len(response.funded) == 1, "Funding proofs len != 1"

funding_proof = response.funded[0]
assert verify_dlc_signature(dlc_root, 64, bytes.fromhex(funding_proof.signature), pubkey), \
ack = response.funded[0]
assert verify_dlc_signature(dlc_root, 64, bytes.fromhex(ack.funding_proof.signature), pubkey), \
"Could not verify funding proof"


Expand Down Expand Up @@ -508,7 +508,7 @@ async def test_settle_dlc(wallet: Wallet, ledger: Ledger):

request = PostDlcRegistrationRequest(registrations=[dlc])
response = await ledger.register_dlc(request)
assert response.errors is None, f"Funding proofs error: {response.errors[0].bad_inputs}"
assert response.errors is None, f"Funding proofs error: {response.errors[0].bad_inputs}"

outcome = DlcOutcome(
P=json.dumps(payouts[1]),
Expand Down Expand Up @@ -558,7 +558,7 @@ async def test_settle_dlc_timeout(wallet: Wallet, ledger: Ledger):

request = PostDlcRegistrationRequest(registrations=[dlc])
response = await ledger.register_dlc(request)
assert response.errors is None, f"Funding proofs error: {response.errors[0].bad_inputs}"
assert response.errors is None, f"Funding proofs error: {response.errors[0].bad_inputs}"

outcome = DlcOutcome(
P=json.dumps(payouts[2]),
Expand All @@ -574,4 +574,4 @@ async def test_settle_dlc_timeout(wallet: Wallet, ledger: Ledger):
response = await ledger.settle_dlc(request)

assert response.errors is None, f"Response contains errors: {response.errors}"
assert len(response.settled) > 0, "Response contains zero settlements."
assert len(response.settled) > 0, "Response contains zero settlements."

0 comments on commit be81d78

Please sign in to comment.