remove ProofsStatus from cashu

This commit is contained in:
thesimplekid
2023-10-03 07:26:54 +01:00
parent 449fe8330c
commit 1070de0eec
4 changed files with 0 additions and 52 deletions

View File

@@ -29,7 +29,6 @@ interface Secret {
sequence<u8> as_bytes();
};
// NUT00
interface Id {

View File

@@ -28,7 +28,6 @@ mod ffi {
pub use crate::types::amount::Amount;
pub use crate::types::Bolt11Invoice;
pub use crate::types::KeySetInfo;
pub use crate::types::ProofsStatus;
pub use crate::types::Secret;
pub use cashu::types::InvoiceStatus;

View File

@@ -1,10 +1,8 @@
pub mod amount;
pub mod bolt11_invoice;
pub mod keyset_info;
pub mod proofs_status;
pub mod secret;
pub use bolt11_invoice::Bolt11Invoice;
pub use keyset_info::KeySetInfo;
pub use proofs_status::ProofsStatus;
pub use secret::Secret;

View File

@@ -1,48 +0,0 @@
use std::{ops::Deref, sync::Arc};
use cashu::types::ProofsStatus as ProofsStatusSdk;
use crate::MintProof;
pub struct ProofsStatus {
inner: ProofsStatusSdk,
}
impl Deref for ProofsStatus {
type Target = ProofsStatusSdk;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl ProofsStatus {
pub fn new(spendable: Vec<Arc<MintProof>>, spent: Vec<Arc<MintProof>>) -> Self {
Self {
inner: ProofsStatusSdk {
spendable: spendable
.iter()
.map(|p| p.as_ref().deref().clone())
.collect(),
spent: spent.iter().map(|p| p.as_ref().deref().clone()).collect(),
},
}
}
pub fn spendable(&self) -> Vec<Arc<MintProof>> {
self.inner
.spendable
.clone()
.into_iter()
.map(|p| Arc::new(p.into()))
.collect()
}
pub fn spent(&self) -> Vec<Arc<MintProof>> {
self.inner
.spent
.clone()
.into_iter()
.map(|p| Arc::new(p.into()))
.collect()
}
}