File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,33 @@ def test_topic_message_submit_transaction_can_submit_a_large_message(env):
109109 delete_topic (env .client , topic_id )
110110
111111
112+ @pytest .mark .integration
113+ def test_topic_message_submit_transaction_fails_if_max_chunks_less_than_requied (env ):
114+ """Test topic message submit transaction can submit large message."""
115+ topic_id = create_topic (
116+ client = env .client ,
117+ admin_key = env .operator_key
118+ )
119+
120+ info = TopicInfoQuery ().set_topic_id (topic_id ).execute (env .client )
121+ assert info .sequence_number == 0
122+
123+ message = "A" * (1024 * 14 ) # message with (1024 * 14) bytes ie 14 chunks
124+
125+ message_tx = (
126+ TopicMessageSubmitTransaction ()
127+ .set_topic_id (topic_id )
128+ .set_message (message )
129+ .set_max_chunks (2 )
130+ .freeze_with (env .client )
131+ )
132+
133+ with pytest .raises (ValueError ):
134+ message_receipt = message_tx .execute (env .client )
135+
136+ delete_topic (env .client , topic_id )
137+
138+
112139@pytest .mark .integration
113140def test_integration_topic_message_submit_transaction_with_submit_key (env ):
114141 """Test that a topic message submit transaction executes with submit key."""
You can’t perform that action at this time.
0 commit comments