cli: payto: fix feerate parsing
Feerate is passed to `Commands._get_fee_policy()` as str which then tried to multiply the string by 1000. Now it first casts the string to `Decimal` and multiplies the decimal. Fixes https://github.com/spesmilo/electrum/issues/10315
This commit is contained in:
@@ -313,6 +313,14 @@ class TestCommandsTestnet(ElectrumTestCase):
|
||||
locktime=1972344,
|
||||
wallet=wallet)
|
||||
|
||||
tx_str_2 = await cmds.payto(
|
||||
destination="tb1qsyzgpwa0vg2940u5t6l97etuvedr5dejpf9tdy",
|
||||
amount="0.00123456",
|
||||
feerate="50.000", # test that passing a string feerate results in the same tx
|
||||
locktime=1972344,
|
||||
wallet=wallet)
|
||||
|
||||
self.assertEqual(tx_str, tx_str_2)
|
||||
tx = tx_from_any(tx_str)
|
||||
self.assertEqual(2, len(tx.outputs()))
|
||||
txout = TxOutput.from_address_and_value("tb1qsyzgpwa0vg2940u5t6l97etuvedr5dejpf9tdy", 123456)
|
||||
|
||||
Reference in New Issue
Block a user