Closed sacarlson closed 9 years ago
Could you please include some further explanatory info?
For example, in what way does the transaction fail? Are you getting an error raised? If so, please paste the stack trace. If it's failing in stellar-core, it's probably a different cause then if an error raised.
I'll try to repro now, but including more direct information about how the system is responding to your script in future reports really makes things quicker to fix and would be much appreciated.
The following snippet does not repro the error:
require 'stellar-base'
master = Stellar::KeyPair.master
destination = Stellar::KeyPair.random
tx = Stellar::Transaction.payment({
account: master,
destination: destination,
sequence: 1,
amount: [:native, 1.234]
})
b64 = tx.to_envelope(master).to_xdr(:base64)
puts b64
In addition, inspecting the resulting transaction, it does properly set the amount to 12340000
from the input of 1.234
.
yes sorry even after pulling my older version of my code I can no longer duplicate this problem. my best guess is I still was running ruby-stellar-base 0.3.0. In the future I'll be sure to capture more details. I think you can close this
It seems I can do a native payment using an integer of 1 but if I use 1.234 the transaction fails. The work around I found is enter the amount when floating point is needed in string format "1.234" then it works. this is using ruby-stellar-base version 0.4.0.