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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bcr-ebill-core = { path = "./crates/bcr-ebill-core" }
bcr-ebill-api = { path = "./crates/bcr-ebill-api" }
bcr-ebill-persistence = { path = "./crates/bcr-ebill-persistence" }
bcr-ebill-transport = { path = "./crates/bcr-ebill-transport" }
bcr-common = { git = "https://github.com/BitcreditProtocol/bcr-common", rev = "c57a0c12859ee87f1a1efddbe991ced6e7665d18" }
bcr-common = { git = "https://github.com/BitcreditProtocol/bcr-common", rev = "3359dd7ebc6faa24c1bd9b8e6c09697b6c864262" }
surrealdb = { version = "2.3", default-features = false }
strum = { version = "0.27", features = ["derive"] }
url = { version = "2.5" }
Expand Down
35 changes: 2 additions & 33 deletions crates/bcr-ebill-api/src/external/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use async_trait::async_trait;
use bcr_common::cashu::{self, ProofsMethods, State, nut01 as cdk01, nut02 as cdk02};
use bcr_common::client::mint::Client as ExternalMintClient;
use bcr_common::core::BillId;
use bcr_common::wire::clowder::{ConnectedMintResponse, ConnectedMintsResponse};
use bcr_common::wire::quotes::{ResolveOffer, StatusReply};
use bcr_ebill_core::protocol::{BitcoinAddress, BlockId, Sha256Hash, Sum};
use bcr_ebill_core::{
Expand All @@ -13,7 +12,6 @@ use bcr_ebill_core::{
};
use nostr::hashes::{Hash, sha256};
use secp256k1::rand::{prelude::SliceRandom, thread_rng};
use serde::Deserialize;
use thiserror::Error;
use uuid::Uuid;

Expand Down Expand Up @@ -379,10 +377,9 @@ impl MintClientApi for MintClient {
return Err(Error::NoBetas.into());
};

let beta_url =
url::Url::from_str(&random_beta.mint.to_string()).map_err(|_| Error::InvalidMintUrl)?;
let beta_url = &random_beta.mint;
let derived_payment_address_from_beta = self
.client(&beta_url)?
.client(beta_url)?
.derive_ebill_payment_address(
*mint_info.node_id,
bill_id.to_owned(),
Expand Down Expand Up @@ -522,34 +519,6 @@ impl From<StatusReply> for QuoteStatusReply {
}
}

#[derive(Debug, Clone, Deserialize)]
pub struct ConnectedMintReply {
pub mint: cashu::MintUrl,
pub pub_key: secp256k1::PublicKey,
}

impl From<ConnectedMintResponse> for ConnectedMintReply {
fn from(value: ConnectedMintResponse) -> Self {
Self {
mint: value.mint,
pub_key: value.node_id,
}
}
}

#[derive(Debug, Clone, Deserialize)]
pub struct ConnectedMintsReply {
pub mints: Vec<ConnectedMintReply>,
}

impl From<ConnectedMintsResponse> for ConnectedMintsReply {
fn from(value: ConnectedMintsResponse) -> Self {
Self {
mints: value.mints.into_iter().map(|m| m.into()).collect(),
}
}
}

fn map_shared_bill(
bill_to_share: BillToShareWithExternalParty,
) -> bcr_common::wire::quotes::SharedBill {
Expand Down
Loading