diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-07-29 23:01:06 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-07-29 23:01:15 +0200 |
commit | e47e5c0cfba7746263775e8bbd4064b640f69020 (patch) | |
tree | 4d853f7e1d065a198b32dd14d38df179cf288e15 /src/exchangedb/exchange_do_batch_coin_known.sql | |
parent | ecf6b2750bb6ed9157aece72602dd042a50e36f3 (diff) | |
download | exchange-e47e5c0cfba7746263775e8bbd4064b640f69020.tar.xz |
migration to new amount style for exchangedb
Diffstat (limited to 'src/exchangedb/exchange_do_batch_coin_known.sql')
-rw-r--r-- | src/exchangedb/exchange_do_batch_coin_known.sql | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/src/exchangedb/exchange_do_batch_coin_known.sql b/src/exchangedb/exchange_do_batch_coin_known.sql index f6a14cfab..db96cb08c 100644 --- a/src/exchangedb/exchange_do_batch_coin_known.sql +++ b/src/exchangedb/exchange_do_batch_coin_known.sql @@ -53,7 +53,7 @@ BEGIN WITH dd AS ( SELECT denominations_serial, - coin_val, coin_frac + coin FROM denominations WHERE denom_pub_hash IN @@ -87,16 +87,14 @@ SELECT denominations_serial, age_commitment_hash, denom_sig, - remaining_val, - remaining_frac + remaining ) SELECT ir.coin_pub, dd.denominations_serial, ir.age_commitment_hash, ir.denom_sig, - dd.coin_val, - dd.coin_frac + dd.coin FROM input_rows ir JOIN dd ON dd.denom_pub_hash = ir.denom_pub_hash @@ -218,7 +216,7 @@ BEGIN WITH dd AS ( SELECT denominations_serial, - coin_val, coin_frac + coin FROM denominations WHERE denom_pub_hash IN @@ -242,16 +240,14 @@ SELECT denominations_serial, age_commitment_hash, denom_sig, - remaining_val, - remaining_frac + remaining ) SELECT ir.coin_pub, dd.denominations_serial, ir.age_commitment_hash, ir.denom_sig, - dd.coin_val, - dd.coin_frac + dd.coin FROM input_rows ir JOIN dd ON dd.denom_pub_hash = ir.denom_pub_hash @@ -324,7 +320,7 @@ BEGIN WITH dd AS ( SELECT denominations_serial, - coin_val, coin_frac + coin FROM denominations WHERE denom_pub_hash IN @@ -344,16 +340,14 @@ SELECT denominations_serial, age_commitment_hash, denom_sig, - remaining_val, - remaining_frac + remaining ) SELECT ir.coin_pub, dd.denominations_serial, ir.age_commitment_hash, ir.denom_sig, - dd.coin_val, - dd.coin_frac + dd.coin FROM input_rows ir JOIN dd ON dd.denom_pub_hash = ir.denom_pub_hash @@ -430,8 +424,8 @@ BEGIN in_denom_sig2 AS denom_sig WHERE i = 2 ); - WITH dd (denominations_serial, coin_val, coin_frac) AS ( - SELECT denominations_serial, coin_val, coin_frac + WITH dd (denominations_serial, coin) AS ( + SELECT denominations_serial, coin FROM denominations WHERE denom_pub_hash = ins_values.denom_pub_hash ), @@ -444,15 +438,13 @@ BEGIN denominations_serial, age_commitment_hash, denom_sig, - remaining_val, - remaining_frac + remaining ) SELECT input_rows.coin_pub, dd.denominations_serial, ins_values.age_commitment_hash, ins_values.denom_sig, - coin_val, - coin_frac + coin FROM dd CROSS JOIN input_rows ON CONFLICT DO NOTHING |