Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/backend/blindbit/backend/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::{backend::blindbit::BlindbitClient, BlockData, ChainBackend, SpentInd

const CONCURRENT_FILTER_REQUESTS: usize = 200;

#[derive(Debug)]
pub struct BlindbitBackend {
client: BlindbitClient,
}
Expand Down
3 changes: 2 additions & 1 deletion src/backend/blindbit/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::structs::{
BlockHeightResponse, FilterResponse, ForwardTxRequest, SpentIndexResponse, UtxoResponse,
};

#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct BlindbitClient {
client: Client,
host_url: Url,
Expand All @@ -29,6 +29,7 @@ impl BlindbitClient {

Ok(BlindbitClient { client, host_url })
}

pub async fn block_height(&self) -> Result<Height> {
let url = self.host_url.join("block-height")?;

Expand Down
6 changes: 3 additions & 3 deletions src/client/spend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl SpClient {
&self,
available_utxos: Vec<(OutPoint, OwnedOutput)>,
mut recipients: Vec<Recipient>,
fee_rate: f32,
fee_rate: FeeRate,
network: Network,
) -> Result<SilentPaymentUnsignedTransaction> {
// check that all available outputs are unspent
Expand Down Expand Up @@ -123,7 +123,7 @@ impl SpClient {
ChangePolicy::min_value(DrainWeights::TR_KEYSPEND, TR_DUST_RELAY_MIN_VALUE);

let target = Target {
fee: TargetFee::from_feerate(FeeRate::from_sat_per_vb(fee_rate)),
fee: TargetFee::from_feerate(fee_rate),
outputs: TargetOutputs::fund_outputs(
tx_outs
.iter()
Expand Down Expand Up @@ -450,7 +450,7 @@ impl SpClient {
Ok(signed)
}

fn get_partial_secret_for_selected_utxos(
pub fn get_partial_secret_for_selected_utxos(
&self,
selected_utxos: &[(OutPoint, OwnedOutput)],
) -> Result<SecretKey> {
Expand Down
1 change: 1 addition & 0 deletions src/client/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub struct Recipient {
pub amount: Amount, // must be 0 if address is Data.
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
// this will be replaced by a proper psbt as soon as sp support is standardised
pub struct SilentPaymentUnsignedTransaction {
pub selected_utxos: Vec<(OutPoint, OwnedOutput)>,
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub mod constants;
mod scanner;
mod updater;

pub use bdk_coin_select::FeeRate;
pub use bitcoin;
pub use silentpayments;

Expand Down
Loading