Skip to content

tutorial: outdated SecretKey::generate since 0.93 #402

@qykr

Description

@qykr

Describe the bug
SecretKey::generate still requires the parameter csprng to implement CryptoRng, but this breaks for OsRng in rand@0.9 even though an official tutorial shows passing OsRng directly. In rand@0.8, it worked because OsRng implemented CryptoRng, but now it only implements TryCryptoRng. Looking at previous issues and PRs, I can see that there has been work on upgrading rand to 0.9, so either the tutorial should be updated or this should be treated as a bug and should be fixed.

OsRng for rand@0.9
OsRng for rand@0.8
PR for upgrading to rand@0.9 as cited in the 0.93.0 announcement

Expected behavior
It should compile and work as expected as shown in the tutorial

Iroh

iroh v0.93.2
├── iroh feature "default"
│   └── iron-gossip-cli v0.1.0 (/Users/<name>/Projects/iron-gossip-cli)
│       └── iron-gossip-cli feature "default" (command-line)
└── iroh feature "metrics"
    └── iroh feature "default" (*)

Platform(s)
all

Also, this is my first issue, so please let me know if I'm doing anything wrong or if I can improve on anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions