Skip to content

fix(wormhole): parse --amount exactly, not via f64 - #187

Open
Iamsohungrynow wants to merge 1 commit into
Quantus-Network:mainfrom
Iamsohungrynow:fix/wormhole-amount-exact
Open

Iamsohungrynow wants to merge 1 commit into
Quantus-Network:mainfrom
Iamsohungrynow:fix/wormhole-amount-exact

Conversation

@Iamsohungrynow

Copy link
Copy Markdown
Contributor

follow-up to #179: wormhole still parsed --amount and --target-size as f64, so dissolve --amount 4.35 moved 4.34 DEV and nan, -1, inf got through. they now go through send::parse_amount_with_decimals like multisig, with regression tests

The wormhole commands still read --amount (and dissolve's --target-size)
as f64 and converted with (amount * 1_000_000_000_000.0) as u128, so
`dissolve --amount 4.35` moved 4.34 DEV (2.01 and 16.4 lost 0.01 too),
and nan, -1 and inf were accepted as 0, 0 and u128::MAX. They now go
through send::parse_amount_with_decimals when clap parses them, like
multisig since Quantus-Network#179; the SCALE_DOWN_FACTOR alignment is unchanged. The
exercise scenario now passes its multiround amount in raw units.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant