[WIP] V2 API Doctest generation (#24)

V2 API Doctest generation
This commit is contained in:
Yeastplume
2019-03-22 12:03:25 +00:00
committed by GitHub
parent 64772e6021
commit 94960b3edd
37 changed files with 1645 additions and 725 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ ring = "0.13"
tokio = "= 0.1.11"
tokio-core = "0.1"
tokio-retry = "0.1"
uuid = { version = "0.6", features = ["serde", "v4"] }
uuid = { version = "0.7", features = ["serde", "v4"] }
chrono = { version = "0.4.4", features = ["serde"] }
grin_wallet_libwallet = { path = "../libwallet", version = "1.1.0" }
+1 -1
View File
@@ -382,7 +382,7 @@ impl WalletCommAdapter for KeybaseWalletCommAdapter {
let res = {
let mut w = wallet.lock();
w.open_with_credentials()?;
let r = foreign::receive_tx(&mut *w, &mut slate, None, None);
let r = foreign::receive_tx(&mut *w, &mut slate, None, None, false);
w.close()?;
r
};
+9 -3
View File
@@ -32,6 +32,7 @@ use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use std::sync::Arc;
use std::thread;
mod testclient;
@@ -140,6 +141,7 @@ pub fn award_blocks_to_wallet<C, K>(
chain: &Chain,
wallet: Arc<Mutex<dyn WalletInst<C, K>>>,
number: usize,
pause_between: bool,
) -> Result<(), libwallet::Error>
where
C: NodeClient,
@@ -147,6 +149,9 @@ where
{
for _ in 0..number {
award_block_to_wallet(chain, vec![], wallet.clone())?;
if pause_between {
thread::sleep(std::time::Duration::from_millis(100));
}
}
Ok(())
}
@@ -185,6 +190,7 @@ pub fn send_to_dest<T: ?Sized, C, K>(
client: LocalWalletClient,
dest: &str,
amount: u64,
test_mode: bool,
) -> Result<(), libwallet::Error>
where
T: WalletBackend<C, K>,
@@ -201,11 +207,11 @@ where
500, // max outputs
1, // num change outputs
true, // select all outputs
None, None,
None, None, test_mode,
)?;
let mut slate = client.send_tx_slate_direct(dest, &slate_i)?;
let slate = client.send_tx_slate_direct(dest, &slate_i)?;
owner::tx_lock_outputs(&mut *w, &slate)?;
owner::finalize_tx(&mut *w, &mut slate)?;
let slate = owner::finalize_tx(&mut *w, &slate)?;
w.close()?;
slate
};
+1 -1
View File
@@ -220,7 +220,7 @@ where
let mut w = wallet.1.lock();
w.open_with_credentials()?;
// receive tx
foreign::receive_tx(&mut *w, &mut slate, None, None)?;
foreign::receive_tx(&mut *w, &mut slate, None, None, false)?;
w.close()?;
}