Skip to content

Commit 109ca21

Browse files
committed
fix: 0 token id
1 parent 870cef4 commit 109ca21

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/hiero_sdk_python/tokens/token_pause_transaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def build_transaction_body(self):
5151
Raises:
5252
ValueError: If no token_id has been set.
5353
"""
54-
if self.token_id is None:
55-
raise ValueError("token_id must be set before building the transaction body")
54+
if self.token_id is None or self.token_id.num == 0:
55+
raise ValueError("token_id must be set before building the transaction body")
5656

5757
token_pause_body = TokenPauseTransactionBody(
5858
token=self.token_id.to_proto()

tests/unit/test_token_pause_transaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def _make(pause_key):
3737

3838
return _make
3939

40+
@pytest.fixture
4041
def test_builds_token_pause_body_with_correct_ids(mock_account_ids, generate_transaction_id):
4142
"""
4243
build_transaction_body() should embed:
@@ -56,7 +57,6 @@ def test_builds_token_pause_body_with_correct_ids(mock_account_ids, generate_tra
5657
assert body.transactionID == tx.transaction_id.to_proto()
5758
assert body.nodeAccountID == tx.node_account_id.to_proto()
5859

59-
6060
@pytest.mark.parametrize("bad_token", [None, TokenId(0, 0, 0)])
6161
def test_build_transaction_body_without_valid_token_id_raises(bad_token):
6262
"""

0 commit comments

Comments
 (0)