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) } }