aboutsummaryrefslogtreecommitdiff
path: root/src/auditor
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-09-15 23:43:53 +0200
committerChristian Grothoff <christian@grothoff.org>2024-09-15 23:43:53 +0200
commit21b069168adbf913ef9dd7e7a6208d9595d1b8d4 (patch)
tree908d926bdbd3f45e24ab629af8abf2f7ed81a347 /src/auditor
parentc26c2ae784bc8fd4deac16b95b289a209584a869 (diff)
modernize test-31
Diffstat (limited to 'src/auditor')
-rwxr-xr-xsrc/auditor/test-auditor.sh27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index 97a378b7e..b5ece1fcf 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -2030,9 +2030,7 @@ function test_30() {
# Test where fees known to the auditor differ from those
# accounted for by the exchange
-# FIXME: test-31 not modernized
function test_31() {
-
echo "===========31: deposit fee inconsistency ================="
echo "UPDATE exchange.denominations SET fee_deposit.frac=5000000 WHERE (coin).val=8;" | psql -Aqt "$DB"
@@ -2042,23 +2040,13 @@ function test_31() {
echo -n "Testing inconsistency detection... "
- call_endpoint "balances" "coin_irregular_loss"
- call_endpoint "bad-sig-losses"
-
- AMOUNT=$(jq -r .balances[0].balance_value < "${MY_TMP_DIR}/coin_irregular_loss.json")
- if [ "$AMOUNT" == "TESTKUDOS:0" ]
- then
- exit_fail "Reported total amount wrong: $AMOUNT"
- fi
-
- OP=$(jq -r --arg dep "deposit" '.bad_sig_losses[] | select(.operation == $dep) | .operation' \
- < "${MY_TMP_DIR}/bad-sig-losses.json" | head -n1)
- if [ "$OP" != "deposit" ]
- then
- exit_fail "Reported wrong operation: $OP"
- fi
-
- echo "OK"
+ check_not_balance \
+ "coin_irregular_loss" \
+ "TESTKUDOS:0" \
+ "Reported total coin_irregular_loss wrong"
+ check_report \
+ "bad-sig-losses" \
+ "operation" "deposit"
# Undo
echo "UPDATE exchange.denominations SET fee_deposit.frac=2000000 WHERE (coin).val=8;" | psql -Aqt "$DB"
stop_auditor_httpd
@@ -2071,7 +2059,6 @@ function test_31() {
# Test where denom_sig in known_coins table is wrong
# (=> bad signature)
function test_32() {
-
echo "===========32: known_coins signature wrong w. aggregation================="
# Modify denom_sig, so it is wrong
OLD_SIG=$(echo 'SELECT denom_sig FROM exchange.known_coins LIMIT 1;' | psql "$DB" -Aqt)