bitcoin-proptest

Crates.iobitcoin-proptest
lib.rsbitcoin-proptest
version0.0.1-alpha.3
sourcesrc
created_at2024-04-27 14:35:54.634406
updated_at2024-07-01 09:44:26.023385
descriptionProptest strategies for Bitcoin-related code
homepage
repositoryhttps://jirijakes.com/code/rust-bitcoin-proptest
max_upload_size
id1222647
size75,458
Jiří Jakeš (jirijakes)

documentation

README

Rust Bitcoin Proptest Strategies

Proptest strategies for Bitcoin-related code.

This collection of generators (called strategies in proptest's terminology) helps developers of Bitcoin-related software written in Rust supply random data – both valid and invalid – to their property-based tests.

Visit documentation for details.

Example

#[cfg(test)]
mod tests {
  proptest! {
     #[test]
     // generates valid hex-encoded public keys, both compressed and uncompressed
     fn pubkey_parsing(s in prop::secp256k1::public_key::valid::hex()) {
        prop_assert!(s.len() == 66 || s.len() == 130);
        prop_assert!(my_parser(s).is_ok());
     }
  }
}
Commit count: 0

cargo fmt