gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-depolymerization] branch master updated (30d29f5 -> 4afbaca)


From: gnunet
Subject: [taler-depolymerization] branch master updated (30d29f5 -> 4afbaca)
Date: Sat, 30 Jul 2022 22:35:13 +0200

This is an automated email from the git hooks/post-receive script.

antoine pushed a change to branch master
in repository depolymerization.

    from 30d29f5  Update dependencies
     new 6efc2a9  Set msrv to 1.57.0 to follow debian package
     new 4afbaca  Improve tests

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Cargo.lock                   | 125 ++++++++++++++++++++-----------------------
 btc-wire/Cargo.toml          |   2 +-
 btc-wire/src/main.rs         |   9 ++--
 common/Cargo.toml            |   4 +-
 eth-wire/Cargo.toml          |   2 +-
 instrumentation/Cargo.toml   |   2 +-
 instrumentation/src/btc.rs   |  29 +++++-----
 instrumentation/src/eth.rs   |   4 +-
 instrumentation/src/main.rs  |  35 ++++++++----
 instrumentation/src/utils.rs |   2 +-
 script/prepare.sh            |   4 +-
 script/tmp_db.sh             |   0
 wire-gateway/Cargo.toml      |   6 +--
 13 files changed, 112 insertions(+), 112 deletions(-)
 mode change 100644 => 100755 script/tmp_db.sh

