commit d799aac4e997154557b0c28eec1ba7d87d71c4eb
parent 60bfc24eaedf3c8cacfea3b6d2b8fec520a1350d
Author: Antoine A <>
Date: Wed, 15 Dec 2021 11:11:26 +0100
Make confirmation configurable
Diffstat:
7 files changed, 169 insertions(+), 91 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -9,6 +9,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
+name = "ahash"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e"
+
+[[package]]
name = "aho-corasick"
version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -154,9 +160,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "block-buffer"
-version = "0.9.0"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
+checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95"
dependencies = [
"generic-array",
]
@@ -180,12 +186,12 @@ dependencies = [
"argh",
"bech32",
"bitcoincore-rpc",
- "configparser",
"criterion",
"fastrand",
"owo-colors",
"postgres",
"rand",
+ "rust-ini",
"serde",
"taler-log",
"thiserror",
@@ -340,13 +346,12 @@ dependencies = [
]
[[package]]
-name = "crypto-mac"
-version = "0.11.1"
+name = "crypto-common"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714"
+checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0"
dependencies = [
"generic-array",
- "subtle",
]
[[package]]
@@ -357,7 +362,7 @@ checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1"
dependencies = [
"bstr",
"csv-core",
- "itoa",
+ "itoa 0.4.8",
"ryu",
"serde",
]
@@ -441,11 +446,23 @@ dependencies = [
[[package]]
name = "digest"
-version = "0.9.0"
+version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
+checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b"
dependencies = [
+ "block-buffer",
+ "crypto-common",
"generic-array",
+ "subtle",
+]
+
+[[package]]
+name = "dlv-list"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "68df3f2b690c1b86e65ef7830956aededf3cb0a16f898f79b9a6f421a7b6211b"
+dependencies = [
+ "rand",
]
[[package]]
@@ -511,9 +528,9 @@ dependencies = [
[[package]]
name = "futures"
-version = "0.3.18"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8cd0210d8c325c245ff06fd95a3b13689a1a276ac8cfa8e8720cb840bfb84b9e"
+checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca"
dependencies = [
"futures-channel",
"futures-core",
@@ -526,9 +543,9 @@ dependencies = [
[[package]]
name = "futures-channel"
-version = "0.3.18"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fc8cd39e3dbf865f7340dce6a2d401d24fd37c6fe6c4f0ee0de8bfca2252d27"
+checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888"
dependencies = [
"futures-core",
"futures-sink",
@@ -536,15 +553,15 @@ dependencies = [
[[package]]
name = "futures-core"
-version = "0.3.18"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "629316e42fe7c2a0b9a65b47d159ceaa5453ab14e8f0a3c5eedbb8cd55b4a445"
+checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d"
[[package]]
name = "futures-executor"
-version = "0.3.18"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b808bf53348a36cab739d7e04755909b9fcaaa69b7d7e588b37b6ec62704c97"
+checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c"
dependencies = [
"futures-core",
"futures-task",
@@ -553,16 +570,18 @@ dependencies = [
[[package]]
name = "futures-io"
-version = "0.3.18"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e481354db6b5c353246ccf6a728b0c5511d752c08da7260546fc0933869daa11"
+checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377"
[[package]]
name = "futures-macro"
-version = "0.3.18"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a89f17b21645bc4ed773c69af9c9a0effd4a3f1a3876eadd453469f8854e7fdd"
+checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb"
dependencies = [
+ "autocfg",
+ "proc-macro-hack",
"proc-macro2",
"quote",
"syn",
@@ -570,22 +589,23 @@ dependencies = [
[[package]]
name = "futures-sink"
-version = "0.3.18"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "996c6442437b62d21a32cd9906f9c41e7dc1e19a9579843fad948696769305af"
+checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11"
[[package]]
name = "futures-task"
-version = "0.3.18"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dabf1872aaab32c886832f2276d2f5399887e2bd613698a02359e4ea83f8de12"
+checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99"
[[package]]
name = "futures-util"
-version = "0.3.18"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d22213122356472061ac0f1ab2cee28d2bac8491410fd68c2af53d1cedb83e"
+checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481"
dependencies = [
+ "autocfg",
"futures-channel",
"futures-core",
"futures-io",
@@ -595,6 +615,8 @@ dependencies = [
"memchr",
"pin-project-lite",
"pin-utils",
+ "proc-macro-hack",
+ "proc-macro-nested",
"slab",
]
@@ -632,6 +654,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7"
[[package]]
+name = "hashbrown"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
+dependencies = [
+ "ahash",
+]
+
+[[package]]
name = "heck"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -651,11 +682,10 @@ dependencies = [
[[package]]
name = "hmac"
-version = "0.11.0"
+version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b"
+checksum = "ddca131f3e7f2ce2df364b57949a9d47915cfbd35e46cfee355ccebbf794d6a2"
dependencies = [
- "crypto-mac",
"digest",
]
@@ -667,7 +697,7 @@ checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b"
dependencies = [
"bytes",
"fnv",
- "itoa",
+ "itoa 0.4.8",
]
[[package]]
@@ -695,9 +725,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]]
name = "hyper"
-version = "0.14.15"
+version = "0.14.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "436ec0091e4f20e655156a30a0df3770fe2900aa301e548e08446ec794b6953c"
+checksum = "b7ec3e62bdc98a2f0393a5048e4c30ef659440ea6e0e572965103e72bd836f55"
dependencies = [
"bytes",
"futures-channel",
@@ -707,7 +737,7 @@ dependencies = [
"http-body",
"httparse",
"httpdate",
- "itoa",
+ "itoa 0.4.8",
"pin-project-lite",
"socket2",
"tokio",
@@ -758,6 +788,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]]
+name = "itoa"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
+
+[[package]]
name = "js-sys"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -786,9 +822,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
-version = "0.2.109"
+version = "0.2.112"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01"
+checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
[[package]]
name = "listenfd"
@@ -827,13 +863,11 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]]
name = "md-5"
-version = "0.9.1"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15"
+checksum = "e6a38fc55c8bbc10058782919516f88826e70320db6d206aebc49611d24216ae"
dependencies = [
- "block-buffer",
"digest",
- "opaque-debug",
]
[[package]]
@@ -917,10 +951,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
[[package]]
-name = "opaque-debug"
-version = "0.3.0"
+name = "ordered-multimap"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
+checksum = "1c672c7ad9ec066e428c00eb917124a06f08db19e2584de982cc34b1f4c12485"
+dependencies = [
+ "dlv-list",
+ "hashbrown",
+]
[[package]]
name = "owo-colors"
@@ -961,9 +999,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
[[package]]
name = "phf"
-version = "0.10.0"
+version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9fc3db1018c4b59d7d582a739436478b6035138b6aecbce989fc91c3e98409f"
+checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
dependencies = [
"phf_shared",
]
@@ -1033,9 +1071,9 @@ dependencies = [
[[package]]
name = "postgres-protocol"
-version = "0.6.2"
+version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b145e6a4ed52cb316a27787fc20fe8a25221cb476479f61e4e0327c15b98d91a"
+checksum = "79ec03bce71f18b4a27c4c64c6ba2ddf74686d69b91d8714fb32ead3adaed713"
dependencies = [
"base64",
"byteorder",
@@ -1067,10 +1105,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba"
[[package]]
+name = "proc-macro-hack"
+version = "0.5.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
+
+[[package]]
+name = "proc-macro-nested"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
+
+[[package]]
name = "proc-macro2"
-version = "1.0.33"
+version = "1.0.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a"
+checksum = "2f84e92c0f7c9d58328b85a78557813e4bd845130db68d7184635344399423b1"
dependencies = [
"unicode-xid",
]
@@ -1204,6 +1254,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]]
+name = "rust-ini"
+version = "0.17.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "63471c4aa97a1cf8332a5f97709a79a4234698de6a1f5087faf66f2dae810e22"
+dependencies = [
+ "cfg-if",
+ "ordered-multimap",
+]
+
+[[package]]
name = "rustc_version"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1220,9 +1280,9 @@ checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
[[package]]
name = "ryu"
-version = "1.0.6"
+version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c9613b5a66ab9ba26415184cfc41156594925a9cf3a2057e57f31ff145f6568"
+checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
[[package]]
name = "same-file"
@@ -1296,11 +1356,11 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.72"
+version = "1.0.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527"
+checksum = "bcbd0344bc6533bc7ec56df11d42fb70f1b912351c0825ccb7211b59d8af7cf5"
dependencies = [
- "itoa",
+ "itoa 1.0.1",
"ryu",
"serde",
]
@@ -1312,7 +1372,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9"
dependencies = [
"form_urlencoded",
- "itoa",
+ "itoa 0.4.8",
"ryu",
"serde",
]
@@ -1342,15 +1402,13 @@ dependencies = [
[[package]]
name = "sha2"
-version = "0.9.8"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa"
+checksum = "900d964dd36bb15bcf2f2b35694c072feab74969a54f2bbeec7a2d725d2bdcb6"
dependencies = [
- "block-buffer",
"cfg-if",
"cpufeatures",
"digest",
- "opaque-debug",
]
[[package]]
@@ -1458,7 +1516,7 @@ version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41effe7cfa8af36f439fac33861b66b049edc6f9a32331e2312660529c1c24ad"
dependencies = [
- "itoa",
+ "itoa 0.4.8",
"libc",
"time-macros",
]
diff --git a/btc-wire/Cargo.toml b/btc-wire/Cargo.toml
@@ -29,7 +29,7 @@ wire-gateway = { path = "../wire-gateway" }
# Ansi color
owo-colors = "3.1.1"
# Ini files
-configparser = "3.0.0"
+rust-ini = "0.17.0"
# Taler logging
taler-log = { path = "../taler-log" }
diff --git a/btc-wire/src/main.rs b/btc-wire/src/main.rs
@@ -10,7 +10,6 @@ use btc_wire::{
segwit::DecodeSegWitErr,
ClientExtended, GetOpReturnErr, GetSegwitErr,
};
-use configparser::ini::Ini;
use postgres::{fallible_iterator::FallibleIterator, Client, IsolationLevel, NoTls, Transaction};
use rand::{rngs::OsRng, RngCore};
use std::{
@@ -261,8 +260,6 @@ fn sender(rpc: RPC, mut db: AutoReloadDb) {
/// Listen for mined block and index confirmed transactions into the database
fn watcher(rpc: RPC, mut db: AutoReloadDb, config: &Config) {
- let confirmation = 1;
-
loop {
let db = db.client();
@@ -272,15 +269,19 @@ fn watcher(rpc: RPC, mut db: AutoReloadDb, config: &Config) {
.query_opt("SELECT value FROM state WHERE name='last_hash'", &[])?
.map(|r| BlockHash::from_slice(r.get(0)).unwrap());
// Get all transactions made since this block
- let list =
- rpc.list_since_block(last_hash.as_ref(), Some(confirmation), None, Some(true))?;
+ let list = rpc.list_since_block(
+ last_hash.as_ref(),
+ Some(config.confirmation as usize),
+ None,
+ Some(true),
+ )?;
// Keep only confirmed send and receive transactions
let txs: HashMap<Txid, Category> = list
.transactions
.into_iter()
.filter_map(|tx| {
let cat = tx.detail.category;
- (tx.info.confirmations >= confirmation as i32
+ (tx.info.confirmations >= config.confirmation as i32
&& (cat == Category::Send || cat == Category::Receive))
.then(|| (tx.info.txid, cat))
})
@@ -423,19 +424,20 @@ struct Config {
port: u16,
payto: Url,
address: String,
+ confirmation: u8,
}
impl Config {
pub fn from_path(path: impl AsRef<Path>) -> Self {
- let string = std::fs::read_to_string(path).unwrap();
- let mut conf = Ini::new();
- conf.read(string).unwrap();
+ let conf = ini::Ini::load_from_file(path).unwrap();
+ let conf = conf.section(Some("main")).unwrap();
Self {
- base_url: Url::parse(&conf.get("main", "BASE_URL").unwrap()).unwrap(),
- db_url: conf.get("main", "DB_URL").unwrap(),
- port: conf.get("main", "PORT").unwrap().parse().unwrap(),
- payto: Url::parse(&conf.get("main", "PAYTO").unwrap()).unwrap(),
- address: conf.get("main", "ADDRESS").unwrap(),
+ base_url: Url::parse(&conf.get("BASE_URL").unwrap()).unwrap(),
+ db_url: conf.get("DB_URL").unwrap().to_string(),
+ port: conf.get("PORT").unwrap().parse().unwrap(),
+ payto: Url::parse(&conf.get("PAYTO").unwrap()).unwrap(),
+ address: conf.get("ADDRESS").unwrap().to_string(),
+ confirmation: 5 //conf.get("CONFIRMATION").unwrap().parse().unwrap(),
}
}
}
diff --git a/script/setup.sh b/script/setup.sh
@@ -1,16 +1,19 @@
#!/bin/bash
+# Load test.conf as bash variables
function load_config() {
source <(grep = test.conf | sed 's/ *= */=/' | sed 's/=\(.*\)/="\1"/g1')
BANK_ENDPOINT=http://127.0.0.1:$PORT/
}
+# Start postgresql service and reset database schema
function reset_db() {
# TODO sudo alternative ?
sudo service postgresql start > /dev/null
sudo -u postgres psql $DB_URL < wire-gateway/db/schema.sql > /dev/null
}
+# Start a bitcoind regtest server in a temporary directory
function init_btc() {
BTC_DIR=$(mktemp -d)
BTC_CLI="bitcoin-cli -regtest -datadir=$BTC_DIR"
@@ -18,6 +21,7 @@ function init_btc() {
$BTC_CLI -rpcwait getnetworkinfo > /dev/null
}
+# Start a bitcoind regest server in a previously created temprorary directory and load wallets
function restart_btc() {
BTC_CLI="bitcoin-cli -regtest -datadir=$BTC_DIR"
bitcoind -datadir=$BTC_DIR -txindex -regtest -fallbackfee=0.00000001 &> /dev/null &
@@ -27,6 +31,7 @@ function restart_btc() {
done
}
+# Create test wallets, generate money and load addresses in variables
function setup_btc() {
for wallet in wire client reserve; do
$BTC_CLI createwallet $wallet > /dev/null
@@ -40,13 +45,19 @@ function setup_btc() {
$BTC_CLI generatetoaddress 1 $RESERVE > /dev/null
}
+# Mine previous transactions
function next_btc() {
- # Mine one block
+ # Mine enough block to confirm previous transactions
+ $BTC_CLI generatetoaddress $CONFIRMATION $RESERVE > /dev/null
+ # Wait for btc_wire to catch up
+ sleep 0.3
+ # Mine one more block to trigger btc_wire
$BTC_CLI generatetoaddress 1 $RESERVE > /dev/null
# Wait for btc_wire to catch up
sleep 0.5
}
+# Check client and wire balance
function check_balance() {
CLIENT_BALANCE=`$BTC_CLI -rpcwallet=client getbalance`
WIRE_BALANCE=`$BTC_CLI -rpcwallet=wire getbalance`
@@ -56,14 +67,22 @@ function check_balance() {
fi
}
+# Start btc_wire
function btc_wire() {
cargo build --bin btc-wire &> /dev/null
- target/debug/btc-wire $BTC_DIR &> btc_wire.log &
- # Can be used to test db transactions serialization
- # target/debug/btc-wire $BTC_DIR &>> btc_wire.log &
- # target/debug/btc-wire $BTC_DIR &>> btc_wire.log &
+ target/debug/btc-wire $BTC_DIR &> btc_wire.log &
+}
+
+# Start multiple btc_wire in parralel in fail mode
+function stress_btc_wire() {
+ cargo build --bin btc-wire &> /dev/null
+ target/debug/btc-wire $BTC_DIR &> btc_wire.log &
+ # Can be used to test db transactions serialization
+ target/debug/btc-wire $BTC_DIR &>> btc_wire.log &
+ target/debug/btc-wire $BTC_DIR &>> btc_wire.log &
}
+# Start wire_gateway in test mode
function gateway() {
cargo build --bin wire-gateway --features test &> /dev/null
target/debug/wire-gateway &> gateway.log &
diff --git a/script/test_btc_wire.sh b/script/test_btc_wire.sh
@@ -51,8 +51,7 @@ taler-exchange-wire-gateway-client \
-b $BANK_ENDPOINT \
-C payto://bitcoin/$CLIENT \
-a BTC:0.00002 > /dev/null
-next_btc # Send transaction
-next_btc # Trigger watcher
+next_btc
check_balance 0.99997209 1.00001801
echo " OK"
diff --git a/script/test_recover_db.sh b/script/test_recover_db.sh
@@ -64,8 +64,7 @@ taler-exchange-wire-gateway-client \
-b $BANK_ENDPOINT \
-C payto://bitcoin/$CLIENT \
-a BTC:0.00002 > /dev/null
-next_btc # Send transaction
-next_btc # Trigger watcher
+next_btc
check_balance 0.99992218 1.00006001
echo " OK"
diff --git a/test.conf b/test.conf
@@ -1,6 +1,7 @@
[main]
-BASE_URL = http://test.com
-DB_URL = postgres://localhost/postgres?user=postgres&password=password
-PORT = 8060
-PAYTO = payto://bitcoin/bcrt1qgkgxkjj27g3f7s87mcvjjsghay7gh34cx39prj
-ADDRESS = mpTJZxWPerz1Gife6mQSdHT8mMuJK6FP85
-\ No newline at end of file
+BASE_URL = http://test.com
+DB_URL = postgres://localhost/postgres?user=postgres&password=password
+PORT = 8060
+PAYTO = payto://bitcoin/bcrt1qgkgxkjj27g3f7s87mcvjjsghay7gh34cx39prj
+ADDRESS = mpTJZxWPerz1Gife6mQSdHT8mMuJK6FP85
+CONFIRMATION = 6
+\ No newline at end of file