ソースを参照

chore: update readme

thesimplekid 11 ヶ月 前
コミット
4cab82d15a
2 ファイル変更9 行追加14 行削除
  1. 2 7
      README.md
  2. 7 7
      crates/cashu/src/dhke.rs

+ 2 - 7
README.md

@@ -20,13 +20,8 @@ Experimental for this project can be found in the [cashu-crab-bindings](https://
 - :heavy_check_mark: [NUT-07](https://github.com/cashubtc/nuts/blob/main/07.md)
 - :heavy_check_mark: [NUT-08](https://github.com/cashubtc/nuts/blob/main/08.md)
 - :heavy_check_mark: [NUT-09](https://github.com/cashubtc/nuts/blob/main/09.md)
-
-
-## Supported token formats:
-
-- :x: v1 read (deprecated)
-- :x: v2 read (deprecated)
-- :heavy_check_mark: [v3](https://github.com/cashubtc/nuts/blob/main/00.md#023---v3-tokens) read/write
+- :heavy_check_mark: [NUT-09](https://github.com/cashubtc/nuts/blob/main/10.md)
+- :heavy_check_mark: [NUT-09](https://github.com/cashubtc/nuts/blob/main/11.md)
 
 
 ## License

+ 7 - 7
crates/cashu/src/dhke.rs

@@ -93,21 +93,21 @@ mod wallet {
         keys: &Keys,
     ) -> Result<Proofs, error::wallet::Error> {
         let mut proofs = vec![];
-        for (i, promise) in promises.into_iter().enumerate() {
-            let blinded_c = promise.c;
+        for ((blinded_signature, r), secret) in promises.into_iter().zip(rs).zip(secrets) {
+            let blinded_c = blinded_signature.c;
             let a: PublicKey = keys
-                .amount_key(promise.amount)
+                .amount_key(blinded_signature.amount)
                 .ok_or(error::wallet::Error::CustomError(
                     "Could not get proofs".to_string(),
                 ))?
                 .to_owned();
 
-            let unblinded_signature = unblind_message(blinded_c, rs[i].clone().into(), a)?;
+            let unblinded_signature = unblind_message(blinded_c, r.into(), a)?;
 
             let proof = Proof::new(
-                promise.amount,
-                promise.keyset_id,
-                secrets[i].clone(),
+                blinded_signature.amount,
+                blinded_signature.keyset_id,
+                secret,
                 unblinded_signature,
             );