Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions bit/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,12 @@ def prepare_transaction(cls, address, outputs, compressed=True, fee=None,
:returns: JSON storing data required to create an offline transaction.
:rtype: ``str``
"""
if not isinstance(fee, (int, type(None))):
raise TypeError('Invalid fee type.')
unspents, outputs = sanitize_tx_data(
unspents or NetworkAPI.get_unspent(address),
outputs,
fee or get_fee_cached(),
fee if isinstance(fee, int) else get_fee_cached(),
leftover or address,
combine=combine,
message=message,
Expand Down Expand Up @@ -766,10 +768,12 @@ def prepare_transaction(cls, address, outputs, compressed=True, fee=None,
:returns: JSON storing data required to create an offline transaction.
:rtype: ``str``
"""
if not isinstance(fee, (int, type(None))):
raise TypeError('Invalid fee type.')
unspents, outputs = sanitize_tx_data(
unspents or NetworkAPI.get_unspent_testnet(address),
outputs,
fee or get_fee_cached(),
fee if isinstance(fee, int) else get_fee_cached(),
leftover or address,
combine=combine,
message=message,
Expand Down Expand Up @@ -1118,10 +1122,12 @@ def prepare_transaction(cls, address, outputs, compressed=True, fee=None,
:returns: JSON storing data required to create an offline transaction.
:rtype: ``str``
"""
if not isinstance(fee, (int, type(None))):
raise TypeError('Invalid fee type.')
unspents, outputs = sanitize_tx_data(
unspents or NetworkAPI.get_unspent(address),
outputs,
fee or get_fee_cached(),
fee if isinstance(fee, int) else get_fee_cached(),
leftover or address,
combine=combine,
message=message,
Expand Down Expand Up @@ -1421,10 +1427,12 @@ def prepare_transaction(cls, address, outputs, compressed=True, fee=None,
:returns: JSON storing data required to create an offline transaction.
:rtype: ``str``
"""
if not isinstance(fee, (int, type(None))):
raise TypeError('Invalid fee type.')
unspents, outputs = sanitize_tx_data(
unspents or NetworkAPI.get_unspent_testnet(address),
outputs,
fee or get_fee_cached(),
fee if isinstance(fee, int) else get_fee_cached(),
leftover or address,
combine=combine,
message=message,
Expand Down