@@ -47,25 +47,29 @@ def test_build_transaction_body(mock_account_ids):
4747
4848
4949def test_missing_token_id (mock_account_ids ):
50- """Test that building a transaction without setting
51- TokenID raises a ValueError.
52- """
53- account_id , freeze_id , node_account_id , token_id , _ = mock_account_ids
50+ """Test that building the protobuf body without TokenID ignores the missing ID."""
51+ _ , freeze_id , _ , _ , _ = mock_account_ids
5452
5553 unfreeze_tx = TokenUnfreezeTransaction ()
5654 unfreeze_tx .set_account_id (freeze_id )
57- with pytest .raises (ValueError , match = "Missing required TokenID." ):
58- unfreeze_tx .build_transaction_body ()
55+
56+ body = unfreeze_tx ._build_proto_body ()
57+
58+ assert not body .HasField ("token" )
59+ assert body .account == freeze_id ._to_proto ()
5960
6061
6162def test_missing_account_id (mock_account_ids ):
62- """Test that building a transaction without setting AccountID raises a ValueError ."""
63- account_id , freeze_id , node_account_id , token_id , _ = mock_account_ids
63+ """Test that building the protobuf body without AccountID ignores the missing ID ."""
64+ _ , _ , _ , token_id , _ = mock_account_ids
6465
6566 unfreeze_tx = TokenUnfreezeTransaction ()
6667 unfreeze_tx .set_token_id (token_id )
67- with pytest .raises (ValueError , match = "Missing required AccountID." ):
68- unfreeze_tx .build_transaction_body ()
68+
69+ body = unfreeze_tx ._build_proto_body ()
70+
71+ assert not body .HasField ("account" )
72+ assert body .token == token_id ._to_proto ()
6973
7074
7175def test_sign_transaction (mock_account_ids , mock_client ):
0 commit comments