Skip to content

Commit

Permalink
Fix RNG in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRubin committed Jan 19, 2024
1 parent c3f6dec commit d2fe87d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions sapio-contrib/src/contracts/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use std::sync::{Arc, Mutex};
#[cfg(test)]
mod tests {
use super::*;
use ::rand::rngs::OsRng;
use bitcoin::secp256k1::*;
use bitcoin::Amount;
use miniscript::Descriptor;
Expand All @@ -35,7 +34,7 @@ mod tests {
fn it_works() {
db_serde::register_db("mock".to_string(), |_s| Arc::new(Mutex::new(MockDB {})));
let full = Secp256k1::new();
let mut rng = OsRng::new().expect("OsRng");
let mut rng = bitcoin::secp256k1::rand::thread_rng();
let public_keys: Vec<_> = (0..3)
.map(|_| full.generate_keypair(&mut rng).1.into())
.collect();
Expand Down
2 changes: 1 addition & 1 deletion sapio-contrib/src/contracts/derivatives/dlc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ mod tests {
#[test]
fn create_dlc() {
let secp = Secp256k1::new();
let mut rng = rand::thread_rng();
let mut rng = bitcoin::secp256k1::rand::thread_rng();
let (_, pk1) = secp.generate_keypair(&mut rng);
let (_, pk2) = secp.generate_keypair(&mut rng);
let o = CachedOracle {
Expand Down

0 comments on commit d2fe87d

Please sign in to comment.