Refactor the Keychain to be based on a trait (#1146)

* First pass at restructuring the keychain crate and introducing a Keychain trait
* Parameterized everything that had to. Stuff compiles.
* More stuff compiles, fix most tests
* Big merge, pushing down opening the keychain forced adding factory methods on trait
* Test fixes for pool and servers crate
This commit is contained in:
Ignotus Peverell
2018-06-08 06:21:54 +01:00
committed by GitHub
parent a6590ea0ae
commit af178f82f8
43 changed files with 840 additions and 678 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ use core::core;
use core::core::hash::Hashed;
use core::ser;
use core::ser::AsFixedBytes;
use keychain::{Identifier, Keychain};
use keychain::{ExtKeychain, Identifier, Keychain};
use pool;
use util;
use util::LOGGER;
@@ -219,7 +219,7 @@ fn build_block(
///
fn burn_reward(block_fees: BlockFees) -> Result<(core::Output, core::TxKernel, BlockFees), Error> {
warn!(LOGGER, "Burning block fees: {:?}", block_fees);
let keychain = Keychain::from_random_seed().unwrap();
let keychain = ExtKeychain::from_random_seed().unwrap();
let key_id = keychain.derive_key_id(1).unwrap();
let (out, kernel) =
wallet::libtx::reward::output(&keychain, &key_id, block_fees.fees, block_fees.height)