From 1070de0eecfd8dee67cbf0e8ffaa3262482f3b19 Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Tue, 3 Oct 2023 07:26:54 +0100 Subject: [PATCH] remove `ProofsStatus` from `cashu` --- bindings/cashu-ffi/src/cashu.udl | 1 - bindings/cashu-ffi/src/lib.rs | 1 - bindings/cashu-ffi/src/types/mod.rs | 2 - bindings/cashu-ffi/src/types/proofs_status.rs | 48 ------------------- 4 files changed, 52 deletions(-) delete mode 100644 bindings/cashu-ffi/src/types/proofs_status.rs diff --git a/bindings/cashu-ffi/src/cashu.udl b/bindings/cashu-ffi/src/cashu.udl index 90caafbd..65b5f12c 100644 --- a/bindings/cashu-ffi/src/cashu.udl +++ b/bindings/cashu-ffi/src/cashu.udl @@ -29,7 +29,6 @@ interface Secret { sequence as_bytes(); }; - // NUT00 interface Id { diff --git a/bindings/cashu-ffi/src/lib.rs b/bindings/cashu-ffi/src/lib.rs index 98a27369..040f3017 100644 --- a/bindings/cashu-ffi/src/lib.rs +++ b/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; diff --git a/bindings/cashu-ffi/src/types/mod.rs b/bindings/cashu-ffi/src/types/mod.rs index 475c4307..c35078c3 100644 --- a/bindings/cashu-ffi/src/types/mod.rs +++ b/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; diff --git a/bindings/cashu-ffi/src/types/proofs_status.rs b/bindings/cashu-ffi/src/types/proofs_status.rs deleted file mode 100644 index 04489af4..00000000 --- a/bindings/cashu-ffi/src/types/proofs_status.rs +++ /dev/null @@ -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>, spent: Vec>) -> 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> { - self.inner - .spendable - .clone() - .into_iter() - .map(|p| Arc::new(p.into())) - .collect() - } - - pub fn spent(&self) -> Vec> { - self.inner - .spent - .clone() - .into_iter() - .map(|p| Arc::new(p.into())) - .collect() - } -}