xmr-btc-swap/swap
Byron Hambly 39e34a608b
fix: fix potential overflow in max_bitcoin_for_price
In testing, ASB panicked in `max_bitcoin_for_price` when the Monero
balance x Bitcoin price was enough to overflow `u64`.

This commit changes the function to do the piconero offset division
first, and then to use `checked_mul` to return None if the calculation
would overflow. This required changing the function return
signature to an `Option`. Additional tests for the function were also added.

MONERO_FEE was changed from 0.000030 to 0.000016, which is still
double the current median transaction fee listed at
https://www.monero.how/monero-transaction-fees as of 2022-07-28.
2022-07-28 15:03:32 +02:00
..
migrations Add sqlite database implementation 2021-09-30 18:59:12 +10:00
proptest-regressions/bitcoin Add proptest for max_giveable and signing PSBT 2021-08-12 18:42:00 +10:00
src fix: fix potential overflow in max_bitcoin_for_price 2022-07-28 15:03:32 +02:00
tests Implement Identify protocol to make network and version of ASB available to peers 2022-04-19 19:48:41 +02:00
build.rs Provide a commit-specific version output 2021-07-07 17:55:13 +10:00
Cargo.toml fix: change logs to UTC due to bug in time crate 2022-07-26 14:16:41 +02:00
sqlite_dev_setup.sh Add sqlite database implementation 2021-09-30 18:59:12 +10:00
sqlx-data.json Add sqlite database implementation 2021-09-30 18:59:12 +10:00