Add keypair gen fn for testing

This commit is contained in:
Paul Hauner
2018-07-11 18:17:04 +10:00
parent ff3795dbf0
commit 707f116344
3 changed files with 22 additions and 14 deletions

View File

@@ -7,3 +7,4 @@ use super::state::crystallized_state;
pub mod types;
pub mod bls;
pub mod test_helpers;

13
src/utils/test_helpers.rs Normal file
View File

@@ -0,0 +1,13 @@
extern crate rand;
use super::bls::Keypair;
use self::rand::{ SeedableRng, XorShiftRng };
// Returns a keypair for use in testing purposes.
pub fn get_dangerous_test_keypair() -> Keypair {
let mut rng = XorShiftRng::from_seed([0xbc4f6d44,
0xd62f276c,
0xb963afd0,
0x5455863d]);
Keypair::generate(&mut rng)
}