V2 Foreign API RPC Tests (#28)

* build_coinbase api doctest

* rustfmt

* foreign api recieve tx rpc

* rustfmt

* re-export grin dependencies

* re-export grin dependencies

* all foreign API rpc tests working
This commit is contained in:
Yeastplume
2019-03-26 16:02:31 +00:00
committed by GitHub
parent 94960b3edd
commit afa6003a8b
47 changed files with 686 additions and 439 deletions
+2 -6
View File
@@ -31,13 +31,9 @@ uuid = { version = "0.7", features = ["serde", "v4"] }
url = "1.7.0"
chrono = { version = "0.4.4", features = ["serde"] }
grin_wallet_util = { path = "../util", version = "1.1.0" }
grin_wallet_api = { path = "../api", version = "1.1.0" }
grin_wallet_impls = { path = "../impls", version = "1.1.0" }
grin_wallet_libwallet = { path = "../libwallet", version = "1.1.0" }
grin_wallet_config = { path = "../config", version = "1.1.0" }
grin_core = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_util = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_api = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
+1 -1
View File
@@ -138,7 +138,7 @@ pub fn listen(config: &WalletConfig, args: &ListenArgs, g_args: &GlobalArgs) ->
)?;
let listen_addr = params.get("api_listen_addr").unwrap();
let tls_conf = match params.get("certificate") {
Some(s) => Some(grin_api::TLSConfig::new(
Some(s) => Some(TLSConfig::new(
s.to_owned(),
params.get("private_key").unwrap().to_owned(),
)),
+1 -1
View File
@@ -684,7 +684,7 @@ where
}
fn handle_request(&self, req: Request<Body>) -> WalletResponseFuture {
let api = *Foreign::new(self.wallet.clone());
let api = Foreign::new(self.wallet.clone());
match req
.uri()
.path()
+5 -5
View File
@@ -20,14 +20,14 @@ extern crate prettytable;
#[macro_use]
extern crate log;
use failure;
use grin_api as api;
extern crate grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_api as apiwallet;
use grin_wallet_config as config;
use grin_wallet_impls as impls;
use grin_wallet_libwallet as libwallet;
extern crate grin_wallet_config as config;
use grin_wallet_util::grin_api as api;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
pub mod command;
pub mod controller;
+4 -3
View File
@@ -17,12 +17,13 @@ extern crate log;
extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::global;
use self::core::global::ChainTypes;
use self::keychain::{ExtKeychain, Keychain};
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_libwallet as libwallet;
use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use std::fs;
+4 -3
View File
@@ -17,13 +17,14 @@ extern crate log;
extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::consensus;
use self::core::global;
use self::core::global::ChainTypes;
use self::keychain::ExtKeychain;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_libwallet as libwallet;
use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use impls::FileWalletCommAdapter;
+4 -3
View File
@@ -17,12 +17,13 @@ extern crate log;
extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::global;
use self::core::global::ChainTypes;
use self::keychain::ExtKeychain;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_libwallet as libwallet;
use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use impls::FileWalletCommAdapter;
+4 -3
View File
@@ -18,13 +18,14 @@ extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls;
extern crate grin_wallet_libwallet as libwallet;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::global;
use self::core::global::ChainTypes;
use self::keychain::ExtKeychain;
use self::libwallet::slate::Slate;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use impls::FileWalletCommAdapter;
use std::fs;
+4 -3
View File
@@ -18,14 +18,15 @@ extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls;
extern crate grin_wallet_libwallet as libwallet;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::global;
use self::core::global::ChainTypes;
use self::keychain::{ExtKeychain, Identifier, Keychain};
use self::libwallet::slate::Slate;
use self::libwallet::types::AcctPathMapping;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use std::fs;
use std::sync::atomic::Ordering;
+4 -3
View File
@@ -17,12 +17,13 @@ extern crate log;
extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::global;
use self::core::global::ChainTypes;
use self::keychain::ExtKeychain;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_libwallet as libwallet;
use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use std::fs;
+4 -3
View File
@@ -18,15 +18,16 @@ extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls;
extern crate grin_wallet_libwallet as libwallet;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::core::transaction;
use self::core::global;
use self::core::global::ChainTypes;
use self::keychain::ExtKeychain;
use self::libwallet::slate::Slate;
use self::libwallet::types::OutputStatus;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use std::fs;
use std::thread;