mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-12-25 07:29:32 -05:00
Simplify Transfer::transfer
return type
We never use the fee returned from this function, remove it.
This commit is contained in:
parent
1de3fa486e
commit
40dcf0355a
@ -190,7 +190,7 @@ pub trait Transfer {
|
||||
public_spend_key: PublicKey,
|
||||
public_view_key: PublicViewKey,
|
||||
amount: Amount,
|
||||
) -> Result<(TransferProof, Amount)>;
|
||||
) -> Result<TransferProof>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user