Simplify Transfer::transfer return type

We never use the fee returned from this function, remove it.
This commit is contained in:
Thomas Eizinger 2021-02-26 15:45:23 +11:00
parent 1de3fa486e
commit 40dcf0355a
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96
3 changed files with 4 additions and 6 deletions

View File

@ -190,7 +190,7 @@ pub trait Transfer {
public_spend_key: PublicKey,
public_view_key: PublicViewKey,
amount: Amount,
) -> Result<(TransferProof, Amount)>;
) -> Result<TransferProof>;
}
#[async_trait]

View File

@ -82,7 +82,7 @@ impl Transfer for Wallet {
public_spend_key: PublicKey,
public_view_key: PublicViewKey,
amount: Amount,
) -> Result<(TransferProof, Amount)> {
) -> Result<TransferProof> {
let destination_address =
Address::standard(self.network, public_spend_key, public_view_key.into());
@ -97,12 +97,10 @@ impl Transfer for Wallet {
tracing::info!("Monero tx broadcasted!, tx hash: {:?}", tx_hash);
let tx_key = PrivateKey::from_str(&res.tx_key)?;
let fee = Amount::from_piconero(res.fee);
let transfer_proof = TransferProof::new(tx_hash, tx_key);
tracing::debug!(" Transfer proof: {:?}", transfer_proof);
Ok((transfer_proof, fee))
Ok(transfer_proof)
}
}

View File

@ -69,7 +69,7 @@ where
let public_spend_key = S_a + state3.S_b_monero;
let public_view_key = state3.v.public();
let (transfer_proof, _) = monero_wallet
let transfer_proof = monero_wallet
.transfer(public_spend_key, public_view_key, state3.xmr)
.await?;