summaryrefslogtreecommitdiff
path: root/src/auditor/test-auditor.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-17 13:04:37 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-17 13:04:37 +0100
commitb74612fc3362e64dcfb7eacad3602025ccfcf5ea (patch)
treeb823ca6aa32f2e9ef5d5b191ab01c36e9a807d5b /src/auditor/test-auditor.sh
parentff27037d42625084a0b1fadea073389b530776c4 (diff)
downloadexchange-b74612fc3362e64dcfb7eacad3602025ccfcf5ea.tar.gz
exchange-b74612fc3362e64dcfb7eacad3602025ccfcf5ea.tar.bz2
exchange-b74612fc3362e64dcfb7eacad3602025ccfcf5ea.zip
update auditordb and test logic to work with new key separation logic (#6175)
Diffstat (limited to 'src/auditor/test-auditor.sh')
-rwxr-xr-xsrc/auditor/test-auditor.sh21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index 48dc76979..0c9ef4724 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -1305,12 +1305,12 @@ echo "===========22: denomination key expired ================="
H_DENOM=`echo 'SELECT denom_pub_hash FROM reserves_out LIMIT 1;' | psql $DB -Aqt`
-OLD_START=`echo "SELECT valid_from FROM auditor_denominations WHERE denom_pub_hash='${H_DENOM}';" | psql $DB -Aqt`
-OLD_WEXP=`echo "SELECT expire_withdraw FROM auditor_denominations WHERE denom_pub_hash='${H_DENOM}';" | psql $DB -Aqt`
+OLD_START=`echo "SELECT valid_from FROM denominations WHERE denom_pub_hash='${H_DENOM}';" | psql $DB -Aqt`
+OLD_WEXP=`echo "SELECT expire_withdraw FROM denominations WHERE denom_pub_hash='${H_DENOM}';" | psql $DB -Aqt`
# Basically expires 'immediately', so that the withdraw must have been 'invalid'
NEW_WEXP=`expr $OLD_START + 1 || true`
-echo "UPDATE auditor_denominations SET expire_withdraw=${NEW_WEXP} WHERE denom_pub_hash='${H_DENOM}';" | psql -Aqt $DB
+echo "UPDATE denominations SET expire_withdraw=${NEW_WEXP} WHERE denom_pub_hash='${H_DENOM}';" | psql -Aqt $DB
run_audit
@@ -1321,7 +1321,7 @@ jq -e .denomination_key_validity_withdraw_inconsistencies[0] < test-audit-reserv
echo PASS
# Undo modification
-echo "UPDATE auditor_denominations SET expire_withdraw=${OLD_WEXP} WHERE denom_pub_hash='${H_DENOM}';" | psql -Aqt $DB
+echo "UPDATE denominations SET expire_withdraw=${OLD_WEXP} WHERE denom_pub_hash='${H_DENOM}';" | psql -Aqt $DB
}
@@ -1650,7 +1650,7 @@ fi
function test_29() {
echo "===========29: withdraw fee inconsistency ================="
-echo "UPDATE auditor_denominations SET fee_withdraw_frac=5000000 WHERE coin_val=1;" | psql -Aqt $DB
+echo "UPDATE denominations SET fee_withdraw_frac=5000000 WHERE coin_val=1;" | psql -Aqt $DB
run_audit
@@ -1668,7 +1668,7 @@ then
fi
echo "OK"
# Undo
-echo "UPDATE auditor_denominations SET fee_withdraw_frac=2000000 WHERE coin_val=1;" | psql -Aqt $DB
+echo "UPDATE denominations SET fee_withdraw_frac=2000000 WHERE coin_val=1;" | psql -Aqt $DB
}
@@ -1678,7 +1678,7 @@ echo "UPDATE auditor_denominations SET fee_withdraw_frac=2000000 WHERE coin_val=
function test_30() {
echo "===========30: melt fee inconsistency ================="
-echo "UPDATE auditor_denominations SET fee_refresh_frac=5000000 WHERE coin_val=10;" | psql -Aqt $DB
+echo "UPDATE denominations SET fee_refresh_frac=5000000 WHERE coin_val=10;" | psql -Aqt $DB
run_audit
echo -n "Testing inconsistency detection... "
@@ -1697,7 +1697,7 @@ fi
jq -e .emergencies[0] < test-audit-coins.json > /dev/null && exit_fail "Unexpected emergency detected in ordinary run"
echo "OK"
# Undo
-echo "UPDATE auditor_denominations SET fee_refresh_frac=3000000 WHERE coin_val=1;" | psql -Aqt $DB
+echo "UPDATE denominations SET fee_refresh_frac=3000000 WHERE coin_val=1;" | psql -Aqt $DB
}
@@ -1715,7 +1715,7 @@ then
echo "===========31: deposit fee inconsistency ================="
- echo "UPDATE auditor_denominations SET fee_deposit_frac=5000000 WHERE coin_val=8;" | psql -Aqt $DB
+ echo "UPDATE denominations SET fee_deposit_frac=5000000 WHERE coin_val=8;" | psql -Aqt $DB
run_audit aggregator
echo -n "Testing inconsistency detection... "
@@ -1733,7 +1733,7 @@ then
echo "OK"
# Undo
- echo "UPDATE auditor_denominations SET fee_deposit_frac=2000000 WHERE coin_val=8;" | psql -Aqt $DB
+ echo "UPDATE denominations SET fee_deposit_frac=2000000 WHERE coin_val=8;" | psql -Aqt $DB
else
echo "Test skipped (database too new)"
@@ -1821,7 +1821,6 @@ check_with_database()
done
echo "Cleanup (disabled, leaving database $DB behind)"
# dropdb $DB
- rm -r $WIRE_FEE_DIR
}