Skip to content

Commit e565969

Browse files
committed
rebuilding of conditions 'transactions_related'
1 parent ce07db1 commit e565969

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tronapi/tron.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,6 @@ def get_transactions_related(self, address, direction='to', limit=30, offset=0):
189189
190190
"""
191191

192-
if not isinstance(limit, int) or limit < 0 or (offset and limit) < 1:
193-
raise Exception('Invalid limit provided')
194-
195-
if not isinstance(offset, int) or offset < 0:
196-
raise Exception('Invalid offset provided')
197-
198192
if direction not in ['from', 'to', 'all']:
199193
raise Exception('Invalid direction provided: Expected "to", "from" or "all"')
200194

@@ -204,9 +198,14 @@ def get_transactions_related(self, address, direction='to', limit=30, offset=0):
204198

205199
callback = from_direction
206200
callback.update(to_direction)
207-
208201
return callback
209202

203+
if not isinstance(limit, int) or limit < 0 or (offset and limit < 1):
204+
raise Exception('Invalid limit provided')
205+
206+
if not isinstance(offset, int) or offset < 0:
207+
raise Exception('Invalid offset provided')
208+
210209
response = self.solidity_node.request('/walletextension/gettransactions{}this'.format(direction), {
211210
'account': {'address': self.to_hex(address)},
212211
'limit': limit,

0 commit comments

Comments
 (0)