@@ -35,21 +35,21 @@ def test_build_transaction_body(mock_account_ids):
3535 assert transaction_body .tokenRevokeKyc .account == account_id ._to_proto ()
3636
3737
38- def test_build_transaction_body_validation (mock_account_ids ):
39- """Test validation when building transaction body ."""
38+ def test_build_transaction_body_allows_missing_ids (mock_account_ids ):
39+ """Allow missing IDs so validation is performed by the network, per the TCK spec ."""
4040 account_id , _ , _ , token_id , _ = mock_account_ids
4141
42- # Test missing token ID
42+ # Missing token ID: build must succeed, with the token field left unset.
4343 revoke_kyc_tx = TokenRevokeKycTransaction (account_id = account_id )
44+ body = revoke_kyc_tx ._build_proto_body ()
45+ assert not body .HasField ("token" )
46+ assert body .account == account_id ._to_proto ()
4447
45- with pytest .raises (ValueError , match = "Missing token ID" ):
46- revoke_kyc_tx .build_transaction_body ()
47-
48- # Test missing account ID
48+ # Missing account ID: build must succeed, with the account field left unset.
4949 revoke_kyc_tx = TokenRevokeKycTransaction (token_id = token_id )
50-
51- with pytest . raises ( ValueError , match = "Missing account ID" ):
52- revoke_kyc_tx . build_transaction_body ( )
50+ body = revoke_kyc_tx . _build_proto_body ()
51+ assert body . token == token_id . _to_proto ()
52+ assert not body . HasField ( "account" )
5353
5454
5555def test_constructor_with_parameters (mock_account_ids ):
0 commit comments