diff options
author | Christian Blättler <blatc2@bfh.ch> | 2023-12-19 17:54:25 +0100 |
---|---|---|
committer | Christian Blättler <blatc2@bfh.ch> | 2023-12-19 17:54:25 +0100 |
commit | 9fb19a985d13867de9cb095915308f2e98d5d184 (patch) | |
tree | d6e4d82b728deae33cc31e2292a429c8f65916a9 | |
parent | 62448125fbffb3bdd50fb5b5abc0d25e2449f8c6 (diff) | |
parent | a911845ccdc46a64d0249b545e21a04524595bd8 (diff) | |
download | exchange-9fb19a985d13867de9cb095915308f2e98d5d184.tar.xz |
Merge branch 'master' into feature/tokens
41 files changed, 950 insertions, 648 deletions
diff --git a/contrib/ci/Containerfile b/contrib/ci/Containerfile index 8b0792166..77239820e 100644 --- a/contrib/ci/Containerfile +++ b/contrib/ci/Containerfile @@ -25,22 +25,17 @@ RUN apt-get update -yqq && \ python3-sphinx-rtd-theme \ recutils \ texinfo \ - zlib1g-dev - -# Debian packaging tools -RUN apt-get install -yqq \ + zlib1g-dev \ + # Debian packaging tools \ po-debconf \ build-essential \ debhelper-compat \ - devscripts - -# Documentation dependencies -RUN apt-get install -yqq \ + devscripts \ + git-buildpackage \ + # Documentation dependencies \ doxygen \ - graphviz - -# Test suite dependencies -RUN apt-get install -yqq \ + graphviz \ + # Test suite dependencies \ jq \ postgresql \ sudo \ diff --git a/contrib/ci/ci.sh b/contrib/ci/ci.sh new file mode 100755 index 000000000..47c7a211e --- /dev/null +++ b/contrib/ci/ci.sh @@ -0,0 +1,34 @@ +#!/bin/bash +set -exvuo pipefail + +# Use podman if available, otherwise use docker. +# Fails if neither is found in PATH +OCI_RUNTIME=$(which podman || which docker) +REPO_NAME=$(basename "${PWD}") +JOB_NAME="${1}" +JOB_CONTAINER=$((grep CONTAINER_NAME contrib/ci/jobs/${JOB_NAME}/config.ini | cut -d' ' -f 3) || echo "${REPO_NAME}") +JOB_ARCH=$((grep CONTAINER_ARCH contrib/ci/jobs/${JOB_NAME}/config.ini | cut -d' ' -f 3) || echo "${2:-amd64}") +CONTAINER_BUILD=$((grep CONTAINER_BUILD contrib/ci/jobs/${JOB_NAME}/config.ini | cut -d' ' -f 3) || echo "True") + +echo "${JOB_CONTAINER}" + +if [ "${CONTAINER_BUILD}" = "True" ] ; then + "${OCI_RUNTIME}" build \ + --arch "${JOB_ARCH}" \ + -t "${JOB_CONTAINER}" \ + -f contrib/ci/Containerfile . +fi + +"${OCI_RUNTIME}" run \ + --rm \ + -ti \ + --arch "${JOB_ARCH}" \ + --env CI_COMMIT_REF="$(git rev-parse HEAD)" \ + --volume "${PWD}":/workdir \ + --workdir /workdir \ + "${JOB_CONTAINER}" \ + contrib/ci/jobs/"${JOB_NAME}"/job.sh + +top_dir=$(dirname "${BASH_SOURCE[0]}") + +#"${top_dir}"/build.sh diff --git a/contrib/ci/jobs/0-codespell/dictionary.txt b/contrib/ci/jobs/0-codespell/dictionary.txt index b4d643349..f4ffa7945 100644 --- a/contrib/ci/jobs/0-codespell/dictionary.txt +++ b/contrib/ci/jobs/0-codespell/dictionary.txt @@ -17,15 +17,18 @@ acn ba bre cant +clen complet doas ect ehr fo +ges hel ifset ist keypair +nam nd onl openin diff --git a/contrib/ci/jobs/0-codespell/job.sh b/contrib/ci/jobs/0-codespell/job.sh index b9c5c9963..41d11a1bc 100755 --- a/contrib/ci/jobs/0-codespell/job.sh +++ b/contrib/ci/jobs/0-codespell/job.sh @@ -3,4 +3,97 @@ set -exuo pipefail job_dir=$(dirname "${BASH_SOURCE[0]}") -codespell -I "${job_dir}"/dictionary.txt -S "*.bib,*.bst,*.cls,*.json,*.png,*.svg,*.wav,*.gz,*/templating/test?/**,**/auditor/*.sql,**/templating/mustach**,*.fees,*key,*.tag,*.info,*.latexmkrc,*.ecc,*.jpg,*.zkey,*.sqlite,*/contrib/hellos/**,*/vpn/tests/**,**/valgrind.h,*.priv,*.file,*.tgz,*.woff,*.gif,*.odt,*.fee,*.deflate,*.dat,*.jpeg,*.eps,*.odg,*/m4/ax_lib_postgresql.m4,*/m4/libgcrypt.m4,*.rpath,config.status,ABOUT-NLS,*/doc/texinfo.tex,*.PNG,*.??.json,*.docx,*.ods,*.doc,*.docx,*.xcf,*.xlsx,*.ecc,*.ttf,*.woff2,*.eot,*.ttf,*.eot,*.mp4,*.pptx,*.epgz,*.min.js,**/*.map,**/fonts/**,*.pack.js,*.po,*.bbl,*/afl-tests/*,*/.git/**,*.pdf,*.epub,**/signing-key.asc,**/pnpm-lock.yaml,**/*.svg,**/*.cls,**/rfc.bib,**/*.bst,*/cbdc-es.tex,*/cbdc-it.tex,**/ExchangeSelection/example.ts,*/testcurl/test_tricky.c,*/i18n/strings.ts,*/src/anastasis-data.ts,**/doc/flows/main.de.tex" +skip=$(cat <<EOF +ABOUT-NLS +*/afl-tests/* +**/auditor/*.sql +*.bbl +*.bib +*build-aux* +*.bst +*.cache/* +*/cbdc-es.tex +*/cbdc-it.tex +*.cls +configure* +config.status +*/contrib/* +*/contrib/hellos/** +*.dat +*.deflate +*.doc +*/doc/* +**/doc/flows/main.de.tex +*/doc/texinfo.tex +*.docx +*.ecc +*.eot +*.epgz +*.eps +*.epub +**/ExchangeSelection/example.ts +*.fee +*.fees +*.file +**/fonts/** +*.gif +*/.git/** +*.gz +*/i18n/strings.ts +*.info +*.jpeg +*.jpg +*.??.json +*.json +*/keys/* +*key +*.latexmkrc +*libtool* +*.log +*/m4/* +*.m4 +**/*.map +*.min.js +*.mp4 +*.odg +*.ods +*.odt +*.pack.js +*.pdf +*.png +*.PNG +**/pnpm-lock.yaml +*.po +*.pptx +*.priv +**/rfc.bib +*.rpath +**/signing-key.asc +*.sqlite +*/src/anastasis-data.ts +**/*.svg +*.svg +*.tag +**/templating/mustach** +*/templating/test?/** +*/testcurl/test_tricky.c +*/debian/tmp/** +*/debian/taler-exchange/** +*/debian/.debhelper/** +*.tgz +*.ttf +*.ttf +**/valgrind.h +*/vpn/tests/** +*.wav +*.woff +*.woff2 +*.xcf +*.xlsx +*.zkey +EOF +); + +echo Current directory: `pwd` + +codespell -I "${job_dir}"/dictionary.txt -S ${skip//$'\n'/,} diff --git a/contrib/ci/jobs/1-build/build.sh b/contrib/ci/jobs/1-build/build.sh index b11374291..35faf0ac5 100755 --- a/contrib/ci/jobs/1-build/build.sh +++ b/contrib/ci/jobs/1-build/build.sh @@ -1,6 +1,9 @@ #!/bin/bash set -exuo pipefail +apt-get update +apt-get upgrade -yqq + ./bootstrap ./configure CFLAGS="-ggdb -O0" \ --enable-logging=verbose \ diff --git a/contrib/ci/jobs/2-test/config.ini b/contrib/ci/jobs/2-test/config.ini new file mode 100644 index 000000000..c5a77c031 --- /dev/null +++ b/contrib/ci/jobs/2-test/config.ini @@ -0,0 +1,6 @@ +[build] +HALT_ON_FAILURE = False +WARN_ON_FAILURE = True +CONTAINER_BUILD = True +CONTAINER_NAME = exchange +CONTAINER_ARCH = amd64 diff --git a/contrib/ci/jobs/2-test/test.sh b/contrib/ci/jobs/2-test/test.sh index 39fca5c16..4c4142309 100755 --- a/contrib/ci/jobs/2-test/test.sh +++ b/contrib/ci/jobs/2-test/test.sh @@ -1,6 +1,9 @@ #!/bin/bash set -evu +apt-get update +apt-get upgrade -yqq + ./bootstrap ./configure CFLAGS="-ggdb -O0" \ --enable-logging=verbose \ diff --git a/contrib/ci/jobs/3-docs/config.ini b/contrib/ci/jobs/3-docs/config.ini new file mode 100644 index 000000000..c5a77c031 --- /dev/null +++ b/contrib/ci/jobs/3-docs/config.ini @@ -0,0 +1,6 @@ +[build] +HALT_ON_FAILURE = False +WARN_ON_FAILURE = True +CONTAINER_BUILD = True +CONTAINER_NAME = exchange +CONTAINER_ARCH = amd64 diff --git a/contrib/ci/jobs/4-deb-package/job.sh b/contrib/ci/jobs/4-deb-package/job.sh index dc78cdf24..adc2a777b 100755 --- a/contrib/ci/jobs/4-deb-package/job.sh +++ b/contrib/ci/jobs/4-deb-package/job.sh @@ -3,22 +3,21 @@ set -exuo pipefail # This file is in the public domain. # Helper script to build the latest DEB packages in the container. -unset LD_LIBRARY_PATH - -git apply ./ci/jobs/2-deb-package/install-fix.patch - -# Get current version from debian/control file. -DEB_VERSION=$(dpkg-parsechangelog -S Version) +unset LD_LIBRARY_PATH # Install build-time dependencies. +# Update apt cache first +apt-get update +apt-get upgrade -y mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control -# We do a sparse checkout, so we need to hint -# the version to the build system. -echo $DEB_VERSION > .version +export VERSION="$(./contrib/ci/jobs/4-deb-package/version.sh)" +echo "Building package version ${VERSION}" +EMAIL=none gbp dch --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}" ./bootstrap dpkg-buildpackage -rfakeroot -b -uc -us -ls ../*.deb -mv ../*.deb /artifacts/ +ls -alh ../*.deb +mkdir -p /artifacts/exchange/${CI_COMMIT_REF} # Variable comes from CI environment +mv ../*.deb /artifacts/exchange/${CI_COMMIT_REF}/ diff --git a/contrib/ci/jobs/4-deb-package/version.sh b/contrib/ci/jobs/4-deb-package/version.sh new file mode 100755 index 000000000..d2647785e --- /dev/null +++ b/contrib/ci/jobs/4-deb-package/version.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -ex + +BRANCH=$(git name-rev --name-only HEAD) +if [ -z "${BRANCH}" ]; then + exit 1 +else + # "Unshallow" our checkout, but only our current branch, and exclude the submodules. + git fetch --no-recurse-submodules --tags --depth=1000 origin "${BRANCH}" + RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --always --abbrev=0 HEAD || exit 1) + commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)" + if [ "${commits}" = "0" ]; then + git describe --tag HEAD || exit 1 + else + echo $(echo ${RECENT_VERSION_TAG} | sed -r 's/^v//')-${commits}-$(git rev-parse --short=8 HEAD) + fi +fi diff --git a/contrib/ci/jobs/5-deploy-package/config.ini b/contrib/ci/jobs/5-deploy-package/config.ini new file mode 100644 index 000000000..8d6409a6e --- /dev/null +++ b/contrib/ci/jobs/5-deploy-package/config.ini @@ -0,0 +1,5 @@ +[build] +HALT_ON_FAILURE = True +WARN_ON_FAILURE = True +CONTAINER_BUILD = False +CONTAINER_NAME = nixery.dev/shell/rsync diff --git a/contrib/ci/jobs/5-deploy-package/job.sh b/contrib/ci/jobs/5-deploy-package/job.sh new file mode 100755 index 000000000..d39cf9987 --- /dev/null +++ b/contrib/ci/jobs/5-deploy-package/job.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -exuo pipefail + +ARTIFACT_PATH="/artifacts/exchange/${CI_COMMIT_REF}/*.deb" + +RSYNC_HOST="taler.host.internal" +RSYNC_PORT=424242 +RSYNC_PATH="incoming_packages/bookworm-taler-ci/" +RSYNC_DEST="rsync://${RSYNC_HOST}/${RSYNC_PATH}" + + +rsync -vP \ + --port ${RSYNC_PORT} \ + ${ARTIFACT_PATH} ${RSYNC_DEST} diff --git a/contrib/exchange-tos-v0.rst b/contrib/exchange-tos-v0.rst index f4d0e9987..0a61e756b 100644 --- a/contrib/exchange-tos-v0.rst +++ b/contrib/exchange-tos-v0.rst @@ -1,15 +1,13 @@ -Terms of Service -================ +# Terms of Service -Last updated: 1.11.2023 +## Last update: 14.12.2023 Welcome! Taler Systems SA (“we,” “our,” or “us”) provides a payment service through our Internet presence (collectively the “Services”). Before using our Services, please read the Terms of Service (the “Terms” or the “Agreement”) carefully. -Overview --------- +## Overview This section provides a brief summary of the highlights of this Agreement. Please note that when you accept this Agreement, you are accepting @@ -19,36 +17,35 @@ Wallet’s self-hosted personal payment application. When using the Taler Wallet to interact with our Services, you are agreeing to our Terms, so please read carefully. -Highlights: -~~~~~~~~~~~ +## Highlights: + - You are responsible for keeping the data in your Taler Wallet at all times - under your control. Any losses arising from you not being in control of - your private information are your problem. +under your control. Any losses arising from you not being in control of +your private information are your problem. - We will try to transfer funds we hold in escrow for our users to any legal - recipient to the best of our ability within the limitations of the law and - our implementation. However, the Services offered today are highly - experimental and the set of recipients of funds is severely restricted. +recipient to the best of our ability within the limitations of the law and +our implementation. However, the Services offered today are highly +experimental and the set of recipients of funds is severely restricted. - For our Services, we may charge transaction fees. The specific fee structure - is provided based on the Taler protocol and should be shown to you when you - withdraw electronic coins using a Taler Wallet. You agree and understand - that the Taler protocol allows for the fee structure to change. +is provided based on the Taler protocol and should be shown to you when you +withdraw electronic coins using a Taler Wallet. You agree and understand +that the Taler protocol allows for the fee structure to change. - You agree to not intentionally overwhelm our systems with requests and - follow responsible disclosure if you find security issues in our services. +follow responsible disclosure if you find security issues in our services. - We cannot be held accountable for our Services not being available due to - circumstances beyond our control. If we modify or terminate our services, - we will try to give you the opportunity to recover your funds. However, - given the experimental state of the Services today, this may not be - possible. You are strongly advised to limit your use of the Service - to small-scale experiments expecting total loss of all funds. +circumstances beyond our control. If we modify or terminate our services, +we will try to give you the opportunity to recover your funds. However, +given the experimental state of the Services today, this may not be +possible. You are strongly advised to limit your use of the Service +to small-scale experiments expecting total loss of all funds. These terms outline approved uses of our Services. The Services and these Terms are still at an experimental stage. If you have any questions or comments related to this Agreement, please send us a message to -legal@taler-systems.com. If you do not agree to this Agreement, you must not +<legal@taler-systems.com>. If you do not agree to this Agreement, you must not use our Services. -How you accept this policy --------------------------- +## How you accept this policy By sending funds to us (to top-up your Taler Wallet), you acknowledge that you have read, understood, and agreed to these Terms. We reserve the right to @@ -62,18 +59,17 @@ signify your acceptance to be bound by the then current Terms. Please check the effective date above to determine if there have been any changes since you have last reviewed these Terms. -Services --------- +## Services We will try to transfer funds that we hold in escrow for our users to any legal recipient to the best of our ability and within the limitations of the law and our implementation. However, the Services offered today are highly -experimental and the set of recipients of funds is severely restricted. The +experimental and the set of recipients of funds is severely restricted. The Taler Wallet can be loaded by exchanging fiat currencies against electronic coins. We are providing this exchange service. Once your Taler Wallet is loaded with electronic coins they can be spent for purchases if the seller is accepting Taler as a means of payment. We are not guaranteeing that any seller -is accepting Taler at all or a particular seller. The seller or recipient of +is accepting Taler at all or a particular seller. The seller or recipient of deposits of electronic coins must specify the target account, as per the design of the Taler protocol. They are responsible for following the protocol and specifying the correct bank account, and are solely liable for any losses @@ -89,15 +85,13 @@ to do so. When using our Services, you agree to not take any action that intentionally imposes an unreasonable load on our infrastructure. If you find security problems in our Services, you agree to first report them to -security@taler-systems.com and grant us the right to publish your report. We +<security@taler-systems.com> and grant us the right to publish your report. We warrant that we will ourselves publicly disclose any issues reported within 3 months, and that we will not prosecute anyone reporting security issues if they did not exploit the issue beyond a proof-of-concept, and followed the above responsible disclosure practice. - -Fees ----- +## Fees You agree to pay the fees for exchanges and withdrawals completed via the Taler Wallet ("Fees") as defined by us, which we may change from time to @@ -106,15 +100,14 @@ for any electronic coin at the time of withdrawal and fixed throughout the validity period of the respective electronic coin. Your wallet should obtain and display applicable fees when withdrawing funds. Fees for coins obtained as change may differ from the fees applicable to the original coin. Wire transfer -fees that are independent from electronic coins may change annually. You +fees that are independent from electronic coins may change annually. You authorize us to charge or deduct applicable fees owed in connection with deposits, exchanges and withdrawals following the rules of the Taler protocol. We reserve the right to provide different types of rewards to users either in the form of discount for our Services or in any other form at our discretion and without prior notice to you. -Eligibility and Financial self-responsibility ---------------------------------------------- +## Eligibility and Financial self-responsibility To be eligible to use our Services, you must be able to form legally binding contracts or have the permission of your legal guardian. By using our @@ -128,23 +121,20 @@ by the software to minimize the chances to losse access to or control over your Wallet data. We will not be liable for any loss or damage arising from your failure to comply with this paragraph. -Copyrights and trademarks -------------------------- +## Copyrights and trademarks The Taler Wallet is released under the terms of the GNU General Public License (GNU GPL). You have the right to access, use, and share the Taler Wallet, in modified or unmodified form. However, the GPL is a strong copyleft license, which means that any derivative works must be distributed under the same license terms as the original software. If you have any questions, you should -review the GNU GPL’s full terms and conditions at -https://www.gnu.org/licenses/gpl-3.0.en.html. “Taler” itself is a trademark +review the GNU GPL’s full terms and conditions on [the GNU GPL Licenses page] +(https://www.gnu.org/licenses/gpl-3.0.en.html). “Taler” itself is a trademark of Taler Systems SA. You are welcome to use the name in relation to processing -payments using the Taler protocol, assuming your use is compatible with an +payments based on the Taler protocol, assuming your use is compatible with an official release from the GNU Project that is not older than two years. - -Limitation of liability & disclaimer of warranties --------------------------------------------------- +## Limitation of liability & disclaimer of warranties You understand and agree that we have no control over, and no duty to take any action regarding: Failures, disruptions, errors, or delays in processing that @@ -153,22 +143,20 @@ software, and Internet connections; The risk of malicious software being introduced or found in the software underlying the Taler Wallet; The risk that third parties may obtain unauthorized access to information stored within your Taler Wallet, including, but not limited to your Taler Wallet coins or backup -encryption keys. You release us from all liability related to any losses, +encryption keys. You release us from all liability related to any losses, damages, or claims arising from: -(a) user error such as forgotten passwords, incorrectly constructed - transactions; -(b) server failure or data loss; -(c) unauthorized access to the Taler Wallet application; -(d) bugs or other errors in the Taler Wallet software; and -(e) any unauthorized third party activities, including, but not limited to, - the use of viruses, phishing, brute forcing, or other means of attack - against the Taler Wallet. We make no representations concerning any - Third Party Content contained in or accessed through our Services. +1. user error such as forgotten passwords, incorrectly constructed transactions; +2. server failure or data loss; +3. unauthorized access to the Taler Wallet application; +4. bugs or other errors in the Taler Wallet software; and +5. any unauthorized third party activities, including, but not limited to, +the use of viruses, phishing, brute forcing, or other means of attack +against the Taler Wallet. We make no representations concerning any +Third Party Content contained in or accessed through our Services. Any other terms, conditions, warranties, or representations associated with -such content, are solely between you and such organizations and/or -individuals. +such content, are solely between you and such organizations and/or individuals. To the fullest extent permitted by applicable law, in no event will we or any of our officers, directors, representatives, agents, servants, counsel, @@ -177,19 +165,17 @@ acting, or purporting to act on our behalf (collectively the “Taler Parties” be liable to you under contract, tort, strict liability, negligence, or any other legal or equitable theory, for: -(a) any lost profits, data loss, cost of procurement of substitute goods or - services, or direct, indirect, incidental, special, punitive, compensatory, - or consequential damages of any kind whatsoever resulting from: - - (i) your use of, or conduct in connection with, our services; - (ii) any unauthorized use of your wallet and/or private key due to your - failure to maintain the confidentiality of your wallet; - (iii) any interruption or cessation of transmission to or from the services; or - (iv) any bugs, viruses, trojan horses, or the like that are found in the Taler - Wallet software or that may be transmitted to or through our services by - any third party (regardless of the source of origination), or - -(b) any direct damages. +1. any lost profits, data loss, cost of procurement of substitute goods or services, +or direct, indirect, incidental, special, punitive, compensatory, +or consequential damages of any kind whatsoever resulting from: + - your use of, or conduct in connection with, our services; + - any unauthorized use of your wallet and/or private key due to your failure +to maintain the confidentiality of your wallet; + - any interruption or cessation of transmission to or from the services; or + - any bugs, viruses, trojan horses, or the like that are found in the Taler +Wallet software or that may be transmitted to or through our services by any +third party (regardless of the source of origination), or +2. any direct damages. These limitations apply regardless of legal theory, whether based on tort, strict liability, breach of contract, breach of warranty, or any other legal @@ -214,8 +200,7 @@ implied warranties, so the foregoing disclaimers may not apply to you. This paragraph gives you specific legal rights and you may also have other legal rights that vary from state to state. -Indemnity and Time limitation on claims and Termination -------------------------------------------------------- +## Indemnity and Time limitation on claims and Termination To the extent permitted by applicable law, you agree to defend, indemnify, and hold harmless the Taler Parties from and against any and all claims, damages, @@ -233,8 +218,7 @@ In the event of termination concerning your use of our Services, your obligations under this Agreement will still continue. -Discontinuance of services and Force majeure --------------------------------------------- +## Discontinuance of services and Force majeure We may, in our sole discretion and without cost to you, with or without prior notice, and at any time, modify or discontinue, temporarily or permanently, @@ -256,9 +240,7 @@ services, failure of equipment and/or software, other catastrophe, or any other occurrence which is beyond our reasonable control and shall not affect the validity and enforceability of any remaining provisions. - -Governing law, Waivers, Severability and Assignment ---------------------------------------------------- +## Governing law, Waivers, Severability and Assignment No matter where you’re located, the laws of Switzerland will govern these Terms. If any provisions of these Terms are inconsistent with any applicable @@ -287,9 +269,7 @@ prior versions of this Agreement) and every nature between us. Except as provided for above, any modification to this Agreement must be in writing and must be signed by both parties. - -Questions or comments ---------------------- +## Questions or comments We welcome comments, questions, concerns, or suggestions. Please send us a -message on our contact page at legal@taler-systems.com. +message on our contact page at <legal@taler-systems.com>. diff --git a/contrib/gana b/contrib/gana -Subproject 2ccbe6a28c86fb1618d30b3d76d9fd70c95203a +Subproject ec6c82120f0c3dca85429b86652fd25d3c25a88 diff --git a/contrib/taler-terms-generator.in b/contrib/taler-terms-generator.in index 33c4bed35..04f7ec3e5 100755 --- a/contrib/taler-terms-generator.in +++ b/contrib/taler-terms-generator.in @@ -41,6 +41,7 @@ needs_sphinx = '1.8.5' extensions = [ 'sphinx.ext.todo', 'sphinx.ext.imgmath', + 'sphinx_markdown_builder', ] templates_path = ['_templates'] source_suffix = { @@ -86,6 +87,14 @@ epub_title = "%TITLE%" EOF } +# Output file given as first argument to stderr, then exit with a failure. +function failcat () +{ + cat "$1" 1>&2 + exit 1 +} + + # defaults AUTHOR="GNU Taler team" VERSION="exchange-tos-v0" @@ -198,7 +207,8 @@ then -d "${BUILDDIR}/.doctrees" \ "${BUILDDIR}" \ "${LOCALE_DIR}/${ADD_LANGUAGE}/LC_MESSAGES/" \ - &> "${BUILDDIR}/add-language.log" + &> "${BUILDDIR}/add-language.log" \ + || failcat "${BUILDDIR}/add-language.log" if [ -f "${LOCALE_DIR}/${ADD_LANGUAGE}/LC_MESSAGES/${VERSION_BASENAME}.po" ] then msgmerge --lang="${ADD_LANGUAGE}" \ @@ -239,7 +249,8 @@ do -b xml \ "${BUILDDIR}" \ "${BUILDDIR}/xml" \ - &> "${BUILDDIR}/xml-sphinx.log" + &> "${BUILDDIR}/xml-sphinx.log" \ + || failcat "${BUILDDIR}/xml-sphinx.log" mv "${BUILDDIR}/xml/${VERSION_BASENAME}.xml" "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.xml" echo "$VERSION_BASENAME TXT ($LANGUAGE)..." 1>&2 @@ -248,9 +259,18 @@ do -b text \ "${BUILDDIR}" \ "${BUILDDIR}/txt" \ - &> "${BUILDDIR}/txt-sphinx.log" + &> "${BUILDDIR}/txt-sphinx.log" \ + || failcat "${BUILDDIR}/txt-sphinx.log" mv "${BUILDDIR}/txt/${VERSION_BASENAME}.txt" "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.txt" - cp "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.txt" "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.md" + + echo "$VERSION_BASENAME MD ($LANGUAGE)..." 1>&2 + $LBUILD \ + -b markdown \ + "${BUILDDIR}" \ + "${BUILDDIR}/md" \ + &> "${BUILDDIR}/md-sphinx.log" \ + || failcat "${BUILDDIR}/md-sphinx.log" + mv "${BUILDDIR}/md/${VERSION_BASENAME}.md" "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.md" echo "$VERSION_BASENAME HTML ($LANGUAGE)..." 1>&2 # shellcheck disable=SC2090 @@ -258,7 +278,8 @@ do -b html \ "${BUILDDIR}" \ "${BUILDDIR}/html" \ - &> "${BUILDDIR}/html-sphinx.log" + &> "${BUILDDIR}/html-sphinx.log" \ + || failcat "${BUILDDIR}/html-sphinx.log" htmlark \ -o "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.html" \ "${BUILDDIR}/html/${VERSION_BASENAME}.html" @@ -269,7 +290,8 @@ do -b epub \ "${BUILDDIR}" \ "${BUILDDIR}/epub" \ - &> "${BUILDDIR}/epub-sphinx.log" + &> "${BUILDDIR}/epub-sphinx.log" \ + || failcat "${BUILDDIR}/epub-sphinx.log" mv "${BUILDDIR}/epub/${VERSION_BASENAME}.epub" "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.epub" echo "$VERSION_BASENAME PDF ($LANGUAGE)..." 1>&2 @@ -279,13 +301,15 @@ do -D latex_paper_size="${PAPER}" \ "${BUILDDIR}" \ "${BUILDDIR}/pdf" \ - &> "${BUILDDIR}/pdf-sphinx.log" + &> "${BUILDDIR}/pdf-sphinx.log" \ + || failcat "${BUILDDIR}/pdf-sphinx.log" # We pipe in /dev/null in case latexmk # asks for input and would hang otherwise. make \ -C "${BUILDDIR}/pdf" \ all-pdf \ - < /dev/null &> "${BUILDDIR}/pdf-latex.log" + < /dev/null &> "${BUILDDIR}/pdf-latex.log" \ + || failcat "${BUILDDIR}/pdf-latex.log" mv "${BUILDDIR}/pdf/${VERSION_BASENAME}.pdf" "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.pdf" done diff --git a/contrib/wallet-core b/contrib/wallet-core -Subproject 53472cb936c69a6830c48d4c8d79d43cb19e37e +Subproject ec95723a68d36620aa66109c329437612383830 diff --git a/debian/changelog b/debian/changelog index 264e99bfc..a712cdc5a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +taler-exchange (0.9.3-7) unstable; urgency=low + + * Move currencies.conf into libtalerexchange base package. + + -- Christian Grothoff <grothoff@gnu.org> Tue, 15 Dec 2023 18:50:12 -0700 + +taler-exchange (0.9.3-6) unstable; urgency=low + + * Generate proper markdown in taler-terms-generator. + * Return language code for legal terms. + + -- Christian Grothoff <grothoff@gnu.org> Tue, 13 Dec 2023 18:50:12 -0700 + taler-exchange (0.9.3-5) unstable; urgency=low * More fixes to the database setup automation scripts. diff --git a/debian/etc-taler-auditor/taler/secrets/auditor-db.secret.conf b/debian/etc-taler-auditor/taler/secrets/auditor-db.secret.conf index b81bb817f..1278a563b 100644 --- a/debian/etc-taler-auditor/taler/secrets/auditor-db.secret.conf +++ b/debian/etc-taler-auditor/taler/secrets/auditor-db.secret.conf @@ -4,7 +4,7 @@ # Typically, there should only be a single line here, of the form: -CONFIG=postgres:///DATABASE +CONFIG=postgres:///taler-auditor # The details of the URI depend on where the database lives and how # access control was configured. diff --git a/debian/etc-taler-exchange/taler/secrets/exchange-db.secret.conf b/debian/etc-taler-exchange/taler/secrets/exchange-db.secret.conf index a7a727b62..08c20074c 100644 --- a/debian/etc-taler-exchange/taler/secrets/exchange-db.secret.conf +++ b/debian/etc-taler-exchange/taler/secrets/exchange-db.secret.conf @@ -4,7 +4,7 @@ # Typically, there should only be a single line here, of the form: -# CONFIG=postgres:///DATABASE +CONFIG=postgres:///taler-exchange # The details of the URI depend on where the database lives and how # access control was configured. diff --git a/debian/libtalerexchange.install b/debian/libtalerexchange.install index 56b69e6d6..55de05837 100644 --- a/debian/libtalerexchange.install +++ b/debian/libtalerexchange.install @@ -2,6 +2,7 @@ usr/lib/*/libtaler*.so.* # FIXME: All this should eventually go into taler-base. usr/share/taler/config.d/paths.conf +usr/share/taler/config.d/currencies.conf usr/share/taler/config.d/taler.conf debian/etc-libtalerexchange/* etc/ usr/bin/taler-config diff --git a/doc/doxygen/taler.doxy b/doc/doxygen/taler.doxy index a9a2bfe91..6fd2a6873 100644 --- a/doc/doxygen/taler.doxy +++ b/doc/doxygen/taler.doxy @@ -2644,7 +2644,7 @@ PLANTUML_INCLUDE_PATH = # Minimum value: 0, maximum value: 10000, default value: 50. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_GRAPH_MAX_NODES = 100 +DOT_GRAPH_MAX_NODES = 1000 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs # generated by dot. A depth value of 3 means that only nodes reachable from the diff --git a/src/auditor/taler-helper-auditor-wire.c b/src/auditor/taler-helper-auditor-wire.c index de5acc48a..babf4bf28 100644 --- a/src/auditor/taler-helper-auditor-wire.c +++ b/src/auditor/taler-helper-auditor-wire.c @@ -1057,7 +1057,7 @@ generate_report (void *cls, } else if (TALER_AML_NORMAL != rd->status) { - const char *sstatus; + const char *sstatus = "<undefined>"; json_t *rep; switch (rd->status) diff --git a/src/bank-lib/fakebank_tbi.c b/src/bank-lib/fakebank_tbi.c index 95e3a8c2e..d3d65afd6 100644 --- a/src/bank-lib/fakebank_tbi.c +++ b/src/bank-lib/fakebank_tbi.c @@ -58,7 +58,7 @@ TALER_FAKEBANK_tbi_main_ (struct TALER_FAKEBANK_Handle *h, connection, MHD_HTTP_OK, GNUNET_JSON_pack_string ("version", - "0:0:0"), + "1:0:1"), GNUNET_JSON_pack_string ("currency", h->currency), GNUNET_JSON_pack_bool ("allow_conversion", diff --git a/src/bank-lib/fakebank_tbi_get_withdrawal_operation.c b/src/bank-lib/fakebank_tbi_get_withdrawal_operation.c index fba8c5de6..4749bda77 100644 --- a/src/bank-lib/fakebank_tbi_get_withdrawal_operation.c +++ b/src/bank-lib/fakebank_tbi_get_withdrawal_operation.c @@ -56,6 +56,7 @@ TALER_FAKEBANK_tbi_get_withdrawal_operation_ ( { struct ConnectionContext *cc = *con_cls; struct WithdrawContext *wc; + const char *status_string; GNUNET_assert (0 == pthread_mutex_lock (&h->big_lock)); @@ -97,15 +98,28 @@ TALER_FAKEBANK_tbi_get_withdrawal_operation_ ( json_string ("x-taler-bank"))); GNUNET_assert (0 == pthread_mutex_unlock (&h->big_lock)); + if (wc->wo->aborted) + status_string = "aborted"; + else if (wc->wo->confirmation_done) + status_string = "confirmed"; + else if (wc->wo->selection_done) + status_string = "selected"; + else + status_string = "pending"; return TALER_MHD_REPLY_JSON_PACK ( connection, MHD_HTTP_OK, + // FIXME: deprecated field, should be removed in the future. GNUNET_JSON_pack_bool ("aborted", wc->wo->aborted), + // FIXME: deprecated field, should be removed in the future. GNUNET_JSON_pack_bool ("selection_done", wc->wo->selection_done), + // FIXME: deprecated field, should be removed in the future. GNUNET_JSON_pack_bool ("transfer_done", wc->wo->confirmation_done), + GNUNET_JSON_pack_string ("status", + status_string), GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_string ("suggested_exchange", h->exchange_url)), diff --git a/src/bank-lib/fakebank_tbi_post_withdrawal_operation.c b/src/bank-lib/fakebank_tbi_post_withdrawal_operation.c index 3dbbb3c91..38b92e494 100644 --- a/src/bank-lib/fakebank_tbi_post_withdrawal_operation.c +++ b/src/bank-lib/fakebank_tbi_post_withdrawal_operation.c @@ -53,6 +53,7 @@ do_post_withdrawal ( struct WithdrawalOperation *wo; char *credit_name; struct Account *credit_account; + const char *status_string; GNUNET_assert (0 == pthread_mutex_lock (&h->big_lock)); @@ -138,11 +139,20 @@ do_post_withdrawal ( wo->selection_done = true; GNUNET_assert (0 == pthread_mutex_unlock (&h->big_lock)); + if (wo->aborted) + status_string = "aborted"; + else if (wo->confirmation_done) + status_string = "confirmed"; + else + status_string = "selected"; return TALER_MHD_REPLY_JSON_PACK ( connection, MHD_HTTP_OK, + // FIXME: Deprecated field, should be deleted in the future. GNUNET_JSON_pack_bool ("transfer_done", - wo->confirmation_done)); + wo->confirmation_done), + GNUNET_JSON_pack_string ("status", + status_string)); } diff --git a/src/exchange-tools/taler-exchange-offline.c b/src/exchange-tools/taler-exchange-offline.c index 1a8d61e70..7380e6079 100644 --- a/src/exchange-tools/taler-exchange-offline.c +++ b/src/exchange-tools/taler-exchange-offline.c @@ -3052,7 +3052,7 @@ parse_restriction (char *const *args, GNUNET_JSON_PACK ( GNUNET_JSON_pack_string ("type", "regex"), - GNUNET_JSON_pack_string ("regex", + GNUNET_JSON_pack_string ("payto_regex", args[1]), GNUNET_JSON_pack_string ("human_hint", args[2]), diff --git a/src/exchange/taler-exchange-httpd_config.h b/src/exchange/taler-exchange-httpd_config.h index ea4551721..f3e67e371 100644 --- a/src/exchange/taler-exchange-httpd_config.h +++ b/src/exchange/taler-exchange-httpd_config.h @@ -41,7 +41,7 @@ * * Returned via both /config and /keys endpoints. */ -#define EXCHANGE_PROTOCOL_VERSION "17:0:0" +#define EXCHANGE_PROTOCOL_VERSION "17:1:0" /** diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c index a00a97856..5be12a508 100644 --- a/src/exchange/taler-exchange-httpd_db.c +++ b/src/exchange/taler-exchange-httpd_db.c @@ -22,6 +22,7 @@ #include <pthread.h> #include <jansson.h> #include <gnunet/gnunet_json_lib.h> +#include "taler_exchangedb_plugin.h" #include "taler_json_lib.h" #include "taler_mhd_lib.h" #include "taler_exchangedb_lib.h" @@ -37,7 +38,7 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, { enum TALER_EXCHANGEDB_CoinKnownStatus cks; struct TALER_DenominationHashP h_denom_pub; - struct TALER_AgeCommitmentHash h_age_commitment; + struct TALER_AgeCommitmentHash h_age_commitment = {{{0}}}; /* make sure coin is 'known' in database */ cks = TEH_plugin->ensure_coin_known (TEH_plugin->cls, @@ -69,10 +70,13 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, &h_denom_pub, &coin->coin_pub); return GNUNET_DB_STATUS_HARD_ERROR; - case TALER_EXCHANGEDB_CKS_AGE_CONFLICT: + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NULL: + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NON_NULL: + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_VALUE_DIFFERS: *mhd_ret = TEH_RESPONSE_reply_coin_age_commitment_conflict ( connection, TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH, + cks, &h_denom_pub, &coin->coin_pub, &h_age_commitment); diff --git a/src/exchange/taler-exchange-httpd_keys.h b/src/exchange/taler-exchange-httpd_keys.h index 5baa8b307..5e19ac2ff 100644 --- a/src/exchange/taler-exchange-httpd_keys.h +++ b/src/exchange/taler-exchange-httpd_keys.h @@ -405,7 +405,7 @@ TEH_keys_finished (void); /** - * Resumse all suspended /keys requests, we may now have key material + * Resumes all suspended /keys requests, we may now have key material * (or are shutting down). * * @param do_shutdown are we shutting down? diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c index c1aa9db6f..2d8dede51 100644 --- a/src/exchange/taler-exchange-httpd_responses.c +++ b/src/exchange/taler-exchange-httpd_responses.c @@ -23,9 +23,11 @@ * @author Christian Grothoff */ #include "platform.h" +#include <gnunet/gnunet_json_lib.h> #include <microhttpd.h> #include <zlib.h> #include "taler-exchange-httpd_responses.h" +#include "taler_exchangedb_plugin.h" #include "taler_util.h" #include "taler_json_lib.h" #include "taler_mhd_lib.h" @@ -181,10 +183,31 @@ MHD_RESULT TEH_RESPONSE_reply_coin_age_commitment_conflict ( struct MHD_Connection *connection, enum TALER_ErrorCode ec, + enum TALER_EXCHANGEDB_CoinKnownStatus status, const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_AgeCommitmentHash *h_age_commitment_hash) + const struct TALER_AgeCommitmentHash *h_age_commitment) { + const struct TALER_AgeCommitmentHash *hac = h_age_commitment; + const char *conflict_detail; + + switch (status) + { + + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NULL: + conflict_detail = "expected NULL age commitment hash"; + hac = NULL; + break; + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NON_NULL: + conflict_detail = "unexpected NULL age commitment hash"; + break; + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_VALUE_DIFFERS: + conflict_detail = "expected age commitment hash differs"; + break; + default: + GNUNET_assert (0); + } + return TALER_MHD_REPLY_JSON_PACK ( connection, TALER_ErrorCode_get_http_status_safe (ec), @@ -193,8 +216,11 @@ TEH_RESPONSE_reply_coin_age_commitment_conflict ( coin_pub), GNUNET_JSON_pack_data_auto ("h_denom_pub", h_denom_pub), - GNUNET_JSON_pack_data_auto ("h_age_commitment_hash", - h_age_commitment_hash) + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_data_auto ("expected_age_commitment_hash", + hac)), + GNUNET_JSON_pack_string ("conflict_detail", + conflict_detail) ); } diff --git a/src/exchange/taler-exchange-httpd_responses.h b/src/exchange/taler-exchange-httpd_responses.h index 5fe106e17..b10a72824 100644 --- a/src/exchange/taler-exchange-httpd_responses.h +++ b/src/exchange/taler-exchange-httpd_responses.h @@ -31,6 +31,7 @@ #include "taler_error_codes.h" #include "taler-exchange-httpd.h" #include "taler-exchange-httpd_db.h" +#include "taler_exchangedb_plugin.h" /** @@ -167,6 +168,7 @@ TEH_RESPONSE_reply_coin_insufficient_funds ( * * @param connection connection to the client * @param ec error code to return + * @param cks specific conflict type * @param h_denom_pub hash of the denomination of the coin * @param coin_pub public key of the coin * @param h_age_commitment hash of the age commitment as found in the database @@ -176,6 +178,7 @@ MHD_RESULT TEH_RESPONSE_reply_coin_age_commitment_conflict ( struct MHD_Connection *connection, enum TALER_ErrorCode ec, + enum TALER_EXCHANGEDB_CoinKnownStatus cks, const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_AgeCommitmentHash *h_age_commitment); diff --git a/src/exchangedb/pg_batch_ensure_coin_known.c b/src/exchangedb/pg_batch_ensure_coin_known.c index e49813064..aca2732c6 100644 --- a/src/exchangedb/pg_batch_ensure_coin_known.c +++ b/src/exchangedb/pg_batch_ensure_coin_known.c @@ -17,10 +17,14 @@ * @file exchangedb/pg_batch_ensure_coin_known.c * @brief Implementation of the batch_ensure_coin_known function for Postgres * @author Christian Grothoff + * + * FIXME: use the array support for postgres to simplify this code! + * */ #include "platform.h" #include "taler_error_codes.h" #include "taler_dbevents.h" +#include "taler_exchangedb_plugin.h" #include "taler_pq_lib.h" #include "pg_batch_ensure_coin_known.h" #include "pg_helper.h" @@ -93,14 +97,37 @@ insert1 (struct PostgresClosure *pg, result[0].denom_conflict = true; } - if ( (! is_age_hash_null) && - (0 != GNUNET_memcmp (&result[0].h_age_commitment, - &coin->h_age_commitment)) ) + if ( (! is_denom_pub_hash_null) && + (0 != GNUNET_memcmp (&result[0].denom_hash, + &coin[0].denom_pub_hash)) ) + { + GNUNET_break_op (0); + result[0].denom_conflict = true; + } + + result[0].age_conflict = TALER_AgeCommitmentHash_NoConflict; + + if (is_age_hash_null != coin[0].no_age_commitment) + { + if (is_age_hash_null) + { + GNUNET_break_op (0); + result[0].age_conflict = TALER_AgeCommitmentHash_NullExpected; + } + else + { + GNUNET_break_op (0); + result[0].age_conflict = TALER_AgeCommitmentHash_ValueExpected; + } + } + else if ( (! is_age_hash_null) && + (0 != GNUNET_memcmp (&result[0].h_age_commitment, + &coin[0].h_age_commitment)) ) { - GNUNET_break (GNUNET_is_zero (&result[0].h_age_commitment)); GNUNET_break_op (0); - result[0].age_conflict = true; + result[0].age_conflict = TALER_AgeCommitmentHash_ValueDiffers; } + return qs; } @@ -111,10 +138,8 @@ insert2 (struct PostgresClosure *pg, struct TALER_EXCHANGEDB_CoinInfo result[2]) { enum GNUNET_DB_QueryStatus qs; - bool is_denom_pub_hash_null = false; - bool is_age_hash_null = false; - bool is_denom_pub_hash_null2 = false; - bool is_age_hash_null2 = false; + bool is_denom_pub_hash_null[2] = {false, false}; + bool is_age_hash_null[2] = {false, false}; PREPARE (pg, "batch2_known_coin", @@ -150,11 +175,11 @@ insert2 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", &result[0].denom_hash), - &is_denom_pub_hash_null), + &is_denom_pub_hash_null[0]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash", &result[0].h_age_commitment), - &is_age_hash_null), + &is_age_hash_null[0]), GNUNET_PQ_result_spec_bool ("existed2", &result[1].existed), GNUNET_PQ_result_spec_uint64 ("known_coin_id2", @@ -162,11 +187,11 @@ insert2 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash2", &result[1].denom_hash), - &is_denom_pub_hash_null2), + &is_denom_pub_hash_null[1]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash2", &result[1].h_age_commitment), - &is_age_hash_null2), + &is_age_hash_null[1]), GNUNET_PQ_result_spec_end }; @@ -188,38 +213,40 @@ insert2 (struct PostgresClosure *pg, break; /* continued below */ } - if ( (! is_denom_pub_hash_null) && - (0 != GNUNET_memcmp (&result[0].denom_hash, - &coin[0].denom_pub_hash)) ) + for (int i = 0; i < 2; i++) { - GNUNET_break_op (0); - result[0].denom_conflict = true; - } + if ( (! is_denom_pub_hash_null[i]) && + (0 != GNUNET_memcmp (&result[i].denom_hash, + &coin[i].denom_pub_hash)) ) + { + GNUNET_break_op (0); + result[i].denom_conflict = true; + } - if ( (! is_age_hash_null) && - (0 != GNUNET_memcmp (&result[0].h_age_commitment, - &coin[0].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[0].h_age_commitment)); - GNUNET_break_op (0); - result[0].age_conflict = true; - } - if ( (! is_denom_pub_hash_null2) && - (0 != GNUNET_memcmp (&result[1].denom_hash, - &coin[1].denom_pub_hash)) ) - { - GNUNET_break_op (0); - result[1].denom_conflict = true; - } + result[i].age_conflict = TALER_AgeCommitmentHash_NoConflict; - if ( (! is_age_hash_null) && - (0 != GNUNET_memcmp (&result[1].h_age_commitment, - &coin[1].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[1].h_age_commitment)); - GNUNET_break_op (0); - result[1].age_conflict = true; + if (is_age_hash_null[i] != coin[i].no_age_commitment) + { + if (is_age_hash_null[i]) + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_NullExpected; + } + else + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_ValueExpected; + } + } + else if ( (! is_age_hash_null[i]) && + (0 != GNUNET_memcmp (&result[i].h_age_commitment, + &coin[i].h_age_commitment)) ) + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_ValueDiffers; + } } + return qs; } @@ -230,14 +257,8 @@ insert4 (struct PostgresClosure *pg, struct TALER_EXCHANGEDB_CoinInfo result[4]) { enum GNUNET_DB_QueryStatus qs; - bool is_denom_pub_hash_null = false; - bool is_age_hash_null = false; - bool is_denom_pub_hash_null2 = false; - bool is_age_hash_null2 = false; - bool is_denom_pub_hash_null3 = false; - bool is_age_hash_null3 = false; - bool is_denom_pub_hash_null4 = false; - bool is_age_hash_null4 = false; + bool is_denom_pub_hash_null[4] = {false, false, false, false}; + bool is_age_hash_null[4] = {false, false, false, false}; PREPARE (pg, "batch4_known_coin", "SELECT" @@ -290,11 +311,11 @@ insert4 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", &result[0].denom_hash), - &is_denom_pub_hash_null), + &is_denom_pub_hash_null[0]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash", &result[0].h_age_commitment), - &is_age_hash_null), + &is_age_hash_null[0]), GNUNET_PQ_result_spec_bool ("existed2", &result[1].existed), GNUNET_PQ_result_spec_uint64 ("known_coin_id2", @@ -302,11 +323,11 @@ insert4 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash2", &result[1].denom_hash), - &is_denom_pub_hash_null2), + &is_denom_pub_hash_null[1]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash2", &result[1].h_age_commitment), - &is_age_hash_null2), + &is_age_hash_null[1]), GNUNET_PQ_result_spec_bool ("existed3", &result[2].existed), GNUNET_PQ_result_spec_uint64 ("known_coin_id3", @@ -314,11 +335,11 @@ insert4 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash3", &result[2].denom_hash), - &is_denom_pub_hash_null3), + &is_denom_pub_hash_null[2]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash3", &result[2].h_age_commitment), - &is_age_hash_null3), + &is_age_hash_null[2]), GNUNET_PQ_result_spec_bool ("existed4", &result[3].existed), GNUNET_PQ_result_spec_uint64 ("known_coin_id4", @@ -326,11 +347,11 @@ insert4 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash4", &result[3].denom_hash), - &is_denom_pub_hash_null4), + &is_denom_pub_hash_null[3]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash4", &result[3].h_age_commitment), - &is_age_hash_null4), + &is_age_hash_null[3]), GNUNET_PQ_result_spec_end }; @@ -352,69 +373,40 @@ insert4 (struct PostgresClosure *pg, break; /* continued below */ } - if ( (! is_denom_pub_hash_null) && - (0 != GNUNET_memcmp (&result[0].denom_hash, - &coin[0].denom_pub_hash)) ) + for (int i = 0; i < 4; i++) { - GNUNET_break_op (0); - result[0].denom_conflict = true; - } - if ( (! is_age_hash_null) && - (0 != GNUNET_memcmp (&result[0].h_age_commitment, - &coin[0].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[0].h_age_commitment)); - GNUNET_break_op (0); - result[0].age_conflict = true; - } + if ( (! is_denom_pub_hash_null[i]) && + (0 != GNUNET_memcmp (&result[i].denom_hash, + &coin[i].denom_pub_hash)) ) + { + GNUNET_break_op (0); + result[i].denom_conflict = true; + } - if ( (! is_denom_pub_hash_null2) && - (0 != GNUNET_memcmp (&result[1].denom_hash, - &coin[1].denom_pub_hash)) ) - { - GNUNET_break_op (0); - result[1].denom_conflict = true; - } - if ( (! is_age_hash_null2) && - (0 != GNUNET_memcmp (&result[1].h_age_commitment, - &coin[1].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[1].h_age_commitment)); - GNUNET_break_op (0); - result[1].age_conflict = true; - } + result[i].age_conflict = TALER_AgeCommitmentHash_NoConflict; - if ( (! is_denom_pub_hash_null3) && - (0 != GNUNET_memcmp (&result[2].denom_hash, - &coin[2].denom_pub_hash)) ) - { - GNUNET_break_op (0); - result[2].denom_conflict = true; - } - if ( (! is_age_hash_null3) && - (0 != GNUNET_memcmp (&result[2].h_age_commitment, - &coin[2].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[2].h_age_commitment)); - GNUNET_break_op (0); - result[2].age_conflict = true; + if (is_age_hash_null[i] != coin[i].no_age_commitment) + { + if (is_age_hash_null[i]) + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_NullExpected; + } + else + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_ValueExpected; + } + } + else if ( (! is_age_hash_null[i]) && + (0 != GNUNET_memcmp (&result[i].h_age_commitment, + &coin[i].h_age_commitment)) ) + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_ValueDiffers; + } } - if ( (! is_denom_pub_hash_null4) && - (0 != GNUNET_memcmp (&result[3].denom_hash, - &coin[3].denom_pub_hash)) ) - { - GNUNET_break_op (0); - result[3].denom_conflict = true; - } - if ( (! is_age_hash_null4) && - (0 != GNUNET_memcmp (&result[3].h_age_commitment, - &coin[3].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[3].h_age_commitment)); - GNUNET_break_op (0); - result[3].age_conflict = true; - } return qs; } diff --git a/src/exchangedb/pg_ensure_coin_known.c b/src/exchangedb/pg_ensure_coin_known.c index 952acf24f..307b8df52 100644 --- a/src/exchangedb/pg_ensure_coin_known.c +++ b/src/exchangedb/pg_ensure_coin_known.c @@ -21,6 +21,7 @@ #include "platform.h" #include "taler_error_codes.h" #include "taler_dbevents.h" +#include "taler_exchangedb_plugin.h" #include "taler_pq_lib.h" #include "pg_ensure_coin_known.h" #include "pg_helper.h" @@ -143,13 +144,25 @@ TEH_PG_ensure_coin_known (void *cls, return TALER_EXCHANGEDB_CKS_DENOM_CONFLICT; } - if ( (! is_age_hash_null) && - (0 != GNUNET_memcmp (h_age_commitment, - &coin->h_age_commitment)) ) + if (is_age_hash_null != coin->no_age_commitment) + { + if (is_age_hash_null) + { + GNUNET_break_op (0); + return TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NULL; + } + else + { + GNUNET_break_op (0); + return TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NON_NULL; + } + } + else if ( (! is_age_hash_null) && + (0 != GNUNET_memcmp (h_age_commitment, + &coin->h_age_commitment)) ) { - GNUNET_break (GNUNET_is_zero (h_age_commitment)); GNUNET_break_op (0); - return TALER_EXCHANGEDB_CKS_AGE_CONFLICT; + return TALER_EXCHANGEDB_CKS_AGE_CONFLICT_VALUE_DIFFERS; } return TALER_EXCHANGEDB_CKS_PRESENT; diff --git a/src/exchangedb/pg_get_coin_transactions.c b/src/exchangedb/pg_get_coin_transactions.c index 421fb4428..fef33a486 100644 --- a/src/exchangedb/pg_get_coin_transactions.c +++ b/src/exchangedb/pg_get_coin_transactions.c @@ -21,6 +21,7 @@ #include "platform.h" #include "taler_error_codes.h" #include "taler_dbevents.h" +#include "taler_exchangedb_plugin.h" #include "taler_pq_lib.h" #include "pg_get_coin_transactions.h" #include "pg_helper.h" @@ -698,39 +699,39 @@ handle_history_entry (void *cls, struct CoinHistoryContext *chc = cls; struct PostgresClosure *pg = chc->pg; static const struct Work work[] = { - /** #TALER_EXCHANGEDB_TT_DEPOSIT */ + [TALER_EXCHANGEDB_TT_DEPOSIT] = { "coin_deposits", "get_deposit_with_coin_pub", &add_coin_deposit }, - /** #TALER_EXCHANGEDB_TT_MELT */ + [TALER_EXCHANGEDB_TT_MELT] = { "refresh_commitments", "get_refresh_session_by_coin", &add_coin_melt }, - /** #TALER_EXCHANGEDB_TT_PURSE_DEPOSIT */ + [TALER_EXCHANGEDB_TT_PURSE_DEPOSIT] = { "purse_deposits", "get_purse_deposit_by_coin_pub", &add_coin_purse_deposit }, - /** #TALER_EXCHANGEDB_TT_PURSE_REFUND */ + [TALER_EXCHANGEDB_TT_PURSE_REFUND] = { "purse_decision", "get_purse_decision_by_coin_pub", &add_coin_purse_decision }, - /** #TALER_EXCHANGEDB_TT_REFUND */ + [TALER_EXCHANGEDB_TT_REFUND] = { "refunds", "get_refunds_by_coin", &add_coin_refund }, - /** #TALER_EXCHANGEDB_TT_OLD_COIN_RECOUP */ + [TALER_EXCHANGEDB_TT_OLD_COIN_RECOUP] = { "recoup_refresh::OLD", "recoup_by_old_coin", &add_old_coin_recoup }, - /** #TALER_EXCHANGEDB_TT_RECOUP */ + [TALER_EXCHANGEDB_TT_RECOUP] = { "recoup", "recoup_by_coin", &add_coin_recoup }, - /** #TALER_EXCHANGEDB_TT_RECOUP_REFRESH */ + [TALER_EXCHANGEDB_TT_RECOUP_REFRESH] = { "recoup_refresh::NEW", "recoup_by_refreshed_coin", &add_coin_recoup_refresh }, - /** #TALER_EXCHANGEDB_TT_RESERVE_OPEN */ + [TALER_EXCHANGEDB_TT_RESERVE_OPEN] = { "reserves_open_deposits", "reserve_open_by_coin", &add_coin_reserve_open }, diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 652ff49ca..51dbea659 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -222,7 +222,7 @@ * slow down things a _lot_, but also provide extensive logging * in the Postgres database logger for performance analysis. */ -#define AUTO_EXPLAIN 1 +#define AUTO_EXPLAIN 0 /** diff --git a/src/include/platform.h b/src/include/platform.h index d4d2c80e7..efce84eeb 100644 --- a/src/include/platform.h +++ b/src/include/platform.h @@ -15,7 +15,7 @@ */ /** - * @file exchange/src/include/platform.h + * @file include/platform.h * @brief This file contains the includes and definitions which are used by the * rest of the modules * @author Sree Harsha Totakura <sreeharsha@totakura.in> diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 6da278637..596764b1c 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -29,6 +29,23 @@ #include "taler_signatures.h" #include "taler_extensions_policy.h" +/** + * The conflict that can occur for the age restriction + */ +enum TALER_EXCHANGEDB_AgeCommitmentHash_Conflict +{ + /* Value OK, no conflict */ + TALER_AgeCommitmentHash_NoConflict = 0, + + /* Given hash had a value, but NULL (or zero) was expected */ + TALER_AgeCommitmentHash_NullExpected = 1, + + /* Given hash was NULL, but value was expected */ + TALER_AgeCommitmentHash_ValueExpected = 2, + + /* Given hash differs from value in the known coin */ + TALER_AgeCommitmentHash_ValueDiffers = 3, +}; /** * Per-coin information returned when doing a batch insert. @@ -63,11 +80,12 @@ struct TALER_EXCHANGEDB_CoinInfo bool denom_conflict; /** - * True if the known coin has a different age restriction; + * Indicates if and what kind of conflict with the age + * restriction of the known coin was present; * application will find age commitment of the already * known coin in @e h_age_commitment. */ - bool age_conflict; + enum TALER_EXCHANGEDB_AgeCommitmentHash_Conflict age_conflict; }; @@ -3538,7 +3556,7 @@ struct TALER_EXCHANGEDB_Plugin * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure */ enum GNUNET_GenericReturnValue - (*drop_tables)(void *cls); + (*drop_tables)(void *cls); /** * Create the necessary tables if they are not present @@ -3551,9 +3569,9 @@ struct TALER_EXCHANGEDB_Plugin * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure */ enum GNUNET_GenericReturnValue - (*create_tables)(void *cls, - bool support_partitions, - uint32_t num_partitions); + (*create_tables)(void *cls, + bool support_partitions, + uint32_t num_partitions); /** @@ -3565,8 +3583,8 @@ struct TALER_EXCHANGEDB_Plugin * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue - (*start)(void *cls, - const char *name); + (*start)(void *cls, + const char *name); /** @@ -3578,8 +3596,8 @@ struct TALER_EXCHANGEDB_Plugin * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue - (*start_read_committed)(void *cls, - const char *name); + (*start_read_committed)(void *cls, + const char *name); /** * Start a READ ONLY serializable transaction. @@ -3590,8 +3608,8 @@ struct TALER_EXCHANGEDB_Plugin * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue - (*start_read_only)(void *cls, - const char *name); + (*start_read_only)(void *cls, + const char *name); /** @@ -3601,7 +3619,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*commit)(void *cls); + (*commit)(void *cls); /** @@ -3615,7 +3633,7 @@ struct TALER_EXCHANGEDB_Plugin * #GNUNET_SYSERR on hard errors */ enum GNUNET_GenericReturnValue - (*preflight)(void *cls); + (*preflight)(void *cls); /** @@ -3682,7 +3700,7 @@ struct TALER_EXCHANGEDB_Plugin * @return status of the query */ enum GNUNET_DB_QueryStatus - (*insert_denomination_info)( + (*insert_denomination_info)( void *cls, const struct TALER_DenominationPublicKey *denom_pub, const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue); @@ -3697,7 +3715,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_denomination_info)( + (*get_denomination_info)( void *cls, const struct TALER_DenominationHashP *denom_pub_hash, struct TALER_EXCHANGEDB_DenominationKeyInformation *issue); @@ -3715,9 +3733,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_denomination_info)(void *cls, - TALER_EXCHANGEDB_DenominationCallback cb, - void *cb_cls); + (*iterate_denomination_info)(void *cls, + TALER_EXCHANGEDB_DenominationCallback cb, + void *cb_cls); /** @@ -3731,9 +3749,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_denominations)(void *cls, - TALER_EXCHANGEDB_DenominationsCallback cb, - void *cb_cls); + (*iterate_denominations)(void *cls, + TALER_EXCHANGEDB_DenominationsCallback cb, + void *cb_cls); /** * Function called to invoke @a cb on every non-revoked exchange signing key @@ -3746,9 +3764,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_active_signkeys)(void *cls, - TALER_EXCHANGEDB_ActiveSignkeysCallback cb, - void *cb_cls); + (*iterate_active_signkeys)(void *cls, + TALER_EXCHANGEDB_ActiveSignkeysCallback cb, + void *cb_cls); /** @@ -3761,9 +3779,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_active_auditors)(void *cls, - TALER_EXCHANGEDB_AuditorsCallback cb, - void *cb_cls); + (*iterate_active_auditors)(void *cls, + TALER_EXCHANGEDB_AuditorsCallback cb, + void *cb_cls); /** @@ -3777,7 +3795,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_auditor_denominations)( + (*iterate_auditor_denominations)( void *cls, TALER_EXCHANGEDB_AuditorDenominationsCallback cb, void *cb_cls); @@ -3793,8 +3811,8 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*reserves_get)(void *cls, - struct TALER_EXCHANGEDB_Reserve *reserve); + (*reserves_get)(void *cls, + struct TALER_EXCHANGEDB_Reserve *reserve); /** @@ -3806,7 +3824,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*reserves_get_origin)( + (*reserves_get_origin)( void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, struct TALER_PaytoHashP *h_payto); @@ -3821,9 +3839,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*drain_kyc_alert)(void *cls, - uint32_t trigger_type, - struct TALER_PaytoHashP *h_payto); + (*drain_kyc_alert)(void *cls, + uint32_t trigger_type, + struct TALER_PaytoHashP *h_payto); /** @@ -3837,7 +3855,7 @@ struct TALER_EXCHANGEDB_Plugin * set to the status of the */ enum GNUNET_DB_QueryStatus - (*reserves_in_insert)( + (*reserves_in_insert)( void *cls, const struct TALER_EXCHANGEDB_ReserveInInfo *reserves, unsigned int reserves_length, @@ -3854,10 +3872,10 @@ struct TALER_EXCHANGEDB_Plugin * @return statement execution status */ enum GNUNET_DB_QueryStatus - (*lock_nonce)(void *cls, - const struct GNUNET_CRYPTO_CsSessionNonce *nonce, - const struct TALER_DenominationHashP *denom_pub_hash, - const union TALER_EXCHANGEDB_NonceLockTargetP *target); + (*lock_nonce)(void *cls, + const struct GNUNET_CRYPTO_CsSessionNonce *nonce, + const struct TALER_DenominationHashP *denom_pub_hash, + const union TALER_EXCHANGEDB_NonceLockTargetP *target); /** @@ -3872,9 +3890,10 @@ struct TALER_EXCHANGEDB_Plugin * @return statement execution status */ enum GNUNET_DB_QueryStatus - (*get_withdraw_info)(void *cls, - const struct TALER_BlindedCoinHashP *bch, - struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable); + (*get_withdraw_info)(void *cls, + const struct TALER_BlindedCoinHashP *bch, + struct TALER_EXCHANGEDB_CollectableBlindcoin * + collectable); /** @@ -3905,7 +3924,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_batch_withdraw)( + (*do_batch_withdraw)( void *cls, struct GNUNET_TIME_Timestamp now, const struct TALER_ReservePublicKeyP *reserve_pub, @@ -3934,7 +3953,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_batch_withdraw_insert)( + (*do_batch_withdraw_insert)( void *cls, const union GNUNET_CRYPTO_BlindSessionNonce *nonce, const struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable, @@ -3956,7 +3975,7 @@ struct TALER_EXCHANGEDB_Plugin * @return statement execution status */ enum GNUNET_DB_QueryStatus - (*get_age_withdraw)( + (*get_age_withdraw)( void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, const struct TALER_AgeWithdrawCommitmentHashP *ach, @@ -3978,7 +3997,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_age_withdraw)( + (*do_age_withdraw)( void *cls, const struct TALER_EXCHANGEDB_AgeWithdraw *commitment, struct GNUNET_TIME_Timestamp now, @@ -3999,7 +4018,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*get_policy_details)( + (*get_policy_details)( void *cls, const struct GNUNET_HashCode *hc, struct TALER_PolicyDetails *detail); @@ -4017,7 +4036,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*persist_policy_details)( + (*persist_policy_details)( void *cls, const struct TALER_PolicyDetails *details, uint64_t *policy_details_serial_id, @@ -4039,7 +4058,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_deposit)( + (*do_deposit)( void *cls, const struct TALER_EXCHANGEDB_BatchDeposit *bd, struct GNUNET_TIME_Timestamp *exchange_timestamp, @@ -4062,7 +4081,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_melt)( + (*do_melt)( void *cls, const struct TALER_RefreshMasterSecretP *rms, struct TALER_EXCHANGEDB_Refresh *refresh, @@ -4079,7 +4098,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*add_policy_fulfillment_proof)( + (*add_policy_fulfillment_proof)( void *cls, struct TALER_PolicyFulfillmentTransactionData *fulfillment); @@ -4098,7 +4117,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*cs_refreshes_reveal)( + (*cs_refreshes_reveal)( void *cls, const struct GNUNET_CRYPTO_CsSessionNonce *nonce, const struct TALER_CoinSpendPublicKeyP *old_coin_pub, @@ -4121,7 +4140,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_refund)( + (*do_refund)( void *cls, const struct TALER_EXCHANGEDB_Refund *refund, const struct TALER_Amount *deposit_fee, @@ -4149,7 +4168,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_recoup)( + (*do_recoup)( void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, uint64_t reserve_out_serial_id, @@ -4179,7 +4198,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_recoup_refresh)( + (*do_recoup_refresh)( void *cls, const struct TALER_CoinSpendPublicKeyP *old_coin_pub, uint64_t rrc_serial, @@ -4210,13 +4229,13 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_reserve_history)(void *cls, - const struct TALER_ReservePublicKeyP *reserve_pub, - uint64_t start_off, - uint64_t etag_in, - uint64_t *etag_out, - struct TALER_Amount *balance, - struct TALER_EXCHANGEDB_ReserveHistory **rhp); + (*get_reserve_history)(void *cls, + const struct TALER_ReservePublicKeyP *reserve_pub, + uint64_t start_off, + uint64_t etag_in, + uint64_t *etag_out, + struct TALER_Amount *balance, + struct TALER_EXCHANGEDB_ReserveHistory **rhp); /** @@ -4228,9 +4247,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_reserve_balance)(void *cls, - const struct TALER_ReservePublicKeyP *reserve_pub, - struct TALER_Amount *balance); + (*get_reserve_balance)(void *cls, + const struct TALER_ReservePublicKeyP *reserve_pub, + struct TALER_Amount *balance); /** @@ -4294,9 +4313,20 @@ struct TALER_EXCHANGEDB_Plugin TALER_EXCHANGEDB_CKS_DENOM_CONFLICT = -3, /** + * Conflicting coin (expected NULL age hash) already in database. + */ + TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NULL = -4, + + /** + * Conflicting coin (unexpected NULL age hash) already in database. + */ + TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NON_NULL = -5, + + /** * Conflicting coin (different age hash) already in database. */ - TALER_EXCHANGEDB_CKS_AGE_CONFLICT = -4, + TALER_EXCHANGEDB_CKS_AGE_CONFLICT_VALUE_DIFFERS = -6, + } (*ensure_coin_known)(void *cls, const struct TALER_CoinPublicInfo *coin, @@ -4316,7 +4346,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status, non-negative on success */ enum GNUNET_DB_QueryStatus - (*batch_ensure_coin_known)( + (*batch_ensure_coin_known)( void *cls, const struct TALER_CoinPublicInfo *coin, struct TALER_EXCHANGEDB_CoinInfo *result, @@ -4332,9 +4362,9 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status, non-negative on success */ enum GNUNET_DB_QueryStatus - (*get_known_coin)(void *cls, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - struct TALER_CoinPublicInfo *coin_info); + (*get_known_coin)(void *cls, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + struct TALER_CoinPublicInfo *coin_info); /** @@ -4347,10 +4377,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_coin_denomination)(void *cls, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - uint64_t *known_coin_id, - struct TALER_DenominationHashP *denom_hash); + (*get_coin_denomination)(void *cls, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + uint64_t *known_coin_id, + struct TALER_DenominationHashP *denom_hash); /** @@ -4370,7 +4400,7 @@ struct TALER_EXCHANGEDB_Plugin */ // FIXME: rename! enum GNUNET_DB_QueryStatus - (*have_deposit2)( + (*have_deposit2)( void *cls, const struct TALER_PrivateContractHashP *h_contract_terms, const struct TALER_MerchantWireHashP *h_wire, @@ -4390,8 +4420,8 @@ struct TALER_EXCHANGEDB_Plugin * @return query result status */ enum GNUNET_DB_QueryStatus - (*insert_refund)(void *cls, - const struct TALER_EXCHANGEDB_Refund *refund); + (*insert_refund)(void *cls, + const struct TALER_EXCHANGEDB_Refund *refund); /** @@ -4406,12 +4436,14 @@ struct TALER_EXCHANGEDB_Plugin * @return query result status */ enum GNUNET_DB_QueryStatus - (*select_refunds_by_coin)(void *cls, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_MerchantPublicKeyP *merchant_pub, - const struct TALER_PrivateContractHashP *h_contract, - TALER_EXCHANGEDB_RefundCoinCallback cb, - void *cb_cls); + (*select_refunds_by_coin)(void *cls, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct + TALER_MerchantPublicKeyP *merchant_pub, + const struct + TALER_PrivateContractHashP *h_contract, + TALER_EXCHANGEDB_RefundCoinCallback cb, + void *cb_cls); /** @@ -4428,11 +4460,11 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_ready_deposit)(void *cls, - uint64_t start_shard_row, - uint64_t end_shard_row, - struct TALER_MerchantPublicKeyP *merchant_pub, - char **payto_uri); + (*get_ready_deposit)(void *cls, + uint64_t start_shard_row, + uint64_t end_shard_row, + struct TALER_MerchantPublicKeyP *merchant_pub, + char **payto_uri); /** @@ -4447,7 +4479,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*aggregate)( + (*aggregate)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_MerchantPublicKeyP *merchant_pub, @@ -4468,7 +4500,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*create_aggregation_transient)( + (*create_aggregation_transient)( void *cls, const struct TALER_PaytoHashP *h_payto, const char *exchange_account_section, @@ -4490,7 +4522,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*select_aggregation_transient)( + (*select_aggregation_transient)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_MerchantPublicKeyP *merchant_pub, @@ -4509,7 +4541,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*find_aggregation_transient)( + (*find_aggregation_transient)( void *cls, const struct TALER_PaytoHashP *h_payto, TALER_EXCHANGEDB_TransientAggregationCallback cb, @@ -4528,7 +4560,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*update_aggregation_transient)( + (*update_aggregation_transient)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_WireTransferIdentifierRawP *wtid, @@ -4546,7 +4578,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*delete_aggregation_transient)( + (*delete_aggregation_transient)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_WireTransferIdentifierRawP *wtid); @@ -4564,10 +4596,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_melt)(void *cls, - const struct TALER_RefreshCommitmentP *rc, - struct TALER_EXCHANGEDB_Melt *melt, - uint64_t *melt_serial_id); + (*get_melt)(void *cls, + const struct TALER_RefreshCommitmentP *rc, + struct TALER_EXCHANGEDB_Melt *melt, + uint64_t *melt_serial_id); /** @@ -4585,7 +4617,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query status for the transaction */ enum GNUNET_DB_QueryStatus - (*insert_refresh_reveal)( + (*insert_refresh_reveal)( void *cls, uint64_t melt_serial_id, uint32_t num_rrcs, @@ -4606,10 +4638,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_refresh_reveal)(void *cls, - const struct TALER_RefreshCommitmentP *rc, - TALER_EXCHANGEDB_RefreshCallback cb, - void *cb_cls); + (*get_refresh_reveal)(void *cls, + const struct TALER_RefreshCommitmentP *rc, + TALER_EXCHANGEDB_RefreshCallback cb, + void *cb_cls); /** @@ -4625,10 +4657,10 @@ struct TALER_EXCHANGEDB_Plugin * @return statement execution status */ enum GNUNET_DB_QueryStatus - (*get_link_data)(void *cls, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - TALER_EXCHANGEDB_LinkCallback ldc, - void *tdc_cls); + (*get_link_data)(void *cls, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + TALER_EXCHANGEDB_LinkCallback ldc, + void *tdc_cls); /** @@ -4652,7 +4684,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*get_coin_transactions)( + (*get_coin_transactions)( void *cls, const struct TALER_CoinSpendPublicKeyP *coin_pub, uint64_t start_off, @@ -4685,10 +4717,10 @@ struct TALER_EXCHANGEDB_Plugin * @return query status of the transaction */ enum GNUNET_DB_QueryStatus - (*lookup_wire_transfer)(void *cls, - const struct TALER_WireTransferIdentifierRawP *wtid, - TALER_EXCHANGEDB_AggregationDataCallback cb, - void *cb_cls); + (*lookup_wire_transfer)(void *cls, + const struct TALER_WireTransferIdentifierRawP *wtid, + TALER_EXCHANGEDB_AggregationDataCallback cb, + void *cb_cls); /** @@ -4713,7 +4745,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_transfer_by_deposit)( + (*lookup_transfer_by_deposit)( void *cls, const struct TALER_PrivateContractHashP *h_contract_terms, const struct TALER_MerchantWireHashP *h_wire, @@ -4740,12 +4772,12 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_wire_fee)(void *cls, - const char *wire_method, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_WireFeeSet *fees, - const struct TALER_MasterSignatureP *master_sig); + (*insert_wire_fee)(void *cls, + const char *wire_method, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + const struct TALER_WireFeeSet *fees, + const struct TALER_MasterSignatureP *master_sig); /** @@ -4762,15 +4794,15 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_global_fee)(void *cls, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_GlobalFeeSet *fees, - struct GNUNET_TIME_Relative purse_timeout, - struct GNUNET_TIME_Relative history_expiration, - uint32_t purse_account_limit, + (*insert_global_fee)(void *cls, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + const struct TALER_GlobalFeeSet *fees, + struct GNUNET_TIME_Relative purse_timeout, + struct GNUNET_TIME_Relative history_expiration, + uint32_t purse_account_limit, - const struct TALER_MasterSignatureP *master_sig); + const struct TALER_MasterSignatureP *master_sig); /** @@ -4786,13 +4818,13 @@ struct TALER_EXCHANGEDB_Plugin * @return query status of the transaction */ enum GNUNET_DB_QueryStatus - (*get_wire_fee)(void *cls, - const char *type, - struct GNUNET_TIME_Timestamp date, - struct GNUNET_TIME_Timestamp *start_date, - struct GNUNET_TIME_Timestamp *end_date, - struct TALER_WireFeeSet *fees, - struct TALER_MasterSignatureP *master_sig); + (*get_wire_fee)(void *cls, + const char *type, + struct GNUNET_TIME_Timestamp date, + struct GNUNET_TIME_Timestamp *start_date, + struct GNUNET_TIME_Timestamp *end_date, + struct TALER_WireFeeSet *fees, + struct TALER_MasterSignatureP *master_sig); /** @@ -4810,15 +4842,15 @@ struct TALER_EXCHANGEDB_Plugin * @return query status of the transaction */ enum GNUNET_DB_QueryStatus - (*get_global_fee)(void *cls, - struct GNUNET_TIME_Timestamp date, - struct GNUNET_TIME_Timestamp *start_date, - struct GNUNET_TIME_Timestamp *end_date, - struct TALER_GlobalFeeSet *fees, - struct GNUNET_TIME_Relative *purse_timeout, - struct GNUNET_TIME_Relative *history_expiration, - uint32_t *purse_account_limit, - struct TALER_MasterSignatureP *master_sig); + (*get_global_fee)(void *cls, + struct GNUNET_TIME_Timestamp date, + struct GNUNET_TIME_Timestamp *start_date, + struct GNUNET_TIME_Timestamp *end_date, + struct TALER_GlobalFeeSet *fees, + struct GNUNET_TIME_Relative *purse_timeout, + struct GNUNET_TIME_Relative *history_expiration, + uint32_t *purse_account_limit, + struct TALER_MasterSignatureP *master_sig); /** @@ -4832,10 +4864,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_expired_reserves)(void *cls, - struct GNUNET_TIME_Timestamp now, - TALER_EXCHANGEDB_ReserveExpiredCallback rec, - void *rec_cls); + (*get_expired_reserves)(void *cls, + struct GNUNET_TIME_Timestamp now, + TALER_EXCHANGEDB_ReserveExpiredCallback rec, + void *rec_cls); /** @@ -4850,7 +4882,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_unfinished_close_requests)( + (*get_unfinished_close_requests)( void *cls, TALER_EXCHANGEDB_ReserveExpiredCallback rec, void *rec_cls); @@ -4871,7 +4903,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, 0 if operation is already in the DB */ enum GNUNET_DB_QueryStatus - (*insert_reserve_open_deposit)( + (*insert_reserve_open_deposit)( void *cls, const struct TALER_CoinPublicInfo *cpi, const struct TALER_CoinSpendSignatureP *coin_sig, @@ -4901,19 +4933,19 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*do_reserve_open)(void *cls, - const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_Amount *total_paid, - const struct TALER_Amount *reserve_payment, - uint32_t min_purse_limit, - const struct TALER_ReserveSignatureP *reserve_sig, - struct GNUNET_TIME_Timestamp desired_expiration, - struct GNUNET_TIME_Timestamp now, - const struct TALER_Amount *open_fee, - bool *no_funds, - struct TALER_Amount *reserve_balance, - struct TALER_Amount *open_cost, - struct GNUNET_TIME_Timestamp *final_expiration); + (*do_reserve_open)(void *cls, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_Amount *total_paid, + const struct TALER_Amount *reserve_payment, + uint32_t min_purse_limit, + const struct TALER_ReserveSignatureP *reserve_sig, + struct GNUNET_TIME_Timestamp desired_expiration, + struct GNUNET_TIME_Timestamp now, + const struct TALER_Amount *open_fee, + bool *no_funds, + struct TALER_Amount *reserve_balance, + struct TALER_Amount *open_cost, + struct GNUNET_TIME_Timestamp *final_expiration); /** @@ -4929,7 +4961,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, 0 if reserve unknown */ enum GNUNET_DB_QueryStatus - (*select_reserve_close_info)( + (*select_reserve_close_info)( void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, struct TALER_Amount *balance, @@ -4952,7 +4984,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, 0 if reserve unknown */ enum GNUNET_DB_QueryStatus - (*select_reserve_close_request_info)( + (*select_reserve_close_request_info)( void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, uint64_t rowid, @@ -4976,7 +5008,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error */ enum GNUNET_DB_QueryStatus - (*iterate_reserve_close_info)( + (*iterate_reserve_close_info)( void *cls, const struct TALER_PaytoHashP *h_payto, struct GNUNET_TIME_Absolute time_limit, @@ -4998,14 +5030,15 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_reserve_closed)(void *cls, - const struct TALER_ReservePublicKeyP *reserve_pub, - struct GNUNET_TIME_Timestamp execution_date, - const char *receiver_account, - const struct TALER_WireTransferIdentifierRawP *wtid, - const struct TALER_Amount *amount_with_fee, - const struct TALER_Amount *closing_fee, - uint64_t close_request_row); + (*insert_reserve_closed)(void *cls, + const struct TALER_ReservePublicKeyP *reserve_pub, + struct GNUNET_TIME_Timestamp execution_date, + const char *receiver_account, + const struct + TALER_WireTransferIdentifierRawP *wtid, + const struct TALER_Amount *amount_with_fee, + const struct TALER_Amount *closing_fee, + uint64_t close_request_row); /** @@ -5018,10 +5051,10 @@ struct TALER_EXCHANGEDB_Plugin * @return query status code */ enum GNUNET_DB_QueryStatus - (*wire_prepare_data_insert)(void *cls, - const char *type, - const char *buf, - size_t buf_size); + (*wire_prepare_data_insert)(void *cls, + const char *type, + const char *buf, + size_t buf_size); /** @@ -5032,8 +5065,8 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*wire_prepare_data_mark_finished)(void *cls, - uint64_t rowid); + (*wire_prepare_data_mark_finished)(void *cls, + uint64_t rowid); /** @@ -5044,8 +5077,8 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*wire_prepare_data_mark_failed)(void *cls, - uint64_t rowid); + (*wire_prepare_data_mark_failed)(void *cls, + uint64_t rowid); /** @@ -5060,11 +5093,11 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*wire_prepare_data_get)(void *cls, - uint64_t start_row, - uint64_t limit, - TALER_EXCHANGEDB_WirePreparationIterator cb, - void *cb_cls); + (*wire_prepare_data_get)(void *cls, + uint64_t start_row, + uint64_t limit, + TALER_EXCHANGEDB_WirePreparationIterator cb, + void *cb_cls); /** @@ -5076,7 +5109,7 @@ struct TALER_EXCHANGEDB_Plugin * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue - (*start_deferred_wire_out)(void *cls); + (*start_deferred_wire_out)(void *cls); /** @@ -5093,7 +5126,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*store_wire_transfer_out)( + (*store_wire_transfer_out)( void *cls, struct GNUNET_TIME_Timestamp date, const struct TALER_WireTransferIdentifierRawP *wtid, @@ -5111,7 +5144,7 @@ struct TALER_EXCHANGEDB_Plugin * #GNUNET_SYSERR on DB errors */ enum GNUNET_GenericReturnValue - (*gc)(void *cls); + (*gc)(void *cls); /** @@ -5125,10 +5158,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_coin_deposits_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_DepositCallback cb, - void *cb_cls); + (*select_coin_deposits_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_DepositCallback cb, + void *cb_cls); /** @@ -5142,7 +5175,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_requests_above_serial_id)( + (*select_purse_requests_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_PurseRequestCallback cb, @@ -5160,7 +5193,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_deposits_above_serial_id)( + (*select_purse_deposits_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_PurseDepositCallback cb, @@ -5178,7 +5211,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_account_merges_above_serial_id)( + (*select_account_merges_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_AccountMergeCallback cb, @@ -5196,7 +5229,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_merges_above_serial_id)( + (*select_purse_merges_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_PurseMergeCallback cb, @@ -5215,7 +5248,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_decisions_above_serial_id)( + (*select_purse_decisions_above_serial_id)( void *cls, uint64_t serial_id, bool refunded, @@ -5234,7 +5267,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_all_purse_decisions_above_serial_id)( + (*select_all_purse_decisions_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_AllPurseDecisionCallback cb, @@ -5251,7 +5284,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_deposits_by_purse)( + (*select_purse_deposits_by_purse)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, TALER_EXCHANGEDB_PurseRefundCoinCallback cb, @@ -5269,10 +5302,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_refreshes_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_RefreshesCallback cb, - void *cb_cls); + (*select_refreshes_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_RefreshesCallback cb, + void *cb_cls); /** @@ -5286,10 +5319,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_refunds_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_RefundCallback cb, - void *cb_cls); + (*select_refunds_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_RefundCallback cb, + void *cb_cls); /** @@ -5303,10 +5336,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_reserves_in_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_ReserveInCallback cb, - void *cb_cls); + (*select_reserves_in_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_ReserveInCallback cb, + void *cb_cls); /** @@ -5321,7 +5354,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_reserves_in_above_serial_id_by_account)( + (*select_reserves_in_above_serial_id_by_account)( void *cls, const char *account_name, uint64_t serial_id, @@ -5341,7 +5374,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_withdrawals_above_serial_id)( + (*select_withdrawals_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_WithdrawCallback cb, @@ -5359,10 +5392,11 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_wire_out_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_WireTransferOutCallback cb, - void *cb_cls); + (*select_wire_out_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_WireTransferOutCallback + cb, + void *cb_cls); /** * Function called to select outgoing wire transfers the exchange @@ -5376,7 +5410,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_wire_out_above_serial_id_by_account)( + (*select_wire_out_above_serial_id_by_account)( void *cls, const char *account_name, uint64_t serial_id, @@ -5395,10 +5429,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_recoup_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_RecoupCallback cb, - void *cb_cls); + (*select_recoup_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_RecoupCallback cb, + void *cb_cls); /** @@ -5412,7 +5446,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_recoup_refresh_above_serial_id)( + (*select_recoup_refresh_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_RecoupRefreshCallback cb, @@ -5430,7 +5464,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_reserve_open_above_serial_id)( + (*select_reserve_open_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_ReserveOpenCallback cb, @@ -5448,7 +5482,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_reserve_closed_above_serial_id)( + (*select_reserve_closed_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_ReserveClosedCallback cb, @@ -5466,7 +5500,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_reserve_by_h_blind)( + (*get_reserve_by_h_blind)( void *cls, const struct TALER_BlindedCoinHashP *bch, struct TALER_ReservePublicKeyP *reserve_pub, @@ -5484,7 +5518,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_old_coin_by_h_blind)( + (*get_old_coin_by_h_blind)( void *cls, const struct TALER_BlindedCoinHashP *h_blind_ev, struct TALER_CoinSpendPublicKeyP *old_coin_pub, @@ -5501,7 +5535,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_denomination_revocation)( + (*insert_denomination_revocation)( void *cls, const struct TALER_DenominationHashP *denom_pub_hash, const struct TALER_MasterSignatureP *master_sig); @@ -5518,7 +5552,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_denomination_revocation)( + (*get_denomination_revocation)( void *cls, const struct TALER_DenominationHashP *denom_pub_hash, struct TALER_MasterSignatureP *master_sig, @@ -5536,7 +5570,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_batch_deposits_missing_wire)( + (*select_batch_deposits_missing_wire)( void *cls, uint64_t min_batch_deposit_serial_id, TALER_EXCHANGEDB_WireMissingCallback cb, @@ -5554,7 +5588,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_aggregations_above_serial)( + (*select_aggregations_above_serial)( void *cls, uint64_t min_tracking_serial_id, TALER_EXCHANGEDB_AggregationCallback cb, @@ -5576,7 +5610,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_justification_for_missing_wire)( + (*select_justification_for_missing_wire)( void *cls, const struct TALER_PaytoHashP *wire_target_h_payto, char **payto_uri, @@ -5594,7 +5628,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_auditor_timestamp)( + (*lookup_auditor_timestamp)( void *cls, const struct TALER_AuditorPublicKeyP *auditor_pub, struct GNUNET_TIME_Timestamp *last_date); @@ -5611,7 +5645,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_auditor_status)( + (*lookup_auditor_status)( void *cls, const struct TALER_AuditorPublicKeyP *auditor_pub, char **auditor_url, @@ -5630,7 +5664,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_auditor)( + (*insert_auditor)( void *cls, const struct TALER_AuditorPublicKeyP *auditor_pub, const char *auditor_url, @@ -5651,7 +5685,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*update_auditor)( + (*update_auditor)( void *cls, const struct TALER_AuditorPublicKeyP *auditor_pub, const char *auditor_url, @@ -5669,9 +5703,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_wire_timestamp)(void *cls, - const char *payto_uri, - struct GNUNET_TIME_Timestamp *last_date); + (*lookup_wire_timestamp)(void *cls, + const char *payto_uri, + struct GNUNET_TIME_Timestamp *last_date); /** @@ -5689,13 +5723,13 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_wire)(void *cls, - const char *payto_uri, - const char *conversion_url, - const json_t *debit_restrictions, - const json_t *credit_restrictions, - struct GNUNET_TIME_Timestamp start_date, - const struct TALER_MasterSignatureP *master_sig); + (*insert_wire)(void *cls, + const char *payto_uri, + const char *conversion_url, + const json_t *debit_restrictions, + const json_t *credit_restrictions, + struct GNUNET_TIME_Timestamp start_date, + const struct TALER_MasterSignatureP *master_sig); /** @@ -5712,13 +5746,13 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*update_wire)(void *cls, - const char *payto_uri, - const char *conversion_url, - const json_t *debit_restrictions, - const json_t *credit_restrictions, - struct GNUNET_TIME_Timestamp change_date, - bool enabled); + (*update_wire)(void *cls, + const char *payto_uri, + const char *conversion_url, + const json_t *debit_restrictions, + const json_t *credit_restrictions, + struct GNUNET_TIME_Timestamp change_date, + bool enabled); /** @@ -5730,9 +5764,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_wire_accounts)(void *cls, - TALER_EXCHANGEDB_WireAccountCallback cb, - void *cb_cls); + (*get_wire_accounts)(void *cls, + TALER_EXCHANGEDB_WireAccountCallback cb, + void *cb_cls); /** @@ -5746,10 +5780,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_wire_fees)(void *cls, - const char *wire_method, - TALER_EXCHANGEDB_WireFeeCallback cb, - void *cb_cls); + (*get_wire_fees)(void *cls, + const char *wire_method, + TALER_EXCHANGEDB_WireFeeCallback cb, + void *cb_cls); /** @@ -5761,9 +5795,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_global_fees)(void *cls, - TALER_EXCHANGEDB_GlobalFeeCallback cb, - void *cb_cls); + (*get_global_fees)(void *cls, + TALER_EXCHANGEDB_GlobalFeeCallback cb, + void *cb_cls); /** @@ -5775,7 +5809,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_signkey_revocation)( + (*insert_signkey_revocation)( void *cls, const struct TALER_ExchangePublicKeyP *exchange_pub, const struct TALER_MasterSignatureP *master_sig); @@ -5790,7 +5824,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_signkey_revocation)( + (*lookup_signkey_revocation)( void *cls, const struct TALER_ExchangePublicKeyP *exchange_pub, struct TALER_MasterSignatureP *master_sig); @@ -5805,7 +5839,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_denomination_key)( + (*lookup_denomination_key)( void *cls, const struct TALER_DenominationHashP *h_denom_pub, struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta); @@ -5822,7 +5856,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*add_denomination_key)( + (*add_denomination_key)( void *cls, const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_DenominationPublicKey *denom_pub, @@ -5841,7 +5875,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*activate_signing_key)( + (*activate_signing_key)( void *cls, const struct TALER_ExchangePublicKeyP *exchange_pub, const struct TALER_EXCHANGEDB_SignkeyMetaData *meta, @@ -5857,7 +5891,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_signing_key)( + (*lookup_signing_key)( void *cls, const struct TALER_ExchangePublicKeyP *exchange_pub, struct TALER_EXCHANGEDB_SignkeyMetaData *meta); @@ -5873,7 +5907,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_auditor_denom_sig)( + (*insert_auditor_denom_sig)( void *cls, const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_AuditorPublicKeyP *auditor_pub, @@ -5890,7 +5924,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_auditor_denom_sig)( + (*select_auditor_denom_sig)( void *cls, const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_AuditorPublicKeyP *auditor_pub, @@ -5910,7 +5944,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_wire_fee_by_time)( + (*lookup_wire_fee_by_time)( void *cls, const char *wire_method, struct GNUNET_TIME_Timestamp start_time, @@ -5933,7 +5967,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_global_fee_by_time)( + (*lookup_global_fee_by_time)( void *cls, struct GNUNET_TIME_Timestamp start_time, struct GNUNET_TIME_Timestamp end_time, @@ -5954,9 +5988,9 @@ struct TALER_EXCHANGEDB_Plugin * @a table does not have a serial number */ enum GNUNET_DB_QueryStatus - (*lookup_serial_by_table)(void *cls, - enum TALER_EXCHANGEDB_ReplicatedTable table, - uint64_t *serial); + (*lookup_serial_by_table)(void *cls, + enum TALER_EXCHANGEDB_ReplicatedTable table, + uint64_t *serial); /** * Lookup records above @a serial number in @a table. Used in @@ -5971,11 +6005,11 @@ struct TALER_EXCHANGEDB_Plugin * @a table does not have a serial number */ enum GNUNET_DB_QueryStatus - (*lookup_records_by_table)(void *cls, - enum TALER_EXCHANGEDB_ReplicatedTable table, - uint64_t serial, - TALER_EXCHANGEDB_ReplicationCallback cb, - void *cb_cls); + (*lookup_records_by_table)(void *cls, + enum TALER_EXCHANGEDB_ReplicatedTable table, + uint64_t serial, + TALER_EXCHANGEDB_ReplicationCallback cb, + void *cb_cls); /** @@ -5989,8 +6023,8 @@ struct TALER_EXCHANGEDB_Plugin * @a table does not have a serial number */ enum GNUNET_DB_QueryStatus - (*insert_records_by_table)(void *cls, - const struct TALER_EXCHANGEDB_TableData *td); + (*insert_records_by_table)(void *cls, + const struct TALER_EXCHANGEDB_TableData *td); /** @@ -6006,12 +6040,12 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*begin_shard)(void *cls, - const char *job_name, - struct GNUNET_TIME_Relative delay, - uint64_t shard_size, - uint64_t *start_row, - uint64_t *end_row); + (*begin_shard)(void *cls, + const char *job_name, + struct GNUNET_TIME_Relative delay, + uint64_t shard_size, + uint64_t *start_row, + uint64_t *end_row); /** * Function called to abort work on a shard. @@ -6023,10 +6057,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*abort_shard)(void *cls, - const char *job_name, - uint64_t start_row, - uint64_t end_row); + (*abort_shard)(void *cls, + const char *job_name, + uint64_t start_row, + uint64_t end_row); /** * Function called to persist that work on a shard was completed. @@ -6038,10 +6072,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*complete_shard)(void *cls, - const char *job_name, - uint64_t start_row, - uint64_t end_row); + (*complete_shard)(void *cls, + const char *job_name, + uint64_t start_row, + uint64_t end_row); /** @@ -6057,12 +6091,12 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*begin_revolving_shard)(void *cls, - const char *job_name, - uint32_t shard_size, - uint32_t shard_limit, - uint32_t *start_row, - uint32_t *end_row); + (*begin_revolving_shard)(void *cls, + const char *job_name, + uint32_t shard_size, + uint32_t shard_limit, + uint32_t *start_row, + uint32_t *end_row); /** @@ -6076,10 +6110,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*release_revolving_shard)(void *cls, - const char *job_name, - uint32_t start_row, - uint32_t end_row); + (*release_revolving_shard)(void *cls, + const char *job_name, + uint32_t start_row, + uint32_t end_row); /** @@ -6092,7 +6126,7 @@ struct TALER_EXCHANGEDB_Plugin * #GNUNET_SYSERR on failure */ enum GNUNET_GenericReturnValue - (*delete_shard_locks)(void *cls); + (*delete_shard_locks)(void *cls); /** @@ -6105,9 +6139,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*set_extension_manifest)(void *cls, - const char *extension_name, - const char *manifest); + (*set_extension_manifest)(void *cls, + const char *extension_name, + const char *manifest); /** @@ -6120,9 +6154,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_extension_manifest)(void *cls, - const char *extension_name, - char **manifest); + (*get_extension_manifest)(void *cls, + const char *extension_name, + char **manifest); /** @@ -6140,14 +6174,14 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_partner)(void *cls, - const struct TALER_MasterPublicKeyP *master_pub, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - struct GNUNET_TIME_Relative wad_frequency, - const struct TALER_Amount *wad_fee, - const char *partner_base_url, - const struct TALER_MasterSignatureP *master_sig); + (*insert_partner)(void *cls, + const struct TALER_MasterPublicKeyP *master_pub, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + struct GNUNET_TIME_Relative wad_frequency, + const struct TALER_Amount *wad_fee, + const char *partner_base_url, + const struct TALER_MasterSignatureP *master_sig); /** @@ -6163,10 +6197,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_contract)(void *cls, - const struct TALER_PurseContractPublicKeyP *purse_pub, - const struct TALER_EncryptedContract *econtract, - bool *in_conflict); + (*insert_contract)(void *cls, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_EncryptedContract *econtract, + bool *in_conflict); /** @@ -6181,7 +6215,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_contract)( + (*select_contract)( void *cls, const struct TALER_ContractDiffiePublicP *pub_ckey, struct TALER_PurseContractPublicKeyP *purse_pub, @@ -6199,7 +6233,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_contract_by_purse)( + (*select_contract_by_purse)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, struct TALER_EncryptedContract *econtract); @@ -6225,7 +6259,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_purse_request)( + (*insert_purse_request)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_PurseMergePublicKeyP *merge_pub, @@ -6248,7 +6282,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code (#GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if no purse expired in the given time interval). */ enum GNUNET_DB_QueryStatus - (*expire_purse)( + (*expire_purse)( void *cls, struct GNUNET_TIME_Absolute start_time, struct GNUNET_TIME_Absolute end_time); @@ -6269,7 +6303,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse)( + (*select_purse)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, struct GNUNET_TIME_Timestamp *purse_creation, @@ -6297,7 +6331,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_purse_request)( + (*get_purse_request)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, struct TALER_PurseMergePublicKeyP *merge_pub, @@ -6325,7 +6359,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_by_merge_pub)( + (*select_purse_by_merge_pub)( void *cls, const struct TALER_PurseMergePublicKeyP *merge_pub, struct TALER_PurseContractPublicKeyP *purse_pub, @@ -6361,7 +6395,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*do_purse_deposit)( + (*do_purse_deposit)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub, @@ -6386,7 +6420,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*do_purse_delete)( + (*do_purse_delete)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_PurseContractSignatureP *purse_sig, @@ -6405,7 +6439,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*set_purse_balance)( + (*set_purse_balance)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_Amount *balance); @@ -6426,7 +6460,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_purse_deposit)( + (*get_purse_deposit)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub, @@ -6456,7 +6490,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*do_purse_merge)( + (*do_purse_merge)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_PurseMergeSignatureP *merge_sig, @@ -6487,7 +6521,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*do_reserve_purse)( + (*do_reserve_purse)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_PurseMergeSignatureP *merge_sig, @@ -6513,7 +6547,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_merge)( + (*select_purse_merge)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, struct TALER_PurseMergeSignatureP *merge_sig, @@ -6535,13 +6569,13 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_close_request)(void *cls, - const struct TALER_ReservePublicKeyP *reserve_pub, - const char *payto_uri, - const struct TALER_ReserveSignatureP *reserve_sig, - struct GNUNET_TIME_Timestamp request_timestamp, - const struct TALER_Amount *balance, - const struct TALER_Amount *closing_fee); + (*insert_close_request)(void *cls, + const struct TALER_ReservePublicKeyP *reserve_pub, + const char *payto_uri, + const struct TALER_ReserveSignatureP *reserve_sig, + struct GNUNET_TIME_Timestamp request_timestamp, + const struct TALER_Amount *balance, + const struct TALER_Amount *closing_fee); /** @@ -6557,13 +6591,13 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_drain_profit)(void *cls, - const struct TALER_WireTransferIdentifierRawP *wtid, - const char *account_section, - const char *payto_uri, - struct GNUNET_TIME_Timestamp request_timestamp, - const struct TALER_Amount *amount, - const struct TALER_MasterSignatureP *master_sig); + (*insert_drain_profit)(void *cls, + const struct TALER_WireTransferIdentifierRawP *wtid, + const char *account_section, + const char *payto_uri, + struct GNUNET_TIME_Timestamp request_timestamp, + const struct TALER_Amount *amount, + const struct TALER_MasterSignatureP *master_sig); /** @@ -6580,14 +6614,14 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_drain_profit)(void *cls, - const struct TALER_WireTransferIdentifierRawP *wtid, - uint64_t *serial, - char **account_section, - char **payto_uri, - struct GNUNET_TIME_Timestamp *request_timestamp, - struct TALER_Amount *amount, - struct TALER_MasterSignatureP *master_sig); + (*get_drain_profit)(void *cls, + const struct TALER_WireTransferIdentifierRawP *wtid, + uint64_t *serial, + char **account_section, + char **payto_uri, + struct GNUNET_TIME_Timestamp *request_timestamp, + struct TALER_Amount *amount, + struct TALER_MasterSignatureP *master_sig); /** @@ -6604,7 +6638,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*profit_drains_get_pending)( + (*profit_drains_get_pending)( void *cls, uint64_t *serial, struct TALER_WireTransferIdentifierRawP *wtid, @@ -6623,7 +6657,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*profit_drains_set_finished)( + (*profit_drains_set_finished)( void *cls, uint64_t serial); @@ -6639,7 +6673,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*insert_kyc_requirement_for_account)( + (*insert_kyc_requirement_for_account)( void *cls, const char *requirements, const struct TALER_PaytoHashP *h_payto, @@ -6659,7 +6693,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*insert_kyc_requirement_process)( + (*insert_kyc_requirement_process)( void *cls, const struct TALER_PaytoHashP *h_payto, const char *provider_section, @@ -6678,7 +6712,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*get_pending_kyc_requirement_process)( + (*get_pending_kyc_requirement_process)( void *cls, const struct TALER_PaytoHashP *h_payto, const char *provider_section, @@ -6700,7 +6734,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*update_kyc_process_by_row)( + (*update_kyc_process_by_row)( void *cls, uint64_t process_row, const char *provider_section, @@ -6722,7 +6756,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*lookup_kyc_requirement_by_row)( + (*lookup_kyc_requirement_by_row)( void *cls, uint64_t requirement_row, char **requirements, @@ -6743,7 +6777,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*lookup_kyc_process_by_account)( + (*lookup_kyc_process_by_account)( void *cls, const char *provider_section, const struct TALER_PaytoHashP *h_payto, @@ -6765,7 +6799,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*kyc_provider_account_lookup)( + (*kyc_provider_account_lookup)( void *cls, const char *provider_section, const char *provider_legitimization_id, @@ -6784,7 +6818,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_satisfied_kyc_processes)( + (*select_satisfied_kyc_processes)( void *cls, const struct TALER_PaytoHashP *h_payto, TALER_EXCHANGEDB_SatisfiedProviderCallback spc, @@ -6802,7 +6836,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_kyc_reference)( + (*iterate_kyc_reference)( void *cls, const struct TALER_PaytoHashP *h_payto, TALER_EXCHANGEDB_LegitimizationProcessCallback lpc, @@ -6821,7 +6855,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error */ enum GNUNET_DB_QueryStatus - (*select_withdraw_amounts_for_kyc_check)( + (*select_withdraw_amounts_for_kyc_check)( void *cls, const struct TALER_PaytoHashP *h_payto, struct GNUNET_TIME_Absolute time_limit, @@ -6841,7 +6875,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error */ enum GNUNET_DB_QueryStatus - (*select_aggregation_amounts_for_kyc_check)( + (*select_aggregation_amounts_for_kyc_check)( void *cls, const struct TALER_PaytoHashP *h_payto, struct GNUNET_TIME_Absolute time_limit, @@ -6861,7 +6895,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error */ enum GNUNET_DB_QueryStatus - (*select_merge_amounts_for_kyc_check)( + (*select_merge_amounts_for_kyc_check)( void *cls, const struct TALER_PaytoHashP *h_payto, struct GNUNET_TIME_Absolute time_limit, @@ -6891,7 +6925,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*insert_kyc_attributes)( + (*insert_kyc_attributes)( void *cls, uint64_t process_row, const struct TALER_PaytoHashP *h_payto, @@ -6919,7 +6953,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*select_similar_kyc_attributes)( + (*select_similar_kyc_attributes)( void *cls, const struct GNUNET_ShortHashCode *kyc_prox, TALER_EXCHANGEDB_AttributeCallback cb, @@ -6936,7 +6970,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*select_kyc_attributes)( + (*select_kyc_attributes)( void *cls, const struct TALER_PaytoHashP *h_payto, TALER_EXCHANGEDB_AttributeCallback cb, @@ -6957,7 +6991,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*insert_aml_officer)( + (*insert_aml_officer)( void *cls, const struct TALER_AmlOfficerPublicKeyP *decider_pub, const struct TALER_MasterSignatureP *master_sig, @@ -6977,7 +7011,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status, if member is unknown or not active, 1 if member is active */ enum GNUNET_DB_QueryStatus - (*test_aml_officer)( + (*test_aml_officer)( void *cls, const struct TALER_AmlOfficerPublicKeyP *decider_pub); @@ -6995,7 +7029,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*lookup_aml_officer)( + (*lookup_aml_officer)( void *cls, const struct TALER_AmlOfficerPublicKeyP *decider_pub, struct TALER_MasterSignatureP *master_sig, @@ -7015,7 +7049,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status, 0 if no threshold was set */ enum GNUNET_DB_QueryStatus - (*select_aml_threshold)( + (*select_aml_threshold)( void *cls, const struct TALER_PaytoHashP *h_payto, enum TALER_AmlDecisionState *decision, @@ -7033,7 +7067,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*trigger_aml_process)( + (*trigger_aml_process)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_Amount *threshold_crossed); @@ -7051,7 +7085,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*select_aml_process)( + (*select_aml_process)( void *cls, enum TALER_AmlDecisionState decision, uint64_t row_off, @@ -7071,7 +7105,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*select_aml_history)( + (*select_aml_history)( void *cls, const struct TALER_PaytoHashP *h_payto, TALER_EXCHANGEDB_AmlHistoryCallback cb, @@ -7098,7 +7132,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*insert_aml_decision)( + (*insert_aml_decision)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_Amount *new_threshold, diff --git a/src/json/json_helper.c b/src/json/json_helper.c index 0628282ca..450cc194c 100644 --- a/src/json/json_helper.c +++ b/src/json/json_helper.c @@ -499,7 +499,7 @@ parse_age_commitment (void *cls, /** - * Cleanup data left fom parsing age commitment + * Cleanup data left from parsing age commitment * * @param cls closure, NULL * @param[out] spec where to free the data diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c index 1d44ed34f..4b0298744 100644 --- a/src/lib/exchange_api_handle.c +++ b/src/lib/exchange_api_handle.c @@ -2045,7 +2045,7 @@ ar_to_json (unsigned int ar_len, "type", "regex"), GNUNET_JSON_pack_string ( - "regex", + "payto_regex", ar->details.regex.posix_egrep), GNUNET_JSON_pack_string ( "human_hint", diff --git a/src/mhd/mhd_legal.c b/src/mhd/mhd_legal.c index 137cc436a..5a600953e 100644 --- a/src/mhd/mhd_legal.c +++ b/src/mhd/mhd_legal.c @@ -260,7 +260,8 @@ TALER_MHD_reply_legal (struct MHD_Connection *conn, { langs = GNUNET_strdup (p->language); } - else + else if (NULL == strstr (langs, + p->language)) { char *tmp = langs; @@ -360,6 +361,10 @@ TALER_MHD_reply_legal (struct MHD_Connection *conn, MHD_add_response_header (resp, MHD_HTTP_HEADER_CONTENT_TYPE, t->mime_type)); + GNUNET_break (MHD_YES == + MHD_add_response_header (resp, + MHD_HTTP_HEADER_CONTENT_LANGUAGE, + t->language)); { MHD_RESULT ret; diff --git a/src/util/config.c b/src/util/config.c index 1342b53b9..188969c6f 100644 --- a/src/util/config.c +++ b/src/util/config.c @@ -461,7 +461,11 @@ TALER_CONFIG_parse_currencies (const struct GNUNET_CONFIGURATION_Handle *cfg, *num_currencies = cpc.num_currencies; *cspecs = cpc.cspecs; if (0 == *num_currencies) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "No currency formatting specification found! Please check your installation!\n"); return GNUNET_NO; + } return GNUNET_OK; } |