Merge rust-bitcoin/rust-bitcoin#1416: Add rand feature flag to the example documentation
f7a6d17143
Add rand feature flag to the example documentation (yancy) Pull request description: It's confusing trying to follow the documentation [here](https://docs.rs/bitcoin/latest/bitcoin/util/address/index.html) unless you know to enable the `rand` feature flag. This PR updates the docs so people know to enable the flag. ``` 22:35 < control> hello, how can i generate a simple wallet address using rust bitcoin? cant find working example 22:45 < andytoshi> control: do you have a private key? 22:45 < andytoshi> what kind of address do you want to generate? 22:46 < andytoshi> my guess would be that you want to use bdk rather than rust-bitcoin directl 22:48 < control> P2PKH address and generate private key. just as simple as bit library in python does 22:52 < control> im trying to run this example 22:52 < control> https://docs.rs/bitcoin/latest/bitcoin/util/address/index.html 22:52 < control> but it says ^^^^ could not find `rand` in `secp256k1` ``` ACKs for top commit: apoelstra: ACKf7a6d17143
Kixunil: ACKf7a6d17143
Tree-SHA512: 6d94f8ffa7797d1e7720a840d4f8bb0ac274507118597dff60631ad3d28dbe57e2341b87d6101e2a9f5fbcc2b1f0beb6d06f9dde48a480cb10a9a45c887f83a4
This commit is contained in:
commit
410b820814
|
@ -21,6 +21,12 @@
|
|||
//! // Generate pay-to-pubkey-hash address.
|
||||
//! let address = Address::p2pkh(&public_key, Network::Bitcoin);
|
||||
//! ```
|
||||
//!
|
||||
//! # Note: creating a new address requires the rand feature flag
|
||||
//!
|
||||
//! ```toml
|
||||
//! bitcoin = { version = "...", features = ["rand"] }
|
||||
//! ```
|
||||
|
||||
use core::convert::TryFrom;
|
||||
use core::fmt;
|
||||
|
|
Loading…
Reference in New Issue