Move fuzzing code out of utils
This commit is contained in:
parent
944c840460
commit
79a88e1612
|
@ -38,7 +38,7 @@ use util::hash::Hash160;
|
|||
#[cfg(feature="bitcoinconsensus")] use std::convert;
|
||||
#[cfg(feature="bitcoinconsensus")] use util::hash::Sha256dHash;
|
||||
|
||||
#[cfg(feature="fuzztarget")] use util::sha2::Sha256;
|
||||
#[cfg(feature="fuzztarget")] use fuzz_util::sha2::Sha256;
|
||||
#[cfg(not(feature="fuzztarget"))] use crypto::sha2::Sha256;
|
||||
|
||||
#[derive(Clone, Default, PartialOrd, Ord, PartialEq, Eq, Hash)]
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
//! This module contains all mocks that are used for fuzz testing. Never use anything from this
|
||||
//! module in production.
|
||||
|
||||
pub mod sha2;
|
|
@ -80,3 +80,6 @@ pub use util::hash::BitcoinHash;
|
|||
pub use util::privkey::Privkey;
|
||||
pub use util::decimal::Decimal;
|
||||
pub use util::decimal::UDecimal;
|
||||
|
||||
#[cfg(feature = "fuzztarget")]
|
||||
pub mod fuzz_util;
|
|
@ -33,7 +33,7 @@ use secp256k1::{self, Secp256k1};
|
|||
use network::constants::Network;
|
||||
use util::base58;
|
||||
|
||||
#[cfg(feature="fuzztarget")] use util::sha2::{Sha256, Sha512};
|
||||
#[cfg(feature="fuzztarget")] use fuzz_util::sha2::{Sha256, Sha512};
|
||||
#[cfg(not(feature="fuzztarget"))] use crypto::sha2::{Sha256, Sha512};
|
||||
|
||||
/// A chain code
|
||||
|
|
|
@ -29,7 +29,7 @@ use std::{error, fmt};
|
|||
use network::constants::Network;
|
||||
use util::{address, hash};
|
||||
|
||||
#[cfg(feature="fuzztarget")] use util::sha2;
|
||||
#[cfg(feature="fuzztarget")] use fuzz_util::sha2;
|
||||
#[cfg(not(feature="fuzztarget"))] use crypto::sha2;
|
||||
|
||||
/// Encoding of "pubkey here" in script; from bitcoin core `src/script/script.h`
|
||||
|
|
|
@ -30,7 +30,7 @@ use crypto::ripemd160::Ripemd160;
|
|||
use consensus::encode::{Encodable, Decodable};
|
||||
use util::uint::Uint256;
|
||||
|
||||
#[cfg(feature="fuzztarget")] use util::sha2::Sha256;
|
||||
#[cfg(feature="fuzztarget")] use fuzz_util::sha2::Sha256;
|
||||
#[cfg(not(feature="fuzztarget"))] use crypto::sha2::Sha256;
|
||||
use std::str::FromStr;
|
||||
|
||||
|
|
|
@ -28,9 +28,6 @@ pub mod iter;
|
|||
pub mod misc;
|
||||
pub mod uint;
|
||||
|
||||
#[cfg(feature = "fuzztarget")]
|
||||
pub mod sha2;
|
||||
|
||||
use std::{error, fmt};
|
||||
|
||||
use secp256k1;
|
||||
|
|
Loading…
Reference in New Issue