Skip to content

Commit 8ed62ad

Browse files
authored
chore: guard token airdrop channel service availability (#632)
Signed-off-by: advay-sinha <advaysinhaa@gmail.com>
1 parent f5435c0 commit 8ed62ad

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
1313
- add AccountRecordsQuery class
1414

1515
### Changed
16+
- chore: validate that token airdrop transactions require an available token service on the channel (#632)
1617

1718
- chore: fix type hint for TokenCancelAirdropTransaction pending_airdrops parameter
1819
- chore: Moved documentation file `common_issues.md` from `examples/sdk_developers/` to `docs/sdk_developers/` for unified documentation management (#516).

src/hiero_sdk_python/tokens/token_airdrop_transaction.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@ def build_scheduled_body(self) -> SchedulableTransactionBody:
219219
return schedulable_body
220220

221221
def _get_method(self, channel: _Channel) -> _Method:
222+
token_service = channel.token
223+
if token_service is None:
224+
raise ValueError("Token service not available on channel")
225+
222226
return _Method(
223-
transaction_func=channel.token.airdropTokens,
227+
transaction_func=token_service.airdropTokens,
224228
query_func=None
225229
)

0 commit comments

Comments
 (0)