Browse Source

remove `ProofsStatus` from `cashu`

thesimplekid 1 year ago
parent
commit
1070de0eec

+ 0 - 1
bindings/cashu-ffi/src/cashu.udl

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

+ 0 - 1
bindings/cashu-ffi/src/lib.rs

@@ -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;

+ 0 - 2
bindings/cashu-ffi/src/types/mod.rs

@@ -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;

+ 0 - 48
bindings/cashu-ffi/src/types/proofs_status.rs

@@ -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()
-    }
-}