updates based on upstream

This commit is contained in:
yeastplume 2019-02-27 12:50:05 +00:00
parent 6a196ffa90
commit 238cd7225e
No known key found for this signature in database
GPG key ID: AE6E005DF6E76B95
6 changed files with 253 additions and 332 deletions

564
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -14,7 +14,6 @@ hyper = "0.12"
futures = "0.1"
http = "0.1"
itertools = "0.7"
lmdb-zero = "0.4.4"
rand = "0.5"
serde = "1"
log = "0.4"

View file

@ -32,6 +32,7 @@ use std::default::Default;
use std::ops::Deref;
use std::sync::Arc;
use std::{fs, thread, time};
use p2p::PeerAddr;
/// Just removes all results from previous runs
pub fn clean_all_output(test_name_dir: &str) {
@ -196,7 +197,7 @@ impl LocalServerContainer {
if self.config.seed_addr.len() > 0 {
seeding_type = p2p::Seeding::List;
seeds = vec![self.config.seed_addr.to_string()];
seeds = vec![PeerAddr::from_ip(self.config.seed_addr.to_string().parse().unwrap())];
}
let s = servers::Server::new(servers::ServerConfig {
@ -240,7 +241,7 @@ impl LocalServerContainer {
for p in &mut self.peer_list {
println!("{} connecting to peer: {}", self.config.p2p_server_port, p);
let _ = s.connect_peer(p.parse().unwrap());
let _ = s.connect_peer(PeerAddr::from_ip(p.parse().unwrap()));
}
if self.wallet_is_running {
@ -654,7 +655,7 @@ pub fn config(n: u16, test_name_dir: &str, seed_n: u16) -> servers::ServerConfig
p2p_config: p2p::P2PConfig {
port: 10000 + n,
seeding_type: p2p::Seeding::List,
seeds: Some(vec![format!("127.0.0.1:{}", 10000 + seed_n)]),
seeds: Some(vec![PeerAddr::from_ip(format!("127.0.0.1:{}", 10000 + seed_n).parse().unwrap())]),
..p2p::P2PConfig::default()
},
chain_type: core::global::ChainTypes::AutomatedTesting,

View file

@ -29,7 +29,6 @@ use self::wallet::controller;
use self::wallet::lmdb_wallet::LMDBBackend;
use self::wallet::{HTTPNodeClient, HTTPWalletCommAdapter};
use self::wallet_config::WalletConfig;
use apiwallet::{APIForeign, APIOwner};
use grin_api as api;
use grin_core as core;
use grin_keychain as keychain;
@ -41,6 +40,7 @@ use std::default::Default;
use std::process::exit;
use std::sync::Arc;
use std::{thread, time};
use p2p::PeerAddr;
use crate::framework::{
config, stop_all_servers, LocalServerContainerConfig, LocalServerContainerPool,
@ -937,7 +937,7 @@ fn replicate_tx_fluff_failure() {
// Server 2 (another node)
let mut s2_config = framework::config(3001, "tx_fluff", 3001);
s2_config.p2p_config.seeds = Some(vec!["127.0.0.1:13000".to_owned()]);
s2_config.p2p_config.seeds = Some(vec![PeerAddr::from_ip("127.0.0.1:13000".parse().unwrap())]);
s2_config.dandelion_config.embargo_secs = Some(10);
s2_config.dandelion_config.patience_secs = Some(1);
s2_config.dandelion_config.relay_secs = Some(1);
@ -948,7 +948,7 @@ fn replicate_tx_fluff_failure() {
for i in 0..dl_nodes {
// (create some stem nodes)
let mut s_config = framework::config(3002 + i, "tx_fluff", 3002 + i);
s_config.p2p_config.seeds = Some(vec!["127.0.0.1:13000".to_owned()]);
s_config.p2p_config.seeds = Some(vec![PeerAddr::from_ip("127.0.0.1:13000".parse().unwrap())]);
s_config.dandelion_config.embargo_secs = Some(10);
s_config.dandelion_config.patience_secs = Some(1);
s_config.dandelion_config.relay_secs = Some(1);

View file

@ -13,7 +13,6 @@
// limitations under the License.
use std::cell::RefCell;
use std::sync::Arc;
use std::{fs, path};
// for writing storedtransaction files
@ -112,8 +111,7 @@ impl<C, K> LMDBBackend<C, K> {
fs::create_dir_all(&stored_tx_path)
.expect("Couldn't create wallet backend tx storage directory!");
let lmdb_env = Arc::new(store::new_env(db_path.to_str().unwrap().to_string()));
let store = store::Store::open(lmdb_env, DB_DIR);
let store = store::Store::new(db_path.to_str().unwrap(), Some(DB_DIR), None)?;
// Make sure default wallet derivation path always exists
// as well as path (so it can be retrieved by batches to know where to store

View file

@ -34,7 +34,6 @@ use grin_api as api;
use grin_chain as chain;
use grin_core as core;
use grin_keychain as keychain;
use grin_store as store;
use grin_util as util;
use serde_json;
use std::collections::HashMap;
@ -101,10 +100,8 @@ where
let genesis_block = pow::mine_genesis_block().unwrap();
let verifier_cache = Arc::new(RwLock::new(LruVerifierCache::new()));
let dir_name = format!("{}/.grin", chain_dir);
let db_env = Arc::new(store::new_env(dir_name.to_string()));
let c = Chain::init(
dir_name.to_string(),
db_env,
Arc::new(NoopAdapter {}),
genesis_block,
pow::verify_size,