message: FIx ledger tests
diff: @@ -124,10 +124,11 @@ impl property::Ledger for Ledger {
  pub mod test {
  use super::*;
  - // use crate::key::PrivateKey;
  + use crate::key::SpendingSecretKey;
  // use cardano::redeem as crypto;
  // use chain_addr::{Address, Discrimination, Kind};
  use quickcheck::{Arbitrary, Gen};
  + use rand::{CryptoRng, RngCore};
  impl Arbitrary for Ledger {
  fn arbitrary<G: Gen>(g: &mut G) -> Self {
  @@ -137,18 +138,18 @@ pub mod test {
  }
  }
  - /*
  - pub fn make_key(u: u8) -> (PrivateKey, Address) {
  - let sk1 = PrivateKey::normalize_bytes([u; crypto::PRIVATEKEY_SIZE]);
  - let pk1 = sk1.public();
  - let user_address = Address(Discrimination::Production, Kind::Single(pk1.0));
  - (sk1, user_address)
  + pub fn make_key<R: RngCore + CryptoRng>(rng: &mut R) -> (SpendingSecretKey, Address) {
  + let sk = SpendingSecretKey::generate(rng);
  + let pk = sk.to_public();
  + let user_address = Address(Discrimination::Production, Kind::Single(pk));
  + (sk, user_address)
  }
  #[test]
  pub fn tx_no_witness() -> () {
  use chain_core::property::Ledger;
  - let (_pk1, user1_address) = make_key(0);
  + let mut rng = rand::thread_rng();
  + let (_pk1, user1_address) = make_key(&mut rng);
  let tx0_id = TransactionId::hash_bytes(&[0]);
  let value = Value(42000);
  let utxo0 = UtxoPointer {
  @@ -180,7 +181,8 @@ pub mod test {
  pub fn tx_wrong_witness() -> () {
  use chain_core::property::Ledger;
  use chain_core::property::Transaction;
  - let (_, user0_address) = make_key(0);
  + let mut rng = rand::thread_rng();
  + let (_, user0_address) = make_key(&mut rng);
  let tx0_id = TransactionId::hash_bytes(&[0]);
  let value = Value(42000);
  let utxo0 = UtxoPointer {
  @@ -199,7 +201,7 @@ pub mod test {
  inputs: vec![utxo0],
  outputs: vec![output0.clone()],
  };
  - let (pk1, _) = make_key(1);
  + let (pk1, _) = make_key(&mut rng);
  let witness = Witness::new(&tx.id(), &pk1);
  let signed_tx = SignedTransaction {
  transaction: tx,
  @@ -215,7 +217,8 @@ pub mod test {
  fn cant_loose_money() {
  use chain_core::property::Ledger;
  use chain_core::property::Transaction;
  - let (pk1, user1_address) = make_key(0);
  + let mut rng = rand::thread_rng();
  + let (pk1, user1_address) = make_key(&mut rng);
  let tx0_id = TransactionId::hash_bytes(&[0]);
  let value = Value(42000);
  let utxo0 = UtxoPointer {
  @@ -244,6 +247,4 @@ pub mod test {
  ledger.diff_transaction(&signed_tx)
  )
  }
  -
  - */
  }
  