1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00

Fixup integration tests

This commit is contained in:
Roman Zeyde 2020-12-01 20:42:33 +02:00
parent b4492e7b67
commit c32e553cac
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB
2 changed files with 5 additions and 6 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import argparse
import client
import json
def main():
parser = argparse.ArgumentParser()
@ -9,7 +10,7 @@ def main():
args = parser.parse_args()
conn = client.Client((args.host, args.port))
print(conn.call("server.version", "health_check", "1.4")["result"])
print(json.dumps(conn.call("server.version", "health_check", "1.4")["result"]))
if __name__ == '__main__':
main()

View File

@ -22,25 +22,23 @@ echo `$BTC getblockchaininfo | jq -r '"Generated \(.blocks) regtest blocks (\(.s
TIP=`$BTC getbestblockhash`
$BTC getblocklocations $TIP 1000 > /dev/null # make sure the new RPC works
echo "Starting `electrs -V`..."
export RUST_LOG=electrs=debug
electrs --db-dir=data/electrs --daemon-dir=data/bitcoin --network=regtest 2> data/electrs/regtest-debug.log &
sleep 1
ELECTRS_VERSION=`contrib/health_check.py localhost 60401 | jq -r .[0]`
TIP_HEADER=`contrib/get_tip.py localhost 60401`
test `jq -r .height <<< "$TIP_HEADER"` == 110 # Make sure electrs is synced to the tip
echo "Started ${ELECTRS_VERSION/\// } with `jq -r .height <<< "$TIP_HEADER"` blocks indexed"
test `jq -r .hex <<< "$TIP_HEADER"` == `$BTC getblockheader $TIP false`
echo "Starting Electrum daemon..."
$ELECTRUM daemon --server localhost:60401:t -1 -vDEBUG 2> data/electrum/regtest-debug.log &
sleep 1
$EL getinfo | jq -c .
echo "Loading Electrum wallet..."
test `$EL load_wallet` == "true"
sleep 1
$EL getinfo | jq -c .
echo "Running integration tests:"
echo " * getbalance"