Skip to content

Commit 407d804

Browse files
committed
chore: fix pylint issues
Signed-off-by: Manish Dait <[email protected]>
1 parent 67a8a4b commit 407d804

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

src/hiero_sdk_python/tokens/abstract_token_transfer_transaction.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,20 @@ def _init_token_transfers(
8080

8181
def _init_nft_transfers(
8282
self,
83-
nft_transfers: Union[Dict[TokenId, List[Tuple[AccountId, AccountId, int, bool]]],List[TokenNftTransfer]]
83+
nft_transfers: Union[
84+
Dict[TokenId, List[Tuple[AccountId, AccountId, int, bool]]],
85+
List[TokenNftTransfer]
86+
]
8487
) -> None:
8588
"""Initializes the transaction with a list of NFT transfers.
8689
8790
Iterates through the provided list and adds each transfer using the
8891
private `_add_nft_transfer` method.
8992
9093
Args:
91-
nft_transfers (Union[Dict[TokenId, List[Tuple[AccountId, AccountId, int, bool]]], List[TokenNftTransfer]]):
92-
A list or dictionary describing NFT transfers.
94+
nft_transfers (Union[
95+
Dict[TokenId, List[Tuple[AccountId, AccountId, int, bool]]], List[TokenNftTransfer]]
96+
):A list or dictionary describing NFT transfers.
9397
9498
Raises:
9599
TypeError: If `nft_transfers` is neither a list nor a dictionary.
@@ -113,7 +117,7 @@ def _init_nft_transfers(
113117
raise TypeError(
114118
"Invalid type for `nft_transfers`. Expected a list of TokenNftTransfer "
115119
"or a dict[TokenId, List[Tuple[AccountId, AccountId, int, bool]]]."
116-
)
120+
)
117121

118122
def _add_token_transfer(
119123
self,
@@ -150,7 +154,7 @@ def _add_token_transfer(
150154
raise TypeError("expected_decimals must be an integer.")
151155
if not isinstance(is_approved, bool):
152156
raise TypeError("is_approved must be a boolean.")
153-
157+
154158
for transfer in self.token_transfers[token_id]:
155159
if transfer.account_id == account_id:
156160
transfer.amount += amount
@@ -190,7 +194,7 @@ def _add_nft_transfer(
190194
raise TypeError("receiver_id must be an AccountId instance.")
191195
if not isinstance(is_approved, bool):
192196
raise TypeError("is_approved must be a boolean.")
193-
197+
194198
self.nft_transfers[token_id].append(
195199
TokenNftTransfer(token_id, sender_id, receiver_id, serial_number, is_approved)
196200
)
@@ -299,11 +303,13 @@ def add_nft_transfer(
299303
Self: The current instance of the transaction for chaining.
300304
"""
301305
self._require_not_frozen()
302-
306+
303307
if not isinstance(nft_id, NftId):
304308
raise TypeError("nft_id must be a NftId instance.")
305-
306-
self._add_nft_transfer(nft_id.token_id, sender_id, receiver_id, nft_id.serial_number, is_approved)
309+
310+
self._add_nft_transfer(
311+
nft_id.token_id, sender_id, receiver_id, nft_id.serial_number, is_approved
312+
)
307313
return self
308314

309315
def add_approved_nft_transfer(
@@ -324,10 +330,10 @@ def add_approved_nft_transfer(
324330
Self: The current instance of the transaction for chaining.
325331
"""
326332
self._require_not_frozen()
327-
333+
328334
if not isinstance(nft_id, NftId):
329335
raise TypeError("nft_id must be a NftId instance.")
330-
336+
331337
self._add_nft_transfer(nft_id.token_id, sender_id, receiver_id, nft_id.serial_number, True)
332338
return self
333339

@@ -358,7 +364,7 @@ def build_token_transfers(self) -> 'List[basic_types_pb2.TokenTransferList]':
358364

359365
for token_transfer in token_transfers:
360366
token_list.add_token_transfer(token_transfer)
361-
367+
362368
token_transfer_list.append(token_list)
363369

364370
# NFTs
@@ -367,7 +373,7 @@ def build_token_transfers(self) -> 'List[basic_types_pb2.TokenTransferList]':
367373

368374
for nft_transfer in nft_transfers:
369375
nft_list.add_nft_transfer(nft_transfer)
370-
376+
371377
token_transfer_list.append(nft_list)
372378

373379
token_transfer_proto: list[basic_types_pb2.TokenTransferList] = []

src/hiero_sdk_python/tokens/token_transfer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _to_proto(self) -> basic_types_pb2.AccountAmount:
5252
amount=self.amount,
5353
is_approval=self.is_approved
5454
)
55-
55+
5656
@classmethod
5757
def _from_proto(cls, proto: basic_types_pb2.TokenTransferList) -> List["TokenTransfer"]:
5858
"""
@@ -78,7 +78,7 @@ def _from_proto(cls, proto: basic_types_pb2.TokenTransferList) -> List["TokenTra
7878
is_approved=transfer.is_approval
7979
)
8080
)
81-
81+
8282
return token_transfer
8383

8484
def __str__(self) -> str:

src/hiero_sdk_python/transaction/transfer_transaction.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
from hiero_sdk_python.hapi.services.schedulable_transaction_body_pb2 import (
1212
SchedulableTransactionBody,
1313
)
14-
from hiero_sdk_python.tokens.abstract_token_transfer_transaction import AbstractTokenTransferTransaction
14+
from hiero_sdk_python.tokens.abstract_token_transfer_transaction import (
15+
AbstractTokenTransferTransaction
16+
)
1517
from hiero_sdk_python.tokens.hbar_transfer import HbarTransfer
1618
from hiero_sdk_python.tokens.token_id import TokenId
1719
from hiero_sdk_python.tokens.token_nft_transfer import TokenNftTransfer

0 commit comments

Comments
 (0)