Merge pull request #277 from jonasnick/rand

Remove unused rand dependency
This commit is contained in:
Andrew Poelstra 2019-07-03 20:42:44 +00:00 committed by GitHub
commit cded694381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 3 additions and 13 deletions

View File

@ -22,7 +22,6 @@ use-serde = ["serde", "bitcoin_hashes/serde"]
[dependencies] [dependencies]
bitcoin-bech32 = "0.9.0" bitcoin-bech32 = "0.9.0"
byteorder = "1.2" byteorder = "1.2"
rand = "0.3"
bitcoin_hashes = "0.3" bitcoin_hashes = "0.3"
bitcoinconsensus = { version = "0.16", optional = true } bitcoinconsensus = { version = "0.16", optional = true }

View File

@ -154,13 +154,6 @@ macro_rules! impl_array_newtype {
} }
} }
} }
impl ::rand::Rand for $thing {
#[inline]
fn rand<R: ::rand::Rng>(r: &mut R) -> $thing {
$thing(::rand::Rand::rand(r))
}
}
} }
} }

View File

@ -46,7 +46,6 @@ extern crate bitcoin_bech32;
extern crate bitcoin_hashes; extern crate bitcoin_hashes;
extern crate byteorder; extern crate byteorder;
extern crate hex; extern crate hex;
extern crate rand;
extern crate secp256k1; extern crate secp256k1;
#[cfg(feature = "serde")] extern crate serde; #[cfg(feature = "serde")] extern crate serde;
#[cfg(all(test, feature = "serde"))] #[macro_use] extern crate serde_derive; // for 1.22.0 compat #[cfg(all(test, feature = "serde"))] #[macro_use] extern crate serde_derive; // for 1.22.0 compat

View File

@ -18,7 +18,6 @@
//! # Example: creating a new address from a randomly-generated key pair //! # Example: creating a new address from a randomly-generated key pair
//! //!
//! ```rust //! ```rust
//! extern crate rand;
//! extern crate secp256k1; //! extern crate secp256k1;
//! extern crate bitcoin; //! extern crate bitcoin;
//! //!
@ -26,7 +25,7 @@
//! use bitcoin::util::address::Address; //! use bitcoin::util::address::Address;
//! use bitcoin::util::key; //! use bitcoin::util::key;
//! use secp256k1::Secp256k1; //! use secp256k1::Secp256k1;
//! use rand::thread_rng; //! use secp256k1::rand::thread_rng;
//! //!
//! fn main() { //! fn main() {
//! // Generate random key pair //! // Generate random key pair

View File

@ -284,7 +284,7 @@ pub fn untemplate(script: &script::Script) -> Result<(Template, Vec<PublicKey>),
mod tests { mod tests {
use secp256k1::Secp256k1; use secp256k1::Secp256k1;
use hex::decode as hex_decode; use hex::decode as hex_decode;
use rand::thread_rng; use secp256k1::rand::thread_rng;
use std::str::FromStr; use std::str::FromStr;
use blockdata::script::Script; use blockdata::script::Script;

View File

@ -124,7 +124,7 @@ pub fn signed_msg_hash(msg: &str) -> sha256d::Hash {
#[cfg(all(test, feature="unstable"))] #[cfg(all(test, feature="unstable"))]
mod benches { mod benches {
use rand::{Rng, thread_rng}; use secp256k1::rand::{Rng, thread_rng};
use super::hex_bytes; use super::hex_bytes;
use test::Bencher; use test::Bencher;