diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-06-04 21:59:55 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-06-04 22:00:02 +0200 |
commit | a17781ba8d5f875b5150e524174c5f144aa6c0ba (patch) | |
tree | c01f11a3810428471e6399b4961942732a21a1f1 /src/exchangedb/exchange-0001-part.sql | |
parent | 6512456dc2559577867fdce1f7fe7f1b5a12291f (diff) | |
download | exchange-a17781ba8d5f875b5150e524174c5f144aa6c0ba.tar.xz |
-more work on p2p payments and tests thereof
Diffstat (limited to 'src/exchangedb/exchange-0001-part.sql')
-rw-r--r-- | src/exchangedb/exchange-0001-part.sql | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/exchangedb/exchange-0001-part.sql b/src/exchangedb/exchange-0001-part.sql index 0b99e25f9..c79fdf840 100644 --- a/src/exchangedb/exchange-0001-part.sql +++ b/src/exchangedb/exchange-0001-part.sql @@ -3090,6 +3090,7 @@ CREATE OR REPLACE FUNCTION exchange_do_purse_merge( IN in_reserve_sig BYTEA, IN in_partner_url VARCHAR, IN in_reserve_pub BYTEA, + IN in_require_kyc BOOLEAN, OUT out_no_partner BOOLEAN, OUT out_no_balance BOOLEAN, OUT out_no_kyc BOOLEAN, @@ -3197,7 +3198,8 @@ out_conflict=FALSE; ASSERT NOT my_finished, 'internal invariant failed'; -IF in_partner_url IS NULL +IF ( (in_partner_url IS NULL) AND + (in_require_kyc) ) THEN -- Need to do KYC check. SELECT NOT kyc_passed @@ -3272,7 +3274,7 @@ RETURN; END $$; -COMMENT ON FUNCTION exchange_do_purse_merge(BYTEA, BYTEA, INT8, BYTEA, VARCHAR, BYTEA) +COMMENT ON FUNCTION exchange_do_purse_merge(BYTEA, BYTEA, INT8, BYTEA, VARCHAR, BYTEA, BOOLEAN) IS 'Checks that the partner exists, the purse has not been merged with a different reserve and that the purse is full. If so, persists the merge data and either merges the purse with the reserve or marks it as ready for the taler-exchange-router. Caller MUST abort the transaction on failures so as to not persist data by accident.'; @@ -3285,6 +3287,7 @@ CREATE OR REPLACE FUNCTION exchange_do_reserve_purse( IN in_purse_fee_val INT8, IN in_purse_fee_frac INT4, IN in_reserve_pub BYTEA, + IN in_require_kyc BOOLEAN, OUT out_no_funds BOOLEAN, OUT out_no_kyc BOOLEAN, OUT out_no_reserve BOOLEAN, @@ -3350,7 +3353,7 @@ THEN END IF; out_no_reserve=FALSE; -IF (out_no_kyc) +IF (out_no_kyc AND in_require_kyc) THEN out_no_funds=FALSE; RETURN; @@ -3412,6 +3415,12 @@ INSERT INTO account_merges END $$; +COMMENT ON FUNCTION exchange_do_reserve_purse(BYTEA, BYTEA, INT8, BYTEA, BOOLEAN, INT8, INT4, BYTEA, BOOLEAN) + IS 'Create a purse for a reserve.'; + + + + CREATE OR REPLACE FUNCTION exchange_do_account_merge( |