mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
Fix test container and remove backtraces (#1430)
* Local test container used different folder than regular server, so test could not find txhashset files * Error stacktrace was printed in cases when error was expected, which created some noise and confusion
This commit is contained in:
parent
4048a3011a
commit
ff2612ca46
2 changed files with 13 additions and 7 deletions
|
@ -214,7 +214,12 @@ impl p2p::ChainAdapter for NetToChainAdapter {
|
||||||
let res = w(&self.chain).process_block_header(&bh, self.chain_opts());
|
let res = w(&self.chain).process_block_header(&bh, self.chain_opts());
|
||||||
|
|
||||||
if let &Err(ref e) = &res {
|
if let &Err(ref e) = &res {
|
||||||
debug!(LOGGER, "Block header {} refused by chain: {:?}", bhash, e);
|
debug!(
|
||||||
|
LOGGER,
|
||||||
|
"Block header {} refused by chain: {:?}",
|
||||||
|
bhash,
|
||||||
|
e.kind()
|
||||||
|
);
|
||||||
if e.is_bad_data() {
|
if e.is_bad_data() {
|
||||||
debug!(
|
debug!(
|
||||||
LOGGER,
|
LOGGER,
|
||||||
|
@ -480,7 +485,9 @@ impl NetToChainAdapter {
|
||||||
_ => {
|
_ => {
|
||||||
debug!(
|
debug!(
|
||||||
LOGGER,
|
LOGGER,
|
||||||
"adapter: process_block: block {} refused by chain: {}", bhash, e
|
"adapter: process_block: block {} refused by chain: {}",
|
||||||
|
bhash,
|
||||||
|
e.kind()
|
||||||
);
|
);
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,8 @@ use wallet::{FileWallet, HTTPWalletClient, WalletConfig};
|
||||||
/// Just removes all results from previous runs
|
/// Just removes all results from previous runs
|
||||||
pub fn clean_all_output(test_name_dir: &str) {
|
pub fn clean_all_output(test_name_dir: &str) {
|
||||||
let target_dir = format!("target/tmp/{}", test_name_dir);
|
let target_dir = format!("target/tmp/{}", test_name_dir);
|
||||||
let result = fs::remove_dir_all(target_dir);
|
if let Err(e) = fs::remove_dir_all(target_dir) {
|
||||||
if let Err(e) = result {
|
println!("can't remove output from previous test :{}, may be ok", e);
|
||||||
println!("{}", e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,10 +153,10 @@ pub struct LocalServerContainer {
|
||||||
impl LocalServerContainer {
|
impl LocalServerContainer {
|
||||||
/// Create a new local server container with defaults, with the given name
|
/// Create a new local server container with defaults, with the given name
|
||||||
/// all related files will be created in the directory
|
/// all related files will be created in the directory
|
||||||
/// target/tmp/test_servers/{name}
|
/// target/tmp/{name}
|
||||||
|
|
||||||
pub fn new(config: LocalServerContainerConfig) -> Result<LocalServerContainer, Error> {
|
pub fn new(config: LocalServerContainerConfig) -> Result<LocalServerContainer, Error> {
|
||||||
let working_dir = format!("target/tmp/test_servers/{}", config.name);
|
let working_dir = format!("target/tmp/{}", config.name);
|
||||||
let mut wallet_config = WalletConfig::default();
|
let mut wallet_config = WalletConfig::default();
|
||||||
|
|
||||||
wallet_config.api_listen_port = config.wallet_port;
|
wallet_config.api_listen_port = config.wallet_port;
|
||||||
|
|
Loading…
Reference in a new issue