Browse Source

ci: remove deprecated attribute

versioning is not constant at the moment
so the attribute just causes ci errors
Will add back once more stable
thesimplekid 1 year ago
parent
commit
c3437beb6f

+ 2 - 10
bindings/cashu-ffi/src/nuts/nut06/mod.rs

@@ -21,11 +21,7 @@ impl SplitRequest {
         let outputs = outputs.into_iter().map(|o| o.as_ref().into()).collect();
 
         Self {
-            inner: SplitRequestSdk {
-                amount: None,
-                proofs,
-                outputs,
-            },
+            inner: SplitRequestSdk::new(proofs, outputs),
         }
     }
 
@@ -64,11 +60,7 @@ impl SplitResponse {
     pub fn new(promises: Vec<Arc<BlindedSignature>>) -> Self {
         let promises = promises.into_iter().map(|p| p.as_ref().into()).collect();
         Self {
-            inner: SplitResponseSdk {
-                fst: None,
-                snd: None,
-                promises: Some(promises),
-            },
+            inner: SplitResponseSdk::new(promises),
         }
     }
 

+ 1 - 5
crates/cashu-sdk/src/wallet.rs

@@ -278,11 +278,7 @@ impl Wallet {
 
         let blinded_messages = BlindedMessages::random(value)?;
 
-        let split_payload = SplitRequest {
-            amount: None,
-            proofs,
-            outputs: blinded_messages.blinded_messages.clone(),
-        };
+        let split_payload = SplitRequest::new(proofs, blinded_messages.blinded_messages.clone());
 
         Ok(SplitPayload {
             blinded_messages,

+ 19 - 22
crates/cashu/src/nuts/nut06.rs

@@ -20,17 +20,29 @@ pub struct SplitPayload {
 /// Split Request [NUT-06]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
 pub struct SplitRequest {
-    #[deprecated(since = "0.3.0", note = "mint does not need amount")]
-    #[serde(skip_serializing_if = "Option::is_none")]
+    // TODO: This should be deprecated
     pub amount: Option<Amount>,
+    /// Proofs that are to be spent in `Split`
     pub proofs: Proofs,
+    /// Blinded Messages for Mint to sign
     pub outputs: Vec<BlindedMessage>,
 }
 
 impl SplitRequest {
+    pub fn new(proofs: Proofs, outputs: Vec<BlindedMessage>) -> Self {
+        Self {
+            amount: None,
+            proofs,
+            outputs,
+        }
+    }
+
+    /// Total value of proofs in `SplitRequest`
     pub fn proofs_amount(&self) -> Amount {
         self.proofs.iter().map(|proof| proof.amount).sum()
     }
+
+    /// Total value of outputs in `SplitRequest`
     pub fn output_amount(&self) -> Amount {
         self.outputs.iter().map(|proof| proof.amount).sum()
     }
@@ -40,17 +52,11 @@ impl SplitRequest {
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
 pub struct SplitResponse {
     /// Promises to keep
-    #[deprecated(
-        since = "0.3.0",
-        note = "mint only response with one list of all promises"
-    )]
+    // TODO: This should be deprecated
     #[serde(skip_serializing_if = "Option::is_none")]
     pub fst: Option<Vec<BlindedSignature>>,
     /// Promises to send
-    #[deprecated(
-        since = "0.3.0",
-        note = "mint only response with one list of all promises"
-    )]
+    // TODO: This should be deprecated
     #[serde(skip_serializing_if = "Option::is_none")]
     pub snd: Option<Vec<BlindedSignature>>,
     /// Promises
@@ -66,10 +72,7 @@ impl SplitResponse {
         }
     }
 
-    #[deprecated(
-        since = "0.3.0",
-        note = "mint only response with one list of all promises"
-    )]
+    // TODO: This should be deprecated
     pub fn new_from_amount(
         fst: Vec<BlindedSignature>,
         snd: Vec<BlindedSignature>,
@@ -81,10 +84,7 @@ impl SplitResponse {
         }
     }
 
-    #[deprecated(
-        since = "0.3.0",
-        note = "mint only response with one list of all promises"
-    )]
+    // TODO: This should be deprecated
     pub fn change_amount(&self) -> Option<Amount> {
         self.fst.as_ref().map(|fst| {
             fst.iter()
@@ -93,10 +93,7 @@ impl SplitResponse {
         })
     }
 
-    #[deprecated(
-        since = "0.3.0",
-        note = "mint only response with one list of all promises"
-    )]
+    // TODO: This should be deprecated
     pub fn target_amount(&self) -> Option<Amount> {
         self.snd.as_ref().map(|snd| {
             snd.iter()