diff --git a/Cargo.lock b/Cargo.lock
index d4286bc..2814689 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -159,7 +159,7 @@ dependencies = [
  "base64",
  "bech32 0.9.0",
  "bitcoin",
- "clap 3.2.13",
+ "clap 3.2.16",
  "common",
  "criterion",
  "hex",
@@ -184,9 +184,9 @@ checksum = 
"14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
 
 [[package]]
 name = "bytes"
-version = "1.2.0"
+version = "1.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e"
+checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db"
 
 [[package]]
 name = "cast"
@@ -215,7 +215,6 @@ dependencies = [
  "libc",
  "num-integer",
  "num-traits",
- "serde",
  "winapi",
 ]
 
@@ -238,9 +237,9 @@ dependencies = [
 
 [[package]]
 name = "clap"
-version = "3.2.13"
+version = "3.2.16"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ac2bd7a1eb07da9ac757c923f69373deb7bc2ba5efc951b873bcb5e693992dca"
+checksum = "a3dbbb6653e7c55cc8595ad3e1f7be8f32aba4eb7ff7f0fd1163d4f3d137c0a9"
 dependencies = [
  "atty",
  "bitflags",
@@ -255,9 +254,9 @@ dependencies = [
 
 [[package]]
 name = "clap_derive"
-version = "3.2.7"
+version = "3.2.15"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "759bf187376e1afa7b85b959e6a664a3e7a95203415dba952ad19139e798f902"
+checksum = "9ba52acd3b0a5c33aeada5cdaa3267cdc7c594a98731d4268cdc1532f4264cb4"
 dependencies = [
  "heck",
  "proc-macro-error",
@@ -281,7 +280,7 @@ version = "0.1.10"
 source = "registry+https://github.com/rust-lang/crates.io-index";
 checksum = "937efe4451c32be4ccb3e19549cbb1ea5cb85197f39b87a9662ca1d7b1765d1d"
 dependencies = [
- "clap 3.2.13",
+ "clap 3.2.16",
  "roff",
 ]
 
@@ -372,9 +371,9 @@ dependencies = [
 
 [[package]]
 name = "crossbeam-channel"
-version = "0.5.5"
+version = "0.5.6"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4c02a4d71819009c192cf4872265391563fd6a84c81ff2c0f2a7026ca4c1d85c"
+checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521"
 dependencies = [
  "cfg-if",
  "crossbeam-utils",
@@ -382,9 +381,9 @@ dependencies = [
 
 [[package]]
 name = "crossbeam-deque"
-version = "0.8.1"
+version = "0.8.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
+checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc"
 dependencies = [
  "cfg-if",
  "crossbeam-epoch",
@@ -393,9 +392,9 @@ dependencies = [
 
 [[package]]
 name = "crossbeam-epoch"
-version = "0.9.9"
+version = "0.9.10"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "07db9d94cbd326813772c968ccd25999e5f8ae22f4f8d1b11effa37ef6ce281d"
+checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1"
 dependencies = [
  "autocfg",
  "cfg-if",
@@ -407,9 +406,9 @@ dependencies = [
 
 [[package]]
 name = "crossbeam-utils"
-version = "0.8.10"
+version = "0.8.11"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83"
+checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc"
 dependencies = [
  "cfg-if",
  "once_cell",
@@ -455,9 +454,9 @@ dependencies = [
 
 [[package]]
 name = "darling"
-version = "0.14.1"
+version = "0.13.4"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4529658bdda7fd6769b8614be250cdcfc3aeb0ee72fe66f9e41e5e5eb73eac02"
+checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c"
 dependencies = [
  "darling_core",
  "darling_macro",
@@ -465,9 +464,9 @@ dependencies = [
 
 [[package]]
 name = "darling_core"
-version = "0.14.1"
+version = "0.13.4"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "649c91bc01e8b1eac09fb91e8dbc7d517684ca6be8ebc75bb9cafc894f9fdb6f"
+checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610"
 dependencies = [
  "fnv",
  "ident_case",
@@ -479,9 +478,9 @@ dependencies = [
 
 [[package]]
 name = "darling_macro"
-version = "0.14.1"
+version = "0.13.4"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ddfc69c5bfcbd2fc09a0f38451d2daf0e372e367986a83906d1b0dbc88134fb5"
+checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835"
 dependencies = [
  "darling_core",
  "quote",
@@ -559,7 +558,7 @@ dependencies = [
 name = "eth-wire"
 version = "0.1.0"
 dependencies = [
- "clap 3.2.13",
+ "clap 3.2.16",
  "common",
  "ethereum-types",
  "hex",
@@ -602,9 +601,9 @@ checksum = 
"4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7"
 
 [[package]]
 name = "fastrand"
-version = "1.7.0"
+version = "1.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf"
+checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499"
 dependencies = [
  "instant",
 ]
@@ -932,7 +931,6 @@ checksum = 
"10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
 dependencies = [
  "autocfg",
  "hashbrown",
- "serde",
 ]
 
 [[package]]
@@ -950,7 +948,7 @@ version = "0.1.0"
 dependencies = [
  "bitcoin",
  "btc-wire",
- "clap 3.2.13",
+ "clap 3.2.16",
  "clap_mangen",
  "color-backtrace",
  "common",
@@ -987,9 +985,9 @@ checksum = 
"112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
 
 [[package]]
 name = "js-sys"
-version = "0.3.58"
+version = "0.3.59"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27"
+checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2"
 dependencies = [
  "wasm-bindgen",
 ]
@@ -1379,9 +1377,9 @@ dependencies = [
 
 [[package]]
 name = "proc-macro2"
-version = "1.0.40"
+version = "1.0.42"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7"
+checksum = "c278e965f1d8cf32d6e0e96de3d3e79712178ae67986d9cf9151f51e95aac89b"
 dependencies = [
  "unicode-ident",
 ]
@@ -1473,9 +1471,9 @@ dependencies = [
 
 [[package]]
 name = "redox_syscall"
-version = "0.2.13"
+version = "0.2.16"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42"
+checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
 dependencies = [
  "bitflags",
 ]
@@ -1695,25 +1693,19 @@ dependencies = [
 
 [[package]]
 name = "serde_with"
-version = "2.0.0"
+version = "1.14.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "89df7a26519371a3cce44fbb914c2819c84d9b897890987fa3ab096491cc0ea8"
+checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff"
 dependencies = [
- "base64",
- "chrono",
- "hex",
- "indexmap",
  "serde",
- "serde_json",
  "serde_with_macros",
- "time",
 ]
 
 [[package]]
 name = "serde_with_macros"
-version = "2.0.0"
+version = "1.5.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "de337f322382fcdfbb21a014f7c224ee041a23785651db67b9827403178f698f"
+checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082"
 dependencies = [
  "darling",
  "proc-macro2",
@@ -1875,7 +1867,6 @@ dependencies = [
  "itoa 1.0.2",
  "libc",
  "num_threads",
- "serde",
  "time-macros",
 ]
 
@@ -1921,9 +1912,9 @@ checksum = 
"cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
 
 [[package]]
 name = "tokio"
-version = "1.20.0"
+version = "1.20.1"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "57aec3cfa4c296db7255446efb4928a6be304b431a806216105542a67b6ca82e"
+checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581"
 dependencies = [
  "autocfg",
  "bytes",
@@ -1994,9 +1985,9 @@ checksum = 
"b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
 
 [[package]]
 name = "tracing"
-version = "0.1.35"
+version = "0.1.36"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160"
+checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307"
 dependencies = [
  "cfg-if",
  "pin-project-lite",
@@ -2005,9 +1996,9 @@ dependencies = [
 
 [[package]]
 name = "tracing-core"
-version = "0.1.28"
+version = "0.1.29"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7"
+checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7"
 dependencies = [
  "once_cell",
 ]
@@ -2156,9 +2147,9 @@ checksum = 
"9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
 
 [[package]]
 name = "wasm-bindgen"
-version = "0.2.81"
+version = "0.2.82"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994"
+checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d"
 dependencies = [
  "cfg-if",
  "wasm-bindgen-macro",
@@ -2166,13 +2157,13 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-backend"
-version = "0.2.81"
+version = "0.2.82"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a"
+checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f"
 dependencies = [
  "bumpalo",
- "lazy_static",
  "log",
+ "once_cell",
  "proc-macro2",
  "quote",
  "syn",
@@ -2181,9 +2172,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-macro"
-version = "0.2.81"
+version = "0.2.82"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa"
+checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602"
 dependencies = [
  "quote",
  "wasm-bindgen-macro-support",
@@ -2191,9 +2182,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-macro-support"
-version = "0.2.81"
+version = "0.2.82"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048"
+checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -2204,15 +2195,15 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-shared"
-version = "0.2.81"
+version = "0.2.82"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be"
+checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a"
 
 [[package]]
 name = "web-sys"
-version = "0.3.58"
+version = "0.3.59"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90"
+checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1"
 dependencies = [
  "js-sys",
  "wasm-bindgen",
@@ -2316,7 +2307,7 @@ name = "wire-gateway"
 version = "0.1.0"
 dependencies = [
  "bitcoin",
- "clap 3.2.13",
+ "clap 3.2.16",
  "common",
  "deadpool-postgres",
  "ethereum-types",
@@ -2335,6 +2326,6 @@ dependencies = [
 
 [[package]]
 name = "zeroize"
-version = "1.5.6"
+version = "1.5.7"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "20b578acffd8516a6c3f2a1bdefc1ec37e547bb4e0fb8b6b01a4cafc886b4442"
+checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f"
diff --git a/btc-wire/Cargo.toml b/btc-wire/Cargo.toml
index f1662e1..f7c4b22 100644
--- a/btc-wire/Cargo.toml
+++ b/btc-wire/Cargo.toml
@@ -3,7 +3,7 @@ name = "btc-wire"
 version = "0.1.0"
 edition = "2021"
 license = "AGPL-3.0-or-later"
-rust-version = "1.56.1"
+rust-version = "1.57.0"
 
 [features]
 # Enable random failures
diff --git a/btc-wire/src/main.rs b/btc-wire/src/main.rs
index 53ec673..c0afd0c 100644
--- a/btc-wire/src/main.rs
+++ b/btc-wire/src/main.rs
@@ -30,10 +30,7 @@ use common::{
 use loops::LoopResult;
 use std::path::PathBuf;
 
-use crate::{
-    loops::{analysis::analysis, watcher::watcher, worker::worker},
-    sql::sql_addr,
-};
+use crate::loops::{analysis::analysis, watcher::watcher, worker::worker};
 
 mod fail_point;
 mod loops;
@@ -113,7 +110,7 @@ fn init(config: Option<PathBuf>, init: Init) -> 
LoopResult<()> {
             // TODO Use address label instead of the database ?
             let prev_addr = db.query_opt("SELECT value FROM state WHERE name = 
'addr'", &[])?;
             let addr = if let Some(row) = prev_addr {
-                sql_addr(&row, 0)
+                String::from_utf8(row.get(0)).unwrap()
             } else {
                 // Or generate a new one
                 let new = Rpc::wallet(&btc_conf, WIRE_WALLET_NAME)
@@ -123,7 +120,7 @@ fn init(config: Option<PathBuf>, init: Init) -> 
LoopResult<()> {
                     "INSERT INTO state (name, value) VALUES ('addr', $1)",
                     &[&new.to_string().as_bytes()],
                 )?;
-                new
+                new.to_string()
             };
 
             if created {
diff --git a/common/Cargo.toml b/common/Cargo.toml
index 08c4944..e3c26e0 100644
--- a/common/Cargo.toml
+++ b/common/Cargo.toml
@@ -3,7 +3,7 @@ name = "common"
 version = "0.1.0"
 edition = "2021"
 license = "AGPL-3.0-or-later"
-rust-version = "1.56.1"
+rust-version = "1.57.0"
 
 # See more keys and their definitions at 
https://doc.rust-lang.org/cargo/reference/manifest.html
 
@@ -11,7 +11,7 @@ rust-version = "1.56.1"
 # Serialization framework
 serde = { version = "1.0.140", features = ["derive"] }
 # Serialization helper
-serde_with = "2.0.0"
+serde_with = "1.14.0"
 # JSON serialization
 serde_json = "1.0.82"
 # Url format
diff --git a/eth-wire/Cargo.toml b/eth-wire/Cargo.toml
index 9be092a..f5f7ed1 100644
--- a/eth-wire/Cargo.toml
+++ b/eth-wire/Cargo.toml
@@ -3,7 +3,7 @@ name = "eth-wire"
 version = "0.1.0"
 edition = "2021"
 license = "AGPL-3.0-or-later"
-rust-version = "1.56.1"
+rust-version = "1.57.0"
 
 [features]
 # Enable random failures
diff --git a/instrumentation/Cargo.toml b/instrumentation/Cargo.toml
index 2690f1c..bdcd13d 100644
--- a/instrumentation/Cargo.toml
+++ b/instrumentation/Cargo.toml
@@ -3,7 +3,7 @@ name = "instrumentation"
 version = "0.1.0"
 edition = "2021"
 license = "AGPL-3.0-or-later"
-rust-version = "1.56.1"
+rust-version = "1.57.0"
 
 [dependencies]
 # Cli args parser
diff --git a/instrumentation/src/btc.rs b/instrumentation/src/btc.rs
index 85620db..8743507 100644
--- a/instrumentation/src/btc.rs
+++ b/instrumentation/src/btc.rs
@@ -26,7 +26,7 @@ use std::{
 use bitcoin::{hashes::Hash, Address, Amount, BlockHash, Network, SignedAmount, 
Txid};
 use btc_wire::{
     btc_config::BitcoinConfig,
-    rpc::{self, Category, ErrorCode, Rpc, Transaction},
+    rpc::{self, Category, ErrorCode, Rpc},
     rpc_utils::{self, segwit_min_amount},
     taler_utils::{btc_payto_url, btc_to_taler},
     WireState,
@@ -68,16 +68,14 @@ fn wait_for_pending(since: &mut BlockHash, client_rpc: &mut 
Rpc, wire_rpc: &mut
     println!();
 }
 
-pub fn btc_test(config: Option<&Path>, base_url: &str) {
+pub fn online_test(config: Option<&Path>, base_url: &str) {
     let state = WireState::load_taler_config(config);
 
     if state.btc_config.network == Network::Bitcoin {
         panic!("You should never run this test on a real bitcoin network");
     }
+    let mut rpc = Rpc::common(&state.btc_config).expect("Cannot connect to 
bitcoin node");
 
-    let min_fund = Amount::from_sat(10_000);
-
-    let mut rpc = Rpc::common(&state.btc_config).unwrap();
     // Load client
     match rpc.load_wallet(CLIENT) {
         Ok(_) => {}
@@ -95,6 +93,7 @@ pub fn btc_test(config: Option<&Path>, base_url: &str) {
     };
     let mut client_rpc = Rpc::wallet(&state.btc_config, CLIENT).unwrap();
     let client_addr = client_rpc.gen_addr().unwrap();
+    let min_fund = Amount::from_sat(10_000);
     if client_rpc.get_balance().unwrap() < min_fund {
         println!(
             "Client need a minimum of {} BTC to run this test, send coins to 
this address: {}",
@@ -152,18 +151,18 @@ pub fn btc_test(config: Option<&Path>, base_url: &str) {
     );
 
     print_now("Wait for bounce:");
-    let bounce: Transaction = 'l: loop {
+    'l: loop {
         let sync = client_rpc.list_since_block(Some(&since), 1).unwrap();
         for tx in sync.transactions {
             if tx.category == Category::Receive {
-                let (tx, metadata) = 
client_rpc.get_tx_op_return(&tx.txid).unwrap();
+                let (_, metadata) = 
client_rpc.get_tx_op_return(&tx.txid).unwrap();
                 let metadata = OutMetadata::decode(&metadata).unwrap();
                 match metadata {
                     OutMetadata::Debit { .. } => {}
                     OutMetadata::Bounce { bounced } => {
                         let bounced = Txid::from_inner(bounced);
                         if bounced == bounce_id {
-                            break 'l tx;
+                            break 'l;
                         } else if bounced == send_min_id {
                             panic!("Bounced send min");
                         } else if bounced == bounce_min_id {
@@ -176,20 +175,16 @@ pub fn btc_test(config: Option<&Path>, base_url: &str) {
         since = sync.lastblock;
         rpc.wait_for_new_block().unwrap();
         print_now(".");
-    };
+    }
     println!();
     wait_for_pending(&mut since, &mut client_rpc, &mut wire_rpc);
 
     println!("Check balance");
-    let new_client_balance = client_rpc.get_balance().unwrap();
     let new_wire_balance = wire_rpc.get_balance().unwrap();
-    assert_eq!(
-        client_balance - client_sent_amount_cost - client_sent_fees_cost + 
unsigned(bounce.amount),
-        new_client_balance
-    );
-    assert_eq!(
-        wire_balance + test_amount + min_bounce_amount + min_send_amount + 
state.bounce_fee,
-        new_wire_balance
+    let new_client_balance = client_rpc.get_balance().unwrap();
+    assert!(new_wire_balance > wire_balance + test_amount + min_bounce_amount 
+ min_send_amount);
+    assert!(
+        new_wire_balance < wire_balance + test_amount * 2 + min_bounce_amount 
+ min_send_amount
     );
 
     println!("Check incoming history");
diff --git a/instrumentation/src/eth.rs b/instrumentation/src/eth.rs
index ec8ca3c..f2bc517 100644
--- a/instrumentation/src/eth.rs
+++ b/instrumentation/src/eth.rs
@@ -48,7 +48,7 @@ fn wait_for_pending(rpc: &mut Rpc) {
     println!();
 }
 
-pub fn eth_test(config: Option<&Path>, base_url: &str) {
+pub fn online_test(config: Option<&Path>, base_url: &str) {
     let state = WireState::load_taler_config(config);
     // TODO eth network check
     let min_fund = U256::from(100_000 * TRUNC);
@@ -438,6 +438,8 @@ impl EthCtx {
             &[
                 "--datadir",
                 self.dirs.wire_dir2.to_str().unwrap(),
+                "--authrpc.port",
+                "8552",
                 "--port",
                 "30305",
                 "--miner.gasprice",
diff --git a/instrumentation/src/main.rs b/instrumentation/src/main.rs
index 6d425f5..f2e74c1 100644
--- a/instrumentation/src/main.rs
+++ b/instrumentation/src/main.rs
@@ -16,10 +16,8 @@
 
 use std::{path::PathBuf, time::Instant};
 
-use btc::btc_test;
 use clap::StructOpt;
 use common::{config::TalerConfig, currency::Currency};
-use eth::eth_test;
 use owo_colors::OwoColorize;
 
 mod btc;
@@ -43,9 +41,20 @@ enum Cmd {
         config: Option<PathBuf>,
     },
     /// Perform offline tests on local private blockchain
-    Offline,
+    Offline {
+        /// With tests to run
+        #[clap(
+            global = true,
+            possible_values(TESTS_KIND),
+            case_insensitive = true,
+            default_value = "all"
+        )]
+        kind: String,
+    },
 }
 
+const TESTS_KIND: &[&str] = &["all", "gateway", "bitcoin", "btc", "ethereum", 
"eth"];
+
 pub fn main() {
     common::log::init();
     color_backtrace::install();
@@ -54,19 +63,25 @@ pub fn main() {
     match args.cmd {
         Cmd::Online { config } => {
             let taler_config = TalerConfig::load(config.as_deref());
-            let base_url = format!("http://localhost:{}";, taler_config.port());
+            let base_url = format!("http://localhost:{}/";, 
taler_config.port());
 
             match taler_config.currency {
-                Currency::BTC(_) => btc_test(config.as_deref(), &base_url),
-                Currency::ETH(_) => eth_test(config.as_deref(), &base_url),
+                Currency::BTC(_) => btc::online_test(config.as_deref(), 
&base_url),
+                Currency::ETH(_) => eth::online_test(config.as_deref(), 
&base_url),
             }
             println!("Instrumentation test successful");
         }
-        Cmd::Offline => {
+        Cmd::Offline { kind } => {
             let mut tests = Vec::new();
-            tests.extend_from_slice(gateway::TESTS);
-            tests.extend_from_slice(btc::TESTS);
-            tests.extend_from_slice(eth::TESTS);
+            if kind == "all" || kind == "gateway" {
+                tests.extend_from_slice(gateway::TESTS);
+            }
+            if kind == "all" || kind == "bitcoin" || kind == "btc" {
+                tests.extend_from_slice(btc::TESTS);
+            }
+            if kind == "all" || kind == "ethereum" || kind == "eth" {
+                tests.extend_from_slice(eth::TESTS);
+            }
             let start = Instant::now();
             for (test, name) in &tests {
                 let start = Instant::now();
diff --git a/instrumentation/src/utils.rs b/instrumentation/src/utils.rs
index f89abb0..f847b4d 100644
--- a/instrumentation/src/utils.rs
+++ b/instrumentation/src/utils.rs
@@ -198,7 +198,7 @@ pub fn cmd_redirect(cmd: &str, args: &[&str], path: &str) 
-> ChildGuard {
 pub fn cmd_ok(mut child: ChildGuard, name: &str) {
     let result = child.0.wait().unwrap();
     if !result.success() {
-        panic!("cmd {name} failed");
+        panic!("cmd {} failed", name);
     }
 }
 
diff --git a/script/prepare.sh b/script/prepare.sh
index a926db4..499370e 100755
--- a/script/prepare.sh
+++ b/script/prepare.sh
@@ -30,11 +30,11 @@ mv -v bitcoin-23.0/* ~/bitcoin
 
 echo "Ⅲ - Install Go Ethereum (Geth) v1.10.20"
 cd $DIR
-curl -L 
https://gethstore.blob.core.windows.net/builds/geth-alltools-linux-amd64-1.10.20-8f2416a8.tar.gz
 -o geth.tar.gz
+curl -L 
https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.21-67109427.tar.gz
 -o geth.tar.gz
 rm -rfv ~/geth
 mkdir -pv ~/geth
 tar xvzf geth.tar.gz
-mv -v geth-alltools-linux-amd64-1.10.20-8f2416a8/* ~/geth
+mv -v geth-linux-amd64-1.10.21-67109427/* ~/geth
 
 echo "Ⅳ - PATH"
 
diff --git a/script/tmp_db.sh b/script/tmp_db.sh
old mode 100644
new mode 100755
diff --git a/wire-gateway/Cargo.toml b/wire-gateway/Cargo.toml
index d8cc4dd..a812bb2 100644
--- a/wire-gateway/Cargo.toml
+++ b/wire-gateway/Cargo.toml
@@ -3,7 +3,7 @@ name = "wire-gateway"
 version = "0.1.0"
 edition = "2021"
 license = "AGPL-3.0-or-later"
-rust-version = "1.56.1"
+rust-version = "1.57.0"
 
 [dependencies]
 # Http library
@@ -15,7 +15,7 @@ tokio = { version = "1.20.0", features = ["net", "macros", 
"rt-multi-thread"] }
 # Serialization framework
 serde = { version = "1.0.140", features = ["derive"] }
 # Serialization helper
-serde_with = "2.0.0"
+serde_with = "1.14.0"
 # JSON serialization
 serde_json = "1.0.82"
 # Url query serialization
@@ -33,7 +33,7 @@ listenfd = "1.0.0"
 common = { path = "../common" }
 # Bitcoin types
 bitcoin = { version = "0.28.1" }
-# Euthereum types
+# Ethereum types
 ethereum-types = { version = "0.13.1", default-features = false }
 # Cli args parser
 clap = { version = "3.2.13", features = ["derive"] }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]