diff options
author | Antoine A <> | 2021-12-27 15:54:08 +0100 |
---|---|---|
committer | Antoine A <> | 2021-12-27 15:54:08 +0100 |
commit | ca6277fe082e3e025cc83d6e2366238c639874c8 (patch) | |
tree | 145600639f51714c2c9d0c8489921d8ffbd31f9e /script | |
parent | e3ac7f84d0c8e134c67d93a401c271dd89f1ac6f (diff) | |
download | depolymerization-ca6277fe082e3e025cc83d6e2366238c639874c8.tar.gz depolymerization-ca6277fe082e3e025cc83d6e2366238c639874c8.tar.bz2 depolymerization-ca6277fe082e3e025cc83d6e2366238c639874c8.zip |
Improve btc_wire architecture to remove Active state
Diffstat (limited to 'script')
-rw-r--r-- | script/setup.sh | 6 | ||||
-rw-r--r-- | script/test_btc_fail.sh | 3 | ||||
-rw-r--r-- | script/test_btc_stress.sh | 13 |
3 files changed, 14 insertions, 8 deletions
diff --git a/script/setup.sh b/script/setup.sh index 2e8381e..bb06920 100644 --- a/script/setup.sh +++ b/script/setup.sh @@ -19,14 +19,14 @@ function reset_db() { function init_btc() { BTC_DIR=$(mktemp -d) BTC_CLI="bitcoin-cli -regtest -datadir=$BTC_DIR" - bitcoind -datadir=$BTC_DIR -txindex -regtest -fallbackfee=0.00000001 &> btc.log & + bitcoind -datadir=$BTC_DIR -txindex -regtest -fallbackfee=0.00000001 -rpcworkqueue=64 &> btc.log & $BTC_CLI -rpcwait getnetworkinfo > /dev/null } -# Start a bitcoind regest server in a previously created temprorary directory and load wallets +# Start a bitcoind regest server in a previously created temporary directory and load wallets function restart_btc() { BTC_CLI="bitcoin-cli -regtest -datadir=$BTC_DIR" - bitcoind -datadir=$BTC_DIR -txindex -regtest -fallbackfee=0.00000001 &>> btc.log & + bitcoind -datadir=$BTC_DIR -txindex -regtest -fallbackfee=0.00000001 -rpcworkqueue=64 &>> btc.log & $BTC_CLI -rpcwait getnetworkinfo > /dev/null for wallet in wire client reserve; do $BTC_CLI loadwallet $wallet > /dev/null diff --git a/script/test_btc_fail.sh b/script/test_btc_fail.sh index 3602364..ae577b2 100644 --- a/script/test_btc_fail.sh +++ b/script/test_btc_fail.sh @@ -65,9 +65,12 @@ for n in `$SEQ`; do -b $BANK_ENDPOINT \ -C payto://bitcoin/$CLIENT \ -a BTC:0.0000$n > /dev/null + mine_btc done sleep 15 mine_btc # Mine transactions +sleep 15 +mine_btc # Mine transactions echo " OK" echo -n "Requesting exchange outgoing transaction list:" diff --git a/script/test_btc_stress.sh b/script/test_btc_stress.sh index c69fdc2..677f9de 100644 --- a/script/test_btc_stress.sh +++ b/script/test_btc_stress.sh @@ -33,7 +33,7 @@ echo "Start gateway" gateway echo "" -SEQ="seq 10 99" +SEQ="seq 10 50" function check() { check_delta "$1?delta=-100" "$SEQ" @@ -48,7 +48,7 @@ for n in `$SEQ`; do done sleep 3 # Give time for btc_wire watcher to process next_btc # Confirm all transactions -sleep 5 # Give time for btc_wire watcher to process +sleep 3 # Give time for btc_wire watcher to process echo " OK" echo -n "Requesting exchange incoming transaction list:" @@ -56,7 +56,7 @@ check incoming echo " OK" echo -n "Check balance:" -check_balance 9.99438310 1.00490500 +check_balance 9.99844569 1.00123000 echo " OK" echo "----- Handle outgoing -----" @@ -71,6 +71,8 @@ for n in `$SEQ`; do done sleep 10 # Give time for btc_wire sender to process next_btc # Mine transactions +sleep 10 # Give time for btc_wire sender to process +next_btc # Mine transactions echo " OK" echo -n "Requesting exchange outgoing transaction list:" @@ -78,9 +80,10 @@ check outgoing echo " OK" echo -n "Check balance:" -check_balance 9.99928810 +check_balance 9.99967569 echo " OK" +next_btc # Mine transactions echo "----- Recover DB -----" echo "Reset database" @@ -98,7 +101,7 @@ echo " OK" echo -n "Check balance:" # Balance should not have changed -check_balance 9.99928810 +check_balance 9.99967569 echo " OK" echo "All tests passed"
\ No newline at end of file |