mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Add zero const to monero::Amount
This commit is contained in:
parent
64b021daf4
commit
71a0832ef4
@ -37,7 +37,7 @@ async fn happy_path() {
|
|||||||
// 10_000 * 100
|
// 10_000 * 100
|
||||||
let xmr_to_swap = xmr_btc::monero::Amount::from_piconero(1_000_000_000_000);
|
let xmr_to_swap = xmr_btc::monero::Amount::from_piconero(1_000_000_000_000);
|
||||||
let xmr_alice = xmr_to_swap * 10;
|
let xmr_alice = xmr_to_swap * 10;
|
||||||
let xmr_bob = xmr_btc::monero::Amount::from_piconero(0);
|
let xmr_bob = xmr_btc::monero::Amount::ZERO;
|
||||||
|
|
||||||
// todo: This should not be hardcoded
|
// todo: This should not be hardcoded
|
||||||
let alice_multiaddr: Multiaddr = "/ip4/127.0.0.1/tcp/9876"
|
let alice_multiaddr: Multiaddr = "/ip4/127.0.0.1/tcp/9876"
|
||||||
@ -142,7 +142,7 @@ async fn alice_punishes_if_bob_never_acts_after_fund() {
|
|||||||
let xmr_to_swap = xmr_btc::monero::Amount::from_piconero(1_000_000_000_000);
|
let xmr_to_swap = xmr_btc::monero::Amount::from_piconero(1_000_000_000_000);
|
||||||
|
|
||||||
let bob_btc_starting_balance = btc_to_swap * 10;
|
let bob_btc_starting_balance = btc_to_swap * 10;
|
||||||
let bob_xmr_starting_balance = xmr_btc::monero::Amount::from_piconero(0);
|
let bob_xmr_starting_balance = xmr_btc::monero::Amount::ZERO;
|
||||||
|
|
||||||
let alice_btc_starting_balance = bitcoin::Amount::ZERO;
|
let alice_btc_starting_balance = bitcoin::Amount::ZERO;
|
||||||
let alice_xmr_starting_balance = xmr_to_swap * 10;
|
let alice_xmr_starting_balance = xmr_to_swap * 10;
|
||||||
|
@ -76,6 +76,7 @@ pub struct PublicViewKey(PublicKey);
|
|||||||
pub struct Amount(u64);
|
pub struct Amount(u64);
|
||||||
|
|
||||||
impl Amount {
|
impl Amount {
|
||||||
|
pub const ZERO: Self = Self(0);
|
||||||
/// Create an [Amount] with piconero precision and the given number of
|
/// Create an [Amount] with piconero precision and the given number of
|
||||||
/// piconeros.
|
/// piconeros.
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user