Skip to content

Commit c6d2eba

Browse files
committed
Create ChunkedTransaction class
Signed-off-by: MonaaEid <monaa_eid@hotmail.com>
1 parent 19bf431 commit c6d2eba

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

tests/integration/file_append_transaction_e2e_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ def test_integration_file_append_transaction_max_chunks_exceeded(env):
233233
)
234234

235235
# Should fail with max chunks exceeded
236-
with pytest.raises(ValueError, match="more than.*chunks"):
236+
with pytest.raises(
237+
ValueError, match="Message requires 100 chunks but max_chunks=5. Increase limit with set_max_chunks()."
238+
):
237239
append_tx.execute(env.client)
238240

239241

tests/unit/chunked_transaction_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,12 @@ def test_execute_all_multi_chunk_replays_each_chunk(mock_client, private_key):
165165
assert responses == ["chunk-1", "chunk-2", "chunk-3"]
166166
assert mock_execute.call_count == 3
167167
assert tx._current_chunk_index == 2
168+
169+
170+
def test_validate_chunking_allows_required_equal_to_max_chunks():
171+
"""Test that _validate_chunking does not raise an error when required_chunks equals max_chunks."""
172+
tx = DummyChunkedTransaction(required_chunks=3).set_max_chunks(3)
173+
174+
tx._validate_chunking()
175+
assert tx._total_chunks == 3
176+
assert tx._current_chunk_index == 0

0 commit comments

Comments
 (0)