commit 9f4fc2ac6d7143dc5e396caeab4e50673f0bd199
parent eb2fc17a215fb66392293791d2f5c4fdcbdd54c5
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 8 Oct 2024 12:48:32 +0200
rename deposit_confirmation_serial_id to row_id for consistency
Diffstat:
2 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/src/auditordb/0002-auditor_deposit_confirmations.sql b/src/auditordb/0002-auditor_deposit_confirmations.sql
@@ -15,24 +15,24 @@
--
CREATE TABLE auditor_deposit_confirmations
-(deposit_confirmation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
- ,h_contract_terms BYTEA NOT NULL CHECK (LENGTH(h_contract_terms)=64)
- ,h_policy BYTEA NOT NULL CHECK (LENGTH(h_policy)=64)
- ,h_wire BYTEA NOT NULL CHECK (LENGTH(h_wire)=64)
- ,exchange_timestamp BIGINT NOT NULL
- ,refund_deadline BIGINT NOT NULL
- ,wire_deadline BIGINT NOT NULL
- ,total_without_fee taler_amount NOT NULL
- ,coin_pubs BYTEA[] NOT NULL CHECK (CARDINALITY(coin_pubs)>0)
- ,coin_sigs BYTEA[] NOT NULL CHECK (CARDINALITY(coin_sigs)=CARDINALITY(coin_pubs))
- ,merchant_pub BYTEA NOT NULL CHECK (LENGTH(merchant_pub)=32)
- ,exchange_sig BYTEA NOT NULL CHECK (LENGTH(exchange_sig)=64)
- ,exchange_pub BYTEA NOT NULL CHECK (LENGTH(exchange_pub)=32)
- ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)
- ,suppressed BOOLEAN NOT NULL DEFAULT FALSE
- ,ancient BOOLEAN NOT NULL DEFAULT FALSE
- ,PRIMARY KEY (h_contract_terms,h_wire,merchant_pub,exchange_sig,exchange_pub,master_sig)
- );
+ (row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
+ ,h_contract_terms BYTEA NOT NULL CHECK (LENGTH(h_contract_terms)=64)
+ ,h_policy BYTEA NOT NULL CHECK (LENGTH(h_policy)=64)
+ ,h_wire BYTEA NOT NULL CHECK (LENGTH(h_wire)=64)
+ ,exchange_timestamp BIGINT NOT NULL
+ ,refund_deadline BIGINT NOT NULL
+ ,wire_deadline BIGINT NOT NULL
+ ,total_without_fee taler_amount NOT NULL
+ ,coin_pubs BYTEA[] NOT NULL CHECK (CARDINALITY(coin_pubs)>0)
+ ,coin_sigs BYTEA[] NOT NULL CHECK (CARDINALITY(coin_sigs)=CARDINALITY(coin_pubs))
+ ,merchant_pub BYTEA NOT NULL CHECK (LENGTH(merchant_pub)=32)
+ ,exchange_sig BYTEA NOT NULL CHECK (LENGTH(exchange_sig)=64)
+ ,exchange_pub BYTEA NOT NULL CHECK (LENGTH(exchange_pub)=32)
+ ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)
+ ,suppressed BOOLEAN NOT NULL DEFAULT FALSE
+ ,ancient BOOLEAN NOT NULL DEFAULT FALSE
+ ,PRIMARY KEY (h_contract_terms,h_wire,merchant_pub,exchange_sig,exchange_pub,master_sig)
+ );
COMMENT ON TABLE auditor_deposit_confirmations
IS 'deposit confirmation sent to us by merchants; we must check that the exchange reported these properly.';
diff --git a/src/auditordb/pg_get_deposit_confirmations.c b/src/auditordb/pg_get_deposit_confirmations.c
@@ -80,7 +80,7 @@ deposit_confirmation_cb (void *cls,
size_t num_pubs = 0;
size_t num_sigs = 0;
struct GNUNET_PQ_ResultSpec rs[] = {
- GNUNET_PQ_result_spec_uint64 ("deposit_confirmation_serial_id",
+ GNUNET_PQ_result_spec_uint64 ("row_id",
&dc.row_id),
GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms",
&dc.h_contract_terms),
@@ -174,7 +174,7 @@ TAH_PG_get_deposit_confirmations (
PREPARE (pg,
"auditor_deposit_confirmation_select_desc",
"SELECT"
- " deposit_confirmation_serial_id"
+ " row_id"
",h_contract_terms"
",h_policy"
",h_wire"
@@ -190,15 +190,15 @@ TAH_PG_get_deposit_confirmations (
",master_sig"
",suppressed"
" FROM auditor_deposit_confirmations"
- " WHERE (deposit_confirmation_serial_id < $1)"
+ " WHERE (row_id < $1)"
" AND ($2 OR NOT suppressed)"
- " ORDER BY deposit_confirmation_serial_id DESC"
+ " ORDER BY row_id DESC"
" LIMIT $3"
);
PREPARE (pg,
"auditor_deposit_confirmation_select_asc",
"SELECT"
- " deposit_confirmation_serial_id"
+ " row_id"
",h_contract_terms"
",h_policy"
",h_wire"
@@ -214,9 +214,9 @@ TAH_PG_get_deposit_confirmations (
",master_sig"
",suppressed"
" FROM auditor_deposit_confirmations"
- " WHERE (deposit_confirmation_serial_id > $1)"
+ " WHERE (row_id > $1)"
" AND ($2 OR NOT suppressed)"
- " ORDER BY deposit_confirmation_serial_id ASC"
+ " ORDER BY row_id ASC"
" LIMIT $3"
);
qs = GNUNET_PQ_eval_prepared_multi_select (