[WIP] Updates to support web-wallet (#1160)

* updates to support web wallet workflow

* rustfmt

* functions to support wallet, error handling

* rustfmt

* rebase rustfmt

* test fix
This commit is contained in:
Yeastplume
2018-06-13 21:58:45 +01:00
committed by GitHub
parent 922b04608f
commit 88616fd341
22 changed files with 260 additions and 89 deletions
+2 -2
View File
@@ -681,7 +681,7 @@ fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
Ok(())
}
("info", Some(_)) => {
let _res = wallet::display::info(&api.retrieve_summary_info()?.1)
let _res = wallet::display::info(&api.retrieve_summary_info(true)?)
.unwrap_or_else(|e| {
panic!(
"Error getting wallet info: {:?} Config: {:?}",
@@ -692,7 +692,7 @@ fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
}
("outputs", Some(_)) => {
let (height, validated) = api.node_height()?;
let (_, outputs) = api.retrieve_outputs(show_spent)?;
let (_, outputs) = api.retrieve_outputs(show_spent, true)?;
let _res =
wallet::display::outputs(height, validated, outputs).unwrap_or_else(|e| {
panic!(
+3 -5
View File
@@ -41,10 +41,8 @@
//! Adapted from https://github.com/behnam/rust-cursive-table-view
//! A basic table view implementation for [cursive](https://crates.io/crates/cursive).
#![deny(
missing_docs, missing_copy_implementations, trivial_casts, trivial_numeric_casts, unsafe_code,
unused_import_braces, unused_qualifications
)]
#![deny(missing_docs, missing_copy_implementations, trivial_casts, trivial_numeric_casts,
unsafe_code, unused_import_braces, unused_qualifications)]
// Crate Dependencies ---------------------------------------------------------
extern crate cursive;
@@ -56,6 +54,7 @@ use std::hash::Hash;
use std::rc::Rc;
// External Dependencies ------------------------------------------------------
use cursive::With;
use cursive::align::HAlign;
use cursive::direction::Direction;
use cursive::event::{Callback, Event, EventResult, Key};
@@ -63,7 +62,6 @@ use cursive::theme::ColorStyle;
use cursive::theme::PaletteColor::*;
use cursive::vec::Vec2;
use cursive::view::{ScrollBase, View};
use cursive::With;
use cursive::{Cursive, Printer};
/// A trait for displaying and sorting items inside a
+1 -1
View File
@@ -14,8 +14,8 @@
//! Types specific to the UI module
use cursive::view::View;
use cursive::Cursive;
use cursive::view::View;
use servers::ServerStats;
/// Main message struct to communicate between the UI and