add more dune deps + use public_names

This commit is contained in:
swrup 2026-03-21 16:31:11 +01:00 committed by Swrup
parent 8bb9d35dda
commit 9fd3b5a3cc
6 changed files with 73 additions and 58 deletions

View file

@ -7,7 +7,7 @@
(public_name mte-validate)
(name validate)
(modules validate)
(libraries mte bos cmdliner))
(libraries mte cmdliner bos fmt fpath))
(cram
(deps

View file

@ -12,53 +12,53 @@ zero_kudos="KUDOS:0.0"
# TODO launch mte.exe and kill it a then end with its PID
offline_tool() {
dune exec offline -- "$@" > /dev/null
mte-offline-tool() {
dune exec mte-offline-tool -- "$@" > /dev/null
}
offline_tool download --output $a --url $url"/management/keys"
offline_tool sign \
mte-offline-tool download --output $a --url $url"/management/keys"
mte-offline-tool sign \
--master_key $master_key \
--input $a \
--output $b
offline_tool upload --input $b --url $url"/management/keys"
mte-offline-tool upload --input $b --url $url"/management/keys"
echo "[OK] /management/keys"
offline_tool download --output $a --url $url"/keys"
mte-offline-tool download --output $a --url $url"/keys"
rsa_pub=$(jq -r '.denominations[0].denoms[0].rsa_pub' $a)
h_denom=$(dune exec offline -- compute-denomination-hash $rsa_pub)
offline_tool revoke-denom \
h_denom=$(dune exec mte-offline-tool -- compute-denomination-hash $rsa_pub)
mte-offline-tool revoke-denom \
--master_key $master_key \
--output $b \
$h_denom
offline_tool upload --input $b --url $url"/management/denominations/"$h_denom"/revoke"
mte-offline-tool upload --input $b --url $url"/management/denominations/"$h_denom"/revoke"
echo "[OK] /management/denominations/\$H_DENOM/revoke"
pub=$(jq -r '.signkeys[0].key' $a)
offline_tool revoke-signkey \
mte-offline-tool revoke-signkey \
--master_key $master_key \
--output $b \
$pub
offline_tool upload --input $b --url $url"/management/signkeys/"$pub"/revoke"
mte-offline-tool upload --input $b --url $url"/management/signkeys/"$pub"/revoke"
echo "[OK] /management/signkeys/\$EXCHANGE_PUB/revoke"
offline_tool enable-auditor \
mte-offline-tool enable-auditor \
--master_key $master_key \
--output $b \
--auditor_url "auditor.example.com" \
--auditor_name "auditor example" \
--auditor_pub $auditor_pub
offline_tool upload --input $b --url $url"/management/auditors"
mte-offline-tool upload --input $b --url $url"/management/auditors"
echo "[OK] /management/auditors"
offline_tool disable-auditor \
mte-offline-tool disable-auditor \
--master_key $master_key \
--output $b \
--auditor_pub $auditor_pub
offline_tool upload --input $b --url $url"/management/auditors/"$auditor_pub"/disable"
mte-offline-tool upload --input $b --url $url"/management/auditors/"$auditor_pub"/disable"
echo "[OK] /management/auditors/\$AUDITOR_PUB/disable"
offline_tool wire-fee \
mte-offline-tool wire-fee \
--master_key $master_key \
--output $b \
--wire_method "x-taler-bank" \
@ -66,10 +66,10 @@ offline_tool wire-fee \
--fee_end 99999999 \
--closing_fee $zero_kudos \
--wire_fee $zero_kudos
offline_tool upload --input $b --url $url"/management/wire-fee"
mte-offline-tool upload --input $b --url $url"/management/wire-fee"
echo "[OK] /management/wire-fee"
offline_tool global-fees \
mte-offline-tool global-fees \
--master_key $master_key \
--output $b \
--start_date 0 \
@ -80,28 +80,28 @@ offline_tool global-fees \
--history_expiration 9999999 \
--purse_account_limit 1 \
--purse_timeout 9999999
offline_tool upload --input $b --url $url"/management/global-fees"
mte-offline-tool upload --input $b --url $url"/management/global-fees"
echo "[OK] /management/global-fees"
offline_tool enable-wire \
mte-offline-tool enable-wire \
--master_key $master_key \
--output $b \
--payto_uri "" \
--bank_label "" \
--priority 4
offline_tool upload --input $b --url $url"/management/wire"
mte-offline-tool upload --input $b --url $url"/management/wire"
echo "[OK] /management/wire"
offline_tool disable-wire \
mte-offline-tool disable-wire \
--master_key $master_key \
--output $b \
--payto_uri ""
offline_tool upload --input $b --url $url"/management/wire/disable"
mte-offline-tool upload --input $b --url $url"/management/wire/disable"
echo "[OK] /management/wire/disable"
# wtid (after base32 decode) must be 32bytes
wtid="000G40R40M30E209185GR38E1W8124GK2GAHC5RR34D1P70X3RFG"
offline_tool drain \
mte-offline-tool drain \
--master_key $master_key \
--output $b \
--debit_account_section "" \
@ -109,12 +109,12 @@ offline_tool drain \
--wtid $wtid \
--date 0 \
--amount $zero_kudos
offline_tool upload --input $b --url $url"/management/drain"
mte-offline-tool upload --input $b --url $url"/management/drain"
echo "[OK] /management/drain"
demo_keys="test/keys.demo.taler.net.v31_0_9.json"
dune exec test/validate_response.exe -- keys --input $demo_keys
mte-validate keys $demo_keys
echo "[OK] exchange.demo.taler.net/keys validation"
offline_tool download --output $a --url $url"/keys"
dune exec test/validate_response.exe -- keys --input $a
mte-offline-tool download --output $a --url $url"/keys"
mte-validate keys $a
echo "[OK] /keys validation"