Skip to content

Remove dependency on rand #871

Closed

Description

@LLFourn

Because we invoke thread_rng directly we have to also depend on getrandom in order to set certain feature flags to get things to compile on wasm.

Can we just depend on rand_core and let users pass in anything implement RngCore? This would simplify dependencies a bit. The place where this will be most tricky is in tx building but I hope it can be done.

We should try and attempt this before v1.

Activity

  1. added this to the v1 milestone on Feb 21, 2023
  2. removed this from the 1.0.0-alpha.0 milestone on Mar 3, 2023
  3. added this to the 1.0.0-alpha milestone on Mar 17, 2024
  4. rustaceanrob commented on Mar 22, 2024

    @rustaceanrob
    Contributor

    Would this imply TxBuilder would be initiated with impl Into<RngCore>? My gut feeling is that would cause problems for the UniFFI bindings.

  5. LLFourn commented on Mar 28, 2024

    @LLFourn
    CollaboratorAuthor

    Ok but the FFI bindings can depend on rand and pass in ThreadRng if they want to?

  6. rustaceanrob commented on Mar 28, 2024

    @rustaceanrob
    Contributor

    Good point. I will try working on this.

  7. ValuedMammal commented on Apr 7, 2024

    @ValuedMammal
    Contributor

    We could consider making TxParams generic over R and adding a field rng: Option<R>.

  8. moved this from Todo to In Progress in BDK Walleton Apr 12, 2024
  9. moved this from In Progress to Needs Review in BDK Walleton Jun 18, 2024
  10. moved this from Needs Review to Done in BDK Walleton Jun 23, 2024
  11. added a commit that references this issue on Jun 23, 2024
    6dab68d
  12. added a commit that references this issue on Jun 25, 2024
    ad0a6f0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions