|
|
|
@@ -118,7 +118,7 @@ fn process_block(chain: &Chain, block: &Block) {
|
|
|
|
|
fn test_block_a_block_b_block_b_fork_header_c_fork_block_c() {
|
|
|
|
|
let chain_dir = ".grin.block_a_block_b_block_b_fork_header_c_fork_block_c";
|
|
|
|
|
clean_output_dir(chain_dir);
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
let kc = ExtKeychain::from_random_seed(false).unwrap();
|
|
|
|
|
let genesis = pow::mine_genesis_block().unwrap();
|
|
|
|
|
let last_status = RwLock::new(None);
|
|
|
|
@@ -170,7 +170,7 @@ fn test_block_a_block_b_block_b_fork_header_c_fork_block_c() {
|
|
|
|
|
fn test_block_a_block_b_block_b_fork_header_c_fork_block_c_fork() {
|
|
|
|
|
let chain_dir = ".grin.block_a_block_b_block_b_fork_header_c_fork_block_c_fork";
|
|
|
|
|
clean_output_dir(chain_dir);
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
let kc = ExtKeychain::from_random_seed(false).unwrap();
|
|
|
|
|
let genesis = pow::mine_genesis_block().unwrap();
|
|
|
|
|
let last_status = RwLock::new(None);
|
|
|
|
@@ -226,7 +226,7 @@ fn test_block_a_block_b_block_b_fork_header_c_fork_block_c_fork() {
|
|
|
|
|
fn test_block_a_header_b_header_b_fork_block_b_fork_block_b_block_c() {
|
|
|
|
|
let chain_dir = ".grin.test_block_a_header_b_header_b_fork_block_b_fork_block_b_block_c";
|
|
|
|
|
clean_output_dir(chain_dir);
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
let kc = ExtKeychain::from_random_seed(false).unwrap();
|
|
|
|
|
let genesis = pow::mine_genesis_block().unwrap();
|
|
|
|
|
let last_status = RwLock::new(None);
|
|
|
|
@@ -282,7 +282,7 @@ fn test_block_a_header_b_header_b_fork_block_b_fork_block_b_block_c() {
|
|
|
|
|
fn test_block_a_header_b_header_b_fork_block_b_fork_block_b_block_c_fork() {
|
|
|
|
|
let chain_dir = ".grin.test_block_a_header_b_header_b_fork_block_b_fork_block_b_block_c_fork";
|
|
|
|
|
clean_output_dir(chain_dir);
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
let kc = ExtKeychain::from_random_seed(false).unwrap();
|
|
|
|
|
let genesis = pow::mine_genesis_block().unwrap();
|
|
|
|
|
let last_status = RwLock::new(None);
|
|
|
|
@@ -347,7 +347,7 @@ fn mine_reorg() {
|
|
|
|
|
const DIR_NAME: &str = ".grin_reorg";
|
|
|
|
|
clean_output_dir(DIR_NAME);
|
|
|
|
|
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
let kc = ExtKeychain::from_random_seed(false).unwrap();
|
|
|
|
|
|
|
|
|
|
let genesis = pow::mine_genesis_block().unwrap();
|
|
|
|
@@ -399,7 +399,7 @@ fn mine_reorg() {
|
|
|
|
|
#[test]
|
|
|
|
|
fn mine_forks() {
|
|
|
|
|
clean_output_dir(".grin2");
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
{
|
|
|
|
|
let chain = init_chain(".grin2", pow::mine_genesis_block().unwrap());
|
|
|
|
|
let kc = ExtKeychain::from_random_seed(false).unwrap();
|
|
|
|
@@ -447,7 +447,7 @@ fn mine_forks() {
|
|
|
|
|
#[test]
|
|
|
|
|
fn mine_losing_fork() {
|
|
|
|
|
clean_output_dir(".grin3");
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
let kc = ExtKeychain::from_random_seed(false).unwrap();
|
|
|
|
|
{
|
|
|
|
|
let chain = init_chain(".grin3", pow::mine_genesis_block().unwrap());
|
|
|
|
@@ -484,7 +484,7 @@ fn mine_losing_fork() {
|
|
|
|
|
#[test]
|
|
|
|
|
fn longer_fork() {
|
|
|
|
|
clean_output_dir(".grin4");
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
let kc = ExtKeychain::from_random_seed(false).unwrap();
|
|
|
|
|
// to make it easier to compute the txhashset roots in the test, we
|
|
|
|
|
// prepare 2 chains, the 2nd will be have the forked blocks we can
|
|
|
|
@@ -528,7 +528,7 @@ fn longer_fork() {
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn spend_rewind_spend() {
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
util::init_test_logger();
|
|
|
|
|
clean_output_dir(".grin_spend_rewind_spend");
|
|
|
|
|
|
|
|
|
@@ -607,7 +607,7 @@ fn spend_rewind_spend() {
|
|
|
|
|
#[test]
|
|
|
|
|
fn spend_in_fork_and_compact() {
|
|
|
|
|
clean_output_dir(".grin6");
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
util::init_test_logger();
|
|
|
|
|
{
|
|
|
|
|
let chain = init_chain(".grin6", pow::mine_genesis_block().unwrap());
|
|
|
|
@@ -746,7 +746,7 @@ fn spend_in_fork_and_compact() {
|
|
|
|
|
/// Test ability to retrieve block headers for a given output
|
|
|
|
|
#[test]
|
|
|
|
|
fn output_header_mappings() {
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
{
|
|
|
|
|
let chain = init_chain(
|
|
|
|
|
".grin_header_for_output",
|
|
|
|
@@ -902,7 +902,7 @@ where
|
|
|
|
|
#[test]
|
|
|
|
|
#[ignore]
|
|
|
|
|
fn actual_diff_iter_output() {
|
|
|
|
|
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
|
|
|
|
global::set_local_chain_type(ChainTypes::AutomatedTesting);
|
|
|
|
|
let genesis_block = pow::mine_genesis_block().unwrap();
|
|
|
|
|
let verifier_cache = Arc::new(RwLock::new(LruVerifierCache::new()));
|
|
|
|
|
let chain = chain::Chain::init(
|
|
|
|
|