Skip to content

Commit

Permalink
Reallow amount in Decimal format
Browse files Browse the repository at this point in the history
  • Loading branch information
clementperon committed Jan 29, 2019
1 parent 331fc3f commit 2cbed26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/signTx.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

from ledgerblue.comm import getDongle
from ledgerblue.commException import CommException
from decimal import Decimal
import argparse
import struct
import binascii
Expand Down Expand Up @@ -51,7 +52,7 @@ def parse_bip32_path(path):
parser.add_argument('--nonce', help="Nonce associated to the account", type=int, required=True)
parser.add_argument('--gasprice', help="Network gas price", type=int, required=True)
parser.add_argument('--startgas', help="startgas", default='21000', type=int)
parser.add_argument('--amount', help="Amount to send in ether", type=int, required=True)
parser.add_argument('--amount', help="Amount to send in ether", required=True)
parser.add_argument('--to', help="Destination address", type=str, required=True)
parser.add_argument('--path', help="BIP 32 path to sign with")
parser.add_argument('--data', help="Data to add, hex encoded")
Expand All @@ -65,7 +66,7 @@ def parse_bip32_path(path):
else:
args.data = decode_hex(args.data[2:])

amount = args.amount * 10**18
amount = Decimal(args.amount) * 10**18

tx = Transaction(
nonce=int(args.nonce),
Expand Down

0 comments on commit 2cbed26

Please sign in to comment.