Merge: Compiling at least

This commit is contained in:
yeastplume 2018-06-22 09:33:42 +01:00
parent d189770080
commit f058b14aea
8 changed files with 24 additions and 21 deletions

View file

@ -81,7 +81,7 @@ fn data_files() {
let mut b = core::core::Block::new(&prev, vec![], difficulty.clone(), reward).unwrap();
b.header.timestamp = prev.timestamp + time::Duration::seconds(60);
chain.set_block_roots(&mut b, false).unwrap();
chain.set_txhashset_roots(&mut b, false).unwrap();
pow::pow_size(
&mut b.header,
@ -117,7 +117,7 @@ fn data_files() {
fn _prepare_block(kc: &ExtKeychain, prev: &BlockHeader, chain: &Chain, diff: u64) -> Block {
let mut b = _prepare_block_nosum(kc, prev, diff, vec![]);
chain.set_block_roots(&mut b, false).unwrap();
chain.set_txhashset_roots(&mut b, false).unwrap();
b
}
@ -129,13 +129,13 @@ fn _prepare_block_tx(
txs: Vec<&Transaction>,
) -> Block {
let mut b = _prepare_block_nosum(kc, prev, diff, txs);
chain.set_block_roots(&mut b, false).unwrap();
chain.set_txhashset_roots(&mut b, false).unwrap();
b
}
fn _prepare_fork_block(kc: &ExtKeychain, prev: &BlockHeader, chain: &Chain, diff: u64) -> Block {
let mut b = _prepare_block_nosum(kc, prev, diff, vec![]);
chain.set_block_roots(&mut b, true).unwrap();
chain.set_txhashset_roots(&mut b, true).unwrap();
b
}
@ -147,7 +147,7 @@ fn _prepare_fork_block_tx(
txs: Vec<&Transaction>,
) -> Block {
let mut b = _prepare_block_nosum(kc, prev, diff, txs);
chain.set_block_roots(&mut b, true).unwrap();
chain.set_txhashset_roots(&mut b, true).unwrap();
b
}

View file

@ -65,7 +65,7 @@ fn mine_empty_chain() {
let mut b = core::core::Block::new(&prev, vec![], difficulty.clone(), reward).unwrap();
b.header.timestamp = prev.timestamp + time::Duration::seconds(60);
chain.set_block_roots(&mut b, false).unwrap();
chain.set_txhashset_roots(&mut b, false).unwrap();
pow::pow_size(
&mut b.header,
@ -365,7 +365,7 @@ where
K: Keychain,
{
let mut b = prepare_block_nosum(kc, prev, diff, vec![]);
chain.set_block_roots(&mut b, false).unwrap();
chain.set_txhashset_roots(&mut b, false).unwrap();
b
}
@ -380,7 +380,7 @@ where
K: Keychain,
{
let mut b = prepare_block_nosum(kc, prev, diff, txs);
chain.set_block_roots(&mut b, false).unwrap();
chain.set_txhashset_roots(&mut b, false).unwrap();
b
}
@ -389,7 +389,7 @@ where
K: Keychain,
{
let mut b = prepare_block_nosum(kc, prev, diff, vec![]);
chain.set_block_roots(&mut b, true).unwrap();
chain.set_txhashset_roots(&mut b, true).unwrap();
b
}
@ -404,7 +404,7 @@ where
K: Keychain,
{
let mut b = prepare_block_nosum(kc, prev, diff, txs);
chain.set_block_roots(&mut b, true).unwrap();
chain.set_txhashset_roots(&mut b, true).unwrap();
b
}

View file

@ -67,7 +67,7 @@ fn test_coinbase_maturity() {
let difficulty = consensus::next_difficulty(chain.difficulty_iter()).unwrap();
chain.set_block_roots(&mut block, false).unwrap();
chain.set_txhashset_roots(&mut block, false).unwrap();
pow::pow_size(
&mut block.header,
@ -121,7 +121,7 @@ fn test_coinbase_maturity() {
let difficulty = consensus::next_difficulty(chain.difficulty_iter()).unwrap();
chain.set_block_roots(&mut block, false).unwrap();
chain.set_txhashset_roots(&mut block, false).unwrap();
// Confirm the tx attempting to spend the coinbase output
// is not valid at the current block height given the current chain state.
@ -151,7 +151,7 @@ fn test_coinbase_maturity() {
let difficulty = consensus::next_difficulty(chain.difficulty_iter()).unwrap();
chain.set_block_roots(&mut block, false).unwrap();
chain.set_txhashset_roots(&mut block, false).unwrap();
pow::pow_size(
&mut block.header,
@ -178,7 +178,7 @@ fn test_coinbase_maturity() {
let difficulty = consensus::next_difficulty(chain.difficulty_iter()).unwrap();
chain.set_block_roots(&mut block, false).unwrap();
chain.set_txhashset_roots(&mut block, false).unwrap();
pow::pow_size(
&mut block.header,

View file

@ -22,7 +22,7 @@ use std::fs;
use std::sync::Arc;
use chain::store::ChainStore;
use chain::txhashset::{self, TxHashSet};
use chain::txhashset;
use chain::types::Tip;
use core::core::merkle_proof::MerkleProof;
use core::core::target::Difficulty;
@ -40,8 +40,11 @@ fn test_some_raw_txs() {
clean_output_dir(&db_root);
let db_env = Arc::new(store::new_env(db_root.clone()));
let store = Arc::new(ChainKVStore::new(db_root.clone()).unwrap());
let mut txhashset = TxHashSet::open(db_root.clone(), store.clone(), None).unwrap();
let chain_store = ChainStore::new(db_env).unwrap();
let store = Arc::new(chain_store);
// open the txhashset, creating a new one if necessary
let mut txhashset = txhashset::TxHashSet::open(db_root.clone(), store.clone(), None).unwrap();
let keychain = ExtKeychain::from_random_seed().unwrap();
let key_id1 = keychain.derive_key_id(1).unwrap();

View file

@ -13,7 +13,7 @@ entity "Grin Node" as grin_node
note left of sender
1: Create Transaction **UUID** (for reference and maintaining correct state)
2: Set **lock_height** for output (current chain height)
2: Set **lock_height** for transaction kernel (current chain height)
3: Select **inputs** using desired selection strategy
4: Create **change_output**
5: Select blinding factor for **change_output**

View file

@ -179,7 +179,7 @@ fn build_block(
b.header.clone().total_difficulty.to_num(),
);
let roots_result = chain.set_block_roots(&mut b, false);
let roots_result = chain.set_txhashset_roots(&mut b, false);
match roots_result {
Ok(_) => Ok((b, block_fees)),

View file

@ -51,7 +51,7 @@ use daemonize::Daemonize;
use config::GlobalConfig;
use core::core::amount_to_hr_string;
use core::global;
use keychain::{self, ExtKeychain};
use keychain::ExtKeychain;
use tui::ui;
use util::{init_logger, LoggingConfig, LOGGER};
use wallet::{libwallet, FileWallet};

View file

@ -145,7 +145,7 @@ pub fn add_block_with_reward(chain: &Chain, txs: Vec<&Transaction>, reward: (Out
reward,
).unwrap();
b.header.timestamp = prev.timestamp + time::Duration::seconds(60);
chain.set_block_roots(&mut b, false).unwrap();
chain.set_txhashset_roots(&mut b, false).unwrap();
pow::pow_size(
&mut b.header,
difficulty,