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

Compiling namada_sdk crate failed due to no "rand" #2164

Closed
yito88 opened this issue Nov 13, 2023 · 1 comment · Fixed by #2165
Closed

Compiling namada_sdk crate failed due to no "rand" #2164

yito88 opened this issue Nov 13, 2023 · 1 comment · Fixed by #2165
Labels
bug Something isn't working

Comments

@yito88
Copy link
Member

yito88 commented Nov 13, 2023

When building an application importing namada_sdk with v0.26.0,

error[E0599]: no function or associated item named `generate` found for struct `namada_core::types::key::ed25519::SigScheme` in the current scope
   --> /Users/yuji/.cargo/git/checkouts/namada-d9874c03bc334f5d/444da00/sdk/src/wallet/mod.rs:235:52
    |
235 |         SchemeType::Ed25519 => ed25519::SigScheme::generate(csprng).try_to_sk(),
    |                                                    ^^^^^^^^ function or associated item not found in `SigScheme`

error[E0599]: no function or associated item named `generate` found for struct `namada_core::types::key::secp256k1::SigScheme` in the current scope
   --> /Users/yuji/.cargo/git/checkouts/namada-d9874c03bc334f5d/444da00/sdk/src/wallet/mod.rs:237:35
    |
237 |             secp256k1::SigScheme::generate(csprng).try_to_sk()
    |                                   ^^^^^^^^ function or associated item not found in `SigScheme`

error[E0599]: no function or associated item named `generate` found for struct `namada_core::types::key::common::SigScheme` in the current scope
   --> /Users/yuji/.cargo/git/checkouts/namada-d9874c03bc334f5d/444da00/sdk/src/wallet/mod.rs:239:50
    |
239 |         SchemeType::Common => common::SigScheme::generate(csprng).try_to_sk(),
    |                                                  ^^^^^^^^ function or associated item not found in `SigScheme`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `namada_sdk` (lib) due to 3 previous errors

generate requires rand in core.

/// Generate a keypair.
#[cfg(feature = "rand")]
fn generate<R>(csprng: &mut R) -> Self::SecretKey
where
R: CryptoRng + RngCore;

But rand isn't specified.

namada_core = {path = "../core", default-features = false}

@yito88 yito88 mentioned this issue Nov 13, 2023
2 tasks
@yito88 yito88 added the bug Something isn't working label Nov 13, 2023
@donglijack
Copy link

Bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants