From 883a913f30b045a68a00b5bb46789c8bc7a393df Mon Sep 17 00:00:00 2001 From: rishflab Date: Tue, 8 Dec 2020 16:12:00 +1100 Subject: [PATCH] Remove nonsensical monero * monero multiplication --- swap/tests/e2e.rs | 4 ++-- xmr-btc/src/monero.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/swap/tests/e2e.rs b/swap/tests/e2e.rs index e8260f95..352aa8f4 100644 --- a/swap/tests/e2e.rs +++ b/swap/tests/e2e.rs @@ -33,7 +33,7 @@ async fn happy_path() { // this xmr value matches the logic of alice::calculate_amounts i.e. btc * // 10_000 * 100 let xmr_to_swap = xmr_btc::monero::Amount::from_piconero(1_000_000_000_000); - let xmr_alice = xmr_to_swap * xmr_btc::monero::Amount::from_piconero(10); + let xmr_alice = xmr_to_swap * 10; let xmr_bob = xmr_btc::monero::Amount::from_piconero(0); let alice_multiaddr: Multiaddr = "/ip4/127.0.0.1/tcp/9876" @@ -121,7 +121,7 @@ async fn alice_punishes_if_bob_never_acts_after_fund() { let bob_xmr_starting_balance = xmr_btc::monero::Amount::from_piconero(0); let alice_btc_starting_balance = bitcoin::Amount::ZERO; - let alice_xmr_starting_balance = xmr_to_swap * xmr_btc::monero::Amount::from_piconero(10); + let alice_xmr_starting_balance = xmr_to_swap * 10; let alice_multiaddr: Multiaddr = "/ip4/127.0.0.1/tcp/9877" .parse() diff --git a/xmr-btc/src/monero.rs b/xmr-btc/src/monero.rs index 7196afc4..e4215853 100644 --- a/xmr-btc/src/monero.rs +++ b/xmr-btc/src/monero.rs @@ -97,11 +97,11 @@ impl Sub for Amount { } } -impl Mul for Amount { +impl Mul for Amount { type Output = Amount; - fn mul(self, rhs: Self) -> Self::Output { - Self(self.0 * rhs.0) + fn mul(self, rhs: u64) -> Self::Output { + Self(self.0 * rhs) } }