From cafd8cecaefe344e8629a6ea4e1ffbbede694094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=BA=C3=B1ez?= Date: Mon, 16 Sep 2024 19:40:10 +0200 Subject: [PATCH] Test bad transcript size --- tests/test_coordinator.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/test_coordinator.py b/tests/test_coordinator.py index a9122876..d117d24c 100644 --- a/tests/test_coordinator.py +++ b/tests/test_coordinator.py @@ -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 ):