diff options
-rw-r--r-- | Cargo.lock | 4 | ||||
-rw-r--r-- | btc-wire/src/loops/worker.rs | 3 | ||||
-rw-r--r-- | test/btc/bumpfee.sh | 54 | ||||
-rw-r--r-- | test/common.sh | 2 | ||||
-rw-r--r-- | test/conf/taler_btc_bump.conf | 3 |
5 files changed, 42 insertions, 24 deletions
@@ -1796,9 +1796,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-width" diff --git a/btc-wire/src/loops/worker.rs b/btc-wire/src/loops/worker.rs index a84e373..a1a20fa 100644 --- a/btc-wire/src/loops/worker.rs +++ b/btc-wire/src/loops/worker.rs @@ -265,8 +265,6 @@ fn sync_chain( &[&lastblock.as_ref()], )?; - - dbg!(last_hash, lastblock); Ok(true) } @@ -557,7 +555,6 @@ fn sync_chain_incoming_confirmed( rpc: &mut Rpc, db: &mut Client, ) -> Result<(), LoopError> { - dbg!(id); match rpc.get_tx_segwit_key(id) { Ok((full, reserve_pub)) => { // Store transactions in database diff --git a/test/btc/bumpfee.sh b/test/btc/bumpfee.sh index e1b7c51..58d7818 100644 --- a/test/btc/bumpfee.sh +++ b/test/btc/bumpfee.sh @@ -25,7 +25,6 @@ echo "" SEQ="seq 10 30" - echo -n "Making wire transfer to exchange:" for n in `$SEQ`; do btc-wire-utils -d $WIRE_DIR transfer 0.$n > /dev/null @@ -46,17 +45,45 @@ sleep 1 check_balance 5.79983389 4.19599801 echo " OK" -echo -n "Abandon pending transaction:" +echo -n "Bump relay fee:" restart_btc -minrelaytxfee=0.0001 echo " OK" echo -n "Check bump:" -sleep 6 +sleep 5 mine_btc +sleep 1 check_balance 5.80383389 4.19598010 echo " OK" -echo "----- Bump stress -----" +echo "----- Bump fee reorg -----" + +echo "Loose second bitcoin node" +btc2_deco + +echo -n "Making wire transfer from exchange:" +taler-exchange-wire-gateway-client \ + -b $BANK_ENDPOINT \ + -C payto://bitcoin/$CLIENT \ + -a BTC:0.004 > /dev/null +sleep 1 +check_balance 5.80383389 4.19196020 +echo " OK" + +echo -n "Perform fork and bump relay fee:" +btc2_fork 6 +restart_btc -minrelaytxfee=0.0002 +mine_btc +echo " OK" + +echo -n "Check bump:" +sleep 5 +next_btc +sleep 1 +check_balance 5.80783389 4.19194030 +echo " OK" + +echo "----- Bump fee stress -----" echo -n "Replace btc_wire with stressed btc_wire" kill $WIRE_PID @@ -71,23 +98,18 @@ for n in `$SEQ`; do -a BTC:0.00$n > /dev/null done sleep 5 -check_balance 5.80383389 4.15356220 echo " OK" -echo -n "Abandon pending transaction:" -restart_btc -minrelaytxfee=0.0002 +echo -n "Bump relay fee:" +restart_btc -minrelaytxfee=0.0003 echo " OK" echo -n "Check bump:" -sleep 2 -mine_btc -sleep 2 -mine_btc -sleep 2 -mine_btc -sleep 2 -mine_btc -check_balance 5.84583389 4.15314430 +for n in `seq 0 4`; do + sleep 2 + mine_btc +done +check_balance 5.84983389 4.14868660 echo " OK" echo "All tests passed!"
\ No newline at end of file diff --git a/test/common.sh b/test/common.sh index ccf2546..9b0c0c7 100644 --- a/test/common.sh +++ b/test/common.sh @@ -203,7 +203,7 @@ function btc_wire() { function stress_btc_wire() { cargo build --bin btc-wire --release --features fail &> log/cargo.log target/release/btc-wire $CONF &> log/wire.log & - target/release/btc-wire $CONF &> log/wire.log & + target/release/btc-wire $CONF &> log/wire1.log & } # ----- Ethereum node ----- # diff --git a/test/conf/taler_btc_bump.conf b/test/conf/taler_btc_bump.conf index 859c692..f8a99c5 100644 --- a/test/conf/taler_btc_bump.conf +++ b/test/conf/taler_btc_bump.conf @@ -9,5 +9,4 @@ DB_URL = postgres://localhost:5454/postgres?user=postgres&password=passwo PORT = 8060 PAYTO = payto://bitcoin/bcrt1qgkgxkjj27g3f7s87mcvjjsghay7gh34cx39prj CONFIRMATION = 3 -BOUNCE_FEE = 1000 -BUMP_DELAY = 10
\ No newline at end of file +BUMP_DELAY = 5
\ No newline at end of file |