Remove nonsensical monero * monero multiplication

This commit is contained in:
rishflab 2020-12-08 16:12:00 +11:00
parent 627b1a9f00
commit 883a913f30
2 changed files with 5 additions and 5 deletions

View File

@ -33,7 +33,7 @@ async fn happy_path() {
// this xmr value matches the logic of alice::calculate_amounts i.e. btc * // this xmr value matches the logic of alice::calculate_amounts i.e. btc *
// 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 * 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 xmr_bob = xmr_btc::monero::Amount::from_piconero(0);
let alice_multiaddr: Multiaddr = "/ip4/127.0.0.1/tcp/9876" 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 bob_xmr_starting_balance = xmr_btc::monero::Amount::from_piconero(0);
let alice_btc_starting_balance = bitcoin::Amount::ZERO; 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" let alice_multiaddr: Multiaddr = "/ip4/127.0.0.1/tcp/9877"
.parse() .parse()

View File

@ -97,11 +97,11 @@ impl Sub for Amount {
} }
} }
impl Mul for Amount { impl Mul<u64> for Amount {
type Output = Amount; type Output = Amount;
fn mul(self, rhs: Self) -> Self::Output { fn mul(self, rhs: u64) -> Self::Output {
Self(self.0 * rhs.0) Self(self.0 * rhs)
} }
} }