Browse Source

`bindings/cashu-sdk` wallet

thesimplekid 1 year ago
parent
commit
871dfde171

+ 19 - 3
.github/workflows/test.yml

@@ -12,13 +12,29 @@ env:
 jobs:
   test:
     runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        rust:
+          - version: stable
+        build-args:
+          [
+            -p cashu,
+            -p cashu --no-default-features,
+            -p cashu --no-default-features --features wallet,
+            -p cashu --no-default-features --features mint,
+            -p cashu-sdk,
+            -p cashu-sdk --no-default-features,
+            -p cashu-sdk --features blocking,
+          ]
     steps:
     - name: Checkout Crate
       uses: actions/checkout@v3
     - name: Set Toolchain
       # https://github.com/dtolnay/rust-toolchain
       uses: dtolnay/rust-toolchain@stable
-    - name: Run tests
+    - name: Set default toolchain
+      run: rustup default ${{ matrix.rust.version }}
+    - name: Test
       run: |
-        rustup update
-        cargo test
+        rustup 
+        cargo test ${{ matrix.build-arfgs }} 

+ 1 - 1
bindings/cashu-js/justfile

@@ -1,5 +1,5 @@
 build:
 	wasm-pack build
 
-build:
+pack:
 	wasm-pack pack

+ 6 - 0
bindings/cashu-sdk-js/justfile

@@ -0,0 +1,6 @@
+build:
+	wasm-pack build
+
+pack:
+	wasm-pack pack
+

+ 1 - 1
bindings/cashu-sdk-js/src/wallet.rs

@@ -125,7 +125,7 @@ impl JsWallet {
     }
 
     /// Send
-    #[wasm_bindgen(js_name = processSplitResponse)]
+    #[wasm_bindgen(js_name = send)]
     pub async fn send(&self, amount: JsAmount, proofs: JsValue) -> Result<JsSendProofs> {
         let proofs = serde_wasm_bindgen::from_value(proofs).map_err(into_err)?;
 

+ 0 - 7
crates/cashu-sdk/Cargo.toml

@@ -16,13 +16,6 @@ blocking = ["dep:once_cell"]
 wallet = ["cashu/wallet", "dep:minreq", "dep:once_cell"]
 
 
-# Fix: Should be minreq or gloo
-# [target.'cfg(not(target_arch = "wasm32"))'.features]
-# wallet = ["cashu/wallet", "minreq", "once_cell"]
-
-# [target.'cfg(target_arch = "wasm32")'.features]
-# wallet = ["cashu/wallet", "gloo", "once_cell"]
-
 [dependencies]
 cashu = { path = "../cashu" }
 serde = { workspace = true }

+ 1 - 0
crates/cashu-sdk/src/lib.rs

@@ -3,6 +3,7 @@ compile_error!("`blocking` feature can't be enabled for WASM targets");
 
 #[cfg(feature = "blocking")]
 use once_cell::sync::Lazy;
+
 #[cfg(feature = "blocking")]
 use tokio::runtime::Runtime;
 

+ 0 - 1
justfile

@@ -8,7 +8,6 @@ precommit:
 	typos
 	cargo test -p cashu
 	cargo test -p cashu-sdk
-	cargo clippy
 	cargo clippy --target wasm32-unknown-unknown -p cashu
 	cargo clippy --target wasm32-unknown-unknown -p cashu-sdk
 	rustup default 1.70.0