Change wallet api_listen_port format (#815)

* Change wallet api_listen_port format
* Fix tests
This commit is contained in:
Quentin Le Sceller 2018-03-22 12:49:27 -04:00 committed by Ignotus Peverell
parent 9d366fe492
commit 675faec05d
3 changed files with 5 additions and 5 deletions

View file

@ -162,7 +162,7 @@ impl LocalServerContainer {
let working_dir = format!("target/tmp/test_servers/{}", config.name); let working_dir = format!("target/tmp/test_servers/{}", config.name);
let mut wallet_config = WalletConfig::default(); let mut wallet_config = WalletConfig::default();
wallet_config.api_listen_port = format!("{}", config.wallet_port); wallet_config.api_listen_port = config.wallet_port;
wallet_config.check_node_api_http_addr = config.wallet_validating_node_url.clone(); wallet_config.check_node_api_http_addr = config.wallet_validating_node_url.clone();
wallet_config.data_file_dir = working_dir.clone(); wallet_config.data_file_dir = working_dir.clone();
Ok(LocalServerContainer { Ok(LocalServerContainer {
@ -263,7 +263,7 @@ impl LocalServerContainer {
self.wallet_config = WalletConfig::default(); self.wallet_config = WalletConfig::default();
self.wallet_config.api_listen_port = format!("{}", self.config.wallet_port); self.wallet_config.api_listen_port = self.config.wallet_port;
self.wallet_config.check_node_api_http_addr = self.wallet_config.check_node_api_http_addr =
self.config.wallet_validating_node_url.clone(); self.config.wallet_validating_node_url.clone();
self.wallet_config.data_file_dir = self.working_dir.clone(); self.wallet_config.data_file_dir = self.working_dir.clone();

View file

@ -516,7 +516,7 @@ fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
match wallet_args.subcommand() { match wallet_args.subcommand() {
("listen", Some(listen_args)) => { ("listen", Some(listen_args)) => {
if let Some(port) = listen_args.value_of("port") { if let Some(port) = listen_args.value_of("port") {
wallet_config.api_listen_port = port.to_string(); wallet_config.api_listen_port = port.parse().unwrap();
} }
wallet::server::start_rest_apis(wallet_config, keychain); wallet::server::start_rest_apis(wallet_config, keychain);
} }

View file

@ -178,7 +178,7 @@ pub struct WalletConfig {
// by default this is 127.0.0.1 (and will not accept connections from external clients) // by default this is 127.0.0.1 (and will not accept connections from external clients)
pub api_listen_interface: String, pub api_listen_interface: String,
// The port this wallet will run on // The port this wallet will run on
pub api_listen_port: String, pub api_listen_port: u16,
// The api address of a running server node against which transaction inputs // The api address of a running server node against which transaction inputs
// will be checked during send // will be checked during send
pub check_node_api_http_addr: String, pub check_node_api_http_addr: String,
@ -191,7 +191,7 @@ impl Default for WalletConfig {
WalletConfig { WalletConfig {
// enable_wallet: false, // enable_wallet: false,
api_listen_interface: "127.0.0.1".to_string(), api_listen_interface: "127.0.0.1".to_string(),
api_listen_port: "13415".to_string(), api_listen_port: 13415,
check_node_api_http_addr: "http://127.0.0.1:13413".to_string(), check_node_api_http_addr: "http://127.0.0.1:13413".to_string(),
data_file_dir: ".".to_string(), data_file_dir: ".".to_string(),
} }