Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running just build results in compile error in cashu-sdk-js #41

Closed
ngutech21 opened this issue Nov 7, 2023 · 0 comments · Fixed by #46
Closed

running just build results in compile error in cashu-sdk-js #41

ngutech21 opened this issue Nov 7, 2023 · 0 comments · Fixed by #46

Comments

@ngutech21
Copy link
Contributor

ngutech21 commented Nov 7, 2023

steps to reproduce:

git clone https://github.com/thesimplekid/cashu-crab.git
just build
-> compile error:

error[E0277]: `std::result::Result<Melted, cashu_sdk::wallet::Error>` is not a future
   --> bindings/cashu-sdk-js/src/wallet.rs:154:14
    |
154 |             .await
    |             -^^^^^
    |             ||
    |             |`std::result::Result<Melted, cashu_sdk::wallet::Error>` is not a future
    |             help: remove the `.await`
    |
    = help: the trait `Future` is not implemented for `std::result::Result<Melted, cashu_sdk::wallet::Error>`
    = note: std::result::Result<Melted, cashu_sdk::wallet::Error> must be a future or must implement `IntoFuture` to be awaited
    = note: required for `std::result::Result<Melted, cashu_sdk::wallet::Error>` to implement `IntoFuture`

warning: call to `.deref()` on a reference in this situation does nothing
error[E0308]: mismatched types
  --> bindings/cashu-sdk-js/src/wallet.rs:39:32
   |
39 |             inner: Wallet::new(client.deref().clone(), mint_keys.deref().clone()),
   |                    ----------- ^^^^^^^^^^^^^^^^^^^^^^ expected `Client`, found a different `Client`
   |                    |
   |                    arguments to this function are incorrect
   |
note: associated function defined here

expected result

cloning the repo and running just build without any feature flags compiles the workspace

JsClient.deref() returns a non-blocking client, which seems to be correct. But Wallet::new() expects a blocking client. I don't understand why this happens since blocking is an optional feature, that is not enabled by default.

@thesimplekid thesimplekid linked a pull request Nov 12, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant