summaryrefslogtreecommitdiff
path: root/btc-wire/src/bin/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'btc-wire/src/bin/test.rs')
-rw-r--r--btc-wire/src/bin/test.rs26
1 files changed, 10 insertions, 16 deletions
diff --git a/btc-wire/src/bin/test.rs b/btc-wire/src/bin/test.rs
index 202adac..658c750 100644
--- a/btc-wire/src/bin/test.rs
+++ b/btc-wire/src/bin/test.rs
@@ -52,16 +52,16 @@ pub fn main() {
{
println!("Generate tests wallets");
// Create wallets
- rpc.create_wallet(&WIRE, None, None, None, None).ok();
- rpc.create_wallet(&CLIENT, None, None, None, None).ok();
- rpc.create_wallet(&RESERVE, None, None, None, None).ok();
+ rpc.create_wallet(WIRE, None, None, None, None).ok();
+ rpc.create_wallet(CLIENT, None, None, None, None).ok();
+ rpc.create_wallet(RESERVE, None, None, None, None).ok();
}
// Load wallets
- rpc.load_wallet(&WIRE).ok();
- rpc.load_wallet(&CLIENT).ok();
- rpc.load_wallet(&RESERVE).ok();
+ rpc.load_wallet(WIRE).ok();
+ rpc.load_wallet(CLIENT).ok();
+ rpc.load_wallet(RESERVE).ok();
}
// Client initialization
@@ -285,15 +285,9 @@ pub fn main() {
assert!(match wire_rpc.bounce(&send_id, bounce_fee) {
Ok(_) => false,
Err(err) => match err {
- BounceErr::RPC(err) => match err {
- bitcoincore_rpc::Error::JsonRpc(err) => match err {
- bitcoincore_rpc::jsonrpc::Error::Rpc(RpcError { code, .. }) => {
- code == RpcErrorCode::RpcWalletInsufficientFunds as i32
- }
- _ => false,
- },
- _ => false,
- },
+ BounceErr::RPC(bitcoincore_rpc::Error::JsonRpc(
+ bitcoincore_rpc::jsonrpc::Error::Rpc(RpcError { code, .. }),
+ )) => code == RpcErrorCode::RpcWalletInsufficientFunds as i32,
_ => false,
},
});
@@ -411,7 +405,7 @@ impl TestRunner {
}
}
- fn test(&mut self, name: &str, test: impl FnOnce() -> ()) {
+ fn test(&mut self, name: &str, test: impl FnOnce()) {
println!("{}", name.cyan());
let result = std::panic::catch_unwind(AssertUnwindSafe(test));