Skip to content

Commit

Permalink
Convert to ContractingDecimal instead of float
Browse files Browse the repository at this point in the history
  • Loading branch information
Endogen committed Oct 18, 2024
1 parent 86228ef commit f4bbcd0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/xian/utils/tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import nacl.signing
import nacl.encoding
from contracting.storage.encoder import encode, decode
from contracting.stdlib.bridge.decimal import ContractingDecimal
from xian.exceptions import TransactionException
from xian.formatting import contract_name_is_formatted, TRANSACTION_PAYLOAD_RULES, TRANSACTION_RULES
from loguru import logger
Expand Down Expand Up @@ -200,7 +201,7 @@ def validate_transaction(client, nonce_storage, tx):
amount = 0 if amount is None else amount

if isinstance(amount, dict) and '__fixed__' in amount:
amount = float(amount['__fixed__'])
amount = ContractingDecimal(amount['__fixed__'])

# Check if they have enough stamps for the operation
check_enough_stamps(
Expand Down

0 comments on commit f4bbcd0

Please sign in to comment.