Skip to content

Commit

Permalink
Test bad transcript size
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusv committed Sep 16, 2024
1 parent a204eb4 commit cafd8ce
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,30 @@ def test_post_transcript_but_already_posted_transcript(
coordinator.postTranscript(0, transcript, sender=nodes[0])


def test_post_transcript_but_wrong_size(
coordinator, nodes, initiator, erc20, fee_model, global_allow_list
):
initiate_ritual(
coordinator=coordinator,
fee_model=fee_model,
erc20=erc20,
authority=initiator,
nodes=nodes,
allow_logic=global_allow_list,
)

size = len(nodes)
threshold = coordinator.getThresholdForRitualSize(size)
bad_transcript = generate_transcript(size, threshold + 1)

with ape.reverts("Invalid transcript size"):
coordinator.postTranscript(0, bad_transcript, sender=nodes[0])

bad_transcript = b""
with ape.reverts("Invalid transcript size"):
coordinator.postTranscript(0, bad_transcript, sender=nodes[0])


def test_post_transcript_but_not_waiting_for_transcripts(
coordinator, nodes, initiator, erc20, fee_model, global_allow_list
):
Expand Down

0 comments on commit cafd8ce

Please sign in to comment.