diff --git a/.gitignore b/.gitignore
index de64370a9..20d4b52c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,16 +27,24 @@ GPATH
GRTAGS
GTAGS
*.swp
-src/lib/test_mint_api
+src/lib/test_exchange_api
doc/doxygen/doxygen_sqlite3.db
-src/mint-lib/test_mint_api
-src/mint-tools/taler-auditor-sign
-src/mint-tools/taler-mint-dbinit
-src/mint-tools/taler-mint-keycheck
-src/mint-tools/taler-mint-keyup
-src/mint-tools/taler-mint-reservemod
-src/mint-tools/taler-mint-sepa
-src/mintdb/perf-mintdb
+src/bank-lib/test_bank_api
+src/exchange-lib/test_exchange_api
+src/exchange-lib/test_exchange_api_home/.local/share/taler/exchange/live-keys/
+src/exchange/taler-exchange-aggregator
+src/exchange/test_taler_exchange_aggregator-postgres
+src/exchange/test_taler_exchange_httpd_home/.local/share/taler/exchange/live-keys/
+src/exchange-tools/taler-auditor-sign
+src/exchange-tools/taler-exchange-dbinit
+src/exchange-tools/taler-exchange-keycheck
+src/exchange-tools/taler-exchange-keyup
+src/exchange-tools/taler-exchange-reservemod
+src/exchange-tools/taler-exchange-wire
+src/exchangedb/perf-exchangedb
+src/json/test_json
+src/wire/test_sepa_wireformat
+src/wire/test_wire_plugin
src/pq/test_pq
src/util/test_amount
src/util/test_crypto
diff --git a/Makefile.am b/Makefile.am
index cbf014371..f14372f52 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,3 +2,10 @@
AM_CPPFLAGS = -I$(top_srcdir)/src/include
SUBDIRS = src doc
ACLOCAL_AMFLAGS = -I m4
+EXTRA_DIST = AUTHORS
+
+app:
+ mkdir -p $(PACKAGE)-$(VERSION)-app
+ tar cf - configure.ac AUTHORS README doc/*.1 doc/*.5 doc/Makefile.am Makefile.am `find src/ -name "*.c" -o -name "*.h" -o -name Makefile.am` | (cd $(PACKAGE)-$(VERSION)-app ; tar xf -)
+ tar cf $(PACKAGE)-$(VERSION)-app.tgz $(PACKAGE)-$(VERSION)-app
+ rm -rf $(PACKAGE)-$(VERSION)-app
diff --git a/README b/README
index a5211ee16..78665b551 100644
--- a/README
+++ b/README
@@ -6,7 +6,7 @@ What is Taler?
Taler is an electronic payment system providing the ability to pay
anonymously using digital cash. Taler consists of a network protocol
-definition (using a RESTful API over HTTP), a Mint (which creates
+definition (using a RESTful API over HTTP), a Exchange (which creates
digital coins), a Wallet (which allows customers to manage, store and
spend digital coins), and a Merchant website which allows customers to
spend their digital coins. Naturally, each Merchant is different, but
@@ -19,7 +19,7 @@ is free software and a GNU package (http://www.gnu.org/).
This is not even a release yet, but some raw development prototype
that does not work yet. This package also only includes the Taler
-mint, not the other components of the system.
+exchange, not the other components of the system.
Documentation about Taler can be found at http://taler.net/.
@@ -27,7 +27,7 @@ Documentation about Taler can be found at http://taler.net/.
Dependencies:
=============
-These are the direct dependencies for running a Taler mint:
+These are the direct dependencies for running a Taler exchange:
- GNUnet >= 0.10.2
- GNU libmicrohttpd >= 0.9.38
@@ -48,50 +48,50 @@ src/util/
src/pq/
-- Postgres-specific utility functions
-src/mintdb/
- -- Mint database backend (with DB-specific plugins)
+src/exchangedb/
+ -- Exchange database backend (with DB-specific plugins)
-src/mint/
- -- taler mint server
+src/exchange/
+ -- taler exchange server
-src/mint-tools/
- -- taler mint helper programs
+src/exchange-tools/
+ -- taler exchange helper programs
-src/mint-lib/
- -- libtalermint: C API to issue HTTP requests to mint
+src/exchange-lib/
+ -- libtalerexchange: C API to issue HTTP requests to exchange
Getting Started
==============
-The following steps illustrate how to set up a mint HTTP server.
-They take as a stub for configuring the mint the content of 'contrib/mint-template/config/'.
+The following steps illustrate how to set up a exchange HTTP server.
+They take as a stub for configuring the exchange the content of 'contrib/exchange-template/config/'.
1) Create a 'test/' directory and copy the stubs in it:
mkdir -p test/config/
-cp mint/contrib/mint-template/config/* test/config/
+cp exchange/contrib/exchange-template/config/* test/config/
cd test/
-2) Create the mint's master with the tool 'gnunet-ecc':
+2) Create the exchange's master with the tool 'gnunet-ecc':
gnunet-ecc -g1 master.priv
-3) Edit config/mint-common.conf by replacing the right value on the line with the
+3) Edit config/exchange-common.conf by replacing the right value on the line with the
MASTER_PUBLIC_KEY entry with the fresh generated (ASCII version of) master.priv.
This ASCII version is obtained by issuing:
gnunet-ecc -p master.priv
-4) Generate other mint related keys ('denomination' and 'signing' keys), by issuing:
+4) Generate other exchange related keys ('denomination' and 'signing' keys), by issuing:
-taler-mint-keyup -d `pwd` -m master.priv
+taler-exchange-keyup -d `pwd` -m master.priv
5) Check with:
-taler-mint-keycheck -d `pwd`
+taler-exchange-keycheck -d `pwd`
-6) A mint needs a database to operate, so the following instructions relate to
+6) A exchange needs a database to operate, so the following instructions relate to
how to set up PostgreSQL. On debian, the two packages needed are:
* postgresql
@@ -99,8 +99,8 @@ how to set up PostgreSQL. On debian, the two packages needed are:
For other operating systems, please refer to the relevant documentation.
-In this settlement, the mint wll use a database called 'talercheck' and will
-run under the username through which 'taler-mint-httpd' is launched. Thus assuming
+In this settlement, the exchange wll use a database called 'talercheck' and will
+run under the username through which 'taler-exchange-httpd' is launched. Thus assuming
that this user is 'demo', we need to create a 'demo' role for postgresql and make
him the owner of 'talercheck' database.
@@ -117,7 +117,7 @@ CREATE DATABASE talercheck OWNER demo;
# quit with CTRL-D
7) If any previous step has been successful, it is now possbile to start up the
-mint web server (by default it will listen on port 4241); issue:
+exchange web server (by default it will listen on port 4241); issue:
-taler-mint-httpd -d `pwd` # assuming we did not move outside of the 'test' directory
+taler-exchange-httpd -d `pwd` # assuming we did not move outside of the 'test' directory
diff --git a/configure.ac b/configure.ac
index 95457e5b4..7b92fd7b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
#
# This file is part of TALER
-# Copyright (C) 2014, 2015 GNUnet e.V.
+# Copyright (C) 2014, 2015, 2016 GNUnet e.V. and Inria
#
# TALER is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
@@ -17,8 +17,8 @@
#
#
AC_PREREQ([2.69])
-AC_INIT([taler-mint], [0.0.0], [taler-bug@gnunet.org])
-AC_CONFIG_SRCDIR([src/util/json.c])
+AC_INIT([taler-exchange], [0.0.0], [taler-bug@gnunet.org])
+AC_CONFIG_SRCDIR([src/util/util.c])
AC_CONFIG_HEADERS([taler_config.h])
# support for non-recursive builds
AM_INIT_AUTOMAKE([subdir-objects])
@@ -354,14 +354,15 @@ AC_CONFIG_FILES([Makefile
doc/Makefile
doc/doxygen/Makefile
src/Makefile
- src/include/Makefile
- src/util/Makefile
- src/pq/Makefile
src/bank-lib/Makefile
+ src/exchangedb/Makefile
+ src/exchange/Makefile
+ src/exchange-tools/Makefile
+ src/exchange-lib/Makefile
+ src/include/Makefile
+ src/json/Makefile
+ src/pq/Makefile
+ src/util/Makefile
src/wire/Makefile
- src/mintdb/Makefile
- src/mint/Makefile
- src/mint-tools/Makefile
- src/mint-lib/Makefile
])
AC_OUTPUT
diff --git a/contrib/coverage.sh b/contrib/coverage.sh
old mode 100755
new mode 100644
index 15318967c..cce622283
--- a/contrib/coverage.sh
+++ b/contrib/coverage.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Run from 'taler-mint/' top-level directory to generate
+# Run from 'taler-exchange/' top-level directory to generate
# code coverage data.
TOP=`pwd`
mkdir -p doc/coverage/
diff --git a/contrib/exchange-template/README b/contrib/exchange-template/README
new file mode 100644
index 000000000..dbbd5c304
--- /dev/null
+++ b/contrib/exchange-template/README
@@ -0,0 +1 @@
+This directory is a template for the exchange directory.
diff --git a/contrib/exchange-template/config/exchange-common.conf b/contrib/exchange-template/config/exchange-common.conf
new file mode 100644
index 000000000..eddde3c32
--- /dev/null
+++ b/contrib/exchange-template/config/exchange-common.conf
@@ -0,0 +1,43 @@
+[exchange]
+# Currency supported by the exchange (can only be one)
+CURRENCY = EUR
+
+# Wire format supported by the exchange, case-insensitive.
+# Examples for formats include 'test' for testing and 'sepa' (for EU IBAN).
+WIREFORMAT = SEPA
+
+# HTTP port the exchange listens to
+PORT = 4241
+
+# Master public key used to sign the exchange's various keys
+MASTER_PUBLIC_KEY = NEGTF62MNGVPZNW19V7S3CRS9D7K04MAHDGX3N6WY2NXREN26J80
+
+# How to access our database
+DB = postgres
+
+# Is this for testing, or for real?
+TESTRUN = YES
+
+[exchangedb-postgres]
+DB_CONN_STR = "postgres:///talercheck"
+
+[wire-incoming-sepa]
+SEPA_RESPONSE_FILE = "sepa.json"
+
+[wire-outgoing-sepa]
+SEPA_RESPONSE_FILE = "sepa.json"
+
+
+[wire-incoming-test]
+# What is the main website of the bank?
+BANK_URI = "https://bank/"
+# Into which account at the 'bank' should incoming
+# wire transfers be made?
+BANK_ACCOUNT_NUMBER = 2
+
+[wire-outgoing-test]
+# What is the main website of the bank?
+BANK_URI = "https://bank/"
+# From which account at the 'bank' should outgoing
+# wire transfers be made?
+BANK_ACCOUNT_NUMBER = 2
diff --git a/contrib/mint-template/config/mint-keyup.conf b/contrib/exchange-template/config/exchange-keyup.conf
similarity index 98%
rename from contrib/mint-template/config/mint-keyup.conf
rename to contrib/exchange-template/config/exchange-keyup.conf
index d8bbc9d20..7eebfe975 100644
--- a/contrib/mint-template/config/mint-keyup.conf
+++ b/contrib/exchange-template/config/exchange-keyup.conf
@@ -1,4 +1,4 @@
-[mint_keys]
+[exchange_keys]
# how long is one signkey valid?
signkey_duration = 4 weeks
diff --git a/contrib/mint-template/README b/contrib/mint-template/README
deleted file mode 100644
index fce5e0180..000000000
--- a/contrib/mint-template/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory is a template for the mint directory.
diff --git a/contrib/mint-template/config/mint-common.conf b/contrib/mint-template/config/mint-common.conf
deleted file mode 100644
index 78a3310a1..000000000
--- a/contrib/mint-template/config/mint-common.conf
+++ /dev/null
@@ -1,28 +0,0 @@
-[mint]
-# Currency supported by the mint (can only be one)
-CURRENCY = EUR
-
-# Wire format supported by the mint, case-insensitive.
-# Examples for formats include 'test' for testing and 'sepa' (for EU IBAN).
-WIREFORMAT = SEPA
-
-# HTTP port the mint listens to
-PORT = 4241
-
-# Master public key used to sign the mint's various keys
-MASTER_PUBLIC_KEY = NEGTF62MNGVPZNW19V7S3CRS9D7K04MAHDGX3N6WY2NXREN26J80
-
-# How to access our database
-DB = postgres
-
-TESTRUN = YES
-
-[mintdb-postgres]
-
-DB_CONN_STR = "postgres:///talercheck"
-
-[mint-wire-sepa]
-SEPA_RESPONSE_FILE = "sepa.json"
-
-[mint-wire-test]
-REDIRECT_URL = "http://test/"
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 51e1ed897..0ccd84746 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -4,11 +4,13 @@ SUBDIRS = . doxygen
man_MANS = \
taler-auditor-sign.1 \
- taler-mint-dbinit.1 \
- taler-mint-httpd.1 \
- taler-mint-keyup.1 \
- taler-mint-keycheck.1 \
- taler-mint-reservemod.1 \
+ taler-exchange-aggregator.1 \
+ taler-exchange-dbinit.1 \
+ taler-exchange-httpd.1 \
+ taler-exchange-keyup.1 \
+ taler-exchange-keycheck.1 \
+ taler-exchange-reservemod.1 \
+ taler-exchange-wire.1 \
taler.conf.5
EXTRA_DIST = \
diff --git a/doc/coding-style.txt b/doc/coding-style.txt
index 093e14d31..fe7bfed12 100644
--- a/doc/coding-style.txt
+++ b/doc/coding-style.txt
@@ -14,10 +14,10 @@ Naming conventions:
SHOULD NOT be included from outside of their own directory
+ end in "_lib" for "simple" libraries
+ end in "_plugin" for plugins
- + end in "_service" for libraries accessing a service, i.e. the mint
+ + end in "_service" for libraries accessing a service, i.e. the exchange
* binaries:
- + taler-mint-xxx: mint programs
+ + taler-exchange-xxx: exchange programs
+ taler-merchant-xxx: merchant programs (demos)
+ taler-wallet-xxx: wallet programs
+ plugins should be libtaler_plugin_xxx_yyy.so: plugin yyy for API xxx
@@ -25,16 +25,16 @@ Naming conventions:
* logging
+ tools use their full name in GNUNET_log_setup
- (i.e. 'taler-mint-keyup') and log using plain 'GNUNET_log'.
+ (i.e. 'taler-exchange-keyup') and log using plain 'GNUNET_log'.
+ pure libraries (without associated service) use 'GNUNET_log_from'
with the component set to their library name (without lib or '.so'),
which should also be their directory name (i.e. 'util')
+ plugin libraries (without associated service) use 'GNUNET_log_from'
with the component set to their type and plugin name (without lib or '.so'),
- which should also be their directory name (i.e. 'mintdb-postgres')
+ which should also be their directory name (i.e. 'exchangedb-postgres')
+ libraries with associated service) use 'GNUNET_log_from'
with the name of the service, which should also be their
- directory name (i.e. 'mint')
+ directory name (i.e. 'exchange')
* configuration
+ same rules as for GNUnet
@@ -44,7 +44,7 @@ Naming conventions:
MUST match the subdirectory of src/ in which the symbol is defined
+ from libtalerutil start just with TALER_, without subsystemname
+ if scope is ONE binary and symbols are not in a shared library,
- use binary-specific prefix (such as TMH = taler-mint-httpd) for
+ use binary-specific prefix (such as TMH = taler-exchange-httpd) for
globals, possibly followed by the subsystem (TMH_DB_xxx).
* structs:
diff --git a/doc/doxygen/Makefile.am b/doc/doxygen/Makefile.am
index 6b6f1ed72..da4dbc140 100644
--- a/doc/doxygen/Makefile.am
+++ b/doc/doxygen/Makefile.am
@@ -5,14 +5,14 @@ all:
"\tmake full - full documentation with dependency graphs (slow)\n" \
"\tmake fast - fast mode without dependency graphs"
-full: taler-mint.doxy
+full: taler-exchange.doxy
doxygen $<
-fast: taler-mint.doxy
+fast: taler-exchange.doxy
sed 's/\(HAVE_DOT.*=\).*/\1 NO/' $< | doxygen -
clean:
rm -rf html
-EXTRA_DIST = taler-mint.doxy
+EXTRA_DIST = taler-exchange.doxy
diff --git a/doc/doxygen/taler-mint.doxy b/doc/doxygen/taler-exchange.doxy
similarity index 99%
rename from doc/doxygen/taler-mint.doxy
rename to doc/doxygen/taler-exchange.doxy
index 2949fac0d..23c2fbe07 100644
--- a/doc/doxygen/taler-mint.doxy
+++ b/doc/doxygen/taler-exchange.doxy
@@ -4,7 +4,7 @@
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
-PROJECT_NAME = "GNU Taler: Mint"
+PROJECT_NAME = "GNU Taler: Exchange"
PROJECT_NUMBER = 0.0
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = YES
diff --git a/doc/logos/fonts/OldNewspaperTypes.ttf b/doc/logos/fonts/OldNewspaperTypes.ttf
old mode 100755
new mode 100644
diff --git a/doc/paper/rfc.bib b/doc/paper/rfc.bib
index 700f3a99a..99c427e58 100644
--- a/doc/paper/rfc.bib
+++ b/doc/paper/rfc.bib
@@ -9025,7 +9025,7 @@
organization="Internet Engineering Task Force",
year=1978,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc748.txt",
}
@@ -13671,7 +13671,7 @@
organization="Internet Engineering Task Force",
year=1989,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1097.txt",
}
@@ -14377,7 +14377,7 @@
organization="Internet Engineering Task Force",
year=1990,
month=apr,
- day="1",
+ day="1",
note="Updated by RFCs 2549, 6214",
url="http://www.ietf.org/rfc/rfc1149.txt",
}
@@ -15260,7 +15260,7 @@
organization="Internet Engineering Task Force",
year=1991,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1216.txt",
}
@@ -15274,7 +15274,7 @@
organization="Internet Engineering Task Force",
year=1991,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1217.txt",
}
@@ -16551,7 +16551,7 @@
organization="Internet Engineering Task Force",
year=1992,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1313.txt",
}
@@ -18223,7 +18223,7 @@
organization="Internet Engineering Task Force",
year=1993,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1437.txt",
}
@@ -18237,7 +18237,7 @@
organization="Internet Engineering Task Force",
year=1993,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1438.txt",
}
@@ -20478,7 +20478,7 @@
organization="Internet Engineering Task Force",
year=1994,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1605.txt",
}
@@ -20492,7 +20492,7 @@
organization="Internet Engineering Task Force",
year=1994,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1606.txt",
}
@@ -20506,7 +20506,7 @@
organization="Internet Engineering Task Force",
year=1994,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1607.txt",
}
@@ -22753,7 +22753,7 @@
organization="Internet Engineering Task Force",
year=1995,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1776.txt",
}
@@ -24716,7 +24716,7 @@
organization="Internet Engineering Task Force",
year=1996,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1924.txt",
}
@@ -24730,7 +24730,7 @@
organization="Internet Engineering Task Force",
year=1996,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1925.txt",
}
@@ -24744,7 +24744,7 @@
organization="Internet Engineering Task Force",
year=1996,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1926.txt",
}
@@ -24758,7 +24758,7 @@
organization="Internet Engineering Task Force",
year=1996,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc1927.txt",
}
@@ -27077,7 +27077,7 @@
organization="Internet Engineering Task Force",
year=1997,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc2100.txt",
}
@@ -30038,7 +30038,7 @@
organization="Internet Engineering Task Force",
year=1998,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc2321.txt",
}
@@ -30052,7 +30052,7 @@
organization="Internet Engineering Task Force",
year=1998,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc2322.txt",
}
@@ -30066,7 +30066,7 @@
organization="Internet Engineering Task Force",
year=1998,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc2323.txt",
}
@@ -30080,7 +30080,7 @@
organization="Internet Engineering Task Force",
year=1998,
month=apr,
- day="1",
+ day="1",
note="Updated by RFC 7168",
url="http://www.ietf.org/rfc/rfc2324.txt",
}
@@ -30095,7 +30095,7 @@
organization="Internet Engineering Task Force",
year=1998,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc2325.txt",
}
@@ -33099,7 +33099,7 @@
organization="Internet Engineering Task Force",
year=1999,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc2549.txt",
}
@@ -33113,7 +33113,7 @@
organization="Internet Engineering Task Force",
year=1999,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc2550.txt",
}
@@ -33127,7 +33127,7 @@
organization="Internet Engineering Task Force",
year=1999,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc2551.txt",
}
@@ -36388,7 +36388,7 @@
organization="Internet Engineering Task Force",
year=2000,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc2795.txt",
}
@@ -40323,7 +40323,7 @@
organization="Internet Engineering Task Force",
year=2001,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc3091.txt",
}
@@ -40337,7 +40337,7 @@
organization="Internet Engineering Task Force",
year=2001,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc3092.txt",
}
@@ -40351,7 +40351,7 @@
organization="Internet Engineering Task Force",
year=2001,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc3093.txt",
}
@@ -42397,7 +42397,7 @@
organization="Internet Engineering Task Force",
year=2002,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc3251.txt",
}
@@ -42411,7 +42411,7 @@
organization="Internet Engineering Task Force",
year=2002,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc3252.txt",
}
@@ -45820,7 +45820,7 @@
organization="Internet Engineering Task Force",
year=2003,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc3514.txt",
}
@@ -48951,7 +48951,7 @@
organization="Internet Engineering Task Force",
year=2004,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc3751.txt",
}
@@ -52675,7 +52675,7 @@
organization="Internet Engineering Task Force",
year=2005,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc4041.txt",
}
@@ -52689,7 +52689,7 @@
organization="Internet Engineering Task Force",
year=2005,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc4042.txt",
}
@@ -62743,7 +62743,7 @@
organization="Internet Engineering Task Force",
year=2007,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc4824.txt",
}
@@ -68094,7 +68094,7 @@
organization="Internet Engineering Task Force",
year=2008,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc5241.txt",
}
@@ -68108,7 +68108,7 @@
organization="Internet Engineering Task Force",
year=2008,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc5242.txt",
}
@@ -71194,7 +71194,7 @@
@misc{rfc5486,
author="D. Malas and D. Meyer",
- title="{Session Peering for Multimedia Interconnect (SPEERMINT) Terminology}",
+ title="{Session Peering for Multimedia Interconnect (SPEEREXCHANGE) Terminology}",
series="Request for Comments",
number="5486",
howpublished="RFC 5486 (Informational)",
@@ -71529,7 +71529,7 @@
organization="Internet Engineering Task Force",
year=2009,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc5513.txt",
}
@@ -71543,7 +71543,7 @@
organization="Internet Engineering Task Force",
year=2009,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc5514.txt",
}
@@ -75706,7 +75706,7 @@
organization="Internet Engineering Task Force",
year=2010,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc5841.txt",
}
@@ -77555,7 +77555,7 @@
organization="Internet Engineering Task Force",
year=2011,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc5984.txt",
}
@@ -80463,7 +80463,7 @@
organization="Internet Engineering Task Force",
year=2011,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc6214.txt",
}
@@ -80503,7 +80503,7 @@
organization="Internet Engineering Task Force",
year=2011,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc6217.txt",
}
@@ -82898,7 +82898,7 @@
@misc{rfc6404,
author="J. Seedorf and S. Niccolini and E. Chen and H. Scholz",
- title="{Session PEERing for Multimedia INTerconnect (SPEERMINT) Security Threats and Suggested Countermeasures}",
+ title="{Session PEERing for Multimedia INTerconnect (SPEEREXCHANGE) Security Threats and Suggested Countermeasures}",
series="Request for Comments",
number="6404",
howpublished="RFC 6404 (Informational)",
@@ -82924,7 +82924,7 @@
@misc{rfc6406,
author="D. Malas and J. Livingood",
- title="{Session PEERing for Multimedia INTerconnect (SPEERMINT) Architecture}",
+ title="{Session PEERing for Multimedia INTerconnect (SPEEREXCHANGE) Architecture}",
series="Request for Comments",
number="6406",
howpublished="RFC 6406 (Informational)",
@@ -85310,7 +85310,7 @@
organization="Internet Engineering Task Force",
year=2012,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc6592.txt",
}
@@ -85324,7 +85324,7 @@
organization="Internet Engineering Task Force",
year=2012,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc6593.txt",
}
@@ -89460,7 +89460,7 @@
organization="Internet Engineering Task Force",
year=2013,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc6919.txt",
}
@@ -89487,7 +89487,7 @@
organization="Internet Engineering Task Force",
year=2013,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc6921.txt",
}
@@ -92639,7 +92639,7 @@
organization="Internet Engineering Task Force",
year=2014,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc7168.txt",
}
@@ -92653,7 +92653,7 @@
organization="Internet Engineering Task Force",
year=2014,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc7169.txt",
}
@@ -97095,7 +97095,7 @@
organization="Internet Engineering Task Force",
year=2015,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc7511.txt",
}
@@ -97135,7 +97135,7 @@
organization="Internet Engineering Task Force",
year=2015,
month=apr,
- day="1",
+ day="1",
url="http://www.ietf.org/rfc/rfc7514.txt",
}
@@ -98711,4 +98711,3 @@
month=sep,
url="http://www.ietf.org/rfc/rfc7651.txt",
}
-
diff --git a/doc/paper/taler.bib b/doc/paper/taler.bib
index b5bd5938d..b22e9eb55 100644
--- a/doc/paper/taler.bib
+++ b/doc/paper/taler.bib
@@ -173,3 +173,77 @@
www_pdf_url = {https://www.torproject.org/svn/trunk/doc/design-paper/tor-design.pdf},
www_section = {Anonymous communication},
}
+
+
+@inbook{BellareRogaway1996,
+ author="Bellare, Mihir and Rogaway, Phillip",
+ editor="Maurer, Ueli",
+ chapter="The Exact Security of Digital Signatures-How to Sign with RSA and Rabin",
+ title="Advances in Cryptology --- EUROCRYPT '96: International Conference on the Theory and Application of Cryptographic Techniques Saragossa, Spain, May 12--16, 1996 Proceedings",
+ year="1996",
+ publisher="Springer Berlin Heidelberg",
+ address="Berlin, Heidelberg",
+ pages="399--416",
+ isbn="978-3-540-68339-1",
+ doi="10.1007/3-540-68339-9_34",
+ url_doi="http://dx.doi.org/10.1007/3-540-68339-9_34",
+ url="http://web.cs.ucdavis.edu/~rogaway/papers/exact.pdf"
+}
+
+
+
+@article{OneMoreInversion,
+ author="Bellare and Namprempre and Pointcheval and Semanko",
+ title="The One-More-RSA-Inversion Problems and the Security of Chaum's Blind Signature Scheme ",
+ journal="Journal of Cryptology",
+ volume="16",
+ number="3",
+ pages="185--215",
+ abstract="We introduce a new class of computational problems which we call the ``one-more-RSA-inversion'' problems. Our main result is that two problems in this class, which we call the chosen-target and known-target inversion problems, respectively, have polynomially equivalent computational complexity. We show how this leads to a proof of security for Chaum's RSA-based blind signature scheme in the random oracle model based on the assumed hardness of either of these problems. We define and prove analogous results for ``one-more-discrete-logarithm'' problems. Since the appearence of the preliminary version of this paper, the new problems we have introduced have found other uses as well.",
+ issn="1432-1378",
+ doi="10.1007/s00145-002-0120-1",
+ doi_url="http://dx.doi.org/10.1007/s00145-002-0120-1",
+ url="https://eprint.iacr.org/2001/002"
+}
+
+@misc{cryptoeprint:2001:002,
+ author = {M. Bellare and C. Namprempre and D. Pointcheval and M. Semanko},
+ title = {The One-More-RSA-Inversion Problems and the Security of Chaum's Blind Signature Scheme},
+ howpublished = {Cryptology ePrint Archive, Report 2001/002},
+ year = {2001},
+ note = {\url{http://eprint.iacr.org/}},
+}
+
+
+@inbook{RSA-KTIvCTI,
+ author="Bellare, Mihir and Namprempre, Chanathip and Pointcheval, David and Semanko, Michael",
+ editor="Syverson, Paul",
+ chapter="The Power of RSA Inversion Oracles and the Security of Chaum's RSA-Based Blind Signature Scheme",
+ title="Financial Cryptography: 5th International Conference, FC 2001 Grand Cayman, British West Indies, February 19--22, 2001 Proceedings",
+ year="2002",
+ publisher="Springer Berlin Heidelberg",
+ address="Berlin, Heidelberg",
+ pages="319--338",
+ isbn="978-3-540-46088-6",
+ doi="10.1007/3-540-46088-8_25",
+ url="https://www.di.ens.fr/~pointche/Documents/Papers/2001_fcA.pdf"
+}
+
+
+@inbook{Coron2000,
+ author="Coron, Jean-S{\'e}bastien",
+ editor="Bellare, Mihir",
+ chapter="On the Exact Security of Full Domain Hash",
+ title="Advances in Cryptology --- CRYPTO 2000: 20th Annual International Cryptology Conference Santa Barbara, California, USA, August 20--24, 2000 Proceedings",
+ year="2000",
+ publisher="Springer Berlin Heidelberg",
+ address="Berlin, Heidelberg",
+ pages="229--235",
+ isbn="978-3-540-44598-2",
+ doi="10.1007/3-540-44598-6_14",
+ doi_url="http://dx.doi.org/10.1007/3-540-44598-6_14",
+ url="https://www.iacr.org/archive/crypto2000/18800229/18800229.pdf"
+}
+
+
+
diff --git a/doc/paper/taler.tex b/doc/paper/taler.tex
index e9c795857..5ad93ec32 100644
--- a/doc/paper/taler.tex
+++ b/doc/paper/taler.tex
@@ -41,17 +41,17 @@
% 'transaction' already when we talk about taxable
% transfers of Taler coins and database 'transactions'.
% - wallet = coins at customer
-% - reserve = currency entrusted to mint waiting for withdrawal
-% - deposit = SEPA to mint
-% - withdrawal = mint to customer
+% - reserve = currency entrusted to exchange waiting for withdrawal
+% - deposit = SEPA to exchange
+% - withdrawal = exchange to customer
% - spending = customer to merchant
-% - redeeming = merchant to mint (and then mint SEPA to merchant)
-% - refreshing = customer-mint-customer
+% - redeeming = merchant to exchange (and then exchange SEPA to merchant)
+% - refreshing = customer-exchange-customer
% - dirty coin = coin with exposed public key
% - fresh coin = coin that was refreshed or is new
-% - coin signing key = mint's online key used to (blindly) sign coin
-% - message signing key = mint's online key to sign mint messages
-% - mint master key = mint's key used to sign other mint keys
+% - coin signing key = exchange's online key used to (blindly) sign coin
+% - message signing key = exchange's online key to sign exchange messages
+% - exchange master key = exchange's key used to sign other exchange keys
% - owner = entity that knows coin private key
% - transaction = coin ownership transfer that should be taxed
% - sharing = coin copying that should not be taxed
@@ -74,7 +74,7 @@ blind signatures that enables anonymous payments while ensuring that
entities that receive payments are auditable and thus taxable. Taler
differs from Chaum's original proposal in that customers can never
defraud anyone, merchants can only fail to deliver the merchandise to
-the customer, and mints can be fully audited. Consequently,
+the customer, and exchanges can be fully audited. Consequently,
enforcement of honest behavior is better and more timely than with
Chaum, and is at least as strict as with legacy credit card payment
systems that do not provide for privacy. Furthermore, Taler allows
@@ -112,11 +112,11 @@ anarchistic economies.
The Taler protocol is heavily based on ideas from
Chaum~\cite{chaum1983blind} and also follows Chaum's basic architecture of
-customer, merchant and mint (Figure~\ref{fig:cmm}). The two designs
+customer, merchant and exchange (Figure~\ref{fig:cmm}). The two designs
share the key first step where the {\em customer} withdraws digital
-{\em coins} from the {\em mint} with unlinkability provided via blind
+{\em coins} from the {\em exchange} with unlinkability provided via blind
signatures. The coins can then be spent at a {\em merchant} who {\em
- deposits} them at the mint. Taler uses online detection of
+ deposits} them at the exchange. Taler uses online detection of
double-spending, thus assuring the merchant instantly that a
transaction is valid.
@@ -125,17 +125,17 @@ transaction is valid.
\begin{tikzpicture}
\tikzstyle{def} = [node distance= 5em and 7em, inner sep=1em, outer sep=.3em];
\node (origin) at (0,0) {};
- \node (mint) [def,above=of origin,draw]{Mint};
+ \node (exchange) [def,above=of origin,draw]{Exchange};
\node (customer) [def, draw, below left=of origin] {Customer};
\node (merchant) [def, draw, below right=of origin] {Merchant};
\node (auditor) [def, draw, above right=of origin]{Auditor};
\tikzstyle{C} = [color=black, line width=1pt]
- \draw [<-, C] (customer) -- (mint) node [midway, above, sloped] (TextNode) {withdraw coins};
- \draw [<-, C] (mint) -- (merchant) node [midway, above, sloped] (TextNode) {deposit coins};
+ \draw [<-, C] (customer) -- (exchange) node [midway, above, sloped] (TextNode) {withdraw coins};
+ \draw [<-, C] (exchange) -- (merchant) node [midway, above, sloped] (TextNode) {deposit coins};
\draw [<-, C] (merchant) -- (customer) node [midway, above, sloped] (TextNode) {spend coins};
- \draw [<-, C] (mint) -- (auditor) node [midway, above, sloped] (TextNode) {verify};
+ \draw [<-, C] (exchange) -- (auditor) node [midway, above, sloped] (TextNode) {verify};
\end{tikzpicture}
\caption{Taler's system model for the payment system is based on Chaum~\cite{chaum1983blind}.}
@@ -147,7 +147,7 @@ believe needs a payment system with the following properties:
\begin{description}
\item[Customer Anonymity]
- It must be impossible for mints, merchants and even a global active
+ It must be impossible for exchanges, merchants and even a global active
adversary, to trace the spending behavior of a customer.
\item[Unlinkability]
As a strong form of customer anonymity, it must be infeasible to
@@ -170,11 +170,11 @@ believe needs a payment system with the following properties:
Nevertheless, customers must never be able to defraud anyone, and
merchants must at best be able to defraud their customers by not
delivering on the agreed contract. Neither merchants nor customers
- should ever be able to commit fraud against the mint. Additionally,
+ should ever be able to commit fraud against the exchange. Additionally,
both customers and merchants must receive cryptographic proofs of
- bad behavior in case of protocol violations by the mint.
- In this way, only the mint will need to be tightly audited and regulated.
- The design must make it easy to audit the finances of the mint.
+ bad behavior in case of protocol violations by the exchange.
+ In this way, only the exchange will need to be tightly audited and regulated.
+ The design must make it easy to audit the finances of the exchange.
\item[Ease of Deployment] %The system should be easy to deploy for
% real-world applications. In order to lower the entry barrier and
% acceptance of the system, a gateway to the existing financial
@@ -206,8 +206,8 @@ say a \EUR{0,01} coin and a \EUR{50,00} coin.
A merchant cannot simply give the customer their coins in another transaction;
however, as this reverses the role of merchant and customer, and
our taxability requirement would deanonymize the customer. The customer
-also cannot withdraw exact change from his account from the mint, as this
-would allow the mint to link the identity of the customer that is revealed
+also cannot withdraw exact change from his account from the exchange, as this
+would allow the exchange to link the identity of the customer that is revealed
during withdrawal to the subsequent deposit operation that follows shortly
afterwards.
Instead, the customer should obtain new freshly anonymized coins that cannot be
@@ -226,9 +226,9 @@ A key contribution of Taler is the {\em refresh} protocol, which enables
a customer to exchange the residual value of the exchanged coin for
unlinkable freshly anonymized change.
-Taler mints ensure that all transactions involving the same coin
+Taler exchanges ensure that all transactions involving the same coin
do not exceed the total value of the coin simply by
-requiring that merchants clear transactions immediately with the mint.
+requiring that merchants clear transactions immediately with the exchange.
This improves dramatically on systems that support offline merchants with
cryptographic threats to deanonymizing customers who double-spend, like
restrictive blind signatures~\cite{brands1993efficient}.
@@ -308,17 +308,17 @@ Taler avoids include:
\item The use of patents to protect the technology; a payment system
should be free software (libre) to have a chance for widespread adoption.
\item The use of off-line payments and thus deferred detection of
- double-spending, which could require the mint to attempt to recover
+ double-spending, which could require the exchange to attempt to recover
funds from customers via the legal system. This creates a
- significant business risk for the mint, as the system is not
- self-enforcing from the perspective of the mint. In 1983 off-line
+ significant business risk for the exchange, as the system is not
+ self-enforcing from the perspective of the exchange. In 1983 off-line
payments might have been a necessary feature. However, today
requiring network connectivity is feasible and avoids the business
risks associated with deferred fraud detection.
\item % In addition to the risk of legal disputes with fraudulent
% merchants and customers,
Chaum's published design does not clearly
- limit the financial damage a mint might suffer from the
+ limit the financial damage a exchange might suffer from the
disclosure of its private online signing key.
\item Chaum did not support fractional payments or refunds without
breaking customer anonymity.
@@ -359,16 +359,16 @@ description of the Opencoin protocol is available to date.
Peppercoin~\cite{rivest2004peppercoin} is a microdonation protocol.
The main idea of the protocol is to reduce transaction costs by
minimizing the number of transactions that are processed directly by
-the mint. Instead of always paying, the customer ``gambles'' with the
+the exchange. Instead of always paying, the customer ``gambles'' with the
merchant for each microdonation. Only if the merchant wins, the
microdonation is upgraded to a macropayment to be deposited at the
-mint. Peppercoin does not provide customer-anonymity. The proposed
-statistical method by which mints detect fraudulent cooperation between
-customers and merchants at the expense of the mint not only creates
-legal risks for the mint, but would also require that the mint learns
+exchange. Peppercoin does not provide customer-anonymity. The proposed
+statistical method by which exchanges detect fraudulent cooperation between
+customers and merchants at the expense of the exchange not only creates
+legal risks for the exchange, but would also require that the exchange learns
about microdonations where the merchant did not get upgraded to a
macropayment. It is therefore unclear how Peppercoin would actually
-reduce the computational burden on the mint.
+reduce the computational burden on the exchange.
\section{Design}
@@ -382,32 +382,32 @@ As with Chaum, the Taler system comprises three principal types of
actors (Figure~\ref{fig:cmm}): The \emph{customer} is interested in
receiving goods or services from the \emph{merchant} in exchange for
payment. When making a transaction, both the customer and the
-merchant must agree on the same \emph{mint}, which serves as an
-intermediary for the financial transaction between the two. The mint
+merchant must agree on the same \emph{exchange}, which serves as an
+intermediary for the financial transaction between the two. The exchange
is responsible for allowing the customer to obtain the anonymous
digital currency and for enabling the merchant to convert the
digital coins back to some traditional currency. The \emph{auditor}
-assures customers and merchants that the mint operates correctly.
+assures customers and merchants that the exchange operates correctly.
\subsection{Security model}
Taler's security model assumes that cryptographic primitives are
secure and that each participant is under full control of his system.
-The contact information of the mint is known to both customer and
+The contact information of the exchange is known to both customer and
merchant from the start. Furthermore, the merchant communication's
authenticity is assured to the customer, such as by using X.509
certificates~\cite{rfc5280}, and we assume that an anonymous, reliable
bi-directional communication channel can be established by the
-customer to both the mint and the merchant, such as by using Tor.
+customer to both the exchange and the merchant, such as by using Tor.
-The mint is trusted to hold funds of its customers and to forward them
+The exchange is trusted to hold funds of its customers and to forward them
when receiving the respective deposit instructions from the merchants.
-Customer and merchant can have some assurances about the mint's
-liquidity and operation, as the mint has proven reserves, is subject
+Customer and merchant can have some assurances about the exchange's
+liquidity and operation, as the exchange has proven reserves, is subject
to the law, and can have its business regularly audited
by a government or third party.
-Regular audits of the mint's accounts should reveal any possible fraud
-before the mint is allowed to destroy the corresponding accumulated
+Regular audits of the exchange's accounts should reveal any possible fraud
+before the exchange is allowed to destroy the corresponding accumulated
cryptographic proofs and book its fees as profits.
%
The merchant is trusted to deliver the service or goods to the
@@ -416,7 +416,7 @@ to achieve this, as he must get cryptographic proofs of the contract
and that he paid his obligations.
%
Neither the merchant nor the customer may have any ability to {\em
- effectively} defraud the mint or the state collecting taxes. Here,
+ effectively} defraud the exchange or the state collecting taxes. Here,
``effectively'' means that the expected return for fraud is negative.
Note that customers do not need to be trusted in any way, and that in
particular it is never necessary for anyone to try to recover funds
@@ -455,10 +455,10 @@ thus {\bf not} recorded for taxation.
Taler ensures taxability only when some entity acquires exclusive
control over the value of digital coins, which requires an interaction
-with the mint. For such transactions, the state can obtain information
-from the mint, or a bank, that identifies the entity that received the
+with the exchange. For such transactions, the state can obtain information
+from the exchange, or a bank, that identifies the entity that received the
digital coins as well as the exact value of those coins.
-Taler also allows the mint, and hence the state, to learn the value of
+Taler also allows the exchange, and hence the state, to learn the value of
digital coins withdrawn by a customer---but not how, where, or when
they were spent.
@@ -468,7 +468,7 @@ An anonymous communication channel such as Tor~\cite{tor-design} is
used for all communication between the customer and the merchant.
Ideally, the customer's anonymity is limited only by this channel;
however, the payment system does additionally reveal that the customer
-is one of the patrons of the mint.
+is one of the patrons of the exchange.
There are naturally risks that the customer-merchant business operation
may leak identifying information about the customer. At least, customers
have some options to defend their privacy against nosey merchants however,
@@ -477,7 +477,7 @@ We consider information leakage specific to the business logic to be
outside of the scope of the design of Taler.
Ideally, customer should use an anonymous communication channel with
-the mint to avoid leaking IP address information; however, the mint
+the exchange to avoid leaking IP address information; however, the exchange
would typically learn the customer's identity from the wire transfer
that funds the customer's withdraw anonymous digital coins.
In fact, this is desirable as there might be rules and regulations
@@ -485,33 +485,33 @@ designed to limit the amount of anonymous digital cash that an
individual customer can withdraw in a given time period, similar to
how states today sometimes impose limits on cash
withdrawals~\cite{france2015cash,greece2015cash}.
-Taler is only anonymous with respect to {\em payments}, as the mint
+Taler is only anonymous with respect to {\em payments}, as the exchange
will be unable to link the known identity of the customer that withdrew
anonymous digital currency to the {\em purchase} performed later at the
merchant. In this respect, Taler provides exactly the same scheme for
unconditional anonymous payments as was proposed by
Chaum~\cite{chaum1983blind,chaum1990untraceable} over 30 years ago.
-While the customer thus has anonymity for purchases, the mint will
+While the customer thus has anonymity for purchases, the exchange will
always learn the merchant's identity in order to credit the merchant's
account. This is simply necessary for taxation, as Taler is supposed
to make information about funds received by any entity transparent
to the state.
% Technically, the merchant could still
-%use an anonymous communication channel to communicate with the mint.
-%However, in order to receive the traditional currency the mint will
+%use an anonymous communication channel to communicate with the exchange.
+%However, in order to receive the traditional currency the exchange will
%require (SEPA) account details for the deposit.
-%As both the initial transaction between the customer and the mint as
-%well as the transactions between the merchant and the mint do not have
+%As both the initial transaction between the customer and the exchange as
+%well as the transactions between the merchant and the exchange do not have
%to be done anonymously, there might be a formal business contract
-%between the customer and the mint and the merchant and the mint. Such
+%between the customer and the exchange and the merchant and the exchange. Such
%a contract may provide customers and merchants some assurance that
-%they will actually receive the traditional currency from the mint
+%they will actually receive the traditional currency from the exchange
%given cryptographic proof about the validity of the transaction(s).
%However, given the business overheads for establishing such contracts
-%and the natural goal for the mint to establish a reputation and to
-%minimize cost, it is more likely that the mint will advertise its
+%and the natural goal for the exchange to establish a reputation and to
+%minimize cost, it is more likely that the exchange will advertise its
%external auditors and proven reserves and thereby try to convince
%customers and merchants to trust it without a formal contract.
@@ -519,57 +519,57 @@ to the state.
\subsection{Coins}
A \emph{coin} in Taler is a public-private key pair which derives its
-financial value from a signature over the coin's public key by a mint.
-The mint is expected to have multiple {\em coin signing key} pairs
+financial value from a signature over the coin's public key by a exchange.
+The exchange is expected to have multiple {\em coin signing key} pairs
available for signing, each representing a different coin
denomination.
These coin signing keys have an expiration date, before which any coins
-signed with it must be spent or refreshed. This allows the mint to
+signed with it must be spent or refreshed. This allows the exchange to
eventually discard records of old transactions, thus limiting the
-records that the mint must retain and search to detect double-spending
-attempts. Furthermore, the mint is expected to use each coin signing
+records that the exchange must retain and search to detect double-spending
+attempts. Furthermore, the exchange is expected to use each coin signing
key only for a limited number of coins.
% for example by limiting its use to sign coins to a week or a month.
In this way, if a private coin signing key were to be compromised,
-the mint would detect this once more coins were redeemed than the total
+the exchange would detect this once more coins were redeemed than the total
that was signed into existence using that coin signing key.
-In this case, the mint could allow authentic customers to exchange their
+In this case, the exchange could allow authentic customers to exchange their
unspent coins that were signed with the compromised private key,
while refusing further anonymous transactions involving those coins.
As a result, the financial damage of losing a private signing key can be
limited to at most twice the amount originally signed with that key.
-To ensure that the mint does not enable deanonymization of users by
-signing each coin with a fresh coin signing key, the mint must publicly
+To ensure that the exchange does not enable deanonymization of users by
+signing each coin with a fresh coin signing key, the exchange must publicly
announce the coin signing keys in advance. Those announcements are
expected to be signed with an off-line long-term private {\em master
-signing key} of the mint and the auditor.
+signing key} of the exchange and the auditor.
-Before a customer can withdraw a coin from the mint,
-he has to pay the mint the value of the coin, as well as processing fees.
+Before a customer can withdraw a coin from the exchange,
+he has to pay the exchange the value of the coin, as well as processing fees.
This is done using other means of payments, such as wire transfers or
-by having a personal {\em reserve} at the mint,
+by having a personal {\em reserve} at the exchange,
which is equivalent to a bank account with a positive balance.
Taler assumes that the customer has a {\em withdrawal authorization key}
to identify himself as authorized to withdraw funds from the reserve.
By signing the withdrawal request messages using this withdrawal
-authorization key, the customer can prove to the mint that he is the
+authorization key, the customer can prove to the exchange that he is the
individual authorized to withdraw anonymous digital coins from his reserve.
-The mint will record the withdrawal messages with the reserve record as
+The exchange will record the withdrawal messages with the reserve record as
proof that the anonymous digital coin was created for the correct
customer. We note that the specifics of how the customer authenticates
-to the mint are orthogonal to the rest of the system, and
+to the exchange are orthogonal to the rest of the system, and
multiple methods can be supported.
%To put it differently, unlike
%modern cryptocurrencies like BitCoin, Taler's design simply
%acknowledges that primitive accumulation~\cite{engels1844} predates
%the system and that a secure method to authenticate owners exists.
-After a coin is minted, the customer is the only entity that knows the
+After a coin is exchanged, the customer is the only entity that knows the
private key of the coin, making him the \emph{owner} of the coin.
-The coin can be identified by the mint by its public key; however, due
-to the use of blind signatures, the mint does not learn the public key
-during the minting process. Knowledge of the private key of the coin
+The coin can be identified by the exchange by its public key; however, due
+to the use of blind signatures, the exchange does not learn the public key
+during the exchange process. Knowledge of the private key of the coin
enables the owner to spent the coin. If the private key is shared
with others, they also become owners of the coin.
@@ -579,10 +579,10 @@ To spend a coin, the coin's owner needs to sign a {\em deposit
request} specifying the amount, the merchant's account information
and a {\em business transaction-specific hash} using the coin's
private key. A merchant can then transfer this permission of the
-coin's owner to the mint to obtain the amount in traditional currency.
-If the customer is cheating and the coin was already spent, the mint
+coin's owner to the exchange to obtain the amount in traditional currency.
+If the customer is cheating and the coin was already spent, the exchange
provides cryptographic proof of the fraud to the merchant, who will
-then refuse the transaction. The mint is typically expected to
+then refuse the transaction. The exchange is typically expected to
transfer the funds to the merchant using a wire transfer or by
crediting the merchant's individual account, depending on what is
appropriate to the domain of the traditional currency.
@@ -591,7 +591,7 @@ To allow exact payments without requiring the customer to keep a large
amount of ``change'' in stock and possibly perform thousands of
signatures for larger transactions, the payment systems allows partial
spending where just a fraction of a coin's total value is transferred.
-Consequently, the mint the must not only store the identifiers of
+Consequently, the exchange the must not only store the identifiers of
spent coins, but also the fraction of the coin that has been spent.
@@ -601,7 +601,7 @@ In this and other scenarios it is thus possible that a customer has
revealed the public key of a coin to a merchant, but not ultimately
signed over the full value of the coin. If the customer then
continues to directly use the coin in other transactions, merchants
-and the mint could link the various transactions as they all share the
+and the exchange could link the various transactions as they all share the
same public key for the coin.
The owner of such a {\em dirty} coin might therefore want to exchange it
@@ -620,21 +620,21 @@ must assure that owner stays the same.
% Meh, this paragraph sucks :
We therefore demand two main properties from the refresh protocol:
-First, the mint must not be able to link the fresh coin's public key to
-the public key of the dirty coin. Second, the mint can ensure that the
+First, the exchange must not be able to link the fresh coin's public key to
+the public key of the dirty coin. Second, the exchange can ensure that the
owner of the dirty coin can determine the private key of the
fresh coin, thereby preventing the refresh protocol from being used to
construct a transaction.
%As with other operations, the refreshing protocol must also protect
-%the mint from double-spending; similarly, the customer has to have
-%cryptographic evidence if there is any misbehavior by the mint.
-%Finally, the mint may choose to charge a transaction fee for
+%the exchange from double-spending; similarly, the customer has to have
+%cryptographic evidence if there is any misbehavior by the exchange.
+%Finally, the exchange may choose to charge a transaction fee for
%refreshing by reducing the value of the generated fresh coins
%in relation to the value of the melted coins.
%
%Naturally, all such transaction fees should be clearly stated as part
-%of the business contract offered by the mint to customers and
+%of the business contract offered by the exchange to customers and
%merchants.
@@ -642,7 +642,7 @@ construct a transaction.
% In this section, we describe the protocols for Taler in detail.
-We shall assume for the sake of brevity that a recipient of a signed
+We shall assume for the sake of brevity that a recipient of a signed
message always first checks that the signature is valid, aborting the
operation if not. Additionally, we assume that the receiver of a
signed message is either told the public key, or knows it from the
@@ -650,10 +650,10 @@ context, and that the signature contains additional identification as
to the purpose of the signature, making it impossible to use a signature
in a different context.
-The mint has an {\em online message signing key} used for signing
-messages, as opposed to coins. The mint's long-term offline key is used
+The exchange has an {\em online message signing key} used for signing
+messages, as opposed to coins. The exchange's long-term offline key is used
to certify both the coin signing keys and the online message signing key
-of the mint. The mint's long-term offline key is assumed to be known to
+of the exchange. The exchange's long-term offline key is assumed to be known to
both customers and merchants and is certified by the auditors.
As we are dealing with financial transactions, we explicitly describe
@@ -665,19 +665,19 @@ information. Keys and thus coins always have a well-known expiration
date; information committed to disk can be discarded after the
expiration date of the respective public key. Customers can also
discard information once the respective coins have been fully spent,
-and merchants may discard information once payments from the mint have
+and merchants may discard information once payments from the exchange have
been received, assuming the records are also no longer needed for tax
-purposes. The mint's bank transfers dealing in traditional currency
+purposes. The exchange's bank transfers dealing in traditional currency
are expected to be recorded for tax authorities to ensure taxability.
\subsection{Withdrawal}
Let $G$ be the generator of an elliptic curve. To withdraw anonymous
digital coins, the customer performs the following interaction with
-the mint:
+the exchange:
\begin{enumerate}
- \item The customer identifies a mint with an auditor-approved
+ \item The customer identifies a exchange with an auditor-approved
coin signing public-private key pair $K := (K_s, K_p)$
and randomly generates:
\begin{itemize}
@@ -685,19 +685,19 @@ the mint:
\item coin key $C := (c_s,C_p)$ with private key $c_s$ and public key $C_p := c_s G$,
\item blinding factor $b$, and commits $\langle W, C, b \rangle$ to disk.
\end{itemize}
- \item The customer transfers an amount of money corresponding to at least $K_p$ to the mint, with $W_p$ in the subject line of the transaction.
- \item The mint receives the transaction and credits the $W_p$ reserve with the respective amount in its database.
- \item The customer sends $S_W(B_b(C_p))$ to the mint to request withdrawal of $C$; here, $B_b$ denotes Chaum-style blinding with blinding factor $b$.
- \item The mint checks if the same withdrawal request was issued before; in this case, it sends $S_{K}(B_b(C_p))$ to the customer.\footnote{Here $S_K$
+ \item The customer transfers an amount of money corresponding to at least $K_p$ to the exchange, with $W_p$ in the subject line of the transaction.
+ \item The exchange receives the transaction and credits the $W_p$ reserve with the respective amount in its database.
+ \item The customer sends $S_W(B_b(C_p))$ to the exchange to request withdrawal of $C$; here, $B_b$ denotes Chaum-style blinding with blinding factor $b$.
+ \item The exchange checks if the same withdrawal request was issued before; in this case, it sends $S_{K}(B_b(C_p))$ to the customer.\footnote{Here $S_K$
denotes a Chaum-style blind signature with private key $K_s$.}
- If this is a fresh withdrawal request, the mint performs the following transaction:
+ If this is a fresh withdrawal request, the exchange performs the following transaction:
\begin{enumerate}
\item checks if the reserve $W_p$ has sufficient funds for a coin of value corresponding to $K_p$
\item stores the withdrawal request and response $\langle S_W(B_b(C_p)), S_K(B_b(C_p)) \rangle$ in its database for future reference,
\item deducts the amount corresponding to $K_p$ from the reserve,
\end{enumerate}
and then sends $S_{K}(B_b(C_p))$ to the customer.
- If the guards for the transaction fail, the mint sends a descriptive error back to the customer,
+ If the guards for the transaction fail, the exchange sends a descriptive error back to the customer,
with proof that it operated correctly.
Assuming the signature was valid, this would involve showing the transaction history for the reserve.
\item The customer computes and verifies the unblinded signature $S_K(C_p) = U_b(S_K(B_b(C_p)))$.
@@ -705,7 +705,7 @@ the mint:
\end{enumerate}
We note that the authorization to create and access a reserve using a
withdrawal key $W$ is just one way to establish that the customer is
-authorized to withdraw funds. If a mint has other ways to securely
+authorized to withdraw funds. If a exchange has other ways to securely
authenticate customers and establish that they are authorized to
withdraw funds, those can also be used with Taler.
@@ -713,19 +713,19 @@ withdraw funds, those can also be used with Taler.
\subsection{Exact and partial spending}
A customer can spend coins at a merchant, under the condition that the
-merchant trusts the specific mint that minted the coin. Merchants are
+merchant trusts the specific exchange that exchanged the coin. Merchants are
identified by their key $M := (m_s, M_p)$ where the public key $M_p$
must be known to the customer a priori.
-We now describe the protocol between the customer, merchant, and mint
+We now describe the protocol between the customer, merchant, and exchange
for a transaction in which the customer spends a coin $C := (c_s, C_p)$
with signature $\widetilde{C} := S_K(C_p)$
- where $K$ is the mint's demonination key.
+ where $K$ is the exchange's demonination key.
\begin{enumerate}
\item\label{contract}
- Let $\vec{D} := D_1, \ldots, D_n$ be the list of mints accepted by
- the merchant where each $D_j$ is a mint's public key.
+ Let $\vec{D} := D_1, \ldots, D_n$ be the list of exchanges accepted by
+ the merchant where each $D_j$ is a exchange's public key.
The merchant creates a digitally signed contract
$\mathcal{A} := S_M(m, f, a, H(p, r), \vec{D})$
where $m$ is an identifier for this transaction, $a$ is data relevant
@@ -734,40 +734,40 @@ with signature $\widetilde{C} := S_K(C_p)$
$p$ is the merchant's payment information (e.g. his IBAN number), and
$r$ is a random nonce. The merchant commits $\langle \mathcal{A} \rangle$
to disk and sends $\mathcal{A}$ to the customer.
-\item\label{deposit}
- The customer should already possess a coin minted by a mint that is
+\item\label{deposit}
+ The customer should already possess a coin exchanged by a exchange that is
accepted by the merchant, meaning $K$ should be publicly signed by
- some $D_j \in \{D_1, D_2, \ldots, D_n\}$, and has a value $\geq f$.
+ some $D_j \in \{D_1, D_2, \ldots, D_n\}$, and has a value $\geq f$.
\item The customer generates a \emph{deposit-permission} $\mathcal{D} :=
S_c(\widetilde{C}, m, f, H(a), H(p,r), M_p)$
and sends $\langle \mathcal{D}, D_j\rangle$ to the merchant,
- where $D_j$ is the mint which signed $K$.
-\item The merchant gives $(\mathcal{D}, p, r)$ to the mint, revealing $p$
- only to the mint.
-\item The mint validates $\mathcal{D}$ and checks for double spending.
+ where $D_j$ is the exchange which signed $K$.
+\item The merchant gives $(\mathcal{D}, p, r)$ to the exchange, revealing $p$
+ only to the exchange.
+\item The exchange validates $\mathcal{D}$ and checks for double spending.
If the coin has been involved in previous transactions and the new
one would exceed its remaining value, it sends an error
with the records from the previous transactions back to the merchant.
%
- If double spending is not found, the mint commits $\langle \mathcal{D} \rangle$ to disk
+ If double spending is not found, the exchange commits $\langle \mathcal{D} \rangle$ to disk
and notifies the merchant that the deposit operation was successful.
-\item The merchant commits and forwards the notification from the mint to the
+\item The merchant commits and forwards the notification from the exchange to the
customer, confirming the success or failure of the operation.
\end{enumerate}
We have simplified the exposition by assuming that one coin suffices, but
-in practice a customer can use multiple coins from the same mint where
+in practice a customer can use multiple coins from the same exchange where
the total value adds up to $f$ by running the following steps for
each of the coins. There is a risk of metadata leakage if a customer
acquires a coin in responce to the merchant, or if a customer uses
-coings issued by multiple mints together.
+coings issued by multiple exchanges together.
If a transaction is aborted after Step~\ref{deposit},
subsequent transactions with the same coin could be linked to the coin,
but not directly to the coin's owner. The same applies to partially
spent coins where $f$ is smaller than the actual value of the coin.
To unlink subsequent transactions from a coin, the customer has to
-execute the coin refreshing protocol with the mint.
+execute the coin refreshing protocol with the exchange.
%\begin{figure}[h]
%\centering
@@ -777,12 +777,12 @@ execute the coin refreshing protocol with the mint.
%\node (origin) at (0,0) {};
%\node (offer) [def,below=of origin]{make offer (merchant $\rightarrow$ customer)};
%\node (A) [def,below=of offer]{permit lock (customer $\rightarrow$ merchant)};
-%\node (B) [def,below=of A]{apply lock (merchant $\rightarrow$ mint)};
-%\node (C) [def,below=of B]{confirm (or refuse) lock (mint $\rightarrow$ merchant)};
+%\node (B) [def,below=of A]{apply lock (merchant $\rightarrow$ exchange)};
+%\node (C) [def,below=of B]{confirm (or refuse) lock (exchange $\rightarrow$ merchant)};
%\node (D) [def,below=of C]{sign contract (merchant $\rightarrow$ customer)};
%\node (E) [def,below=of D]{permit deposit (customer $\rightarrow$ merchant)};
-%\node (F) [def,below=of E]{make deposit (merchant $\rightarrow$ mint)};
-%\node (G) [def,below=of F]{transfer confirmation (mint $\rightarrow$ merchant)};
+%\node (F) [def,below=of E]{make deposit (merchant $\rightarrow$ exchange)};
+%\node (G) [def,below=of F]{transfer confirmation (exchange $\rightarrow$ merchant)};
%
%\tikzstyle{C} = [color=black, line width=1pt]
%\draw [->,C](offer) -- (A);
@@ -796,7 +796,7 @@ execute the coin refreshing protocol with the mint.
%\draw [->,C, bend right, shorten <=2mm] (E.east)
% to[out=-135,in=-45,distance=3.8cm] node[left] {aggregate} (D.east);
%\end{tikzpicture}
-%\caption{Interactions between a customer, merchant and mint in the coin spending
+%\caption{Interactions between a customer, merchant and exchange in the coin spending
% protocol}
%\label{fig:spending_protocol_interactions}
%\end{figure}
@@ -804,11 +804,11 @@ execute the coin refreshing protocol with the mint.
\subsection{Refreshing} \label{sec:refreshing}
-We now describe the refresh protocol whereby a dirty coin $C'$ of
+We now describe the refresh protocol whereby a dirty coin $C'$ of
denomination $K$ is melted to obtain a fresh coin $\widetilde{C}$
with the same denomination. In practice, Taler uses a natural
extension where multiple fresh coins are generated a the same time to
-enable giving precise change matching any amount.
+enable giving precise change matching any amount.
In the protocol, $\kappa \ge 3$ is a security parameter and $G$ is the
generator of the elliptic curve.
@@ -830,18 +830,18 @@ generator of the elliptic curve.
between the private key $c'_s$ of the original coin with
the public transfer key $T_p^{(i)}$.
\item The customer computes $B^{(i)} := B_{b^{(i)}}(C^{(i)}_p)$ for $i \in \{1,\ldots,\kappa\}$ and sends a commitment
- $S_{C'}(\vec{E}, \vec{B}, \vec{T_p})$ to the mint.
- \item The mint generates a random $\gamma$ with $1 \le \gamma \le \kappa$ and
+ $S_{C'}(\vec{E}, \vec{B}, \vec{T_p})$ to the exchange.
+ \item The exchange generates a random $\gamma$ with $1 \le \gamma \le \kappa$ and
marks $C'_p$ as spent by committing
$\langle C', \gamma, S_{C'}(\vec{E}, \vec{B}, \vec{T_p}) \rangle$ to disk.
Auditing processes should assure that $\gamma$ is unpredictable until
- this time to prevent the mint from assisting tax evasion.
- \item The mint sends $S_{K'}(C'_p, \gamma)$ to the customer where
- $K'$ is the mint's message signing key.
+ this time to prevent the exchange from assisting tax evasion.
+ \item The exchange sends $S_{K'}(C'_p, \gamma)$ to the customer where
+ $K'$ is the exchange's message signing key.
\item The customer commits $\langle C', S_K(C'_p, \gamma) \rangle$ to disk.
\item The customer computes $\mathfrak{R} := \left(t_s^{(i)}\right)_{i \ne \gamma}$
- and sends $S_{C'}(\mathfrak{R})$ to the mint.
- \item \label{step:refresh-ccheck} The mint checks whether $\mathfrak{R}$ is consistent with the commitments;
+ and sends $S_{C'}(\mathfrak{R})$ to the exchange.
+ \item \label{step:refresh-ccheck} The exchange checks whether $\mathfrak{R}$ is consistent with the commitments;
specifically, it computes for $i \not= \gamma$:
\vspace{-2ex}
@@ -864,8 +864,8 @@ generator of the elliptic curve.
\item \label{step:refresh-done} If the commitments were consistent,
- the mint sends the blind signature $\widetilde{C} :=
- S_{K}(B^{(\gamma)})$ to the customer. Otherwise, the mint responds
+ the exchange sends the blind signature $\widetilde{C} :=
+ S_{K}(B^{(\gamma)})$ to the customer. Otherwise, the exchange responds
with an error indicating the location of the failure.
\end{enumerate}
@@ -875,7 +875,7 @@ generator of the elliptic curve.
\subsection{Linking}
-For a coin that was successfully refreshed, the mint responds to a
+For a coin that was successfully refreshed, the exchange responds to a
request $S_{C'}(\mathtt{link})$ with $(T^{(\gamma)}_p$, $E^{(\gamma)},
\widetilde{C})$.
%
@@ -883,7 +883,7 @@ This allows the owner of the melted coin to also obtain the private
key of the new coin, even if the refreshing protocol was illicitly
executed with the help of another party who generated $\vec{c_s}$ and only
provided $\vec{C_p}$ and other required information to the old owner.
-As a result, linking ensures that access to the new coins minted by
+As a result, linking ensures that access to the new coins exchanged by
the refresh protocol is always {\em shared} with the owner of the
melted coins. This makes it impossible to abuse the refresh protocol
for {\em transactions}.
@@ -892,7 +892,7 @@ The linking request is not expected to be used at all during ordinary
operation of Taler. If the refresh protocol is used by Alice to
obtain change as designed, she already knows all of the information
and thus has little reason to request it via the linking protocol.
-The fundamental reason why the mint must provide the link protocol is
+The fundamental reason why the exchange must provide the link protocol is
simply to provide a threat: if Bob were to use the refresh protocol
for a transaction of funds from Alice to him, Alice may use a link
request to gain shared access to Bob's coins. Thus, this threat
@@ -903,8 +903,8 @@ exchanging the original private coin keys. This is permitted in our
taxation model as with such trust they are assumed to be the same
entity.
-The auditor can anonymously check if the mint correctly implements the
-link request, thus preventing the mint operator from legally disabling
+The auditor can anonymously check if the exchange correctly implements the
+link request, thus preventing the exchange operator from legally disabling
this protocol component. Without the link operation, Taler would
devolve into a payment system where both sides can be anonymous, and
thus no longer provide taxability.
@@ -926,7 +926,7 @@ server indicates that the client is violating the protocol, the
client should record the interaction and enable the user to file a
bug report.
-The second case is a faulty mint service provider. Such faults will
+The second case is a faulty exchange service provider. Such faults will
be detected because of protocol violations, such as providing
a faulty proof or no proof. In this case, the client is expected to
notify the auditor, providing a transcript of the interaction. The
@@ -935,11 +935,11 @@ provide the now correct response to the client or take appropriate
legal action against the faulty provider.
The third case are transient failures, such as network failures or
-temporary hardware failures at the mint service provider. Here, the
+temporary hardware failures at the exchange service provider. Here, the
client may receive an explicit protocol indication, such as an HTTP
response code 500 ``internal server error'' or simply no response.
The appropriate behavior for the client is to automatically retry
-after 1s, and twice more at randomized times within 1 minute.
+after 1s, and twice more at randomized times within 1 minute.
If those three attempts fail, the user should be informed about the
delay. The client should then retry another three times within the
next 24h, and after that time the auditor be informed about the outage.
@@ -947,7 +947,7 @@ next 24h, and after that time the auditor be informed about the outage.
Using this process, short term failures should be effectively obscured
from the user, while malicious behavior is reported to the auditor who
can then presumably rectify the situation, such as by shutting down
-the operator and helping customers to regain refunds for coins in
+the operator and helping customers to regain refunds for coins in
their wallets. To ensure that such refunds are possible, the operator
is expected to always provide adequate securities for the amount of
coins in circulation as part of the certification process.
@@ -961,14 +961,14 @@ details, and having the customer keep the private key of the spent
coins on file.
Given this, the merchant can simply sign a {\em refund confirmation}
-and share it with the mint and the customer. Assuming the mint has
+and share it with the exchange and the customer. Assuming the exchange has
a way to recover the funds from the merchant, or has not yet performed
-the wire transfer, the mint can simply add the value of the refunded
-transaction back to the original coin, re-enabling those funds to be
+the wire transfer, the exchange can simply add the value of the refunded
+transaction back to the original coin, re-enabling those funds to be
spent again by the original customer.
This anonymous customer can then use the refresh protocol to melt the
-refunded coin and create a fresh coin that is unlinkable to the
+refunded coin and create a fresh coin that is unlinkable to the
refunded transaction.
@@ -976,11 +976,11 @@ refunded transaction.
Taler's security is largely equivalent to that of Chaum's original
design without online checks or the cut-and-choose revelation of
-double-spending customers for offline spending.
-We specifically note that the digital equivalent of the ``Columbian
-Black Market Exchange''~\cite{fatf1997} is a theoretical problem for
+double-spending customers for offline spending.
+We specifically note that the digital equivalent of the ``Columbian
+Black Market Exchange''~\cite{fatf1997} is a theoretical problem for
both Chaum and Taler, as individuals with a strong mutual trust
-foundation can simply copy electronic coins and thereby establish a
+foundation can simply copy electronic coins and thereby establish a
limited form of black transfers. However, unlike the situation with
physical checks with blank recipients in the Columbian black market,
the transitivity is limited as each participant can deposit the electronic
@@ -990,11 +990,11 @@ check and not also all previous owners of the physical check.
As with any unconditionally anonymous payment system, the ``Perfect
Crime'' attack~\cite{solms1992perfect} where blackmail is used to
-force the mint to issue anonymous coins also continues to apply in
+force the exchange to issue anonymous coins also continues to apply in
principle. However, as mentioned Taler does facilitate limits on
withdrawals, which we believe is a better trade-off than the
problematic escrow systems where the necessary intransparency
-actually facilitates voluntary cooperation between the mint and
+actually facilitates voluntary cooperation between the exchange and
criminals~\cite{sander1999escrow} and where state can selectively
deanonymize activists to support the deep state's quest for absolute
security.
@@ -1002,12 +1002,12 @@ security.
\subsection{Offline Payments}
Chaum's original proposals for anonymous digital cash avoided the need
-for online interactions with the mint to detect double spending by
+for online interactions with the exchange to detect double spending by
providing a means to deanonymize customers involved in
-double-spending. We believe that this is problematic as the mint or
+double-spending. We believe that this is problematic as the exchange or
the merchant will then still need out-of-band means to recover funds
from the customer, which may be impossible in practice. In contrast,
-in our design only the mint may try to defraud the other participants
+in our design only the exchange may try to defraud the other participants
and disappear. While this is still a risk, and regular financial
audits are required to protect against it, this is more manageable and
significantly cheaper compared to recovering funds via the court
@@ -1017,12 +1017,12 @@ Chaum's method for offline payments would also be incompatible with
the refreshing protocol (Section~\ref{sec:refreshing}) which enables
the crucial feature of giving unlinkable change. The reason is that
if the owner's identity were embedded in coins, it would be leaked to
-the mint as part of the reveal operation in the cut-and-choose
+the exchange as part of the reveal operation in the cut-and-choose
operation of the refreshing protocol.
%\subsection{Merchant Tax Audits}
%
-%For a tax audit on the merchant, the mint includes the business
+%For a tax audit on the merchant, the exchange includes the business
%transaction-specific hash in the transfer of the traditional
%currency. A tax auditor can then request the merchant to reveal
%(meaningful) details about the business transaction ($\mathcal{D}$,
@@ -1048,13 +1048,13 @@ computing base (TCB) is public and free software.
%\subsection{System Performance}
%
%We performed some initial performance measurements for the various
-%operations on our mint implementation. The main conclusion was that
+%operations on our exchange implementation. The main conclusion was that
%the computational and bandwidth cost for transactions described in
%this paper is smaller than $10^{-3}$ cent/transaction, and thus
-%dwarfed by the other business costs for the mint. However, this
+%dwarfed by the other business costs for the exchange. However, this
%figure excludes the cost of currency transfers using traditional
-%banking, which a mint operator would ultimately have to interact with.
-%Here, mint operators should be able to reduce their expenses by
+%banking, which a exchange operator would ultimately have to interact with.
+%Here, exchange operators should be able to reduce their expenses by
%aggregating multiple transfers to the same merchant.
@@ -1065,8 +1065,8 @@ computing base (TCB) is public and free software.
%citizen's need for privacy and the state's need for taxation. The
%coin refreshing protocol makes the design flexible and enables a
%variety of payment methods. The current balance and profits of the
-%mint are also easily determined, thus audits can be used to ensure
-%that the mint operates correctly. The libre implementation and open
+%exchange are also easily determined, thus audits can be used to ensure
+%that the exchange operates correctly. The libre implementation and open
%protocol may finally enable modern society to upgrade to proper
%electronic wallets with efficient, secure and privacy-preserving
%transactions.
@@ -1097,17 +1097,17 @@ certain interactions.
However, we note that Taler's transaction costs are expected to be so
low that these features are likely not particularly useful in
practice: When we performed some initial performance measurements for
-the various operations on our mint implementation, the main conclusion
+the various operations on our exchange implementation, the main conclusion
was that the computational and bandwidth cost for transactions
described in this paper is smaller than $10^{-3}$ cent/transaction,
-and thus dwarfed by the other business costs for the mint. We note
+and thus dwarfed by the other business costs for the exchange. We note
that the $10^{-3}$ cent/transaction estimate excludes the cost of wire
-transfers using traditional banking, which a mint operator would
-ultimately have to interact with. Here, mint operators should be able
+transfers using traditional banking, which a exchange operator would
+ultimately have to interact with. Here, exchange operators should be able
to reduce their expenses by aggregating multiple transfers to the same
merchant.
-As a result of the low cost of the interaction with the mint in Taler
+As a result of the low cost of the interaction with the exchange in Taler
today, we expect that transactions with amounts below Taler's internal
transaction costs to be economically meaningless. Nevertheless, we
document various ways how such transactions could be achieved within
@@ -1120,7 +1120,7 @@ Taler.
For services that include pay-as-you-go billing, customers can over
time sign deposit permissions for an increasing fraction of the value
of a coin to be paid to a particular merchant. As checking with the
-mint for each increment might be expensive, the coin's owner can
+exchange for each increment might be expensive, the coin's owner can
instead sign a {\em lock permission}, which allows the merchant to get
an exclusive right to redeem deposit permissions for the coin for a
limited duration. The merchant uses the lock permission to determine
@@ -1128,41 +1128,41 @@ if the coin has already been spent and to ensure that it cannot be
spent by another merchant for the {\em duration} of the lock as
specified in the lock permission. If the coin has insufficient funds
because too much has been spent or is
-already locked, the mint provides the owner's deposit or locking
+already locked, the exchange provides the owner's deposit or locking
request and signature to prove the attempted fraud by the customer.
-Otherwise, the mint locks the coin for the expected duration of the
+Otherwise, the exchange locks the coin for the expected duration of the
transaction (and remembers the lock permission). The merchant and the
customer can then finalize the business transaction, possibly
exchanging a series of incremental payment permissions for services.
-Finally, the merchant then redeems the coin at the mint before the
+Finally, the merchant then redeems the coin at the exchange before the
lock permission expires to ensure that no other merchant redeems the
coin first.
\begin{enumerate}
\item\label{offer2} The merchant sends an \emph{offer:} $\langle S_M(m, f),
\vec{D} \rangle$ containing the price of the offer $f$, a transaction
- ID $m$ and the list of mints $D_1, \ldots, D_n$ accepted by the merchant
- where each $D_j$ is a mint's public key.
+ ID $m$ and the list of exchanges $D_1, \ldots, D_n$ accepted by the merchant
+ where each $D_j$ is a exchange's public key.
\item\label{lock2} The customer must possess or acquire a coin $\widetilde{C}$
- signed by a mint that is
+ signed by a exchange that is
accepted by the merchant, i.e. $K$ should be signed by some $D_j
\in \{D_1, D_2, \ldots, D_n\}$, and has a value $\geq f$.
Customer then generates a \emph{lock-permission} $\mathcal{L} :=
S_c(\widetilde{C}, t, m, f, M_p)$ where $t$ specifies the time until which the
lock is valid and sends $\langle \mathcal{L}, D_j\rangle$ to the merchant,
- where $D_j$ is the mint which signed $K$.
-\item The merchant asks the mint to apply the lock by sending $\langle
- \mathcal{L} \rangle$ to the mint.
-\item The mint validates $\widetilde{C}$ and detects double spending
+ where $D_j$ is the exchange which signed $K$.
+\item The merchant asks the exchange to apply the lock by sending $\langle
+ \mathcal{L} \rangle$ to the exchange.
+\item The exchange validates $\widetilde{C}$ and detects double spending
in the form of existing \emph{deposit-permission} or
lock-permission records for $\widetilde{C}$. If such records exist
- and indicate that insufficient funds are left, the mint sends those
+ and indicate that insufficient funds are left, the exchange sends those
records to the merchant, who can then use the records to prove the double
spending to the customer.
If double spending is not found,
- the mint commits $\langle \mathcal{L} \rangle$ to disk
+ the exchange commits $\langle \mathcal{L} \rangle$ to disk
and notifies the merchant that locking was successful.
\item\label{contract2} The merchant creates a digitally signed contract
$\mathcal{A} := S_M(m, f, a, H(p, r))$ where $a$ is data relevant to the contract
@@ -1173,23 +1173,23 @@ coin first.
\emph{deposit-permission} $\mathcal{D} := S_c(\widetilde{C}, \widetilde{L}, f, m, M_p, H(a), H(p, r))$, commits
$\langle \mathcal{A}, \mathcal{D} \rangle$ to disk and sends $\mathcal{D}$ to the merchant.
\item\label{invoice_paid2} The merchant commits the received $\langle \mathcal{D} \rangle$ to disk.
-\item The merchant gives $(\mathcal{D}, p, r)$ to the mint, revealing his
+\item The merchant gives $(\mathcal{D}, p, r)$ to the exchange, revealing his
payment information.
-\item The mint verifies $(\mathcal{D}, p, r)$ for its validity and
+\item The exchange verifies $(\mathcal{D}, p, r)$ for its validity and
checks against double spending, while of
course permitting the merchant to withdraw funds from the amount that
had been locked for this merchant.
\item If $\widetilde{C}$ is valid and no equivalent \emph{deposit-permission} for $\widetilde{C}$ and $\widetilde{L}$ exists on disk, the
- mint performs the following transaction:
+ exchange performs the following transaction:
\begin{enumerate}
\item $\langle \mathcal{D}, p, r \rangle$ is committed to disk.
\item\label{transfer2} transfers an amount of $f$ to the merchant's bank account
given in $p$. The subject line of the transaction to $p$ must contain
$H(\mathcal{D})$.
\end{enumerate}
- Finally, the mint sends a confirmation to the merchant.
+ Finally, the exchange sends a confirmation to the merchant.
\item If the deposit record $\langle \mathcal{D}, p, r \rangle$ already exists,
- the mint sends the confirmation to the merchant,
+ the exchange sends the confirmation to the merchant,
but does not transfer money to $p$ again.
\end{enumerate}
@@ -1223,7 +1223,7 @@ incremental amount up to $f_{max}$:
For transactions with multiple coins, the steps of the protocol are
executed in parallel for each coin. During the time a coin is locked,
the locked fraction may not be spent at a different merchant or via a
-deposit permission that does not contain $\mathcal{L}$. The mint will
+deposit permission that does not contain $\mathcal{L}$. The exchange will
release the locks when they expire or are used in a deposit operation.
Thus the coins can be used with other merchants once their locks
expire, even if the original merchant never executed any deposit for
@@ -1234,7 +1234,7 @@ Similarly, if a transaction is aborted after Step 2, subsequent
transactions with the same coin can be linked to the coin, but not
directly to the coin's owner. The same applies to partially spent
coins. Thus, to unlink subsequent transactions from a coin, the
-customer has to execute the coin refreshing protocol with the mint.
+customer has to execute the coin refreshing protocol with the exchange.
%\begin{figure}[h]
%\centering
@@ -1244,12 +1244,12 @@ customer has to execute the coin refreshing protocol with the mint.
%\node (origin) at (0,0) {};
%\node (offer) [def,below=of origin]{make offer (merchant $\rightarrow$ customer)};
%\node (A) [def,below=of offer]{permit lock (customer $\rightarrow$ merchant)};
-%\node (B) [def,below=of A]{apply lock (merchant $\rightarrow$ mint)};
-%\node (C) [def,below=of B]{confirm (or refuse) lock (mint $\rightarrow$ merchant)};
+%\node (B) [def,below=of A]{apply lock (merchant $\rightarrow$ exchange)};
+%\node (C) [def,below=of B]{confirm (or refuse) lock (exchange $\rightarrow$ merchant)};
%\node (D) [def,below=of C]{sign contract (merchant $\rightarrow$ customer)};
%\node (E) [def,below=of D]{permit deposit (customer $\rightarrow$ merchant)};
-%\node (F) [def,below=of E]{make deposit (merchant $\rightarrow$ mint)};
-%\node (G) [def,below=of F]{transfer confirmation (mint $\rightarrow$ merchant)};
+%\node (F) [def,below=of E]{make deposit (merchant $\rightarrow$ exchange)};
+%\node (G) [def,below=of F]{transfer confirmation (exchange $\rightarrow$ merchant)};
%
%\tikzstyle{C} = [color=black, line width=1pt]
%\draw [->,C](offer) -- (A);
@@ -1263,7 +1263,7 @@ customer has to execute the coin refreshing protocol with the mint.
%\draw [->,C, bend right, shorten <=2mm] (E.east)
% to[out=-135,in=-45,distance=3.8cm] node[left] {aggregate} (D.east);
%\end{tikzpicture}
-%\caption{Interactions between a customer, merchant and mint in the coin spending
+%\caption{Interactions between a customer, merchant and exchange in the coin spending
% protocol}
%\label{fig:spending_protocol_interactions}
%\end{figure}
@@ -1274,7 +1274,7 @@ customer has to execute the coin refreshing protocol with the mint.
Similar to Peppercoin, Taler supports probabilistic {\em micro}donations of coins to
support cost-effective transactions for small amounts. We consider
amounts to be ``micro'' if the value of the transaction is close or
-even below the business cost of an individual transaction to the mint.
+even below the business cost of an individual transaction to the exchange.
To support microdonations, an ordinary transaction is performed based
on the result of a biased coin flip with a probability related to the
@@ -1282,7 +1282,7 @@ desired transaction amount in relation to the value of the coin. More
specifically, a microdonation of value $\epsilon$ is upgraded to a
macropayment of value $m$ with a probability of $\frac{\epsilon}{m}$.
Here, $m$ is chosen such that the business transaction cost at the
-mint is small in relation to $m$. The mint is only involved in the
+exchange is small in relation to $m$. The exchange is only involved in the
tiny fraction of transactions that are upgraded. On average both
customers and merchants end up paying (or receiving) the expected
amount $\epsilon$ per microdonation.
@@ -1290,12 +1290,12 @@ amount $\epsilon$ per microdonation.
Unlike Peppercoin, in Taler either the merchant wins and the customer
looses the coin, or the merchant looses and the customer keeps the
coin. Thus, there is no opportunity for the merchant and the customer
-to conspire against the mint. To determine if the coin is to be
+to conspire against the exchange. To determine if the coin is to be
transferred, merchant and customer execute a secure coin flipping
protocol~\cite{blum1981}. The commit values are included in the
business contract and are revealed after the contract has been signed
using the private key of the coin. If the coin flip is decided in
-favor of the merchant, the merchant can redeem the coin at the mint.
+favor of the merchant, the merchant can redeem the coin at the exchange.
One issue in this protocol is that the customer may use a worthless
coin by offering a coin that has already been spent. This kind of
@@ -1306,9 +1306,9 @@ already spent coins until the coin flip is in his favor.
As with incremental spending, lock permissions could be used to ensure
that the customer cannot defraud the merchant by offering a coin that
-has already been spent. However, as this means involving the mint
+has already been spent. However, as this means involving the exchange
even if the merchant looses the coin flip, such a scheme is unsuitable
-for microdonations as the transaction costs from involving the mint
+for microdonations as the transaction costs from involving the exchange
might be disproportionate to the value of the transaction, and thus
with locking the probabilistic scheme has no advantage over simply
using fractional payments.
@@ -1366,7 +1366,7 @@ indicate the application of a function $f$ to one or more arguments. Records of
data being committed to disk are represented in between $\langle\rangle$.
\begin{description}
- \item[$K_s$]{Private (RSA) key of the mint used for coin signing}
+ \item[$K_s$]{Private (RSA) key of the exchange used for coin signing}
\item[$K_p$]{Public (RSA) key corresponding to $K_s$}
\item[$K$]{Public-priate (RSA) coin signing key pair $K := (K_s, K_p)$}
\item[$b$]{RSA blinding factor for RSA-style blind signatures}
@@ -1389,11 +1389,11 @@ data being committed to disk are represented in between $\langle\rangle$.
\item[$c_s'$]{Private key of a ``dirty'' coin (otherwise like $c_s$)}
\item[$C_p'$]{Public key of a ``dirty'' coin (otherwise like $C_p$)}
\item[$C'$]{Dirty coin (otherwise like $C$)}
- \item[$\widetilde{C}$]{Mint signature $S_K(C_p)$ indicating validity of a fresh coin (with key $C$)}
- \item[$n$]{Number of mints accepted by a merchant}
- \item[$j$]{Index into a set of accepted mints, $i \in \{1,\ldots,n\}$}
- \item[$D_j$]{Public key of a mint (not used to sign coins)}
- \item[$\vec{D}$]{Vector of $D_j$ signifying mints accepted by a merchant}
+ \item[$\widetilde{C}$]{Exchange signature $S_K(C_p)$ indicating validity of a fresh coin (with key $C$)}
+ \item[$n$]{Number of exchanges accepted by a merchant}
+ \item[$j$]{Index into a set of accepted exchanges, $i \in \{1,\ldots,n\}$}
+ \item[$D_j$]{Public key of a exchange (not used to sign coins)}
+ \item[$\vec{D}$]{Vector of $D_j$ signifying exchanges accepted by a merchant}
\item[$a$]{Complete text of a contract between customer and merchant}
\item[$f$]{Amount a customer agrees to pay to a merchant for a contract}
\item[$m$]{Unique transaction identifier chosen by the merchant}
diff --git a/doc/taler-auditor-sign.1 b/doc/taler-auditor-sign.1
index ed264a496..f0f90a5b8 100644
--- a/doc/taler-auditor-sign.1
+++ b/doc/taler-auditor-sign.1
@@ -1,7 +1,7 @@
-.TH TALER\-AUDITOR\-SIGN 1 "Sep 15, 2015" "GNU Taler"
+.TH TALER\-AUDITOR\-SIGN 1 "Mar 15, 2016" "GNU Taler"
.SH NAME
-taler\-auditor\-sign \- Sign mint denomination as auditor.
+taler\-auditor\-sign \- Sign exchange denomination as auditor.
.SH SYNOPSIS
.B taler\-auditor\-sign
@@ -9,7 +9,7 @@ taler\-auditor\-sign \- Sign mint denomination as auditor.
.br
.SH DESCRIPTION
-\fBtaler\-auditor\-sign\fP is a command line tool to be used by an auditor to sign that he is aware of certain keys being used by a mint. Using this signature, the auditor affirms that he will verify that the mint is properly accounting for those coins.
+\fBtaler\-auditor\-sign\fP is a command line tool to be used by an auditor to sign that he is aware of certain keys being used by a exchange. Using this signature, the auditor affirms that he will verify that the exchange is properly accounting for those coins.
.SH OPTIONS
.B
@@ -19,11 +19,14 @@ Location of the private EdDSA auditor key. If it does not exist, it will be cre
.IP "\-h, \-\-help"
Print short help on options.
.B
-.IP "\-m KEY, \-\-mint-key=KEY"
-Public key of the mint in Crockford base32 encoding, for example as generated by gnunet\-ecc \-p.
+.IP "\-m KEY, \-\-exchange-key=KEY"
+Public key of the exchange in Crockford base32 encoding, for example as generated by gnunet\-ecc \-p.
.B
-.IP "\-r FILE, \-\-mint-request=FILE"
-File with the mint's denomination key signing request as generated by taler\-mint\-keyup \-o.
+.IP "\-u URL, \-\-auditor-url=URL"
+URL of the auditor. Provides informative link for the user to learn more about the auditor.
+.B
+.IP "\-r FILE, \-\-exchange-request=FILE"
+File with the exchange's denomination key signing request as generated by taler\-exchange\-keyup \-o.
.B
.IP "\-o FILE, \-\-output=FILE"
File where the auditor should write the EdDSA signature.
@@ -32,4 +35,4 @@ File where the auditor should write the EdDSA signature.
Report bugs by using Mantis or by sending electronic mail to
.SH "SEE ALSO"
-\fBtaler\-mint\-keyup\fP(1), \fBgnunet\-ecc\fP(1), \fBtaler.conf\fP(5)
+\fBtaler\-exchange\-keyup\fP(1), \fBgnunet\-ecc\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-exchange-aggregator.1 b/doc/taler-exchange-aggregator.1
new file mode 100644
index 000000000..954f88b20
--- /dev/null
+++ b/doc/taler-exchange-aggregator.1
@@ -0,0 +1,35 @@
+.TH TALER\-EXCHANGE\-AGGREGATOR 1 "Mar 30, 2016" "GNU Taler"
+
+.SH NAME
+taler\-exchange\-aggregator \- Aggregate and execute exchange transactions
+
+.SH SYNOPSIS
+.B taler\-exchange\-aggregator
+.RI [ options ]
+.br
+
+.SH DESCRIPTION
+\fBtaler\-exchange\-aggregator\fP is a command line tool to run pending transactions from the Taler exchange.
+
+.SH OPTIONS
+.B
+.IP "\-d DIRNAME, \-\-exchange-dir=DIRNAME"
+Use the configuration and other resources for the exchange to operate from DIRNAME.
+.B
+.IP "\-f WIREFORMAT, \-\-format=WIREFORMAT"
+Overrides WIREFORMAT option from the configuation file.
+.B
+.IP "\-h, \-\-help"
+Print short help on options.
+.B
+.IP "\-t, \-\-test"
+Run in test mode (use temporary tables). Only useful for testcases.
+.B
+.IP "\-v, \-\-version"
+Print version information.
+.B
+.SH BUGS
+Report bugs by using Mantis or by sending electronic mail to
+
+.SH "SEE ALSO"
+\fBtaler\-exchange\-dbinit\fP(1), \fBtaler\-exchange\-keyup\fP(1), \fBtaler\-exchange\-httpd\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-exchange-dbinit.1 b/doc/taler-exchange-dbinit.1
new file mode 100644
index 000000000..456a85b0c
--- /dev/null
+++ b/doc/taler-exchange-dbinit.1
@@ -0,0 +1,29 @@
+.TH TALER\-EXCHANGE\-DBINIT 1 "Apr 22, 2015" "GNU Taler"
+
+.SH NAME
+taler\-exchange\-dbinit \- Initialize Taler exchange database.
+
+.SH SYNOPSIS
+.B taler\-exchange\-dbinit
+.RI [ options ]
+.br
+
+.SH DESCRIPTION
+\fBtaler\-exchange\-dbinit\fP is a command line tool to initialize the Taler exchange database. It creates the necessary tables and indices for the Taler exchange to operate.
+
+.SH OPTIONS
+.B
+.IP "\-d DIRNAME, \-\-exchange-dir=DIRNAME"
+Use the configuration and other resources for the exchange to operate from DIRNAME.
+.B
+.IP "\-h, \-\-help"
+Print short help on options.
+.B
+.IP "\-v, \-\-version"
+Print version information.
+
+.SH BUGS
+Report bugs by using Mantis or by sending electronic mail to
+
+.SH "SEE ALSO"
+\fBtaler\-exchange\-httpd\fP(1), \fBtaler\-exchange\-keyup\fP(1), \fBtaler\-exchange\-reservemod\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-exchange-httpd.1 b/doc/taler-exchange-httpd.1
new file mode 100644
index 000000000..959f1ec76
--- /dev/null
+++ b/doc/taler-exchange-httpd.1
@@ -0,0 +1,39 @@
+.TH TALER\-EXCHANGE\-HTTPD 1 "Apr 22, 2015" "GNU Taler"
+
+.SH NAME
+taler\-exchange\-httpd \- Run Taler exchange (with RESTful API)
+
+.SH SYNOPSIS
+.B taler\-exchange\-httpd
+.RI [ options ]
+.br
+
+.SH DESCRIPTION
+\fBtaler\-exchange\-httpd\fP is a command line tool to run the Taler exchange (HTTP server). The required configuration, keys and database must exist before running this command.
+
+.SH OPTIONS
+.B
+.IP "\-C, \-\-connection-close"
+Force each HTTP connection to be closed after each request (useful in combination with \-f to avoid having to wait for nc to time out).
+.B
+.IP "\-d DIRNAME, \-\-exchange-dir=DIRNAME"
+Use the configuration and other resources for the exchange to operate from DIRNAME.
+.B
+.IP "\-h, \-\-help"
+Print short help on options.
+.B
+.IP "\-v, \-\-version"
+Print version information.
+.B
+.IP "\-f FILENAME, \-\-file\-input=FILENAME"
+This option is only available if the exchange was compiled with the configure option
+\-\-enable\-developer\-mode. It is used for generating test cases against the exchange using AFL. When this option is present, the HTTP server will (1) terminate after the first client's HTTP connection is completed, and (2) automatically start such a client using a helper process based on the 'nc' or 'ncat' binary using FILENAME as the standard input to the helper process. As a result, the process will effectively run with FILENAME as the input from an HTTP client and then immediately exit. This is useful to test taler\-exchange\-httpd against many different possible inputs in a controlled way.
+.B
+.IP \"-t SECONDS, \-\-timeout=SECONDS"
+Specifies the number of SECONDS after which the HTTPD should close (idle) HTTP connections.
+
+.SH BUGS
+Report bugs by using Mantis or by sending electronic mail to
+
+.SH "SEE ALSO"
+\fBtaler\-exchange\-dbinit\fP(1), \fBtaler\-exchange\-keyup\fP(1), \fBtaler\-exchange\-reservemod\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-exchange-keycheck.1 b/doc/taler-exchange-keycheck.1
new file mode 100644
index 000000000..3f3382336
--- /dev/null
+++ b/doc/taler-exchange-keycheck.1
@@ -0,0 +1,29 @@
+.TH TALER\-EXCHANGE\-KEYCHECK 1 "Apr 22, 2015" "GNU Taler"
+
+.SH NAME
+taler\-exchange\-keycheck \- Check validity of Taler signing and denomination keys.
+
+.SH SYNOPSIS
+.B taler\-exchange\-keycheck
+.RI [ options ]
+.br
+
+.SH DESCRIPTION
+\fBtaler\-exchange\-keycheck\fP can be used to check if the signing and denomination keys in the operation directory are well-formed. This can be useful after importing fresh keys from the offline system to ensure that the files are correct.
+
+.SH OPTIONS
+.B
+.IP "\-d DIRNAME, \-\-exchange-dir=DIRNAME"
+Use the configuration and other resources for the exchange to operate from DIRNAME.
+.B
+.IP "\-h, \-\-help"
+Print short help on options.
+.B
+.IP "\-v, \-\-version"
+Print version information.
+
+.SH BUGS
+Report bugs by using Mantis or by sending electronic mail to
+
+.SH "SEE ALSO"
+\fBtaler\-exchange\-httpd\fP(1), \fBtaler\-exchange\-keyup\fP(1), \fBtaler\-exchange\-dbinit\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-exchange-keyup.1 b/doc/taler-exchange-keyup.1
new file mode 100644
index 000000000..541c10ec8
--- /dev/null
+++ b/doc/taler-exchange-keyup.1
@@ -0,0 +1,38 @@
+.TH TALER\-EXCHANGE\-KEYUP 1 "Apr 22, 2015" "GNU Taler"
+
+.SH NAME
+taler\-exchange\-keyup \- Setup Taler exchange denomination and signing keys.
+
+.SH SYNOPSIS
+.B taler\-exchange\-keyup
+.RI [ options ]
+.br
+
+.SH DESCRIPTION
+\fBtaler\-exchange\-keyup\fP is a command line tool to setup Taler denomination and signing keys. This tool requires access to the exchange's long-term offline signing key and should be run in a secure (offline) environment under strict controls. The resulting keys can then be copied to the main online directory where the Taler HTTP server operates.
+
+.SH OPTIONS
+.B
+.IP "\-d DIRNAME, \-\-exchange-dir=DIRNAME"
+Use the configuration and other resources for the exchange to operate from DIRNAME.
+.B
+.IP "\-h, \-\-help"
+Print short help on options.
+.B
+.IP "\-m FILE, \-\-master-key=FILE"
+Location of the private EdDSA offline master key of the exchange.
+.B
+.IP "\-o FILE, \-\-ouptut=FILE"
+Where to write a denomination key signing request file to be given to the auditor.
+.B
+.IP "\-t TIMESTAMP, \-\-time=TIMESTAMP"
+Operate as if the current time was TIMESTAMP.
+.B
+.IP "\-v, \-\-version"
+Print version information.
+
+.SH BUGS
+Report bugs by using Mantis or by sending electronic mail to
+
+.SH "SEE ALSO"
+\fBtaler\-exchange\-httpd\fP(1), \fBtaler\-exchange\-keyup\fP(1), \fBtaler\-exchange\-keycheck\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-exchange-reservemod.1 b/doc/taler-exchange-reservemod.1
new file mode 100644
index 000000000..7044a7c61
--- /dev/null
+++ b/doc/taler-exchange-reservemod.1
@@ -0,0 +1,35 @@
+.TH TALER\-EXCHANGE\-RESERVEMOD 1 "Apr 22, 2015" "GNU Taler"
+
+.SH NAME
+taler\-exchange\-reservemod \- Modify reserve balance in the Taler exchange database.
+
+.SH SYNOPSIS
+.B taler\-exchange\-reservemod
+.RI [ options ]
+.br
+
+.SH DESCRIPTION
+\fBtaler\-exchange\-reservemod\fP is a command line tool to modify reserves in the Taler exchange database. Basically, it can be used to import deposits, either for testing or as part of the import from the list of incoming transactions.
+
+.SH OPTIONS
+.B
+.IP "\-a DENOM, \-\-add=DENOM"
+Amount to add to the reserve.
+.B
+.IP "\-d DIRNAME, \-\-exchange-dir=DIRNAME"
+Use the configuration and other resources for the exchange to operate from DIRNAME.
+.B
+.IP "\-h, \-\-help"
+Print short help on options.
+.B
+.IP "\-R KEY, \-\-reserve=KEY"
+Public EdDSA key of the reserve to modify.
+.B
+.IP "\-v, \-\-version"
+Print version information.
+
+.SH BUGS
+Report bugs by using Mantis or by sending electronic mail to
+
+.SH "SEE ALSO"
+\fBtaler\-exchange\-httpd\fP(1), \fBtaler\-exchange\-keyup\fP(1), \fBtaler\-exchange\-dbinit\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-exchange-wire.1 b/doc/taler-exchange-wire.1
new file mode 100644
index 000000000..546d8eb74
--- /dev/null
+++ b/doc/taler-exchange-wire.1
@@ -0,0 +1,38 @@
+.TH TALER\-EXCHANGE\-WIRE 1 "Apr 2, 2016" "GNU Taler"
+
+.SH NAME
+taler\-exchange\-wire \- Create the master-key signed responses to /wire.
+
+.SH SYNOPSIS
+.B taler\-exchange\-wire
+.RI [ options ]
+.br
+
+.SH DESCRIPTION
+\fBtaler\-exchange\-wire\fP is used to create the exchange's reply to a /wire request. It converts the bank details into the appropriate signed response. This needs to be done using the long-term offline master key.
+
+.SH OPTIONS
+.B
+.IP "\-j JSON, \-\-json=JSON"
+Gives JSON with all of the relevant account details in a method-specific format.
+.B
+.IP "\-t METHOD, \-\-type=METHOD"
+Specifies the wire transfer method to use. Common are 'test' and 'sepa'.
+.B
+.IP "\-m MASTERKEYFILE, \-\-master=MASTERKEYFILE"
+Specifies the name of the file containing the exchange's master key.
+.B
+.IP "\-o FILENAME, \-\-output=FILENAME"
+Where to write the SEPA_RESPONSE_FILE.
+.B
+.IP "\-h, \-\-help"
+Print short help on options.
+.B
+.IP "\-v, \-\-version"
+Print version information.
+
+.SH BUGS
+Report bugs by using Mantis or by sending electronic mail to
+
+.SH "SEE ALSO"
+\fBtaler\-exchange\-httpd\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-mint-dbinit.1 b/doc/taler-mint-dbinit.1
deleted file mode 100644
index c8678aed0..000000000
--- a/doc/taler-mint-dbinit.1
+++ /dev/null
@@ -1,29 +0,0 @@
-.TH TALER\-MINT\-DBINIT 1 "Apr 22, 2015" "GNU Taler"
-
-.SH NAME
-taler\-mint\-dbinit \- Initialize Taler mint database.
-
-.SH SYNOPSIS
-.B taler\-mint\-dbinit
-.RI [ options ]
-.br
-
-.SH DESCRIPTION
-\fBtaler\-mint\-dbinit\fP is a command line tool to initialize the Taler mint database. It creates the necessary tables and indices for the Taler mint to operate.
-
-.SH OPTIONS
-.B
-.IP "\-d DIRNAME, \-\-mint-dir=DIRNAME"
-Use the configuration and other resources for the mint to operate from DIRNAME.
-.B
-.IP "\-h, \-\-help"
-Print short help on options.
-.B
-.IP "\-v, \-\-version"
-Print version information.
-
-.SH BUGS
-Report bugs by using Mantis or by sending electronic mail to
-
-.SH "SEE ALSO"
-\fBtaler\-mint\-httpd\fP(1), \fBtaler\-mint\-keyup\fP(1), \fBtaler\-mint\-reservemod\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-mint-httpd.1 b/doc/taler-mint-httpd.1
deleted file mode 100644
index 4f9c35292..000000000
--- a/doc/taler-mint-httpd.1
+++ /dev/null
@@ -1,39 +0,0 @@
-.TH TALER\-MINT\-HTTPD 1 "Apr 22, 2015" "GNU Taler"
-
-.SH NAME
-taler\-mint\-httpd \- Run Taler mint (with RESTful API)
-
-.SH SYNOPSIS
-.B taler\-mint\-httpd
-.RI [ options ]
-.br
-
-.SH DESCRIPTION
-\fBtaler\-mint\-httpd\fP is a command line tool to run the Taler mint (HTTP server). The required configuration, keys and database must exist before running this command.
-
-.SH OPTIONS
-.B
-.IP "\-C, \-\-connection-close"
-Force each HTTP connection to be closed after each request (useful in combination with \-f to avoid having to wait for nc to time out).
-.B
-.IP "\-d DIRNAME, \-\-mint-dir=DIRNAME"
-Use the configuration and other resources for the mint to operate from DIRNAME.
-.B
-.IP "\-h, \-\-help"
-Print short help on options.
-.B
-.IP "\-v, \-\-version"
-Print version information.
-.B
-.IP "\-f FILENAME, \-\-file\-input=FILENAME"
-This option is only available if the mint was compiled with the configure option
-\-\-enable\-developer\-mode. It is used for generating test cases against the mint using AFL. When this option is present, the HTTP server will (1) terminate after the first client's HTTP connection is completed, and (2) automatically start such a client using a helper process based on the 'nc' or 'ncat' binary using FILENAME as the standard input to the helper process. As a result, the process will effectively run with FILENAME as the input from an HTTP client and then immediately exit. This is useful to test taler\-mint\-httpd against many different possible inputs in a controlled way.
-.B
-.IP \"-t SECONDS, \-\-timeout=SECONDS"
-Specifies the number of SECONDS after which the HTTPD should close (idle) HTTP connections.
-
-.SH BUGS
-Report bugs by using Mantis or by sending electronic mail to
-
-.SH "SEE ALSO"
-\fBtaler\-mint\-dbinit\fP(1), \fBtaler\-mint\-keyup\fP(1), \fBtaler\-mint\-reservemod\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-mint-keycheck.1 b/doc/taler-mint-keycheck.1
deleted file mode 100644
index a2c153244..000000000
--- a/doc/taler-mint-keycheck.1
+++ /dev/null
@@ -1,29 +0,0 @@
-.TH TALER\-MINT\-KEYCHECK 1 "Apr 22, 2015" "GNU Taler"
-
-.SH NAME
-taler\-mint\-keycheck \- Check validity of Taler signing and denomination keys.
-
-.SH SYNOPSIS
-.B taler\-mint\-keycheck
-.RI [ options ]
-.br
-
-.SH DESCRIPTION
-\fBtaler\-mint\-keycheck\fP can be used to check if the signing and denomination keys in the operation directory are well-formed. This can be useful after importing fresh keys from the offline system to ensure that the files are correct.
-
-.SH OPTIONS
-.B
-.IP "\-d DIRNAME, \-\-mint-dir=DIRNAME"
-Use the configuration and other resources for the mint to operate from DIRNAME.
-.B
-.IP "\-h, \-\-help"
-Print short help on options.
-.B
-.IP "\-v, \-\-version"
-Print version information.
-
-.SH BUGS
-Report bugs by using Mantis or by sending electronic mail to
-
-.SH "SEE ALSO"
-\fBtaler\-mint\-httpd\fP(1), \fBtaler\-mint\-keyup\fP(1), \fBtaler\-mint\-dbinit\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-mint-keyup.1 b/doc/taler-mint-keyup.1
deleted file mode 100644
index 71135b36a..000000000
--- a/doc/taler-mint-keyup.1
+++ /dev/null
@@ -1,38 +0,0 @@
-.TH TALER\-MINT\-KEYUP 1 "Apr 22, 2015" "GNU Taler"
-
-.SH NAME
-taler\-mint\-keyup \- Setup Taler mint denomination and signing keys.
-
-.SH SYNOPSIS
-.B taler\-mint\-keyup
-.RI [ options ]
-.br
-
-.SH DESCRIPTION
-\fBtaler\-mint\-keyup\fP is a command line tool to setup Taler denomination and signing keys. This tool requires access to the mint's long-term offline signing key and should be run in a secure (offline) environment under strict controls. The resulting keys can then be copied to the main online directory where the Taler HTTP server operates.
-
-.SH OPTIONS
-.B
-.IP "\-d DIRNAME, \-\-mint-dir=DIRNAME"
-Use the configuration and other resources for the mint to operate from DIRNAME.
-.B
-.IP "\-h, \-\-help"
-Print short help on options.
-.B
-.IP "\-m FILE, \-\-master-key=FILE"
-Location of the private EdDSA offline master key of the mint.
-.B
-.IP "\-o FILE, \-\-ouptut=FILE"
-Where to write a denomination key signing request file to be given to the auditor.
-.B
-.IP "\-t TIMESTAMP, \-\-time=TIMESTAMP"
-Operate as if the current time was TIMESTAMP.
-.B
-.IP "\-v, \-\-version"
-Print version information.
-
-.SH BUGS
-Report bugs by using Mantis or by sending electronic mail to
-
-.SH "SEE ALSO"
-\fBtaler\-mint\-httpd\fP(1), \fBtaler\-mint\-keyup\fP(1), \fBtaler\-mint\-keycheck\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-mint-reservemod.1 b/doc/taler-mint-reservemod.1
deleted file mode 100644
index 1d8270458..000000000
--- a/doc/taler-mint-reservemod.1
+++ /dev/null
@@ -1,35 +0,0 @@
-.TH TALER\-MINT\-RESERVEMOD 1 "Apr 22, 2015" "GNU Taler"
-
-.SH NAME
-taler\-mint\-reservemod \- Modify reserve balance in the Taler mint database.
-
-.SH SYNOPSIS
-.B taler\-mint\-reservemod
-.RI [ options ]
-.br
-
-.SH DESCRIPTION
-\fBtaler\-mint\-reservemod\fP is a command line tool to modify reserves in the Taler mint database. Basically, it can be used to import deposits, either for testing or as part of the import from the list of incoming transactions.
-
-.SH OPTIONS
-.B
-.IP "\-a DENOM, \-\-add=DENOM"
-Amount to add to the reserve.
-.B
-.IP "\-d DIRNAME, \-\-mint-dir=DIRNAME"
-Use the configuration and other resources for the mint to operate from DIRNAME.
-.B
-.IP "\-h, \-\-help"
-Print short help on options.
-.B
-.IP "\-R KEY, \-\-reserve=KEY"
-Public EdDSA key of the reserve to modify.
-.B
-.IP "\-v, \-\-version"
-Print version information.
-
-.SH BUGS
-Report bugs by using Mantis or by sending electronic mail to
-
-.SH "SEE ALSO"
-\fBtaler\-mint\-httpd\fP(1), \fBtaler\-mint\-keyup\fP(1), \fBtaler\-mint\-dbinit\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler-mint-sepa.1 b/doc/taler-mint-sepa.1
deleted file mode 100644
index 62d75a667..000000000
--- a/doc/taler-mint-sepa.1
+++ /dev/null
@@ -1,41 +0,0 @@
-.TH TALER\-MINT\-SEPA 1 "Apr 22, 2015" "GNU Taler"
-
-.SH NAME
-taler\-mint\-sepa \- Create the master-key signed response to /wire/sepa.
-
-.SH SYNOPSIS
-.B taler\-mint\-sepa
-.RI [ options ]
-.br
-
-.SH DESCRIPTION
-\fBtaler\-mint\-sepa\fP is used to create the mint's reply to a /wire/sepa request. It converts the bank details into the appropriate signed response. This needs to be done using the long-term offline master key.
-
-.SH OPTIONS
-.B
-.IP "\-b BIC, \-\-bic=BIC"
-Specifies the BIC code to use.
-.B
-.IP "\-i IBAN, \-\-iban=IBAN"
-Specifies the IBAN to use.
-.B
-.IP "\-n NAME, \-\-name=NAME"
-Specifies the name of the account holder.
-.B
-.IP "\-m MASTERKEYFILE, \-\-master=MASTERKEYFILE"
-Specifies the name of the file containing the mint's master key.
-.B
-.IP "\-o FILENAME, \-\-output=FILENAME"
-Where to write the SEPA_RESPONSE_FILE.
-.B
-.IP "\-h, \-\-help"
-Print short help on options.
-.B
-.IP "\-v, \-\-version"
-Print version information.
-
-.SH BUGS
-Report bugs by using Mantis or by sending electronic mail to
-
-.SH "SEE ALSO"
-\fBtaler\-mint\-httpd\fP(1), \fBtaler.conf\fP(5)
diff --git a/doc/taler.conf.5 b/doc/taler.conf.5
index 87f216913..1d03927ea 100644
--- a/doc/taler.conf.5
+++ b/doc/taler.conf.5
@@ -1,18 +1,18 @@
-.TH TALER.CONF 5 "Aug 11, 2015" "GNU Taler"
+.TH TALER.CONF 5 "Apr 11, 2016" "GNU Taler"
.SH NAME
taler.conf \- Taler configuration file.
.SH SYNOPSIS
-.B DIRNAME/taler.conf
+.B taler.conf
.SH DESCRIPTION
-The basic structure of the configuration file is the following. The file is split into sections. Every section begins with "[SECTIONNAME]" and contains a number of options of the form "OPTION=VALUE". Empty lines and lines beginning with a "#" are treated as comments.
+The basic structure of the configuration file is the following. The file is split into sections. Every section begins with "[SECTIONNAME]" and contains a number of options of the form "OPTION=VALUE". Empty lines and lines beginning with a "#" are treated as comments. Files containing default values for many of the options described below are installed under \$TALER\_PREFIX/share/taler/config.d/. The configuration file given with \-c to Taler binaries overrides these defaults.
-.SH MINT OPTIONS
+.SH EXCHANGE OPTIONS
-The following options are from the "[mint]" section and used by most mint tools:
+The following options are from the "[exchange]" section and used by most exchange tools:
.IP CURRENCY
Name of the currency, i.e. "EUR" for Euro.
@@ -23,32 +23,35 @@ The following options are from the "[mint]" section and used by most mint tools:
.IP PORT
Port on which the HTTP server listens, i.e. 8080.
.IP MASTER_PUBLIC_KEY
- Crockford Base32-encoded master public key, public version of the mint\'s long\-time offline signing key.
+ Crockford Base32-encoded master public key, public version of the exchange\'s long\-time offline signing key.
.SH WIRE transfer details
-The following options must be in section "[mint-wire-test]":
+The following options must be in section "[wire\-incoming\-test]" and "[wire\-outgoing\-test]":
-.IP REDIRECT_URL
- URL to redirect /wire/test to. Should contain a Web form the user can use to charge his wallet with coins in a "test" currency for testing. If this option is not provided, /wire/test will return "501 NOT IMPLEMENTED".
+.IP BANK_URI
+ URL of the Taler bank.
-The following options must be in section "[mint-wire-sepa]":
+.IP BANK_ACCOUNT_NUMBER
+ Number of the bank account of the exchange.
+
+The following options must be in section "[wire\-incoming\-sepa]" and "[wire\-outgoing\-sepa]":
.IP SEPA_RESPONSE_FILE
- Filename with the JSON body for the /wire/sepa response, signed using the mint's long-term offline master key. If this option is not provided, /wire/test will return "501 NOT IMPLEMENTED". Use "taler-mint-sepa" to create the SEPA_RESPONSE_FILE.
+ Filename with the JSON body for the /wire response, signed using the exchange\'s long-term offline master key. Use taler\-exchange\-sepa to create the SEPA_RESPONSE_FILE.
.SH Postgres database options
-The following options must be in section "[mintdb-postgres]":
+The following options must be in section "[exchangedb\-postgres]":
.IP DB_CONN_STR
How to access the database, i.e. "postgres:///taler" to use the "taler" database. Testcases use "talercheck".
.SH COIN OPTIONS
-The following options must be in sections starting with "[coin_]" and are used by taler\-mint\-keyup to create denomination keys:
+The following options must be in sections starting with "[coin_]" and are used by taler\-exchange\-keyup to create denomination keys:
.IP VALUE
Value of the coin, i.e. "EUR:1.50" for 1 Euro and 50 Cents (per coin).
@@ -69,7 +72,7 @@ The following options must be in sections starting with "[coin_]" and are used b
.SH KEY OPTIONS
-The following options are from the "[mint_keys]" section and used by most taler\-mint\-keyup to create keys:
+The following options are from the "[exchange_keys]" section and used by most taler\-exchange\-keyup to create keys:
.IP SIGNKEY_DURATION
For how long is a signing key valid?
@@ -85,5 +88,4 @@ The following options are from the "[mint_keys]" section and used by most taler\
Report bugs by using Mantis or by sending electronic mail to
.SH "SEE ALSO"
-\fBtaler\-mint\-httpd\fP(1), \fBtaler\-mint\-keyup\fP(1), \fBtaler\-mint\-reservemod\fP(1), \fBtaler\-mint\-dbinit\fP(1), \fBtaler\-mint\-sepa(1)
-
+\fBtaler\-exchange\-httpd\fP(1), \fBtaler\-exchange\-keyup\fP(1), \fBtaler\-exchange\-reservemod\fP(1), \fBtaler\-exchange\-dbinit\fP(1), \fBtaler\-exchange\-sepa(1)
diff --git a/src/Makefile.am b/src/Makefile.am
index ac839d52a..6e0fb2049 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,16 +3,24 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/include
if HAVE_POSTGRESQL
PQ_DIR = pq
endif
+if HAVE_LIBCURL
+ BANK_LIB = bank-lib
+else
+if HAVE_LIBGNURL
+ BANK_LIB = bank-lib
+endif
+endif
+
if WALLET_ONLY
SUBDIRS = include util
else
-SUBDIRS = include util $(PQ_DIR) bank-lib wire mintdb mint mint-tools
+SUBDIRS = include util json $(PQ_DIR) $(BANK_LIB) wire exchangedb exchange exchange-tools
if HAVE_LIBCURL
- SUBDIRS += mint-lib
+ SUBDIRS += exchange-lib
else
if HAVE_LIBGNURL
- SUBDIRS += mint-lib
+ SUBDIRS += exchange-lib
endif
endif
diff --git a/src/bank-lib/Makefile.am b/src/bank-lib/Makefile.am
index 2f44adada..58b1c67d5 100644
--- a/src/bank-lib/Makefile.am
+++ b/src/bank-lib/Makefile.am
@@ -15,10 +15,11 @@ libtalerbank_la_LDFLAGS = \
libtalerbank_la_SOURCES = \
bank_api_context.c bank_api_context.h \
- bank_api_json.c bank_api_json.h \
bank_api_admin.c
libtalerbank_la_LIBADD = \
+ $(top_builddir)/src/json/libtalerjson.la \
+ -lgnunetjson \
-lgnunetutil \
-ljansson \
$(XLIB)
@@ -42,4 +43,5 @@ test_bank_api_SOURCES = \
test_bank_api_LDADD = \
libtalerbank.la \
$(top_builddir)/src/util/libtalerutil.la \
- -lgnunetutil
+ -lgnunetutil \
+ -ljansson
diff --git a/src/bank-lib/bank_api_admin.c b/src/bank-lib/bank_api_admin.c
index bfcf16a23..907e15ea7 100644
--- a/src/bank-lib/bank_api_admin.c
+++ b/src/bank-lib/bank_api_admin.c
@@ -24,8 +24,9 @@
#include
#include /* just for HTTP status codes */
#include
+#include
#include "taler_bank_service.h"
-#include "bank_api_json.h"
+#include "taler_json_lib.h"
#include "bank_api_context.h"
#include "taler_signatures.h"
@@ -134,7 +135,8 @@ handle_admin_add_incoming_finished (void *cls,
break;
}
aai->cb (aai->cb_cls,
- response_code);
+ response_code,
+ json);
json_decref (json);
TALER_BANK_admin_add_incoming_cancel (aai);
}
@@ -150,7 +152,8 @@ handle_admin_add_incoming_finished (void *cls,
* @param reserve_pub public key of the reserve
* @param amount amount that was deposited
* @param execution_date when did we receive the amount
- * @param account_no account number (53 bits at most)
+ * @param debit_account_no account number to withdraw from (53 bits at most)
+ * @param credit_account_no account number to deposit into (53 bits at most)
* @param res_cb the callback to call when the final result for this request is available
* @param res_cb_cls closure for the above callback
* @return NULL
@@ -161,7 +164,8 @@ struct TALER_BANK_AdminAddIncomingHandle *
TALER_BANK_admin_add_incoming (struct TALER_BANK_Context *bank,
const struct TALER_WireTransferIdentifierRawP *wtid,
const struct TALER_Amount *amount,
- uint64_t account_no,
+ uint64_t debit_account_no,
+ uint64_t credit_account_no,
TALER_BANK_AdminAddIncomingResultCallback res_cb,
void *res_cb_cls)
{
@@ -169,12 +173,13 @@ TALER_BANK_admin_add_incoming (struct TALER_BANK_Context *bank,
json_t *admin_obj;
CURL *eh;
- admin_obj = json_pack ("{s:o, s:o," /* reserve_pub/amount */
- " s:I}", /* execution_Date/wire */
- "wtid", TALER_json_from_data (wtid,
- sizeof (*wtid)),
- "amount", TALER_json_from_amount (amount),
- "account", (json_int_t) account_no);
+ admin_obj = json_pack ("{s:o, s:o,"
+ " s:I, s:I}",
+ "wtid", GNUNET_JSON_from_data (wtid,
+ sizeof (*wtid)), /* #4340 */
+ "amount", TALER_JSON_from_amount (amount),
+ "debit_account", (json_int_t) debit_account_no,
+ "credit_account", (json_int_t) credit_account_no);
aai = GNUNET_new (struct TALER_BANK_AdminAddIncomingHandle);
aai->bank = bank;
aai->cb = res_cb;
diff --git a/src/bank-lib/bank_api_context.c b/src/bank-lib/bank_api_context.c
index a47b4072a..2e4083cae 100644
--- a/src/bank-lib/bank_api_context.c
+++ b/src/bank-lib/bank_api_context.c
@@ -390,7 +390,7 @@ TALER_BANK_fini (struct TALER_BANK_Context *ctx)
/**
* Obtain the URL to use for an API request.
*
- * @param h the mint handle to query
+ * @param h the exchange handle to query
* @param path Taler API path (i.e. "/reserve/withdraw")
* @return the full URI to use with cURL
*/
diff --git a/src/bank-lib/bank_api_context.h b/src/bank-lib/bank_api_context.h
index 552cbe440..1f21cb8d2 100644
--- a/src/bank-lib/bank_api_context.h
+++ b/src/bank-lib/bank_api_context.h
@@ -21,6 +21,7 @@
* @author Christian Grothoff
*/
#include "platform.h"
+#include
#include
#include
#include "taler_bank_service.h"
diff --git a/src/bank-lib/bank_api_json.c b/src/bank-lib/bank_api_json.c
deleted file mode 100644
index 2a09e5272..000000000
--- a/src/bank-lib/bank_api_json.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU Affero General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License along with
- TALER; see the file COPYING. If not, If not, see
-*/
-/**
- * @file bank-lib/bank_api_json.c
- * @brief functions to parse incoming requests (JSON snippets)
- * @author Florian Dold
- * @author Benedikt Mueller
- * @author Christian Grothoff
- */
-#include "platform.h"
-#include "bank_api_json.h"
-
-/**
- * Navigate and parse data in a JSON tree.
- *
- * @param root the JSON node to start the navigation at.
- * @param spec parse specification array
- * @return offset in @a spec where parsing failed, -1 on success (!)
- */
-static int
-parse_json (json_t *root,
- struct BAJ_Specification *spec)
-{
- int i;
- json_t *pos; /* what's our current position? */
-
- pos = root;
- for (i=0;BAJ_CMD_END != spec[i].cmd;i++)
- {
- pos = json_object_get (root,
- spec[i].field);
- if (NULL == pos)
- {
- GNUNET_break_op (0);
- return i;
- }
- switch (spec[i].cmd)
- {
- case BAJ_CMD_END:
- GNUNET_assert (0);
- return i;
- case BAJ_CMD_AMOUNT:
- if (GNUNET_OK !=
- TALER_json_to_amount (pos,
- spec[i].details.amount))
- {
- GNUNET_break_op (0);
- return i;
- }
- break;
- case BAJ_CMD_TIME_ABSOLUTE:
- if (GNUNET_OK !=
- TALER_json_to_abs (pos,
- spec[i].details.abs_time))
- {
- GNUNET_break_op (0);
- return i;
- }
- break;
-
- case BAJ_CMD_STRING:
- {
- const char *str;
-
- str = json_string_value (pos);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- return i;
- }
- *spec[i].details.strptr = str;
- }
- break;
-
- case BAJ_CMD_BINARY_FIXED:
- {
- const char *str;
- int res;
-
- str = json_string_value (pos);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- return i;
- }
- res = GNUNET_STRINGS_string_to_data (str, strlen (str),
- spec[i].details.fixed_data.dest,
- spec[i].details.fixed_data.dest_size);
- if (GNUNET_OK != res)
- {
- GNUNET_break_op (0);
- return i;
- }
- }
- break;
-
- case BAJ_CMD_BINARY_VARIABLE:
- {
- const char *str;
- size_t size;
- void *data;
- int res;
-
- str = json_string_value (pos);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- return i;
- }
- size = (strlen (str) * 5) / 8;
- if (size >= 1024)
- {
- GNUNET_break_op (0);
- return i;
- }
- data = GNUNET_malloc (size);
- res = GNUNET_STRINGS_string_to_data (str,
- strlen (str),
- data,
- size);
- if (GNUNET_OK != res)
- {
- GNUNET_break_op (0);
- GNUNET_free (data);
- return i;
- }
- *spec[i].details.variable_data.dest_p = data;
- *spec[i].details.variable_data.dest_size_p = size;
- }
- break;
-
- case BAJ_CMD_RSA_PUBLIC_KEY:
- {
- size_t size;
- const char *str;
- int res;
- void *buf;
-
- str = json_string_value (pos);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- return i;
- }
- size = (strlen (str) * 5) / 8;
- buf = GNUNET_malloc (size);
- res = GNUNET_STRINGS_string_to_data (str,
- strlen (str),
- buf,
- size);
- if (GNUNET_OK != res)
- {
- GNUNET_free (buf);
- GNUNET_break_op (0);
- return i;
- }
- *spec[i].details.rsa_public_key
- = GNUNET_CRYPTO_rsa_public_key_decode (buf,
- size);
- GNUNET_free (buf);
- if (NULL == spec[i].details.rsa_public_key)
- {
- GNUNET_break_op (0);
- return i;
- }
- }
- break;
-
- case BAJ_CMD_RSA_SIGNATURE:
- {
- size_t size;
- const char *str;
- int res;
- void *buf;
-
- str = json_string_value (pos);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- return i;
- }
- size = (strlen (str) * 5) / 8;
- buf = GNUNET_malloc (size);
- res = GNUNET_STRINGS_string_to_data (str,
- strlen (str),
- buf,
- size);
- if (GNUNET_OK != res)
- {
- GNUNET_free (buf);
- GNUNET_break_op (0);
- return i;
- }
- *spec[i].details.rsa_signature
- = GNUNET_CRYPTO_rsa_signature_decode (buf,
- size);
- GNUNET_free (buf);
- if (NULL == spec[i].details.rsa_signature)
- return i;
- }
- break;
-
- case BAJ_CMD_UINT16:
- {
- json_int_t val;
-
- if (! json_is_integer (pos))
- {
- GNUNET_break_op (0);
- return i;
- }
- val = json_integer_value (pos);
- if ( (0 > val) || (val > UINT16_MAX) )
- {
- GNUNET_break_op (0);
- return i;
- }
- *spec[i].details.u16 = (uint16_t) val;
- }
- break;
-
- case BAJ_CMD_UINT64:
- {
- json_int_t val;
-
- if (! json_is_integer (pos))
- {
- GNUNET_break_op (0);
- return i;
- }
- val = json_integer_value (pos);
- *spec[i].details.u64 = (uint64_t) val;
- }
- break;
-
- case BAJ_CMD_JSON_OBJECT:
- {
- if (! (json_is_object (pos) || json_is_array (pos)) )
- {
- GNUNET_break_op (0);
- return i;
- }
- json_incref (pos);
- *spec[i].details.obj = pos;
- }
- break;
-
- default:
- GNUNET_break (0);
- return i;
- }
- }
- return -1; /* all OK! */
-}
-
-
-/**
- * Free all elements allocated during a
- * #BAJ_parse_json() operation.
- *
- * @param spec specification of the parse operation
- * @param end number of elements in @a spec to process
- */
-static void
-parse_free (struct BAJ_Specification *spec,
- int end)
-{
- int i;
-
- for (i=0;i
-*/
-/**
- * @file mint-lib/mint_api_json.h
- * @brief functions to parse incoming requests (JSON snippets)
- * @author Florian Dold
- * @author Benedikt Mueller
- * @author Christian Grothoff
- */
-#include "platform.h"
-#include
-#include "taler_util.h"
-#include
-
-
-/**
- * Enumeration with the various commands for the
- * #BAJ_parse_json interpreter.
- */
-enum BAJ_Command
-{
-
- /**
- * End of command list.
- */
- BAJ_CMD_END,
-
- /**
- * Parse amount at current position.
- */
- BAJ_CMD_AMOUNT,
-
- /**
- * Parse absolute time at current position.
- */
- BAJ_CMD_TIME_ABSOLUTE,
-
- /**
- * Parse fixed binary value at current position.
- */
- BAJ_CMD_BINARY_FIXED,
-
- /**
- * Parse variable-size binary value at current position.
- */
- BAJ_CMD_BINARY_VARIABLE,
-
- /**
- * Parse RSA public key at current position.
- */
- BAJ_CMD_RSA_PUBLIC_KEY,
-
- /**
- * Parse RSA signature at current position.
- */
- BAJ_CMD_RSA_SIGNATURE,
-
- /**
- * Parse `const char *` JSON string at current position.
- */
- BAJ_CMD_STRING,
-
- /**
- * Parse `uint16_t` integer at the current position.
- */
- BAJ_CMD_UINT16,
-
- /**
- * Parse `uint64_t` integer at the current position.
- */
- BAJ_CMD_UINT64,
-
- /**
- * Parse JSON object at the current position.
- */
- BAJ_CMD_JSON_OBJECT,
-
- /**
- * Parse ??? at current position.
- */
- BAJ_CMD_C
-
-};
-
-
-/**
- * @brief Entry in parser specification for #BAJ_parse_json.
- */
-struct BAJ_Specification
-{
-
- /**
- * Command to execute.
- */
- enum BAJ_Command cmd;
-
- /**
- * Name of the field to access.
- */
- const char *field;
-
- /**
- * Further details for the command.
- */
- union {
-
- /**
- * Where to store amount for #BAJ_CMD_AMOUNT.
- */
- struct TALER_Amount *amount;
-
- /**
- * Where to store time, for #BAJ_CMD_TIME_ABSOLUTE.
- */
- struct GNUNET_TIME_Absolute *abs_time;
-
- /**
- * Where to write binary data, for #BAJ_CMD_BINARY_FIXED.
- */
- struct {
- /**
- * Where to write the data.
- */
- void *dest;
-
- /**
- * How many bytes to write to @e dest.
- */
- size_t dest_size;
-
- } fixed_data;
-
- /**
- * Where to write binary data, for #BAJ_CMD_BINARY_VARIABLE.
- */
- struct {
- /**
- * Where to store the pointer with the data (is allocated).
- */
- void **dest_p;
-
- /**
- * Where to store the number of bytes allocated at `*dest`.
- */
- size_t *dest_size_p;
-
- } variable_data;
-
- /**
- * Where to store the RSA public key for #BAJ_CMD_RSA_PUBLIC_KEY
- */
- struct GNUNET_CRYPTO_rsa_PublicKey **rsa_public_key;
-
- /**
- * Where to store the RSA signature for #BAJ_CMD_RSA_SIGNATURE
- */
- struct GNUNET_CRYPTO_rsa_Signature **rsa_signature;
-
- /**
- * Details for #BAJ_CMD_EDDSA_SIGNATURE
- */
- struct {
-
- /**
- * Where to store the purpose.
- */
- struct GNUNET_CRYPTO_EccSignaturePurpose **purpose_p;
-
- /**
- * Key to verify the signature against.
- */
- const struct GNUNET_CRYPTO_EddsaPublicKey *pub_key;
-
- } eddsa_signature;
-
- /**
- * Where to store a pointer to the string.
- */
- const char **strptr;
-
- /**
- * Where to store 16-bit integer.
- */
- uint16_t *u16;
-
- /**
- * Where to store 64-bit integer.
- */
- uint64_t *u64;
-
- /**
- * Where to store a JSON object.
- */
- json_t **obj;
-
- } details;
-
-};
-
-
-/**
- * Navigate and parse data in a JSON tree.
- *
- * @param root the JSON node to start the navigation at.
- * @param spec parse specification array
- * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
- */
-int
-BAJ_parse_json (const json_t *root,
- struct BAJ_Specification *spec);
-
-
-/**
- * Free all elements allocated during a
- * #BAJ_parse_json() operation.
- *
- * @param spec specification of the parse operation
- */
-void
-BAJ_parse_free (struct BAJ_Specification *spec);
-
-
-/**
- * End of a parser specification.
- */
-#define BAJ_spec_end { .cmd = BAJ_CMD_END }
-
-/**
- * Fixed size object (in network byte order, encoded using Crockford
- * Base32hex encoding).
- *
- * @param name name of the JSON field
- * @param obj pointer where to write the data (type of `*obj` will determine size)
- */
-#define BAJ_spec_fixed_auto(name,obj) { .cmd = BAJ_CMD_BINARY_FIXED, .field = name, .details.fixed_data.dest = obj, .details.fixed_data.dest_size = sizeof (*obj) }
-
-
-/**
- * Variable size object (in network byte order, encoded using Crockford
- * Base32hex encoding).
- *
- * @param name name of the JSON field
- * @param obj pointer where to write the data (a `void **`)
- * @param size where to store the number of bytes allocated for @a obj (of type `size_t *`
- */
-#define BAJ_spec_varsize(name,obj,size) { .cmd = BAJ_CMD_BINARY_VARIABLE, .field = name, .details.variable_data.dest_p = obj, .details.variable_data.dest_size_p = size }
-
-
-/**
- * The expected field stores a string.
- *
- * @param name name of the JSON field
- * @param strptr where to store a pointer to the field
- */
-struct BAJ_Specification
-BAJ_spec_string (const char *name,
- const char **strptr);
-
-
-/**
- * Absolute time.
- *
- * @param name name of the JSON field
- * @param[out] at where to store the absolute time found under @a name
- */
-struct BAJ_Specification
-BAJ_spec_absolute_time (const char *name,
- struct GNUNET_TIME_Absolute *at);
-
-
-/**
- * 16-bit integer.
- *
- * @param name name of the JSON field
- * @param[out] u16 where to store the integer found under @a name
- */
-struct BAJ_Specification
-BAJ_spec_uint16 (const char *name,
- uint16_t *u16);
-
-
-/**
- * 64-bit integer.
- *
- * @param name name of the JSON field
- * @param[out] u64 where to store the integer found under @a name
- */
-struct BAJ_Specification
-BAJ_spec_uint64 (const char *name,
- uint64_t *u64);
-
-
-/**
- * JSON object.
- *
- * @param name name of the JSON field
- * @param[out] jsonp where to store the JSON found under @a name
- */
-struct BAJ_Specification
-BAJ_spec_json (const char *name,
- json_t **jsonp);
-
-
-/**
- * Specification for parsing an amount value.
- *
- * @param name name of the JSON field
- * @param amount where to store the amount under @a name
- */
-struct BAJ_Specification
-BAJ_spec_amount (const char *name,
- struct TALER_Amount *amount);
-
-
-/**
- * Specification for parsing an RSA public key.
- *
- * @param name name of the JSON field
- * @param pk where to store the RSA key found under @a name
- */
-struct BAJ_Specification
-BAJ_spec_rsa_public_key (const char *name,
- struct GNUNET_CRYPTO_rsa_PublicKey **pk);
-
-
-/**
- * Specification for parsing an RSA signature.
- *
- * @param name name of the JSON field
- * @param sig where to store the RSA signature found under @a name
- */
-struct BAJ_Specification
-BAJ_spec_rsa_signature (const char *name,
- struct GNUNET_CRYPTO_rsa_Signature **sig);
-
-
-
-
-/* end of mint_api_json.h */
diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c
index b14f523ba..4d6b9700c 100644
--- a/src/bank-lib/test_bank_api.c
+++ b/src/bank-lib/test_bank_api.c
@@ -103,9 +103,14 @@ struct Command
const char *amount;
/**
- * Account number.
+ * Credited account number.
*/
- uint64_t account_no;
+ uint64_t credit_account_no;
+
+ /**
+ * Debited account number.
+ */
+ uint64_t debit_account_no;
/**
* Wire transfer identifier to use. Initialized to
@@ -158,11 +163,9 @@ struct InterpreterState
* Task that runs the context's event loop with the GNUnet scheduler.
*
* @param cls unused
- * @param tc scheduler context (unused)
*/
static void
-context_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+context_task (void *cls);
/**
@@ -228,11 +231,9 @@ find_command (const struct InterpreterState *is,
* Run the main interpreter loop that performs bank operations.
*
* @param cls contains the `struct InterpreterState`
- * @param tc scheduler context
*/
static void
-interpreter_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+interpreter_run (void *cls);
/**
@@ -241,10 +242,12 @@ interpreter_run (void *cls,
* @param cls closure with the interpreter state
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
* 0 if the bank's reply is bogus (fails to follow the protocol)
+ * @param json detailed response from the HTTPD, or NULL if reply was not in JSON
*/
static void
add_incoming_cb (void *cls,
- unsigned int http_status)
+ unsigned int http_status,
+ json_t *json)
{
struct InterpreterState *is = cls;
struct Command *cmd = &is->commands[is->ip];
@@ -253,6 +256,14 @@ add_incoming_cb (void *cls,
if (cmd->expected_response_code != http_status)
{
GNUNET_break (0);
+ if (NULL != json)
+ {
+ fprintf (stderr,
+ "Unexpected response code %u:\n",
+ http_status);
+ json_dumpf (json, stderr, 0);
+ fprintf (stderr, "\n");
+ }
fail (is);
return;
}
@@ -266,17 +277,17 @@ add_incoming_cb (void *cls,
* Run the main interpreter loop that performs bank operations.
*
* @param cls contains the `struct InterpreterState`
- * @param tc scheduler context
*/
static void
-interpreter_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+interpreter_run (void *cls)
{
struct InterpreterState *is = cls;
struct Command *cmd = &is->commands[is->ip];
struct TALER_Amount amount;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
is->task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
fprintf (stderr,
@@ -310,7 +321,8 @@ interpreter_run (void *cls,
= TALER_BANK_admin_add_incoming (ctx,
&cmd->details.admin_add_incoming.wtid,
&amount,
- cmd->details.admin_add_incoming.account_no,
+ cmd->details.admin_add_incoming.debit_account_no,
+ cmd->details.admin_add_incoming.credit_account_no,
&add_incoming_cb,
is);
if (NULL == cmd->details.admin_add_incoming.aih)
@@ -338,11 +350,9 @@ interpreter_run (void *cls,
* Cleans up our state.
*
* @param cls the interpreter state.
- * @param tc unused
*/
static void
-do_shutdown (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown (void *cls)
{
struct InterpreterState *is = cls;
struct Command *cmd;
@@ -399,11 +409,9 @@ do_shutdown (void *cls,
* Task that runs the context's event loop with the GNUnet scheduler.
*
* @param cls unused
- * @param tc scheduler context (unused)
*/
static void
-context_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+context_task (void *cls)
{
long timeout;
int max_fd;
@@ -455,13 +463,9 @@ context_task (void *cls,
* Main function that will be run by the scheduler.
*
* @param cls closure
- * @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used (for saving, can be NULL!)
- * @param config configuration
*/
static void
-run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run (void *cls)
{
struct InterpreterState *is;
static struct Command commands[] =
@@ -470,8 +474,9 @@ run (void *cls,
{ .oc = OC_ADMIN_ADD_INCOMING,
.label = "deposit-1",
.expected_response_code = MHD_HTTP_OK,
- .details.admin_add_incoming.account_no = 42,
- .details.admin_add_incoming.amount = "EUR:5.01" },
+ .details.admin_add_incoming.credit_account_no = 1,
+ .details.admin_add_incoming.debit_account_no = 2,
+ .details.admin_add_incoming.amount = "PUDOS:5.01" },
{ .oc = OC_END }
};
@@ -503,6 +508,7 @@ main (int argc,
char * const *argv)
{
struct GNUNET_OS_Process *bankd;
+ unsigned int cnt;
GNUNET_log_setup ("test-bank-api",
"WARNING",
@@ -510,32 +516,43 @@ main (int argc,
bankd = GNUNET_OS_start_process (GNUNET_NO,
GNUNET_OS_INHERIT_STD_ALL,
NULL, NULL, NULL,
- "taler-bank-httpd",
- "taler-bank-httpd",
- "-d", "test-bank-home",
+ "taler-bank-manage",
+ "taler-bank-manage",
+ "serve-http", "--port", "8081",
NULL);
if (NULL == bankd)
{
fprintf (stderr,
- "taler-bank-httpd not found, skipping test\n");
+ "taler-bank-manage not found, skipping test\n");
return 77; /* report 'skip' */
}
/* give child time to start and bind against the socket */
fprintf (stderr,
- "Waiting for taler-bank-httpd to be ready");
+ "Waiting for taler-bank-manage to be ready\n");
+ cnt = 0;
do
{
fprintf (stderr, ".");
sleep (1);
+ cnt++;
+ if (cnt > 30)
+ break;
}
- while (0 != system ("wget -q -t 1 -T 1 http://127.0.0.1:8081/keys -o /dev/null -O /dev/null"));
+ while (0 != system ("wget -q -t 1 -T 1 http://127.0.0.1:8081/ -o /dev/null -O /dev/null"));
fprintf (stderr, "\n");
result = GNUNET_SYSERR;
- GNUNET_SCHEDULER_run (&run, NULL);
+ if (cnt <= 30)
+ GNUNET_SCHEDULER_run (&run, NULL);
GNUNET_OS_process_kill (bankd,
SIGTERM);
GNUNET_OS_process_wait (bankd);
GNUNET_OS_process_destroy (bankd);
+ if (cnt > 30)
+ {
+ fprintf (stderr,
+ "taler-bank-manage failed to start properly.\n");
+ return 77;
+ }
return (GNUNET_OK == result) ? 0 : 1;
}
diff --git a/src/exchange-lib/Makefile.am b/src/exchange-lib/Makefile.am
new file mode 100644
index 000000000..d953a7a86
--- /dev/null
+++ b/src/exchange-lib/Makefile.am
@@ -0,0 +1,67 @@
+# This Makefile.am is in the public domain
+AM_CPPFLAGS = -I$(top_srcdir)/src/include
+
+if USE_COVERAGE
+ AM_CFLAGS = --coverage -O0
+ XLIB = -lgcov
+endif
+
+lib_LTLIBRARIES = \
+ libtalerexchange.la
+
+libtalerexchange_la_LDFLAGS = \
+ -version-info 0:0:0 \
+ -no-undefined
+
+libtalerexchange_la_SOURCES = \
+ exchange_api_common.c exchange_api_common.h \
+ exchange_api_context.c exchange_api_context.h \
+ exchange_api_handle.c exchange_api_handle.h \
+ exchange_api_admin.c \
+ exchange_api_deposit.c \
+ exchange_api_deposit_wtid.c \
+ exchange_api_refresh.c \
+ exchange_api_refresh_link.c \
+ exchange_api_reserve.c \
+ exchange_api_wire.c \
+ exchange_api_wire_deposits.c
+
+libtalerexchange_la_LIBADD = \
+ $(top_builddir)/src/json/libtalerjson.la \
+ $(top_builddir)/src/util/libtalerutil.la \
+ -lgnunetjson \
+ -lgnunetutil \
+ -ljansson \
+ $(XLIB)
+
+if HAVE_LIBCURL
+libtalerexchange_la_LIBADD += -lcurl
+else
+if HAVE_LIBGNURL
+libtalerexchange_la_LIBADD += -lgnurl
+endif
+endif
+
+check_PROGRAMS = \
+ test_exchange_api
+
+AM_TESTS_ENVIRONMENT=export TALER_PREFIX=$${TALER_PREFIX:-@libdir@};export PATH=$${TALER_PREFIX:-@prefix@}/bin:$$PATH;
+
+TESTS = \
+ $(check_PROGRAMS)
+
+test_exchange_api_SOURCES = \
+ test_exchange_api.c
+test_exchange_api_LDADD = \
+ libtalerexchange.la \
+ $(LIBGCRYPT_LIBS) \
+ $(top_builddir)/src/json/libtalerjson.la \
+ $(top_builddir)/src/util/libtalerutil.la \
+ -lgnunetutil \
+ -ljansson
+
+EXTRA_DIST = \
+ test_taler_exchange_api_home/.local/share/taler/exchange/offline-keys/master.priv \
+ test_taler_exchange_api_home/.config/taler/test.json \
+ test_taler_exchange_api_home/.config/taler/sepa.json \
+ test_taler_exchange_api.conf
diff --git a/src/mint-lib/afl-generate.sh b/src/exchange-lib/afl-generate.sh
similarity index 86%
rename from src/mint-lib/afl-generate.sh
rename to src/exchange-lib/afl-generate.sh
index 4b5051869..6ae833087 100644
--- a/src/mint-lib/afl-generate.sh
+++ b/src/exchange-lib/afl-generate.sh
@@ -16,9 +16,9 @@
#
#
# This will generate testcases in a directory 'afl-tests', which can then
-# be moved into src/mint/afl-tests/ to be run during mint-testing.
+# be moved into src/exchange/afl-tests/ to be run during exchange-testing.
#
-# This script uses American Fuzzy Loop (AFL) to fuzz the mint to
+# This script uses American Fuzzy Loop (AFL) to fuzz the exchange to
# automatically create tests with good coverage. You must install
# AFL and set AFL_HOME to the directory where AFL is installed
# before running. Also, a directory "baseline/" should exist with
@@ -31,4 +31,4 @@
#
# Must be run from this directory.
#
-$AFL_HOME/afl-fuzz -i baseline/ -m 250 -o afl-tests/ -f /tmp/afl-input taler-mint-httpd -f /tmp/afl-input -d test-mint-home/ -C
+$AFL_HOME/afl-fuzz -i baseline/ -m 250 -o afl-tests/ -f /tmp/afl-input taler-exchange-httpd -f /tmp/afl-input -d test-exchange-home/ -C
diff --git a/src/mint-lib/baseline/admin_add_incoming.req b/src/exchange-lib/baseline/admin_add_incoming.req
similarity index 100%
rename from src/mint-lib/baseline/admin_add_incoming.req
rename to src/exchange-lib/baseline/admin_add_incoming.req
diff --git a/src/mint-lib/baseline/deposit.req b/src/exchange-lib/baseline/deposit.req
similarity index 100%
rename from src/mint-lib/baseline/deposit.req
rename to src/exchange-lib/baseline/deposit.req
diff --git a/src/mint-lib/baseline/keys.req b/src/exchange-lib/baseline/keys.req
similarity index 100%
rename from src/mint-lib/baseline/keys.req
rename to src/exchange-lib/baseline/keys.req
diff --git a/src/mint-lib/baseline/refresh_link.req b/src/exchange-lib/baseline/refresh_link.req
similarity index 100%
rename from src/mint-lib/baseline/refresh_link.req
rename to src/exchange-lib/baseline/refresh_link.req
diff --git a/src/mint-lib/baseline/refresh_melt.req b/src/exchange-lib/baseline/refresh_melt.req
similarity index 100%
rename from src/mint-lib/baseline/refresh_melt.req
rename to src/exchange-lib/baseline/refresh_melt.req
diff --git a/src/mint-lib/baseline/refresh_reveal.req b/src/exchange-lib/baseline/refresh_reveal.req
similarity index 100%
rename from src/mint-lib/baseline/refresh_reveal.req
rename to src/exchange-lib/baseline/refresh_reveal.req
diff --git a/src/mint-lib/baseline/reserve_status.req b/src/exchange-lib/baseline/reserve_status.req
similarity index 100%
rename from src/mint-lib/baseline/reserve_status.req
rename to src/exchange-lib/baseline/reserve_status.req
diff --git a/src/mint-lib/baseline/reserve_withdraw.req b/src/exchange-lib/baseline/reserve_withdraw.req
similarity index 100%
rename from src/mint-lib/baseline/reserve_withdraw.req
rename to src/exchange-lib/baseline/reserve_withdraw.req
diff --git a/src/mint-lib/baseline/wire.req b/src/exchange-lib/baseline/wire.req
similarity index 100%
rename from src/mint-lib/baseline/wire.req
rename to src/exchange-lib/baseline/wire.req
diff --git a/src/mint-lib/baseline/wire_sepa.req b/src/exchange-lib/baseline/wire_sepa.req
similarity index 100%
rename from src/mint-lib/baseline/wire_sepa.req
rename to src/exchange-lib/baseline/wire_sepa.req
diff --git a/src/mint-lib/baseline/wire_test.req b/src/exchange-lib/baseline/wire_test.req
similarity index 100%
rename from src/mint-lib/baseline/wire_test.req
rename to src/exchange-lib/baseline/wire_test.req
diff --git a/src/mint-lib/mint_api_admin.c b/src/exchange-lib/exchange_api_admin.c
similarity index 74%
rename from src/mint-lib/mint_api_admin.c
rename to src/exchange-lib/exchange_api_admin.c
index 641e0690f..871a88a6b 100644
--- a/src/mint-lib/mint_api_admin.c
+++ b/src/exchange-lib/exchange_api_admin.c
@@ -15,8 +15,8 @@
*/
/**
- * @file mint-lib/mint_api_admin.c
- * @brief Implementation of the /admin/ requests of the mint's HTTP API
+ * @file exchange-lib/exchange_api_admin.c
+ * @brief Implementation of the /admin/ requests of the exchange's HTTP API
* @author Christian Grothoff
*/
#include "platform.h"
@@ -24,23 +24,24 @@
#include
#include /* just for HTTP status codes */
#include
-#include "taler_mint_service.h"
-#include "mint_api_json.h"
-#include "mint_api_context.h"
-#include "mint_api_handle.h"
+#include
+#include "taler_json_lib.h"
+#include "taler_exchange_service.h"
+#include "exchange_api_context.h"
+#include "exchange_api_handle.h"
#include "taler_signatures.h"
/**
* @brief An admin/add/incoming Handle
*/
-struct TALER_MINT_AdminAddIncomingHandle
+struct TALER_EXCHANGE_AdminAddIncomingHandle
{
/**
- * The connection to mint this request handle will use
+ * The connection to exchange this request handle will use
*/
- struct TALER_MINT_Handle *mint;
+ struct TALER_EXCHANGE_Handle *exchange;
/**
* The url for this request.
@@ -65,7 +66,7 @@ struct TALER_MINT_AdminAddIncomingHandle
/**
* Function to call with the result.
*/
- TALER_MINT_AdminAddIncomingResultCallback cb;
+ TALER_EXCHANGE_AdminAddIncomingResultCallback cb;
/**
* Closure for @a cb.
@@ -84,14 +85,14 @@ struct TALER_MINT_AdminAddIncomingHandle
* Function called when we're done processing the
* HTTP /admin/add/incoming request.
*
- * @param cls the `struct TALER_MINT_AdminAddIncomingHandle`
+ * @param cls the `struct TALER_EXCHANGE_AdminAddIncomingHandle`
* @param eh the curl request handle
*/
static void
handle_admin_add_incoming_finished (void *cls,
CURL *eh)
{
- struct TALER_MINT_AdminAddIncomingHandle *aai = cls;
+ struct TALER_EXCHANGE_AdminAddIncomingHandle *aai = cls;
long response_code;
json_t *json;
@@ -106,14 +107,14 @@ handle_admin_add_incoming_finished (void *cls,
case MHD_HTTP_OK:
break;
case MHD_HTTP_BAD_REQUEST:
- /* This should never happen, either us or the mint is buggy
+ /* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
case MHD_HTTP_FORBIDDEN:
/* Access denied */
break;
case MHD_HTTP_UNAUTHORIZED:
- /* Nothing really to verify, mint says one of the signatures is
+ /* Nothing really to verify, exchange says one of the signatures is
invalid; as we checked them, this should never happen, we
should pass the JSON reply to the application */
break;
@@ -138,17 +139,17 @@ handle_admin_add_incoming_finished (void *cls,
response_code,
json);
json_decref (json);
- TALER_MINT_admin_add_incoming_cancel (aai);
+ TALER_EXCHANGE_admin_add_incoming_cancel (aai);
}
/**
- * Notify the mint that we have received an incoming transaction
+ * Notify the exchange that we have received an incoming transaction
* which fills a reserve. Note that this API is an administrative
- * API and thus not accessible to typical mint clients, but only
- * to the operators of the mint.
+ * API and thus not accessible to typical exchange clients, but only
+ * to the operators of the exchange.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param reserve_pub public key of the reserve
* @param amount amount that was deposited
* @param execution_date when did we receive the amount
@@ -159,40 +160,40 @@ handle_admin_add_incoming_finished (void *cls,
* if the inputs are invalid (i.e. invalid amount).
* In this case, the callback is not called.
*/
-struct TALER_MINT_AdminAddIncomingHandle *
-TALER_MINT_admin_add_incoming (struct TALER_MINT_Handle *mint,
+struct TALER_EXCHANGE_AdminAddIncomingHandle *
+TALER_EXCHANGE_admin_add_incoming (struct TALER_EXCHANGE_Handle *exchange,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *amount,
struct GNUNET_TIME_Absolute execution_date,
const json_t *wire,
- TALER_MINT_AdminAddIncomingResultCallback res_cb,
+ TALER_EXCHANGE_AdminAddIncomingResultCallback res_cb,
void *res_cb_cls)
{
- struct TALER_MINT_AdminAddIncomingHandle *aai;
- struct TALER_MINT_Context *ctx;
+ struct TALER_EXCHANGE_AdminAddIncomingHandle *aai;
+ struct TALER_EXCHANGE_Context *ctx;
json_t *admin_obj;
CURL *eh;
GNUNET_assert (GNUNET_OK ==
- TALER_round_abs_time (&execution_date));
+ GNUNET_TIME_round_abs (&execution_date));
if (GNUNET_YES !=
- MAH_handle_is_ready (mint))
+ MAH_handle_is_ready (exchange))
{
GNUNET_break (0);
return NULL;
}
admin_obj = json_pack ("{s:o, s:o," /* reserve_pub/amount */
" s:o, s:O}", /* execution_Date/wire */
- "reserve_pub", TALER_json_from_data (reserve_pub,
+ "reserve_pub", GNUNET_JSON_from_data (reserve_pub,
sizeof (*reserve_pub)),
- "amount", TALER_json_from_amount (amount),
- "execution_date", TALER_json_from_abs (execution_date),
+ "amount", TALER_JSON_from_amount (amount),
+ "execution_date", GNUNET_JSON_from_time_abs (execution_date),
"wire", wire);
- aai = GNUNET_new (struct TALER_MINT_AdminAddIncomingHandle);
- aai->mint = mint;
+ aai = GNUNET_new (struct TALER_EXCHANGE_AdminAddIncomingHandle);
+ aai->exchange = exchange;
aai->cb = res_cb;
aai->cb_cls = res_cb_cls;
- aai->url = MAH_path_to_url (mint, "/admin/add/incoming");
+ aai->url = MAH_path_to_url (exchange, "/admin/add/incoming");
eh = curl_easy_init ();
GNUNET_assert (NULL != (aai->json_enc =
@@ -219,7 +220,7 @@ TALER_MINT_admin_add_incoming (struct TALER_MINT_Handle *mint,
curl_easy_setopt (eh,
CURLOPT_WRITEDATA,
&aai->db));
- ctx = MAH_handle_to_context (mint);
+ ctx = MAH_handle_to_context (exchange);
aai->job = MAC_job_add (ctx,
eh,
GNUNET_YES,
@@ -236,7 +237,7 @@ TALER_MINT_admin_add_incoming (struct TALER_MINT_Handle *mint,
* @param aai the admin add incoming request handle
*/
void
-TALER_MINT_admin_add_incoming_cancel (struct TALER_MINT_AdminAddIncomingHandle *aai)
+TALER_EXCHANGE_admin_add_incoming_cancel (struct TALER_EXCHANGE_AdminAddIncomingHandle *aai)
{
if (NULL != aai->job)
{
@@ -251,4 +252,4 @@ TALER_MINT_admin_add_incoming_cancel (struct TALER_MINT_AdminAddIncomingHandle *
}
-/* end of mint_api_admin.c */
+/* end of exchange_api_admin.c */
diff --git a/src/mint-lib/mint_api_common.c b/src/exchange-lib/exchange_api_common.c
similarity index 75%
rename from src/mint-lib/mint_api_common.c
rename to src/exchange-lib/exchange_api_common.c
index faba38c74..aacbb4a2a 100644
--- a/src/mint-lib/mint_api_common.c
+++ b/src/exchange-lib/exchange_api_common.c
@@ -15,20 +15,20 @@
*/
/**
- * @file mint-lib/mint_api_common.c
- * @brief common functions for the mint API
+ * @file exchange-lib/exchange_api_common.c
+ * @brief common functions for the exchange API
* @author Christian Grothoff
*/
#include "platform.h"
-#include "mint_api_common.h"
-#include "mint_api_json.h"
-#include "mint_api_context.h"
-#include "mint_api_handle.h"
+#include "exchange_api_common.h"
+#include "taler_json_lib.h"
+#include "exchange_api_context.h"
+#include "exchange_api_handle.h"
#include "taler_signatures.h"
/**
- * Verify a coins transaction history as returned by the mint.
+ * Verify a coins transaction history as returned by the exchange.
*
* @param currency expected currency for the coin
* @param coin_pub public key of the coin
@@ -37,10 +37,10 @@
* @return #GNUNET_OK if @a history is valid, #GNUNET_SYSERR if not
*/
int
-TALER_MINT_verify_coin_history_ (const char *currency,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- json_t *history,
- struct TALER_Amount *total)
+TALER_EXCHANGE_verify_coin_history_ (const char *currency,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ json_t *history,
+ struct TALER_Amount *total)
{
size_t len;
size_t off;
@@ -66,24 +66,25 @@ TALER_MINT_verify_coin_history_ (const char *currency,
void *details;
size_t details_size;
const char *type;
- struct MAJ_Specification spec[] = {
- MAJ_spec_amount ("amount",
+ struct GNUNET_JSON_Specification spec[] = {
+ TALER_JSON_spec_amount ("amount",
&amount),
- MAJ_spec_string ("type",
+ GNUNET_JSON_spec_string ("type",
&type),
- MAJ_spec_fixed_auto ("signature",
+ GNUNET_JSON_spec_fixed_auto ("signature",
&sig),
- MAJ_spec_varsize ("details",
+ GNUNET_JSON_spec_varsize ("details",
&details,
&details_size),
- MAJ_spec_end
+ GNUNET_JSON_spec_end()
};
transaction = json_array_get (history,
off);
if (GNUNET_OK !=
- MAJ_parse_json (transaction,
- spec))
+ GNUNET_JSON_parse (transaction,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -97,14 +98,14 @@ TALER_MINT_verify_coin_history_ (const char *currency,
if (details_size != sizeof (struct TALER_DepositRequestPS))
{
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
dr = (const struct TALER_DepositRequestPS *) details;
if (details_size != ntohl (dr->purpose.size))
{
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
@@ -114,18 +115,17 @@ TALER_MINT_verify_coin_history_ (const char *currency,
&coin_pub->eddsa_pub))
{
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
- // FIXME: check sig!
TALER_amount_ntoh (&dr_amount,
&dr->amount_with_fee);
if (0 != TALER_amount_cmp (&dr_amount,
&amount))
{
GNUNET_break (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
}
@@ -138,14 +138,14 @@ TALER_MINT_verify_coin_history_ (const char *currency,
if (details_size != sizeof (struct TALER_RefreshMeltCoinAffirmationPS))
{
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
rm = (const struct TALER_RefreshMeltCoinAffirmationPS *) details;
if (details_size != ntohl (rm->purpose.size))
{
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
@@ -155,7 +155,7 @@ TALER_MINT_verify_coin_history_ (const char *currency,
&coin_pub->eddsa_pub))
{
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
TALER_amount_ntoh (&rm_amount,
@@ -164,7 +164,7 @@ TALER_MINT_verify_coin_history_ (const char *currency,
&amount))
{
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
}
@@ -172,7 +172,7 @@ TALER_MINT_verify_coin_history_ (const char *currency,
{
/* signature not supported, new version on server? */
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
@@ -180,15 +180,15 @@ TALER_MINT_verify_coin_history_ (const char *currency,
total,
&amount))
{
- /* overflow in history already!? inconceivable! Bad mint! */
+ /* overflow in history already!? inconceivable! Bad exchange! */
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
}
return GNUNET_OK;
}
-/* end of mint_api_common.c */
+/* end of exchange_api_common.c */
diff --git a/src/mint-lib/mint_api_common.h b/src/exchange-lib/exchange_api_common.h
similarity index 68%
rename from src/mint-lib/mint_api_common.h
rename to src/exchange-lib/exchange_api_common.h
index 10a202146..2a521ceb2 100644
--- a/src/mint-lib/mint_api_common.h
+++ b/src/exchange-lib/exchange_api_common.h
@@ -15,16 +15,16 @@
*/
/**
- * @file mint-lib/mint_api_common.h
- * @brief common functions for the mint API
+ * @file exchange-lib/exchange_api_common.h
+ * @brief common functions for the exchange API
* @author Christian Grothoff
*/
#include
#include
-#include "taler_mint_service.h"
+#include "taler_exchange_service.h"
/**
- * Verify a coins transaction history as returned by the mint.
+ * Verify a coins transaction history as returned by the exchange.
*
* @param currency expected currency for the coin
* @param coin_pub public key of the coin
@@ -33,9 +33,9 @@
* @return #GNUNET_OK if @a history is valid, #GNUNET_SYSERR if not
*/
int
-TALER_MINT_verify_coin_history_ (const char *currency,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- json_t *history,
- struct TALER_Amount *total);
+TALER_EXCHANGE_verify_coin_history_ (const char *currency,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ json_t *history,
+ struct TALER_Amount *total);
-/* end of mint_api_common.h */
+/* end of exchange_api_common.h */
diff --git a/src/mint-lib/mint_api_context.c b/src/exchange-lib/exchange_api_context.c
similarity index 89%
rename from src/mint-lib/mint_api_context.c
rename to src/exchange-lib/exchange_api_context.c
index 2767906b5..8d6746a17 100644
--- a/src/mint-lib/mint_api_context.c
+++ b/src/exchange-lib/exchange_api_context.c
@@ -15,15 +15,15 @@
*/
/**
- * @file mint-lib/mint_api_context.c
- * @brief Implementation of the context part of the mint's HTTP API
+ * @file exchange-lib/exchange_api_context.c
+ * @brief Implementation of the context part of the exchange's HTTP API
* @author Sree Harsha Totakura
* @author Christian Grothoff
*/
#include "platform.h"
#include
-#include "taler_mint_service.h"
-#include "mint_api_context.h"
+#include "taler_exchange_service.h"
+#include "exchange_api_context.h"
/**
@@ -51,11 +51,11 @@
* Failsafe flag. Raised if our constructor fails to initialize
* the Curl library.
*/
-static int TALER_MINT_curl_fail;
+static int TALER_EXCHANGE_curl_fail;
/**
- * Jobs are CURL requests running within a `struct TALER_MINT_Context`.
+ * Jobs are CURL requests running within a `struct TALER_EXCHANGE_Context`.
*/
struct MAC_Job
{
@@ -78,7 +78,7 @@ struct MAC_Job
/**
* Context this job runs in.
*/
- struct TALER_MINT_Context *ctx;
+ struct TALER_EXCHANGE_Context *ctx;
/**
* Function to call upon completion.
@@ -96,7 +96,7 @@ struct MAC_Job
/**
* Context
*/
-struct TALER_MINT_Context
+struct TALER_EXCHANGE_Context
{
/**
* Curl multi handle
@@ -133,14 +133,14 @@ struct TALER_MINT_Context
*
* @return library context
*/
-struct TALER_MINT_Context *
-TALER_MINT_init ()
+struct TALER_EXCHANGE_Context *
+TALER_EXCHANGE_init ()
{
- struct TALER_MINT_Context *ctx;
+ struct TALER_EXCHANGE_Context *ctx;
CURLM *multi;
CURLSH *share;
- if (TALER_MINT_curl_fail)
+ if (TALER_EXCHANGE_curl_fail)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Curl was not initialised properly\n");
@@ -158,7 +158,7 @@ TALER_MINT_init ()
"Failed to create a Curl share handle\n");
return NULL;
}
- ctx = GNUNET_new (struct TALER_MINT_Context);
+ ctx = GNUNET_new (struct TALER_EXCHANGE_Context);
ctx->multi = multi;
ctx->share = share;
GNUNET_assert (NULL != (ctx->json_header =
@@ -186,7 +186,7 @@ TALER_MINT_init ()
* @param jcc_cls closure for @a jcc
*/
struct MAC_Job *
-MAC_job_add (struct TALER_MINT_Context *ctx,
+MAC_job_add (struct TALER_EXCHANGE_Context *ctx,
CURL *eh,
int add_json,
MAC_JobCompletionCallback jcc,
@@ -252,7 +252,7 @@ MAC_easy_to_closure (CURL *eh)
void
MAC_job_cancel (struct MAC_Job *job)
{
- struct TALER_MINT_Context *ctx = job->ctx;
+ struct TALER_EXCHANGE_Context *ctx = job->ctx;
GNUNET_CONTAINER_DLL_remove (ctx->jobs_head,
ctx->jobs_tail,
@@ -271,7 +271,7 @@ MAC_job_cancel (struct MAC_Job *job)
* @param ctx the library context
*/
void
-TALER_MINT_perform (struct TALER_MINT_Context *ctx)
+TALER_EXCHANGE_perform (struct TALER_EXCHANGE_Context *ctx)
{
CURLMsg *cmsg;
struct MAC_Job *job;
@@ -299,12 +299,12 @@ TALER_MINT_perform (struct TALER_MINT_Context *ctx)
/**
* Obtain the information for a select() call to wait until
- * #TALER_MINT_perform() is ready again. Note that calling
- * any other TALER_MINT-API may also imply that the library
- * is again ready for #TALER_MINT_perform().
+ * #TALER_EXCHANGE_perform() is ready again. Note that calling
+ * any other TALER_EXCHANGE-API may also imply that the library
+ * is again ready for #TALER_EXCHANGE_perform().
*
* Basically, a client should use this API to prepare for select(),
- * then block on select(), then call #TALER_MINT_perform() and then
+ * then block on select(), then call #TALER_EXCHANGE_perform() and then
* start again until the work with the context is done.
*
* This function will NOT zero out the sets and assumes that @a max_fd
@@ -323,15 +323,15 @@ TALER_MINT_perform (struct TALER_MINT_Context *ctx)
* to be passed to select().)
* @param timeout set to the timeout in milliseconds (!); -1 means
* no timeout (NULL, blocking forever is OK), 0 means to
- * proceed immediately with #TALER_MINT_perform().
+ * proceed immediately with #TALER_EXCHANGE_perform().
*/
void
-TALER_MINT_get_select_info (struct TALER_MINT_Context *ctx,
- fd_set *read_fd_set,
- fd_set *write_fd_set,
- fd_set *except_fd_set,
- int *max_fd,
- long *timeout)
+TALER_EXCHANGE_get_select_info (struct TALER_EXCHANGE_Context *ctx,
+ fd_set *read_fd_set,
+ fd_set *write_fd_set,
+ fd_set *except_fd_set,
+ int *max_fd,
+ long *timeout)
{
long to;
int m;
@@ -368,7 +368,7 @@ TALER_MINT_get_select_info (struct TALER_MINT_Context *ctx,
* @param ctx the library context
*/
void
-TALER_MINT_fini (struct TALER_MINT_Context *ctx)
+TALER_EXCHANGE_fini (struct TALER_EXCHANGE_Context *ctx)
{
/* all jobs must have been cancelled at this time, assert this */
GNUNET_assert (NULL == ctx->jobs_head);
@@ -508,7 +508,7 @@ MAC_download_get_result (struct MAC_DownloadBuffer *db,
*/
__attribute__ ((constructor))
void
-TALER_MINT_constructor__ (void)
+TALER_EXCHANGE_constructor__ (void)
{
CURLcode ret;
@@ -517,7 +517,7 @@ TALER_MINT_constructor__ (void)
CURL_STRERROR (GNUNET_ERROR_TYPE_ERROR,
"curl_global_init",
ret);
- TALER_MINT_curl_fail = 1;
+ TALER_EXCHANGE_curl_fail = 1;
}
}
@@ -527,11 +527,11 @@ TALER_MINT_constructor__ (void)
*/
__attribute__ ((destructor))
void
-TALER_MINT_destructor__ (void)
+TALER_EXCHANGE_destructor__ (void)
{
- if (TALER_MINT_curl_fail)
+ if (TALER_EXCHANGE_curl_fail)
return;
curl_global_cleanup ();
}
-/* end of mint_api_context.c */
+/* end of exchange_api_context.c */
diff --git a/src/mint-lib/mint_api_context.h b/src/exchange-lib/exchange_api_context.h
similarity index 95%
rename from src/mint-lib/mint_api_context.h
rename to src/exchange-lib/exchange_api_context.h
index 181a4808f..3c54bfe07 100644
--- a/src/mint-lib/mint_api_context.h
+++ b/src/exchange-lib/exchange_api_context.h
@@ -15,15 +15,15 @@
*/
/**
- * @file mint-lib/mint_api_context.h
- * @brief Internal interface to the context part of the mint's HTTP API
+ * @file exchange-lib/exchange_api_context.h
+ * @brief Internal interface to the context part of the exchange's HTTP API
* @author Sree Harsha Totakura
* @author Christian Grothoff
*/
#include "platform.h"
#include
#include
-#include "taler_mint_service.h"
+#include "taler_exchange_service.h"
#include "taler_signatures.h"
@@ -61,7 +61,7 @@ typedef void
* @param jcc_cls closure for @a jcc
*/
struct MAC_Job *
-MAC_job_add (struct TALER_MINT_Context *ctx,
+MAC_job_add (struct TALER_EXCHANGE_Context *ctx,
CURL *eh,
int add_json,
MAC_JobCompletionCallback jcc,
@@ -166,4 +166,4 @@ MAC_download_get_result (struct MAC_DownloadBuffer *db,
long *response_code);
-/* end of mint_api_context.h */
+/* end of exchange_api_context.h */
diff --git a/src/mint-lib/mint_api_deposit.c b/src/exchange-lib/exchange_api_deposit.c
similarity index 75%
rename from src/mint-lib/mint_api_deposit.c
rename to src/exchange-lib/exchange_api_deposit.c
index 400372925..8ec45a23f 100644
--- a/src/mint-lib/mint_api_deposit.c
+++ b/src/exchange-lib/exchange_api_deposit.c
@@ -15,8 +15,8 @@
*/
/**
- * @file mint-lib/mint_api_deposit.c
- * @brief Implementation of the /deposit request of the mint's HTTP API
+ * @file exchange-lib/exchange_api_deposit.c
+ * @brief Implementation of the /deposit request of the exchange's HTTP API
* @author Sree Harsha Totakura
* @author Christian Grothoff
*/
@@ -25,24 +25,25 @@
#include
#include /* just for HTTP status codes */
#include
-#include "taler_mint_service.h"
-#include "mint_api_common.h"
-#include "mint_api_json.h"
-#include "mint_api_context.h"
-#include "mint_api_handle.h"
+#include
+#include "taler_json_lib.h"
+#include "taler_exchange_service.h"
+#include "exchange_api_common.h"
+#include "exchange_api_context.h"
+#include "exchange_api_handle.h"
#include "taler_signatures.h"
/**
* @brief A Deposit Handle
*/
-struct TALER_MINT_DepositHandle
+struct TALER_EXCHANGE_DepositHandle
{
/**
- * The connection to mint this request handle will use
+ * The connection to exchange this request handle will use
*/
- struct TALER_MINT_Handle *mint;
+ struct TALER_EXCHANGE_Handle *exchange;
/**
* The url for this request.
@@ -62,7 +63,7 @@ struct TALER_MINT_DepositHandle
/**
* Function to call with the result.
*/
- TALER_MINT_DepositResultCallback cb;
+ TALER_EXCHANGE_DepositResultCallback cb;
/**
* Closure for @a cb.
@@ -75,7 +76,7 @@ struct TALER_MINT_DepositHandle
struct MAC_DownloadBuffer db;
/**
- * Information the mint should sign in response.
+ * Information the exchange should sign in response.
*/
struct TALER_DepositConfirmationPS depconf;
@@ -94,45 +95,46 @@ struct TALER_MINT_DepositHandle
/**
* Verify that the signature on the "200 OK" response
- * from the mint is valid.
+ * from the exchange is valid.
*
* @param dh deposit handle
* @param json json reply with the signature
* @return #GNUNET_OK if the signature is valid, #GNUNET_SYSERR if not
*/
static int
-verify_deposit_signature_ok (const struct TALER_MINT_DepositHandle *dh,
+verify_deposit_signature_ok (const struct TALER_EXCHANGE_DepositHandle *dh,
json_t *json)
{
- struct TALER_MintSignatureP mint_sig;
- struct TALER_MintPublicKeyP mint_pub;
- const struct TALER_MINT_Keys *key_state;
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("sig", &mint_sig),
- MAJ_spec_fixed_auto ("pub", &mint_pub),
- MAJ_spec_end
+ struct TALER_ExchangeSignatureP exchange_sig;
+ struct TALER_ExchangePublicKeyP exchange_pub;
+ const struct TALER_EXCHANGE_Keys *key_state;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("sig", &exchange_sig),
+ GNUNET_JSON_spec_fixed_auto ("pub", &exchange_pub),
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- key_state = TALER_MINT_get_keys (dh->mint);
+ key_state = TALER_EXCHANGE_get_keys (dh->exchange);
if (GNUNET_OK !=
- TALER_MINT_test_signing_key (key_state,
- &mint_pub))
+ TALER_EXCHANGE_test_signing_key (key_state,
+ &exchange_pub))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MINT_CONFIRM_DEPOSIT,
+ GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT,
&dh->depconf.purpose,
- &mint_sig.eddsa_signature,
- &mint_pub.eddsa_pub))
+ &exchange_sig.eddsa_signature,
+ &exchange_pub.eddsa_pub))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -143,14 +145,14 @@ verify_deposit_signature_ok (const struct TALER_MINT_DepositHandle *dh,
/**
* Verify that the signatures on the "403 FORBIDDEN" response from the
- * mint demonstrating customer double-spending are valid.
+ * exchange demonstrating customer double-spending are valid.
*
* @param dh deposit handle
* @param json json reply with the signature(s) and transaction history
* @return #GNUNET_OK if the signature(s) is valid, #GNUNET_SYSERR if not
*/
static int
-verify_deposit_signature_forbidden (const struct TALER_MINT_DepositHandle *dh,
+verify_deposit_signature_forbidden (const struct TALER_EXCHANGE_DepositHandle *dh,
json_t *json)
{
json_t *history;
@@ -159,7 +161,7 @@ verify_deposit_signature_forbidden (const struct TALER_MINT_DepositHandle *dh,
history = json_object_get (json,
"history");
if (GNUNET_OK !=
- TALER_MINT_verify_coin_history_ (dh->coin_value.currency,
+ TALER_EXCHANGE_verify_coin_history_ (dh->coin_value.currency,
&dh->depconf.coin_pub,
history,
&total))
@@ -193,14 +195,14 @@ verify_deposit_signature_forbidden (const struct TALER_MINT_DepositHandle *dh,
* Function called when we're done processing the
* HTTP /deposit request.
*
- * @param cls the `struct TALER_MINT_DepositHandle`
+ * @param cls the `struct TALER_EXCHANGE_DepositHandle`
* @param eh the curl request handle
*/
static void
handle_deposit_finished (void *cls,
CURL *eh)
{
- struct TALER_MINT_DepositHandle *dh = cls;
+ struct TALER_EXCHANGE_DepositHandle *dh = cls;
long response_code;
json_t *json;
@@ -222,7 +224,7 @@ handle_deposit_finished (void *cls,
}
break;
case MHD_HTTP_BAD_REQUEST:
- /* This should never happen, either us or the mint is buggy
+ /* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
case MHD_HTTP_FORBIDDEN:
@@ -236,7 +238,7 @@ handle_deposit_finished (void *cls,
}
break;
case MHD_HTTP_UNAUTHORIZED:
- /* Nothing really to verify, mint says one of the signatures is
+ /* Nothing really to verify, exchange says one of the signatures is
invalid; as we checked them, this should never happen, we
should pass the JSON reply to the application */
break;
@@ -261,7 +263,7 @@ handle_deposit_finished (void *cls,
response_code,
json);
json_decref (json);
- TALER_MINT_deposit_cancel (dh);
+ TALER_EXCHANGE_deposit_cancel (dh);
}
@@ -271,19 +273,19 @@ handle_deposit_finished (void *cls,
* @param dki public key information
* @param amount the amount to be deposited
* @param h_wire hash of the merchant’s account details
- * @param h_contract hash of the contact of the merchant with the customer (further details are never disclosed to the mint)
+ * @param h_contract hash of the contact of the merchant with the customer (further details are never disclosed to the exchange)
* @param coin_pub coin’s public key
* @param denom_pub denomination key with which the coin is signed
- * @param denom_sig mint’s unblinded signature of the coin
- * @param timestamp timestamp when the contract was finalized, must match approximately the current time of the mint
+ * @param denom_sig exchange’s unblinded signature of the coin
+ * @param timestamp timestamp when the contract was finalized, must match approximately the current time of the exchange
* @param transaction_id transaction id for the transaction between merchant and customer
* @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests)
- * @param refund_deadline date until which the merchant can issue a refund to the customer via the mint (can be zero if refunds are not allowed)
+ * @param refund_deadline date until which the merchant can issue a refund to the customer via the exchange (can be zero if refunds are not allowed)
* @param coin_sig the signature made with purpose #TALER_SIGNATURE_WALLET_COIN_DEPOSIT made by the customer with the coin’s private key.
* @return #GNUNET_OK if signatures are OK, #GNUNET_SYSERR if not
*/
static int
-verify_signatures (const struct TALER_MINT_DenomPublicKey *dki,
+verify_signatures (const struct TALER_EXCHANGE_DenomPublicKey *dki,
const struct TALER_Amount *amount,
const struct GNUNET_HashCode *h_wire,
const struct GNUNET_HashCode *h_contract,
@@ -353,40 +355,40 @@ verify_signatures (const struct TALER_MINT_DenomPublicKey *dki,
/**
- * Submit a deposit permission to the mint and get the mint's response.
+ * Submit a deposit permission to the exchange and get the exchange's response.
* Note that while we return the response verbatim to the caller for
* further processing, we do already verify that the response is
* well-formed (i.e. that signatures included in the response are all
- * valid). If the mint's reply is not well-formed, we return an
+ * valid). If the exchange's reply is not well-formed, we return an
* HTTP status code of zero to @a cb.
*
* We also verify that the @a coin_sig is valid for this deposit
* request, and that the @a ub_sig is a valid signature for @a
- * coin_pub. Also, the @a mint must be ready to operate (i.e. have
+ * coin_pub. Also, the @a exchange must be ready to operate (i.e. have
* finished processing the /keys reply). If either check fails, we do
- * NOT initiate the transaction with the mint and instead return NULL.
+ * NOT initiate the transaction with the exchange and instead return NULL.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param amount the amount to be deposited
- * @param wire_deadline date until which the merchant would like the mint to settle the balance (advisory, the mint cannot be
- * forced to settle in the past or upon very short notice, but of course a well-behaved mint will limit aggregation based on the advice received)
- * @param wire_details the merchant’s account details, in a format supported by the mint
- * @param h_contract hash of the contact of the merchant with the customer (further details are never disclosed to the mint)
+ * @param wire_deadline date until which the merchant would like the exchange to settle the balance (advisory, the exchange cannot be
+ * forced to settle in the past or upon very short notice, but of course a well-behaved exchange will limit aggregation based on the advice received)
+ * @param wire_details the merchant’s account details, in a format supported by the exchange
+ * @param h_contract hash of the contact of the merchant with the customer (further details are never disclosed to the exchange)
* @param coin_pub coin’s public key
* @param denom_pub denomination key with which the coin is signed
- * @param denom_sig mint’s unblinded signature of the coin
- * @param timestamp timestamp when the contract was finalized, must match approximately the current time of the mint
+ * @param denom_sig exchange’s unblinded signature of the coin
+ * @param timestamp timestamp when the contract was finalized, must match approximately the current time of the exchange
* @param transaction_id transaction id for the transaction between merchant and customer
* @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests)
- * @param refund_deadline date until which the merchant can issue a refund to the customer via the mint (can be zero if refunds are not allowed)
+ * @param refund_deadline date until which the merchant can issue a refund to the customer via the exchange (can be zero if refunds are not allowed)
* @param coin_sig the signature made with purpose #TALER_SIGNATURE_WALLET_COIN_DEPOSIT made by the customer with the coin’s private key.
* @param cb the callback to call when a reply for this request is available
* @param cb_cls closure for the above callback
* @return a handle for this request; NULL if the inputs are invalid (i.e.
* signatures fail to verify). In this case, the callback is not called.
*/
-struct TALER_MINT_DepositHandle *
-TALER_MINT_deposit (struct TALER_MINT_Handle *mint,
+struct TALER_EXCHANGE_DepositHandle *
+TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
const struct TALER_Amount *amount,
struct GNUNET_TIME_Absolute wire_deadline,
json_t *wire_details,
@@ -399,39 +401,39 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint,
const struct TALER_MerchantPublicKeyP *merchant_pub,
struct GNUNET_TIME_Absolute refund_deadline,
const struct TALER_CoinSpendSignatureP *coin_sig,
- TALER_MINT_DepositResultCallback cb,
+ TALER_EXCHANGE_DepositResultCallback cb,
void *cb_cls)
{
- const struct TALER_MINT_Keys *key_state;
- const struct TALER_MINT_DenomPublicKey *dki;
- struct TALER_MINT_DepositHandle *dh;
- struct TALER_MINT_Context *ctx;
+ const struct TALER_EXCHANGE_Keys *key_state;
+ const struct TALER_EXCHANGE_DenomPublicKey *dki;
+ struct TALER_EXCHANGE_DepositHandle *dh;
+ struct TALER_EXCHANGE_Context *ctx;
json_t *deposit_obj;
CURL *eh;
struct GNUNET_HashCode h_wire;
struct TALER_Amount amount_without_fee;
- (void) TALER_round_abs_time (&wire_deadline);
+ (void) GNUNET_TIME_round_abs (&wire_deadline);
if (GNUNET_YES !=
- MAH_handle_is_ready (mint))
+ MAH_handle_is_ready (exchange))
{
GNUNET_break (0);
return NULL;
}
/* initialize h_wire */
if (GNUNET_OK !=
- TALER_hash_json (wire_details,
+ TALER_JSON_hash (wire_details,
&h_wire))
{
GNUNET_break (0);
return NULL;
}
- key_state = TALER_MINT_get_keys (mint);
- dki = TALER_MINT_get_denomination_key (key_state,
+ key_state = TALER_EXCHANGE_get_keys (exchange);
+ dki = TALER_EXCHANGE_get_denomination_key (key_state,
denom_pub);
if (NULL == dki)
{
- TALER_LOG_WARNING ("Denomination key unknown to mint\n");
+ TALER_LOG_WARNING ("Denomination key unknown to exchange\n");
return NULL;
}
if (GNUNET_SYSERR ==
@@ -468,33 +470,33 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint,
" s:I, s:o," /* transaction id, merchant_pub */
" s:o, s:o," /* refund_deadline, wire_deadline */
" s:o}", /* coin_sig */
- "f", TALER_json_from_amount (amount),
+ "f", TALER_JSON_from_amount (amount),
"wire", wire_details,
- "H_wire", TALER_json_from_data (&h_wire,
+ "H_wire", GNUNET_JSON_from_data (&h_wire,
sizeof (h_wire)),
- "H_contract", TALER_json_from_data (h_contract,
+ "H_contract", GNUNET_JSON_from_data (h_contract,
sizeof (struct GNUNET_HashCode)),
- "coin_pub", TALER_json_from_data (coin_pub,
+ "coin_pub", GNUNET_JSON_from_data (coin_pub,
sizeof (*coin_pub)),
- "denom_pub", TALER_json_from_rsa_public_key (denom_pub->rsa_public_key),
- "ub_sig", TALER_json_from_rsa_signature (denom_sig->rsa_signature),
- "timestamp", TALER_json_from_abs (timestamp),
+ "denom_pub", GNUNET_JSON_from_rsa_public_key (denom_pub->rsa_public_key),
+ "ub_sig", GNUNET_JSON_from_rsa_signature (denom_sig->rsa_signature),
+ "timestamp", GNUNET_JSON_from_time_abs (timestamp),
"transaction_id", (json_int_t) transaction_id,
- "merchant_pub", TALER_json_from_data (merchant_pub,
+ "merchant_pub", GNUNET_JSON_from_data (merchant_pub,
sizeof (*merchant_pub)),
- "refund_deadline", TALER_json_from_abs (refund_deadline),
- "edate", TALER_json_from_abs (wire_deadline),
- "coin_sig", TALER_json_from_data (coin_sig,
+ "refund_deadline", GNUNET_JSON_from_time_abs (refund_deadline),
+ "edate", GNUNET_JSON_from_time_abs (wire_deadline),
+ "coin_sig", GNUNET_JSON_from_data (coin_sig,
sizeof (*coin_sig))
);
- dh = GNUNET_new (struct TALER_MINT_DepositHandle);
- dh->mint = mint;
+ dh = GNUNET_new (struct TALER_EXCHANGE_DepositHandle);
+ dh->exchange = exchange;
dh->cb = cb;
dh->cb_cls = cb_cls;
- dh->url = MAH_path_to_url (mint, "/deposit");
+ dh->url = MAH_path_to_url (exchange, "/deposit");
dh->depconf.purpose.size = htonl (sizeof (struct TALER_DepositConfirmationPS));
- dh->depconf.purpose.purpose = htonl (TALER_SIGNATURE_MINT_CONFIRM_DEPOSIT);
+ dh->depconf.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT);
dh->depconf.h_contract = *h_contract;
dh->depconf.h_wire = h_wire;
dh->depconf.transaction_id = GNUNET_htonll (transaction_id);
@@ -535,7 +537,7 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint,
curl_easy_setopt (eh,
CURLOPT_WRITEDATA,
&dh->db));
- ctx = MAH_handle_to_context (mint);
+ ctx = MAH_handle_to_context (exchange);
dh->job = MAC_job_add (ctx,
eh,
GNUNET_YES,
@@ -552,7 +554,7 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint,
* @param deposit the deposit permission request handle
*/
void
-TALER_MINT_deposit_cancel (struct TALER_MINT_DepositHandle *deposit)
+TALER_EXCHANGE_deposit_cancel (struct TALER_EXCHANGE_DepositHandle *deposit)
{
if (NULL != deposit->job)
{
@@ -566,4 +568,4 @@ TALER_MINT_deposit_cancel (struct TALER_MINT_DepositHandle *deposit)
}
-/* end of mint_api_deposit.c */
+/* end of exchange_api_deposit.c */
diff --git a/src/mint-lib/mint_api_deposit_wtid.c b/src/exchange-lib/exchange_api_deposit_wtid.c
similarity index 70%
rename from src/mint-lib/mint_api_deposit_wtid.c
rename to src/exchange-lib/exchange_api_deposit_wtid.c
index d29f406e3..1ad1dd019 100644
--- a/src/mint-lib/mint_api_deposit_wtid.c
+++ b/src/exchange-lib/exchange_api_deposit_wtid.c
@@ -15,8 +15,8 @@
*/
/**
- * @file mint-lib/mint_api_deposit_wtid.c
- * @brief Implementation of the /deposit/wtid request of the mint's HTTP API
+ * @file exchange-lib/exchange_api_deposit_wtid.c
+ * @brief Implementation of the /deposit/wtid request of the exchange's HTTP API
* @author Christian Grothoff
*/
#include "platform.h"
@@ -24,24 +24,25 @@
#include
#include /* just for HTTP status codes */
#include
-#include "taler_mint_service.h"
-#include "mint_api_common.h"
-#include "mint_api_json.h"
-#include "mint_api_context.h"
-#include "mint_api_handle.h"
+#include
+#include "taler_json_lib.h"
+#include "taler_exchange_service.h"
+#include "exchange_api_common.h"
+#include "exchange_api_context.h"
+#include "exchange_api_handle.h"
#include "taler_signatures.h"
/**
* @brief A Deposit Wtid Handle
*/
-struct TALER_MINT_DepositWtidHandle
+struct TALER_EXCHANGE_DepositWtidHandle
{
/**
- * The connection to mint this request handle will use
+ * The connection to exchange this request handle will use
*/
- struct TALER_MINT_Handle *mint;
+ struct TALER_EXCHANGE_Handle *exchange;
/**
* The url for this request.
@@ -61,7 +62,7 @@ struct TALER_MINT_DepositWtidHandle
/**
* Function to call with the result.
*/
- TALER_MINT_DepositWtidCallback cb;
+ TALER_EXCHANGE_DepositWtidCallback cb;
/**
* Closure for @a cb.
@@ -74,7 +75,7 @@ struct TALER_MINT_DepositWtidHandle
struct MAC_DownloadBuffer db;
/**
- * Information the mint should sign in response.
+ * Information the exchange should sign in response.
* (with pre-filled fields from the request).
*/
struct TALER_ConfirmWirePS depconf;
@@ -84,45 +85,46 @@ struct TALER_MINT_DepositWtidHandle
/**
* Verify that the signature on the "200 OK" response
- * from the mint is valid.
+ * from the exchange is valid.
*
* @param dwh deposit wtid handle
* @param json json reply with the signature
* @return #GNUNET_OK if the signature is valid, #GNUNET_SYSERR if not
*/
static int
-verify_deposit_wtid_signature_ok (const struct TALER_MINT_DepositWtidHandle *dwh,
+verify_deposit_wtid_signature_ok (const struct TALER_EXCHANGE_DepositWtidHandle *dwh,
json_t *json)
{
- struct TALER_MintSignatureP mint_sig;
- struct TALER_MintPublicKeyP mint_pub;
- const struct TALER_MINT_Keys *key_state;
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("mint_sig", &mint_sig),
- MAJ_spec_fixed_auto ("mint_pub", &mint_pub),
- MAJ_spec_end
+ struct TALER_ExchangeSignatureP exchange_sig;
+ struct TALER_ExchangePublicKeyP exchange_pub;
+ const struct TALER_EXCHANGE_Keys *key_state;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("exchange_sig", &exchange_sig),
+ GNUNET_JSON_spec_fixed_auto ("exchange_pub", &exchange_pub),
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- key_state = TALER_MINT_get_keys (dwh->mint);
+ key_state = TALER_EXCHANGE_get_keys (dwh->exchange);
if (GNUNET_OK !=
- TALER_MINT_test_signing_key (key_state,
- &mint_pub))
+ TALER_EXCHANGE_test_signing_key (key_state,
+ &exchange_pub))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MINT_CONFIRM_WIRE,
+ GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE,
&dwh->depconf.purpose,
- &mint_sig.eddsa_signature,
- &mint_pub.eddsa_pub))
+ &exchange_sig.eddsa_signature,
+ &exchange_pub.eddsa_pub))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -135,14 +137,14 @@ verify_deposit_wtid_signature_ok (const struct TALER_MINT_DepositWtidHandle *dwh
* Function called when we're done processing the
* HTTP /deposit/wtid request.
*
- * @param cls the `struct TALER_MINT_DepositWtidHandle`
+ * @param cls the `struct TALER_EXCHANGE_DepositWtidHandle`
* @param eh the curl request handle
*/
static void
handle_deposit_wtid_finished (void *cls,
CURL *eh)
{
- struct TALER_MINT_DepositWtidHandle *dwh = cls;
+ struct TALER_EXCHANGE_DepositWtidHandle *dwh = cls;
long response_code;
json_t *json;
const struct TALER_WireTransferIdentifierRawP *wtid = NULL;
@@ -160,16 +162,17 @@ handle_deposit_wtid_finished (void *cls,
break;
case MHD_HTTP_OK:
{
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("wtid", &dwh->depconf.wtid),
- MAJ_spec_absolute_time ("execution_time", &execution_time),
- MAJ_spec_amount ("coin_contribution", &coin_contribution_s),
- MAJ_spec_end
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("wtid", &dwh->depconf.wtid),
+ GNUNET_JSON_spec_absolute_time ("execution_time", &execution_time),
+ TALER_JSON_spec_amount ("coin_contribution", &coin_contribution_s),
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
response_code = 0;
@@ -192,14 +195,15 @@ handle_deposit_wtid_finished (void *cls,
case MHD_HTTP_ACCEPTED:
{
/* Transaction known, but not executed yet */
- struct MAJ_Specification spec[] = {
- MAJ_spec_absolute_time ("execution_time", &execution_time),
- MAJ_spec_end
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_absolute_time ("execution_time", &execution_time),
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
response_code = 0;
@@ -208,16 +212,16 @@ handle_deposit_wtid_finished (void *cls,
}
break;
case MHD_HTTP_BAD_REQUEST:
- /* This should never happen, either us or the mint is buggy
+ /* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
case MHD_HTTP_UNAUTHORIZED:
- /* Nothing really to verify, mint says one of the signatures is
+ /* Nothing really to verify, exchange says one of the signatures is
invalid; as we checked them, this should never happen, we
should pass the JSON reply to the application */
break;
case MHD_HTTP_NOT_FOUND:
- /* Mint does not know about transaction;
+ /* Exchange does not know about transaction;
we should pass the reply to the application */
break;
case MHD_HTTP_INTERNAL_SERVER_ERROR:
@@ -240,14 +244,14 @@ handle_deposit_wtid_finished (void *cls,
execution_time,
coin_contribution);
json_decref (json);
- TALER_MINT_deposit_wtid_cancel (dwh);
+ TALER_EXCHANGE_deposit_wtid_cancel (dwh);
}
/**
* Obtain wire transfer details about an existing deposit operation.
*
- * @param mint the mint to query
+ * @param exchange the exchange to query
* @param merchant_priv the merchant's private key
* @param h_wire hash of merchant's wire transfer details
* @param h_contract hash of the contract
@@ -257,25 +261,25 @@ handle_deposit_wtid_finished (void *cls,
* @param cb_cls closure for @a cb
* @return handle to abort request
*/
-struct TALER_MINT_DepositWtidHandle *
-TALER_MINT_deposit_wtid (struct TALER_MINT_Handle *mint,
+struct TALER_EXCHANGE_DepositWtidHandle *
+TALER_EXCHANGE_deposit_wtid (struct TALER_EXCHANGE_Handle *exchange,
const struct TALER_MerchantPrivateKeyP *merchant_priv,
const struct GNUNET_HashCode *h_wire,
const struct GNUNET_HashCode *h_contract,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
uint64_t transaction_id,
- TALER_MINT_DepositWtidCallback cb,
+ TALER_EXCHANGE_DepositWtidCallback cb,
void *cb_cls)
{
struct TALER_DepositTrackPS dtp;
struct TALER_MerchantSignatureP merchant_sig;
- struct TALER_MINT_DepositWtidHandle *dwh;
- struct TALER_MINT_Context *ctx;
+ struct TALER_EXCHANGE_DepositWtidHandle *dwh;
+ struct TALER_EXCHANGE_Context *ctx;
json_t *deposit_wtid_obj;
CURL *eh;
if (GNUNET_YES !=
- MAH_handle_is_ready (mint))
+ MAH_handle_is_ready (exchange))
{
GNUNET_break (0);
return NULL;
@@ -296,25 +300,25 @@ TALER_MINT_deposit_wtid (struct TALER_MINT_Handle *mint,
deposit_wtid_obj = json_pack ("{s:o, s:o," /* H_wire, H_contract */
" s:o, s:I," /* coin_pub, transaction_id */
" s:o, s:o}", /* merchant_pub, merchant_sig */
- "H_wire", TALER_json_from_data (h_wire,
+ "H_wire", GNUNET_JSON_from_data (h_wire,
sizeof (struct GNUNET_HashCode)),
- "H_contract", TALER_json_from_data (h_contract,
+ "H_contract", GNUNET_JSON_from_data (h_contract,
sizeof (struct GNUNET_HashCode)),
- "coin_pub", TALER_json_from_data (coin_pub,
+ "coin_pub", GNUNET_JSON_from_data (coin_pub,
sizeof (*coin_pub)),
"transaction_id", (json_int_t) transaction_id,
- "merchant_pub", TALER_json_from_data (&dtp.merchant,
+ "merchant_pub", GNUNET_JSON_from_data (&dtp.merchant,
sizeof (struct TALER_MerchantPublicKeyP)),
- "merchant_sig", TALER_json_from_data (&merchant_sig,
+ "merchant_sig", GNUNET_JSON_from_data (&merchant_sig,
sizeof (merchant_sig)));
- dwh = GNUNET_new (struct TALER_MINT_DepositWtidHandle);
- dwh->mint = mint;
+ dwh = GNUNET_new (struct TALER_EXCHANGE_DepositWtidHandle);
+ dwh->exchange = exchange;
dwh->cb = cb;
dwh->cb_cls = cb_cls;
- dwh->url = MAH_path_to_url (mint, "/deposit/wtid");
+ dwh->url = MAH_path_to_url (exchange, "/deposit/wtid");
dwh->depconf.purpose.size = htonl (sizeof (struct TALER_DepositConfirmationPS));
- dwh->depconf.purpose.purpose = htonl (TALER_SIGNATURE_MINT_CONFIRM_WIRE);
+ dwh->depconf.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE);
dwh->depconf.h_wire = *h_wire;
dwh->depconf.h_contract = *h_contract;
dwh->depconf.coin_pub = *coin_pub;
@@ -345,7 +349,7 @@ TALER_MINT_deposit_wtid (struct TALER_MINT_Handle *mint,
curl_easy_setopt (eh,
CURLOPT_WRITEDATA,
&dwh->db));
- ctx = MAH_handle_to_context (mint);
+ ctx = MAH_handle_to_context (exchange);
dwh->job = MAC_job_add (ctx,
eh,
GNUNET_YES,
@@ -362,7 +366,7 @@ TALER_MINT_deposit_wtid (struct TALER_MINT_Handle *mint,
* @param dwh the wire deposits request handle
*/
void
-TALER_MINT_deposit_wtid_cancel (struct TALER_MINT_DepositWtidHandle *dwh)
+TALER_EXCHANGE_deposit_wtid_cancel (struct TALER_EXCHANGE_DepositWtidHandle *dwh)
{
if (NULL != dwh->job)
{
@@ -376,4 +380,4 @@ TALER_MINT_deposit_wtid_cancel (struct TALER_MINT_DepositWtidHandle *dwh)
}
-/* end of mint_api_deposit_wtid.c */
+/* end of exchange_api_deposit_wtid.c */
diff --git a/src/mint-lib/mint_api_handle.c b/src/exchange-lib/exchange_api_handle.c
similarity index 68%
rename from src/mint-lib/mint_api_handle.c
rename to src/exchange-lib/exchange_api_handle.c
index ef26cd838..65597126c 100644
--- a/src/mint-lib/mint_api_handle.c
+++ b/src/exchange-lib/exchange_api_handle.c
@@ -15,21 +15,19 @@
*/
/**
- * @file mint-lib/mint_api_handle.c
- * @brief Implementation of the "handle" component of the mint's HTTP API
+ * @file exchange-lib/exchange_api_handle.c
+ * @brief Implementation of the "handle" component of the exchange's HTTP API
* @author Sree Harsha Totakura
* @author Christian Grothoff
*/
#include "platform.h"
#include
-#include
-#include
#include
-#include "taler_mint_service.h"
+#include "taler_json_lib.h"
+#include "taler_exchange_service.h"
#include "taler_signatures.h"
-#include "mint_api_context.h"
-#include "mint_api_json.h"
-#include "mint_api_handle.h"
+#include "exchange_api_context.h"
+#include "exchange_api_handle.h"
/**
@@ -45,9 +43,9 @@
/**
- * Stages of initialization for the `struct TALER_MINT_Handle`
+ * Stages of initialization for the `struct TALER_EXCHANGE_Handle`
*/
-enum MintHandleState
+enum ExchangeHandleState
{
/**
* Just allocated.
@@ -55,7 +53,7 @@ enum MintHandleState
MHS_INIT = 0,
/**
- * Obtained the mint's certification data and keys.
+ * Obtained the exchange's certification data and keys.
*/
MHS_CERT = 1,
@@ -67,31 +65,31 @@ enum MintHandleState
/**
- * Data for the request to get the /keys of a mint.
+ * Data for the request to get the /keys of a exchange.
*/
struct KeysRequest;
/**
- * Handle to the mint
+ * Handle to the exchange
*/
-struct TALER_MINT_Handle
+struct TALER_EXCHANGE_Handle
{
/**
* The context of this handle
*/
- struct TALER_MINT_Context *ctx;
+ struct TALER_EXCHANGE_Context *ctx;
/**
- * The URL of the mint (i.e. "http://mint.taler.net/")
+ * The URL of the exchange (i.e. "http://exchange.taler.net/")
*/
char *url;
/**
- * Function to call with the mint's certification data,
+ * Function to call with the exchange's certification data,
* NULL if this has already been done.
*/
- TALER_MINT_CertificationCallback cert_cb;
+ TALER_EXCHANGE_CertificationCallback cert_cb;
/**
* Closure to pass to @e cert_cb.
@@ -99,21 +97,21 @@ struct TALER_MINT_Handle
void *cert_cb_cls;
/**
- * Data for the request to get the /keys of a mint,
+ * Data for the request to get the /keys of a exchange,
* NULL once we are past stage #MHS_INIT.
*/
struct KeysRequest *kr;
/**
- * Key data of the mint, only valid if
+ * Key data of the exchange, only valid if
* @e handshake_complete is past stage #MHS_CERT.
*/
- struct TALER_MINT_Keys key_data;
+ struct TALER_EXCHANGE_Keys key_data;
/**
- * Stage of the mint's initialization routines.
+ * Stage of the exchange's initialization routines.
*/
- enum MintHandleState state;
+ enum ExchangeHandleState state;
};
@@ -121,14 +119,14 @@ struct TALER_MINT_Handle
/* ***************** Internal /keys fetching ************* */
/**
- * Data for the request to get the /keys of a mint.
+ * Data for the request to get the /keys of a exchange.
*/
struct KeysRequest
{
/**
- * The connection to mint this request handle will use
+ * The connection to exchange this request handle will use
*/
- struct TALER_MINT_Handle *mint;
+ struct TALER_EXCHANGE_Handle *exchange;
/**
* The url for this handle
@@ -136,7 +134,7 @@ struct KeysRequest
char *url;
/**
- * Entry for this request with the `struct TALER_MINT_Context`.
+ * Entry for this request with the `struct TALER_EXCHANGE_Context`.
*/
struct MAC_Job *job;
@@ -171,7 +169,7 @@ free_keys_request (struct KeysRequest *kr)
/**
- * Parse a mint's signing key encoded in JSON.
+ * Parse a exchange's signing key encoded in JSON.
*
* @param[out] sign_key where to return the result
* @param[in] sign_key_obj json to parse
@@ -180,32 +178,33 @@ free_keys_request (struct KeysRequest *kr)
* invalid or the json malformed.
*/
static int
-parse_json_signkey (struct TALER_MINT_SigningPublicKey *sign_key,
+parse_json_signkey (struct TALER_EXCHANGE_SigningPublicKey *sign_key,
json_t *sign_key_obj,
const struct TALER_MasterPublicKeyP *master_key)
{
- struct TALER_MintSigningKeyValidityPS sign_key_issue;
+ struct TALER_ExchangeSigningKeyValidityPS sign_key_issue;
struct GNUNET_CRYPTO_EddsaSignature sig;
struct GNUNET_TIME_Absolute valid_from;
struct GNUNET_TIME_Absolute valid_until;
struct GNUNET_TIME_Absolute valid_legal;
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("master_sig",
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("master_sig",
&sig),
- MAJ_spec_fixed_auto ("key",
+ GNUNET_JSON_spec_fixed_auto ("key",
&sign_key_issue.signkey_pub),
- MAJ_spec_absolute_time ("stamp_start",
+ GNUNET_JSON_spec_absolute_time ("stamp_start",
&valid_from),
- MAJ_spec_absolute_time ("stamp_expire",
+ GNUNET_JSON_spec_absolute_time ("stamp_expire",
&valid_until),
- MAJ_spec_absolute_time ("stamp_end",
+ GNUNET_JSON_spec_absolute_time ("stamp_end",
&valid_legal),
- MAJ_spec_end
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (sign_key_obj,
- spec))
+ GNUNET_JSON_parse (sign_key_obj,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -213,8 +212,8 @@ parse_json_signkey (struct TALER_MINT_SigningPublicKey *sign_key,
sign_key_issue.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY);
sign_key_issue.purpose.size =
- htonl (sizeof (struct TALER_MintSigningKeyValidityPS)
- - offsetof (struct TALER_MintSigningKeyValidityPS,
+ htonl (sizeof (struct TALER_ExchangeSigningKeyValidityPS)
+ - offsetof (struct TALER_ExchangeSigningKeyValidityPS,
purpose));
sign_key_issue.master_public_key = *master_key;
sign_key_issue.start = GNUNET_TIME_absolute_hton (valid_from);
@@ -237,7 +236,7 @@ parse_json_signkey (struct TALER_MINT_SigningPublicKey *sign_key,
/**
- * Parse a mint's denomination key encoded in JSON.
+ * Parse a exchange's denomination key encoded in JSON.
*
* @param[out] denom_key where to return the result
* @param[in] denom_key_obj json to parse
@@ -247,7 +246,7 @@ parse_json_signkey (struct TALER_MINT_SigningPublicKey *sign_key,
* invalid or the json malformed.
*/
static int
-parse_json_denomkey (struct TALER_MINT_DenomPublicKey *denom_key,
+parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
json_t *denom_key_obj,
struct TALER_MasterPublicKeyP *master_key,
struct GNUNET_HashContext *hash_context)
@@ -261,36 +260,36 @@ parse_json_denomkey (struct TALER_MINT_DenomPublicKey *denom_key,
struct TALER_Amount fee_deposit;
struct TALER_Amount fee_refresh;
struct TALER_DenominationKeyValidityPS denom_key_issue;
- struct GNUNET_CRYPTO_rsa_PublicKey *pk;
+ struct GNUNET_CRYPTO_RsaPublicKey *pk;
struct GNUNET_CRYPTO_EddsaSignature sig;
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("master_sig",
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("master_sig",
&sig),
- MAJ_spec_absolute_time ("stamp_expire_deposit",
+ GNUNET_JSON_spec_absolute_time ("stamp_expire_deposit",
&deposit_valid_until),
- MAJ_spec_absolute_time ("stamp_expire_withdraw",
+ GNUNET_JSON_spec_absolute_time ("stamp_expire_withdraw",
&withdraw_valid_until),
- MAJ_spec_absolute_time ("stamp_start",
+ GNUNET_JSON_spec_absolute_time ("stamp_start",
&valid_from),
- MAJ_spec_absolute_time ("stamp_expire_legal",
+ GNUNET_JSON_spec_absolute_time ("stamp_expire_legal",
&expire_legal),
- MAJ_spec_amount ("value",
+ TALER_JSON_spec_amount ("value",
&value),
- MAJ_spec_amount ("fee_withdraw",
+ TALER_JSON_spec_amount ("fee_withdraw",
&fee_withdraw),
- MAJ_spec_amount ("fee_deposit",
+ TALER_JSON_spec_amount ("fee_deposit",
&fee_deposit),
- MAJ_spec_amount ("fee_refresh",
+ TALER_JSON_spec_amount ("fee_refresh",
&fee_refresh),
- MAJ_spec_rsa_public_key ("denom_pub",
+ GNUNET_JSON_spec_rsa_public_key ("denom_pub",
&pk),
- MAJ_spec_end
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (denom_key_obj,
- spec))
+ GNUNET_JSON_parse (denom_key_obj,
+ spec, NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -337,13 +336,13 @@ parse_json_denomkey (struct TALER_MINT_DenomPublicKey *denom_key,
return GNUNET_OK;
EXITIF_exit:
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
/**
- * Parse a mint's auditor information encoded in JSON.
+ * Parse a exchange's auditor information encoded in JSON.
*
* @param[out] auditor where to return the result
* @param[in] auditor_obj json to parse
@@ -352,56 +351,64 @@ parse_json_denomkey (struct TALER_MINT_DenomPublicKey *denom_key,
* invalid or the json malformed.
*/
static int
-parse_json_auditor (struct TALER_MINT_AuditorInformation *auditor,
+parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
json_t *auditor_obj,
- const struct TALER_MINT_Keys *key_data)
+ const struct TALER_EXCHANGE_Keys *key_data)
{
json_t *keys;
json_t *key;
unsigned int len;
unsigned int off;
unsigned int i;
- struct TALER_MintKeyValidityPS kv;
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("auditor_pub",
- &auditor->auditor_pub),
- MAJ_spec_json ("denomination_keys",
- &keys),
- MAJ_spec_end
+ const char *auditor_url;
+ struct TALER_ExchangeKeyValidityPS kv;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("auditor_pub",
+ &auditor->auditor_pub),
+ GNUNET_JSON_spec_string ("auditor_url",
+ &auditor_url),
+ GNUNET_JSON_spec_json ("denomination_keys",
+ &keys),
+ GNUNET_JSON_spec_end()
};
- auditor->auditor_url = NULL; /* #3987 */
if (GNUNET_OK !=
- MAJ_parse_json (auditor_obj,
- spec))
+ GNUNET_JSON_parse (auditor_obj,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- kv.purpose.purpose = htonl (TALER_SIGNATURE_AUDITOR_MINT_KEYS);
- kv.purpose.size = htonl (sizeof (struct TALER_MintKeyValidityPS));
+ auditor->auditor_url = GNUNET_strdup (auditor_url);
+ kv.purpose.purpose = htonl (TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS);
+ kv.purpose.size = htonl (sizeof (struct TALER_ExchangeKeyValidityPS));
+ GNUNET_CRYPTO_hash (auditor_url,
+ strlen (auditor_url) + 1,
+ &kv.auditor_url_hash);
kv.master = key_data->master_pub;
len = json_array_size (keys);
auditor->denom_keys = GNUNET_new_array (len,
- const struct TALER_MINT_DenomPublicKey *);
+ const struct TALER_EXCHANGE_DenomPublicKey *);
i = 0;
off = 0;
json_array_foreach (keys, i, key) {
struct TALER_AuditorSignatureP auditor_sig;
struct GNUNET_HashCode denom_h;
- const struct TALER_MINT_DenomPublicKey *dk;
+ const struct TALER_EXCHANGE_DenomPublicKey *dk;
unsigned int j;
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("denom_pub_h",
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("denom_pub_h",
&denom_h),
- MAJ_spec_fixed_auto ("auditor_sig",
+ GNUNET_JSON_spec_fixed_auto ("auditor_sig",
&auditor_sig),
- MAJ_spec_end
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (key,
- spec))
+ GNUNET_JSON_parse (key,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
continue;
@@ -436,7 +443,7 @@ parse_json_auditor (struct TALER_MINT_AuditorInformation *auditor,
&dk->fee_refresh);
kv.denom_hash = dk->h_key;
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_AUDITOR_MINT_KEYS,
+ GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS,
&kv.purpose,
&auditor_sig.eddsa_sig,
&auditor->auditor_pub.eddsa_pub))
@@ -462,13 +469,13 @@ parse_json_auditor (struct TALER_MINT_AuditorInformation *auditor,
*/
static int
decode_keys_json (json_t *resp_obj,
- struct TALER_MINT_Keys *key_data)
+ struct TALER_EXCHANGE_Keys *key_data)
{
struct GNUNET_TIME_Absolute list_issue_date;
- struct TALER_MintSignatureP sig;
- struct TALER_MintKeySetPS ks;
+ struct TALER_ExchangeSignatureP sig;
+ struct TALER_ExchangeKeySetPS ks;
struct GNUNET_HashContext *hash_context;
- struct TALER_MintPublicKeyP pub;
+ struct TALER_ExchangePublicKeyP pub;
if (JSON_OBJECT != json_typeof (resp_obj))
return GNUNET_SYSERR;
@@ -476,21 +483,22 @@ decode_keys_json (json_t *resp_obj,
hash_context = GNUNET_CRYPTO_hash_context_start ();
/* parse the master public key and issue date of the response */
{
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("master_public_key",
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("master_public_key",
&key_data->master_pub),
- MAJ_spec_fixed_auto ("eddsa_sig",
+ GNUNET_JSON_spec_fixed_auto ("eddsa_sig",
&sig),
- MAJ_spec_fixed_auto ("eddsa_pub",
+ GNUNET_JSON_spec_fixed_auto ("eddsa_pub",
&pub),
- MAJ_spec_absolute_time ("list_issue_date",
+ GNUNET_JSON_spec_absolute_time ("list_issue_date",
&list_issue_date),
- MAJ_spec_end
+ GNUNET_JSON_spec_end()
};
EXITIF (GNUNET_OK !=
- MAJ_parse_json (resp_obj,
- spec));
+ GNUNET_JSON_parse (resp_obj,
+ spec,
+ NULL, NULL));
}
/* parse the signing keys */
@@ -507,7 +515,7 @@ decode_keys_json (json_t *resp_obj,
json_array_size (sign_keys_array)));
key_data->sign_keys
= GNUNET_new_array (key_data->num_sign_keys,
- struct TALER_MINT_SigningPublicKey);
+ struct TALER_EXCHANGE_SigningPublicKey);
index = 0;
json_array_foreach (sign_keys_array, index, sign_key_obj) {
EXITIF (GNUNET_SYSERR ==
@@ -528,7 +536,7 @@ decode_keys_json (json_t *resp_obj,
EXITIF (JSON_ARRAY != json_typeof (denom_keys_array));
EXITIF (0 == (key_data->num_denom_keys = json_array_size (denom_keys_array)));
key_data->denom_keys = GNUNET_new_array (key_data->num_denom_keys,
- struct TALER_MINT_DenomPublicKey);
+ struct TALER_EXCHANGE_DenomPublicKey);
index = 0;
json_array_foreach (denom_keys_array, index, denom_key_obj) {
EXITIF (GNUNET_SYSERR ==
@@ -553,7 +561,7 @@ decode_keys_json (json_t *resp_obj,
if (0 != len)
{
key_data->auditors = GNUNET_new_array (len,
- struct TALER_MINT_AuditorInformation);
+ struct TALER_EXCHANGE_AuditorInformation);
index = 0;
json_array_foreach (auditors_array, index, auditor_info) {
EXITIF (GNUNET_SYSERR ==
@@ -566,16 +574,16 @@ decode_keys_json (json_t *resp_obj,
/* Validate signature... */
ks.purpose.size = htonl (sizeof (ks));
- ks.purpose.purpose = htonl (TALER_SIGNATURE_MINT_KEY_SET);
+ ks.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_KEY_SET);
ks.list_issue_date = GNUNET_TIME_absolute_hton (list_issue_date);
GNUNET_CRYPTO_hash_context_finish (hash_context,
&ks.hc);
hash_context = NULL;
EXITIF (GNUNET_OK !=
- TALER_MINT_test_signing_key (key_data,
+ TALER_EXCHANGE_test_signing_key (key_data,
&pub));
EXITIF (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MINT_KEY_SET,
+ GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_KEY_SET,
&ks.purpose,
&sig.eddsa_signature,
&pub.eddsa_pub));
@@ -600,10 +608,10 @@ keys_completed_cb (void *cls,
CURL *eh)
{
struct KeysRequest *kr = cls;
- struct TALER_MINT_Handle *mint = kr->mint;
+ struct TALER_EXCHANGE_Handle *exchange = kr->exchange;
json_t *resp_obj;
long response_code;
- TALER_MINT_CertificationCallback cb;
+ TALER_EXCHANGE_CertificationCallback cb;
resp_obj = MAC_download_get_result (&kr->db,
eh,
@@ -619,7 +627,7 @@ keys_completed_cb (void *cls,
if ( (NULL == resp_obj) ||
(GNUNET_OK !=
decode_keys_json (resp_obj,
- &kr->mint->key_data)) )
+ &kr->exchange->key_data)) )
response_code = 0;
break;
default:
@@ -633,27 +641,27 @@ keys_completed_cb (void *cls,
if (MHD_HTTP_OK != response_code)
{
- mint->kr = NULL;
+ exchange->kr = NULL;
free_keys_request (kr);
- mint->state = MHS_FAILED;
+ exchange->state = MHS_FAILED;
/* notify application that we failed */
- if (NULL != (cb = mint->cert_cb))
+ if (NULL != (cb = exchange->cert_cb))
{
- mint->cert_cb = NULL;
- cb (mint->cert_cb_cls,
+ exchange->cert_cb = NULL;
+ cb (exchange->cert_cb_cls,
NULL);
}
return;
}
- mint->kr = NULL;
+ exchange->kr = NULL;
free_keys_request (kr);
- mint->state = MHS_CERT;
+ exchange->state = MHS_CERT;
/* notify application about the key information */
- if (NULL != (cb = mint->cert_cb))
+ if (NULL != (cb = exchange->cert_cb))
{
- mint->cert_cb = NULL;
- cb (mint->cert_cb_cls,
- &mint->key_data);
+ exchange->cert_cb = NULL;
+ cb (exchange->cert_cb_cls,
+ &exchange->key_data);
}
}
@@ -662,13 +670,13 @@ keys_completed_cb (void *cls,
/**
- * Get the context of a mint.
+ * Get the context of a exchange.
*
- * @param h the mint handle to query
+ * @param h the exchange handle to query
* @return ctx context to execute jobs in
*/
-struct TALER_MINT_Context *
-MAH_handle_to_context (struct TALER_MINT_Handle *h)
+struct TALER_EXCHANGE_Context *
+MAH_handle_to_context (struct TALER_EXCHANGE_Handle *h)
{
return h->ctx;
}
@@ -677,11 +685,11 @@ MAH_handle_to_context (struct TALER_MINT_Handle *h)
/**
* Check if the handle is ready to process requests.
*
- * @param h the mint handle to query
+ * @param h the exchange handle to query
* @return #GNUNET_YES if we are ready, #GNUNET_NO if not
*/
int
-MAH_handle_is_ready (struct TALER_MINT_Handle *h)
+MAH_handle_is_ready (struct TALER_EXCHANGE_Handle *h)
{
return (MHS_CERT == h->state) ? GNUNET_YES : GNUNET_NO;
}
@@ -690,12 +698,12 @@ MAH_handle_is_ready (struct TALER_MINT_Handle *h)
/**
* Obtain the URL to use for an API request.
*
- * @param h the mint handle to query
+ * @param h the exchange handle to query
* @param path Taler API path (i.e. "/reserve/withdraw")
* @return the full URI to use with cURL
*/
char *
-MAH_path_to_url (struct TALER_MINT_Handle *h,
+MAH_path_to_url (struct TALER_EXCHANGE_Handle *h,
const char *path)
{
char *url;
@@ -715,39 +723,39 @@ MAH_path_to_url (struct TALER_MINT_Handle *h,
/* ********************* public API ******************* */
/**
- * Initialise a connection to the mint. Will connect to the
- * mint and obtain information about the mint's master public
- * key and the mint's auditor. The respective information will
+ * Initialise a connection to the exchange. Will connect to the
+ * exchange and obtain information about the exchange's master public
+ * key and the exchange's auditor. The respective information will
* be passed to the @a cert_cb once available, and all future
- * interactions with the mint will be checked to be signed
+ * interactions with the exchange will be checked to be signed
* (where appropriate) by the respective master key.
*
* @param ctx the context
- * @param url HTTP base URL for the mint
- * @param cert_cb function to call with the mint's certification information
+ * @param url HTTP base URL for the exchange
+ * @param cert_cb function to call with the exchange's certification information
* @param cert_cb_cls closure for @a cert_cb
- * @param ... list of additional arguments, terminated by #TALER_MINT_OPTION_END.
- * @return the mint handle; NULL upon error
+ * @param ... list of additional arguments, terminated by #TALER_EXCHANGE_OPTION_END.
+ * @return the exchange handle; NULL upon error
*/
-struct TALER_MINT_Handle *
-TALER_MINT_connect (struct TALER_MINT_Context *ctx,
+struct TALER_EXCHANGE_Handle *
+TALER_EXCHANGE_connect (struct TALER_EXCHANGE_Context *ctx,
const char *url,
- TALER_MINT_CertificationCallback cert_cb,
+ TALER_EXCHANGE_CertificationCallback cert_cb,
void *cert_cb_cls,
...)
{
- struct TALER_MINT_Handle *mint;
+ struct TALER_EXCHANGE_Handle *exchange;
struct KeysRequest *kr;
CURL *c;
- mint = GNUNET_new (struct TALER_MINT_Handle);
- mint->ctx = ctx;
- mint->url = GNUNET_strdup (url);
- mint->cert_cb = cert_cb;
- mint->cert_cb_cls = cert_cb_cls;
+ exchange = GNUNET_new (struct TALER_EXCHANGE_Handle);
+ exchange->ctx = ctx;
+ exchange->url = GNUNET_strdup (url);
+ exchange->cert_cb = cert_cb;
+ exchange->cert_cb_cls = cert_cb_cls;
kr = GNUNET_new (struct KeysRequest);
- kr->mint = mint;
- kr->url = MAH_path_to_url (mint, "/keys");
+ kr->exchange = exchange;
+ kr->url = MAH_path_to_url (exchange, "/keys");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Requesting keys with URL `%s'.\n",
kr->url);
@@ -772,59 +780,59 @@ TALER_MINT_connect (struct TALER_MINT_Context *ctx,
curl_easy_setopt (c,
CURLOPT_WRITEDATA,
&kr->db));
- kr->job = MAC_job_add (mint->ctx,
+ kr->job = MAC_job_add (exchange->ctx,
c,
GNUNET_NO,
&keys_completed_cb,
kr);
- mint->kr = kr;
- return mint;
+ exchange->kr = kr;
+ return exchange;
}
/**
- * Disconnect from the mint
+ * Disconnect from the exchange
*
- * @param mint the mint handle
+ * @param exchange the exchange handle
*/
void
-TALER_MINT_disconnect (struct TALER_MINT_Handle *mint)
+TALER_EXCHANGE_disconnect (struct TALER_EXCHANGE_Handle *exchange)
{
unsigned int i;
- if (NULL != mint->kr)
+ if (NULL != exchange->kr)
{
- MAC_job_cancel (mint->kr->job);
- free_keys_request (mint->kr);
- mint->kr = NULL;
+ MAC_job_cancel (exchange->kr->job);
+ free_keys_request (exchange->kr);
+ exchange->kr = NULL;
}
- GNUNET_array_grow (mint->key_data.sign_keys,
- mint->key_data.num_sign_keys,
+ GNUNET_array_grow (exchange->key_data.sign_keys,
+ exchange->key_data.num_sign_keys,
0);
- for (i=0;ikey_data.num_denom_keys;i++)
- GNUNET_CRYPTO_rsa_public_key_free (mint->key_data.denom_keys[i].key.rsa_public_key);
- GNUNET_array_grow (mint->key_data.denom_keys,
- mint->key_data.num_denom_keys,
+ for (i=0;ikey_data.num_denom_keys;i++)
+ GNUNET_CRYPTO_rsa_public_key_free (exchange->key_data.denom_keys[i].key.rsa_public_key);
+ GNUNET_array_grow (exchange->key_data.denom_keys,
+ exchange->key_data.num_denom_keys,
0);
- GNUNET_array_grow (mint->key_data.auditors,
- mint->key_data.num_auditors,
+ GNUNET_array_grow (exchange->key_data.auditors,
+ exchange->key_data.num_auditors,
0);
- GNUNET_free (mint->url);
- GNUNET_free (mint);
+ GNUNET_free (exchange->url);
+ GNUNET_free (exchange);
}
/**
- * Test if the given @a pub is a the current signing key from the mint
+ * Test if the given @a pub is a the current signing key from the exchange
* according to @a keys.
*
- * @param keys the mint's key set
- * @param pub claimed current online signing key for the mint
+ * @param keys the exchange's key set
+ * @param pub claimed current online signing key for the exchange
* @return #GNUNET_OK if @a pub is (according to /keys) a current signing key
*/
int
-TALER_MINT_test_signing_key (const struct TALER_MINT_Keys *keys,
- const struct TALER_MintPublicKeyP *pub)
+TALER_EXCHANGE_test_signing_key (const struct TALER_EXCHANGE_Keys *keys,
+ const struct TALER_ExchangePublicKeyP *pub)
{
struct GNUNET_TIME_Absolute now;
unsigned int i;
@@ -836,22 +844,22 @@ TALER_MINT_test_signing_key (const struct TALER_MINT_Keys *keys,
(keys->sign_keys[i].valid_until.abs_value_us > now.abs_value_us - 60 * 60 * 1000LL * 1000LL) &&
(0 == memcmp (pub,
&keys->sign_keys[i].key,
- sizeof (struct TALER_MintPublicKeyP))) )
+ sizeof (struct TALER_ExchangePublicKeyP))) )
return GNUNET_OK;
return GNUNET_SYSERR;
}
/**
- * Obtain the denomination key details from the mint.
+ * Obtain the denomination key details from the exchange.
*
- * @param keys the mint's key set
+ * @param keys the exchange's key set
* @param pk public key of the denomination to lookup
* @return details about the given denomination key, NULL if the key is
* not found
*/
-const struct TALER_MINT_DenomPublicKey *
-TALER_MINT_get_denomination_key (const struct TALER_MINT_Keys *keys,
+const struct TALER_EXCHANGE_DenomPublicKey *
+TALER_EXCHANGE_get_denomination_key (const struct TALER_EXCHANGE_Keys *keys,
const struct TALER_DenominationPublicKey *pk)
{
unsigned int i;
@@ -865,14 +873,14 @@ TALER_MINT_get_denomination_key (const struct TALER_MINT_Keys *keys,
/**
- * Obtain the denomination key details from the mint.
+ * Obtain the denomination key details from the exchange.
*
- * @param keys the mint's key set
+ * @param keys the exchange's key set
* @param hc hash of the public key of the denomination to lookup
* @return details about the given denomination key
*/
-const struct TALER_MINT_DenomPublicKey *
-TALER_MINT_get_denomination_key_by_hash (const struct TALER_MINT_Keys *keys,
+const struct TALER_EXCHANGE_DenomPublicKey *
+TALER_EXCHANGE_get_denomination_key_by_hash (const struct TALER_EXCHANGE_Keys *keys,
const struct GNUNET_HashCode *hc)
{
unsigned int i;
@@ -887,16 +895,16 @@ TALER_MINT_get_denomination_key_by_hash (const struct TALER_MINT_Keys *keys,
/**
- * Obtain the keys from the mint.
+ * Obtain the keys from the exchange.
*
- * @param mint the mint handle
- * @return the mint's key set
+ * @param exchange the exchange handle
+ * @return the exchange's key set
*/
-const struct TALER_MINT_Keys *
-TALER_MINT_get_keys (const struct TALER_MINT_Handle *mint)
+const struct TALER_EXCHANGE_Keys *
+TALER_EXCHANGE_get_keys (const struct TALER_EXCHANGE_Handle *exchange)
{
- return &mint->key_data;
+ return &exchange->key_data;
}
-/* end of mint_api_handle.c */
+/* end of exchange_api_handle.c */
diff --git a/src/mint-lib/mint_api_handle.h b/src/exchange-lib/exchange_api_handle.h
similarity index 68%
rename from src/mint-lib/mint_api_handle.h
rename to src/exchange-lib/exchange_api_handle.h
index 0dae58db6..48423a7b8 100644
--- a/src/mint-lib/mint_api_handle.h
+++ b/src/exchange-lib/exchange_api_handle.h
@@ -15,45 +15,45 @@
*/
/**
- * @file mint-lib/mint_api_handle.h
- * @brief Internal interface to the handle part of the mint's HTTP API
+ * @file exchange-lib/exchange_api_handle.h
+ * @brief Internal interface to the handle part of the exchange's HTTP API
* @author Christian Grothoff
*/
#include "platform.h"
#include
-#include "taler_mint_service.h"
+#include "taler_exchange_service.h"
/**
- * Get the context of a mint.
+ * Get the context of a exchange.
*
- * @param h the mint handle to query
+ * @param h the exchange handle to query
* @return ctx context to execute jobs in
*/
-struct TALER_MINT_Context *
-MAH_handle_to_context (struct TALER_MINT_Handle *h);
+struct TALER_EXCHANGE_Context *
+MAH_handle_to_context (struct TALER_EXCHANGE_Handle *h);
/**
* Check if the handle is ready to process requests.
*
- * @param h the mint handle to query
+ * @param h the exchange handle to query
* @return #GNUNET_YES if we are ready, #GNUNET_NO if not
*/
int
-MAH_handle_is_ready (struct TALER_MINT_Handle *h);
+MAH_handle_is_ready (struct TALER_EXCHANGE_Handle *h);
/**
* Obtain the URL to use for an API request.
*
- * @param h the mint handle to query
+ * @param h the exchange handle to query
* @param path Taler API path (i.e. "/reserve/withdraw")
* @return the full URI to use with cURL
*/
char *
-MAH_path_to_url (struct TALER_MINT_Handle *h,
+MAH_path_to_url (struct TALER_EXCHANGE_Handle *h,
const char *path);
-/* end of mint_api_handle.h */
+/* end of exchange_api_handle.h */
diff --git a/src/mint-lib/mint_api_refresh.c b/src/exchange-lib/exchange_api_refresh.c
similarity index 88%
rename from src/mint-lib/mint_api_refresh.c
rename to src/exchange-lib/exchange_api_refresh.c
index cea16b153..5cdf059b7 100644
--- a/src/mint-lib/mint_api_refresh.c
+++ b/src/exchange-lib/exchange_api_refresh.c
@@ -15,8 +15,8 @@
*/
/**
- * @file mint-lib/mint_api_refresh.c
- * @brief Implementation of the /refresh/melt+reveal requests of the mint's HTTP API
+ * @file exchange-lib/exchange_api_refresh.c
+ * @brief Implementation of the /refresh/melt+reveal requests of the exchange's HTTP API
* @author Christian Grothoff
*/
#include "platform.h"
@@ -24,11 +24,12 @@
#include
#include /* just for HTTP status codes */
#include
-#include "taler_mint_service.h"
-#include "mint_api_common.h"
-#include "mint_api_json.h"
-#include "mint_api_context.h"
-#include "mint_api_handle.h"
+#include
+#include "taler_json_lib.h"
+#include "taler_exchange_service.h"
+#include "exchange_api_common.h"
+#include "exchange_api_context.h"
+#include "exchange_api_handle.h"
#include "taler_signatures.h"
@@ -145,7 +146,7 @@ struct MeltDataP
/* Followed by serializations of:
1) struct MeltedCoinP melted_coins[num_melted_coins];
- 2) struct TALER_MINT_DenomPublicKey fresh_pks[num_fresh_coins];
+ 2) struct TALER_EXCHANGE_DenomPublicKey fresh_pks[num_fresh_coins];
3) TALER_CNC_KAPPA times:
3a) struct FreshCoinP fresh_coins[num_fresh_coins];
*/
@@ -196,7 +197,7 @@ struct MeltedCoin
struct TALER_DenominationPublicKey pub_key;
/**
- * Mint's signature over the coin.
+ * Exchange's signature over the coin.
*/
struct TALER_DenominationSignature sig;
@@ -257,7 +258,7 @@ struct MeltData
/**
* Array of @e num_fresh_coins denomination keys for the coins to be
- * freshly minted.
+ * freshly exchangeed.
*/
struct TALER_DenominationPublicKey *fresh_pks;
@@ -794,7 +795,7 @@ deserialize_melt_data (const char *buf,
*/
static void
setup_fresh_coin (struct FreshCoin *fc,
- const struct TALER_MINT_DenomPublicKey *pk)
+ const struct TALER_EXCHANGE_DenomPublicKey *pk)
{
struct GNUNET_CRYPTO_EddsaPrivateKey *epk;
unsigned int len;
@@ -818,7 +819,7 @@ setup_fresh_coin (struct FreshCoin *fc,
* no money is lost in case of hardware failures, is operation does
* not actually initiate the request. Instead, it generates a buffer
* which the caller must store before proceeding with the actual call
- * to #TALER_MINT_refresh_melt() that will generate the request.
+ * to #TALER_EXCHANGE_refresh_melt() that will generate the request.
*
* This function does verify that the given request data is internally
* consistent. However, the @a melts_sigs are only verified if
@@ -845,20 +846,20 @@ setup_fresh_coin (struct FreshCoin *fc,
* @param fresh_pks array of @a pks_len denominations of fresh coins to create
* @param[out] res_size set to the size of the return value, or 0 on error
* @return NULL
- * if the inputs are invalid (i.e. denomination key not with this mint).
+ * if the inputs are invalid (i.e. denomination key not with this exchange).
* Otherwise, pointer to a buffer of @a res_size to store persistently
- * before proceeding to #TALER_MINT_refresh_melt().
+ * before proceeding to #TALER_EXCHANGE_refresh_melt().
* Non-null results should be freed using #GNUNET_free().
*/
char *
-TALER_MINT_refresh_prepare (unsigned int num_melts,
+TALER_EXCHANGE_refresh_prepare (unsigned int num_melts,
const struct TALER_CoinSpendPrivateKeyP *melt_privs,
const struct TALER_Amount *melt_amounts,
const struct TALER_DenominationSignature *melt_sigs,
- const struct TALER_MINT_DenomPublicKey *melt_pks,
+ const struct TALER_EXCHANGE_DenomPublicKey *melt_pks,
int check_sigs,
unsigned int fresh_pks_len,
- const struct TALER_MINT_DenomPublicKey *fresh_pks,
+ const struct TALER_EXCHANGE_DenomPublicKey *fresh_pks,
size_t *res_size)
{
struct MeltData md;
@@ -1022,13 +1023,13 @@ TALER_MINT_refresh_prepare (unsigned int num_melts,
/**
* @brief A /refresh/melt Handle
*/
-struct TALER_MINT_RefreshMeltHandle
+struct TALER_EXCHANGE_RefreshMeltHandle
{
/**
- * The connection to mint this request handle will use
+ * The connection to exchange this request handle will use
*/
- struct TALER_MINT_Handle *mint;
+ struct TALER_EXCHANGE_Handle *exchange;
/**
* The url for this request.
@@ -1048,7 +1049,7 @@ struct TALER_MINT_RefreshMeltHandle
/**
* Function to call with refresh melt failure results.
*/
- TALER_MINT_RefreshMeltCallback melt_cb;
+ TALER_EXCHANGE_RefreshMeltCallback melt_cb;
/**
* Closure for @e result_cb and @e melt_failure_cb.
@@ -1069,42 +1070,43 @@ struct TALER_MINT_RefreshMeltHandle
/**
* Verify that the signature on the "200 OK" response
- * from the mint is valid.
+ * from the exchange is valid.
*
* @param rmh melt handle
* @param json json reply with the signature
- * @param[out] noreveal_index set to the noreveal index selected by the mint
+ * @param[out] noreveal_index set to the noreveal index selected by the exchange
* @return #GNUNET_OK if the signature is valid, #GNUNET_SYSERR if not
*/
static int
-verify_refresh_melt_signature_ok (struct TALER_MINT_RefreshMeltHandle *rmh,
+verify_refresh_melt_signature_ok (struct TALER_EXCHANGE_RefreshMeltHandle *rmh,
json_t *json,
uint16_t *noreveal_index)
{
- struct TALER_MintSignatureP mint_sig;
- struct TALER_MintPublicKeyP mint_pub;
- const struct TALER_MINT_Keys *key_state;
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("mint_sig", &mint_sig),
- MAJ_spec_fixed_auto ("mint_pub", &mint_pub),
- MAJ_spec_uint16 ("noreveal_index", noreveal_index),
- MAJ_spec_end
+ struct TALER_ExchangeSignatureP exchange_sig;
+ struct TALER_ExchangePublicKeyP exchange_pub;
+ const struct TALER_EXCHANGE_Keys *key_state;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("exchange_sig", &exchange_sig),
+ GNUNET_JSON_spec_fixed_auto ("exchange_pub", &exchange_pub),
+ GNUNET_JSON_spec_uint16 ("noreveal_index", noreveal_index),
+ GNUNET_JSON_spec_end()
};
struct TALER_RefreshMeltConfirmationPS confirm;
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- /* check that mint signing key is permitted */
- key_state = TALER_MINT_get_keys (rmh->mint);
+ /* check that exchange signing key is permitted */
+ key_state = TALER_EXCHANGE_get_keys (rmh->exchange);
if (GNUNET_OK !=
- TALER_MINT_test_signing_key (key_state,
- &mint_pub))
+ TALER_EXCHANGE_test_signing_key (key_state,
+ &exchange_pub))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -1117,17 +1119,17 @@ verify_refresh_melt_signature_ok (struct TALER_MINT_RefreshMeltHandle *rmh,
return GNUNET_SYSERR;
}
- /* verify signature by mint */
- confirm.purpose.purpose = htonl (TALER_SIGNATURE_MINT_CONFIRM_MELT);
+ /* verify signature by exchange */
+ confirm.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT);
confirm.purpose.size = htonl (sizeof (struct TALER_RefreshMeltConfirmationPS));
confirm.session_hash = rmh->md->melt_session_hash;
confirm.noreveal_index = htons (*noreveal_index);
confirm.reserved = htons (0);
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MINT_CONFIRM_MELT,
+ GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT,
&confirm.purpose,
- &mint_sig.eddsa_signature,
- &mint_pub.eddsa_pub))
+ &exchange_sig.eddsa_signature,
+ &exchange_pub.eddsa_pub))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -1138,14 +1140,14 @@ verify_refresh_melt_signature_ok (struct TALER_MINT_RefreshMeltHandle *rmh,
/**
* Verify that the signatures on the "403 FORBIDDEN" response from the
- * mint demonstrating customer double-spending are valid.
+ * exchange demonstrating customer double-spending are valid.
*
* @param rmh melt handle
* @param json json reply with the signature(s) and transaction history
* @return #GNUNET_OK if the signature(s) is valid, #GNUNET_SYSERR if not
*/
static int
-verify_refresh_melt_signature_forbidden (struct TALER_MINT_RefreshMeltHandle *rmh,
+verify_refresh_melt_signature_forbidden (struct TALER_EXCHANGE_RefreshMeltHandle *rmh,
json_t *json)
{
json_t *history;
@@ -1154,25 +1156,26 @@ verify_refresh_melt_signature_forbidden (struct TALER_MINT_RefreshMeltHandle *rm
struct TALER_Amount total;
struct TALER_CoinSpendPublicKeyP coin_pub;
unsigned int i;
- struct MAJ_Specification spec[] = {
- MAJ_spec_json ("history", &history),
- MAJ_spec_fixed_auto ("coin_pub", &coin_pub),
- MAJ_spec_amount ("original_value", &original_value),
- MAJ_spec_amount ("requested_value", &melt_value_with_fee),
- MAJ_spec_end
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_json ("history", &history),
+ GNUNET_JSON_spec_fixed_auto ("coin_pub", &coin_pub),
+ TALER_JSON_spec_amount ("original_value", &original_value),
+ TALER_JSON_spec_amount ("requested_value", &melt_value_with_fee),
+ GNUNET_JSON_spec_end()
};
const struct MeltedCoin *mc;
/* parse JSON reply */
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- /* Find out which coin was deemed problematic by the mint */
+ /* Find out which coin was deemed problematic by the exchange */
mc = NULL;
for (i=0;imd->num_melted_coins;i++)
{
@@ -1222,7 +1225,7 @@ verify_refresh_melt_signature_forbidden (struct TALER_MINT_RefreshMeltHandle *rm
history = json_object_get (json,
"history");
if (GNUNET_OK !=
- TALER_MINT_verify_coin_history_ (original_value.currency,
+ TALER_EXCHANGE_verify_coin_history_ (original_value.currency,
&coin_pub,
history,
&total))
@@ -1261,14 +1264,14 @@ verify_refresh_melt_signature_forbidden (struct TALER_MINT_RefreshMeltHandle *rm
* Function called when we're done processing the
* HTTP /refresh/melt request.
*
- * @param cls the `struct TALER_MINT_RefreshMeltHandle`
+ * @param cls the `struct TALER_EXCHANGE_RefreshMeltHandle`
* @param eh the curl request handle
*/
static void
handle_refresh_melt_finished (void *cls,
CURL *eh)
{
- struct TALER_MINT_RefreshMeltHandle *rmh = cls;
+ struct TALER_EXCHANGE_RefreshMeltHandle *rmh = cls;
long response_code;
json_t *json;
uint16_t noreveal_index = TALER_CNC_KAPPA; /* invalid value */
@@ -1300,7 +1303,7 @@ handle_refresh_melt_finished (void *cls,
}
break;
case MHD_HTTP_BAD_REQUEST:
- /* This should never happen, either us or the mint is buggy
+ /* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
case MHD_HTTP_FORBIDDEN:
@@ -1314,7 +1317,7 @@ handle_refresh_melt_finished (void *cls,
}
break;
case MHD_HTTP_UNAUTHORIZED:
- /* Nothing really to verify, mint says one of the signatures is
+ /* Nothing really to verify, exchange says one of the signatures is
invalid; assuming we checked them, this should never happen, we
should pass the JSON reply to the application */
break;
@@ -1341,7 +1344,7 @@ handle_refresh_melt_finished (void *cls,
UINT16_MAX,
json);
json_decref (json);
- TALER_MINT_refresh_melt_cancel (rmh);
+ TALER_EXCHANGE_refresh_melt_cancel (rmh);
}
@@ -1373,45 +1376,45 @@ melted_coin_to_json (const struct GNUNET_HashCode *melt_session_hash,
&confirm_sig.eddsa_signature);
return json_pack ("{s:o, s:o, s:o, s:o, s:o}",
"coin_pub",
- TALER_json_from_data (&melt.coin_pub,
+ GNUNET_JSON_from_data (&melt.coin_pub,
sizeof (melt.coin_pub)),
"denom_pub",
- TALER_json_from_rsa_public_key (mc->pub_key.rsa_public_key),
+ GNUNET_JSON_from_rsa_public_key (mc->pub_key.rsa_public_key),
"denom_sig",
- TALER_json_from_rsa_signature (mc->sig.rsa_signature),
+ GNUNET_JSON_from_rsa_signature (mc->sig.rsa_signature),
"confirm_sig",
- TALER_json_from_data (&confirm_sig,
+ GNUNET_JSON_from_data (&confirm_sig,
sizeof (confirm_sig)),
"value_with_fee",
- TALER_json_from_amount (&mc->melt_amount_with_fee));
+ TALER_JSON_from_amount (&mc->melt_amount_with_fee));
}
/**
- * Submit a melt request to the mint and get the mint's
+ * Submit a melt request to the exchange and get the exchange's
* response.
*
* This API is typically used by a wallet. Note that to ensure that
* no money is lost in case of hardware failures, the provided
* argument should have been constructed using
- * #TALER_MINT_refresh_prepare and committed to persistent storage
+ * #TALER_EXCHANGE_refresh_prepare and committed to persistent storage
* prior to calling this function.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param refresh_data_length size of the @a refresh_data (returned
- * in the `res_size` argument from #TALER_MINT_refresh_prepare())
+ * in the `res_size` argument from #TALER_EXCHANGE_refresh_prepare())
* @param refresh_data the refresh data as returned from
- #TALER_MINT_refresh_prepare())
+ #TALER_EXCHANGE_refresh_prepare())
* @param melt_cb the callback to call with the result
* @param melt_cb_cls closure for @a melt_cb
* @return a handle for this request; NULL if the argument was invalid.
* In this case, neither callback will be called.
*/
-struct TALER_MINT_RefreshMeltHandle *
-TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
+struct TALER_EXCHANGE_RefreshMeltHandle *
+TALER_EXCHANGE_refresh_melt (struct TALER_EXCHANGE_Handle *exchange,
size_t refresh_data_length,
const char *refresh_data,
- TALER_MINT_RefreshMeltCallback melt_cb,
+ TALER_EXCHANGE_RefreshMeltCallback melt_cb,
void *melt_cb_cls)
{
json_t *melt_obj;
@@ -1422,15 +1425,15 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
json_t *secret_encs;
json_t *link_encs;
json_t *tmp;
- struct TALER_MINT_RefreshMeltHandle *rmh;
+ struct TALER_EXCHANGE_RefreshMeltHandle *rmh;
CURL *eh;
- struct TALER_MINT_Context *ctx;
+ struct TALER_EXCHANGE_Context *ctx;
struct MeltData *md;
unsigned int i;
unsigned int j;
if (GNUNET_YES !=
- MAH_handle_is_ready (mint))
+ MAH_handle_is_ready (exchange))
{
GNUNET_break (0);
return NULL;
@@ -1472,7 +1475,7 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
GNUNET_CRYPTO_ecdhe_key_get_public (&mc->transfer_priv[j].ecdhe_priv,
&transfer_pub.ecdhe_pub);
json_array_append (tmp,
- TALER_json_from_data (&transfer_pub,
+ GNUNET_JSON_from_data (&transfer_pub,
sizeof (transfer_pub)));
}
json_array_append (transfer_pubs,
@@ -1497,7 +1500,7 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
&trans_sec,
&els));
json_array_append (tmp,
- TALER_json_from_data (&els,
+ GNUNET_JSON_from_data (&els,
sizeof (els)));
}
json_array_append (secret_encs,
@@ -1508,7 +1511,7 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
for (i=0;inum_fresh_coins;i++)
{
json_array_append (new_denoms,
- TALER_json_from_rsa_public_key
+ GNUNET_JSON_from_rsa_public_key
(md->fresh_pks[i].rsa_public_key));
}
@@ -1533,7 +1536,7 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
&buf_len);
GNUNET_assert (NULL != buf);
json_array_append (tmp,
- TALER_json_from_data (buf,
+ GNUNET_JSON_from_data (buf,
buf_len));
GNUNET_free (buf);
GNUNET_free (rle);
@@ -1564,7 +1567,7 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
md->fresh_pks[i].rsa_public_key,
&coin_ev);
json_array_append (tmp,
- TALER_json_from_data (coin_ev,
+ GNUNET_JSON_from_data (coin_ev,
coin_ev_size));
GNUNET_free (coin_ev);
}
@@ -1582,12 +1585,12 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
"link_encs", link_encs);
/* and now we can at last begin the actual request handling */
- rmh = GNUNET_new (struct TALER_MINT_RefreshMeltHandle);
- rmh->mint = mint;
+ rmh = GNUNET_new (struct TALER_EXCHANGE_RefreshMeltHandle);
+ rmh->exchange = exchange;
rmh->melt_cb = melt_cb;
rmh->melt_cb_cls = melt_cb_cls;
rmh->md = md;
- rmh->url = MAH_path_to_url (mint,
+ rmh->url = MAH_path_to_url (exchange,
"/refresh/melt");
eh = curl_easy_init ();
@@ -1615,7 +1618,7 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
curl_easy_setopt (eh,
CURLOPT_WRITEDATA,
&rmh->db));
- ctx = MAH_handle_to_context (mint);
+ ctx = MAH_handle_to_context (exchange);
rmh->job = MAC_job_add (ctx,
eh,
GNUNET_YES,
@@ -1632,7 +1635,7 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
* @param rmh the refresh melt handle
*/
void
-TALER_MINT_refresh_melt_cancel (struct TALER_MINT_RefreshMeltHandle *rmh)
+TALER_EXCHANGE_refresh_melt_cancel (struct TALER_EXCHANGE_RefreshMeltHandle *rmh)
{
if (NULL != rmh->job)
{
@@ -1654,13 +1657,13 @@ TALER_MINT_refresh_melt_cancel (struct TALER_MINT_RefreshMeltHandle *rmh)
/**
* @brief A /refresh/reveal Handle
*/
-struct TALER_MINT_RefreshRevealHandle
+struct TALER_EXCHANGE_RefreshRevealHandle
{
/**
- * The connection to mint this request handle will use
+ * The connection to exchange this request handle will use
*/
- struct TALER_MINT_Handle *mint;
+ struct TALER_EXCHANGE_Handle *exchange;
/**
* The url for this request.
@@ -1680,7 +1683,7 @@ struct TALER_MINT_RefreshRevealHandle
/**
* Function to call with the result.
*/
- TALER_MINT_RefreshRevealCallback reveal_cb;
+ TALER_EXCHANGE_RefreshRevealCallback reveal_cb;
/**
* Closure for @e reveal_cb.
@@ -1698,7 +1701,7 @@ struct TALER_MINT_RefreshRevealHandle
struct MeltData *md;
/**
- * The index selected by the mint in cut-and-choose to not be revealed.
+ * The index selected by the exchange in cut-and-choose to not be revealed.
*/
uint16_t noreveal_index;
@@ -1708,7 +1711,7 @@ struct TALER_MINT_RefreshRevealHandle
/**
* We got a 200 OK response for the /refresh/reveal operation.
* Extract the coin signatures and return them to the caller.
- * The signatures we get from the mint is for the blinded value.
+ * The signatures we get from the exchange is for the blinded value.
* Thus, we first must unblind them and then should verify their
* validity.
*
@@ -1716,27 +1719,28 @@ struct TALER_MINT_RefreshRevealHandle
* to the application via the callback.
*
* @param rrh operation handle
- * @param json reply from the mint
+ * @param json reply from the exchange
* @param[out] coin_privs array of length `num_fresh_coins`, initialized to contain private keys
* @param[out] sigs array of length `num_fresh_coins`, initialized to cointain RSA signatures
* @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
*/
static int
-refresh_reveal_ok (struct TALER_MINT_RefreshRevealHandle *rrh,
+refresh_reveal_ok (struct TALER_EXCHANGE_RefreshRevealHandle *rrh,
json_t *json,
struct TALER_CoinSpendPrivateKeyP *coin_privs,
struct TALER_DenominationSignature *sigs)
{
unsigned int i;
json_t *jsona;
- struct MAJ_Specification spec[] = {
- MAJ_spec_json ("ev_sigs", &jsona),
- MAJ_spec_end
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_json ("ev_sigs", &jsona),
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -1758,14 +1762,14 @@ refresh_reveal_ok (struct TALER_MINT_RefreshRevealHandle *rrh,
const struct FreshCoin *fc;
struct TALER_DenominationPublicKey *pk;
json_t *jsonai;
- struct GNUNET_CRYPTO_rsa_Signature *blind_sig;
- struct GNUNET_CRYPTO_rsa_Signature *sig;
+ struct GNUNET_CRYPTO_RsaSignature *blind_sig;
+ struct GNUNET_CRYPTO_RsaSignature *sig;
struct TALER_CoinSpendPublicKeyP coin_pub;
struct GNUNET_HashCode coin_hash;
- struct MAJ_Specification spec[] = {
- MAJ_spec_rsa_signature ("ev_sig", &blind_sig),
- MAJ_spec_end
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_rsa_signature ("ev_sig", &blind_sig),
+ GNUNET_JSON_spec_end()
};
fc = &rrh->md->fresh_coins[rrh->noreveal_index][i];
@@ -1774,8 +1778,9 @@ refresh_reveal_ok (struct TALER_MINT_RefreshRevealHandle *rrh,
GNUNET_assert (NULL != jsonai);
if (GNUNET_OK !=
- MAJ_parse_json (jsonai,
- spec))
+ GNUNET_JSON_parse (jsonai,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -1814,14 +1819,14 @@ refresh_reveal_ok (struct TALER_MINT_RefreshRevealHandle *rrh,
* Function called when we're done processing the
* HTTP /refresh/reveal request.
*
- * @param cls the `struct TALER_MINT_RefreshHandle`
+ * @param cls the `struct TALER_EXCHANGE_RefreshHandle`
* @param eh the curl request handle
*/
static void
handle_refresh_reveal_finished (void *cls,
CURL *eh)
{
- struct TALER_MINT_RefreshRevealHandle *rrh = cls;
+ struct TALER_EXCHANGE_RefreshRevealHandle *rrh = cls;
long response_code;
json_t *json;
@@ -1865,11 +1870,11 @@ handle_refresh_reveal_finished (void *cls,
}
break;
case MHD_HTTP_BAD_REQUEST:
- /* This should never happen, either us or the mint is buggy
+ /* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
case MHD_HTTP_CONFLICT:
- /* Nothing really to verify, mint says our reveal is inconsitent
+ /* Nothing really to verify, exchange says our reveal is inconsitent
with our commitment, so either side is buggy; we
should pass the JSON reply to the application */
break;
@@ -1892,12 +1897,12 @@ handle_refresh_reveal_finished (void *cls,
0, NULL, NULL,
json);
json_decref (json);
- TALER_MINT_refresh_reveal_cancel (rrh);
+ TALER_EXCHANGE_refresh_reveal_cancel (rrh);
}
/**
- * Submit a /refresh/reval request to the mint and get the mint's
+ * Submit a /refresh/reval request to the exchange and get the exchange's
* response.
*
* This API is typically used by a wallet. Note that to ensure that
@@ -1905,39 +1910,39 @@ handle_refresh_reveal_finished (void *cls,
* arguments should have been committed to persistent storage
* prior to calling this function.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param refresh_data_length size of the @a refresh_data (returned
- * in the `res_size` argument from #TALER_MINT_refresh_prepare())
+ * in the `res_size` argument from #TALER_EXCHANGE_refresh_prepare())
* @param refresh_data the refresh data as returned from
- #TALER_MINT_refresh_prepare())
- * @param noreveal_index response from the mint to the
- * #TALER_MINT_refresh_melt() invocation
+ #TALER_EXCHANGE_refresh_prepare())
+ * @param noreveal_index response from the exchange to the
+ * #TALER_EXCHANGE_refresh_melt() invocation
* @param reveal_cb the callback to call with the final result of the
* refresh operation
* @param reveal_cb_cls closure for the above callback
* @return a handle for this request; NULL if the argument was invalid.
* In this case, neither callback will be called.
*/
-struct TALER_MINT_RefreshRevealHandle *
-TALER_MINT_refresh_reveal (struct TALER_MINT_Handle *mint,
+struct TALER_EXCHANGE_RefreshRevealHandle *
+TALER_EXCHANGE_refresh_reveal (struct TALER_EXCHANGE_Handle *exchange,
size_t refresh_data_length,
const char *refresh_data,
uint16_t noreveal_index,
- TALER_MINT_RefreshRevealCallback reveal_cb,
+ TALER_EXCHANGE_RefreshRevealCallback reveal_cb,
void *reveal_cb_cls)
{
- struct TALER_MINT_RefreshRevealHandle *rrh;
+ struct TALER_EXCHANGE_RefreshRevealHandle *rrh;
json_t *transfer_privs;
json_t *reveal_obj;
json_t *tmp;
CURL *eh;
- struct TALER_MINT_Context *ctx;
+ struct TALER_EXCHANGE_Context *ctx;
struct MeltData *md;
unsigned int i;
unsigned int j;
if (GNUNET_YES !=
- MAH_handle_is_ready (mint))
+ MAH_handle_is_ready (exchange))
{
GNUNET_break (0);
return NULL;
@@ -1953,7 +1958,7 @@ TALER_MINT_refresh_reveal (struct TALER_MINT_Handle *mint,
{
/* We check this here, as it would be really bad to below just
disclose all the transfer keys. Note that this error should
- have been caught way earlier when the mint replied, but maybe
+ have been caught way earlier when the exchange replied, but maybe
we had some internal corruption that changed the value... */
GNUNET_break (0);
return NULL;
@@ -1975,7 +1980,7 @@ TALER_MINT_refresh_reveal (struct TALER_MINT_Handle *mint,
const struct MeltedCoin *mc = &md->melted_coins[i];
json_array_append (tmp,
- TALER_json_from_data (&mc->transfer_priv[j],
+ GNUNET_JSON_from_data (&mc->transfer_priv[j],
sizeof (struct TALER_TransferPrivateKeyP)));
}
json_array_append (transfer_privs,
@@ -1985,19 +1990,19 @@ TALER_MINT_refresh_reveal (struct TALER_MINT_Handle *mint,
/* build main JSON request */
reveal_obj = json_pack ("{s:o, s:o}",
"session_hash",
- TALER_json_from_data (&md->melt_session_hash,
+ GNUNET_JSON_from_data (&md->melt_session_hash,
sizeof (struct GNUNET_HashCode)),
"transfer_privs",
transfer_privs);
/* finally, we can actually issue the request */
- rrh = GNUNET_new (struct TALER_MINT_RefreshRevealHandle);
- rrh->mint = mint;
+ rrh = GNUNET_new (struct TALER_EXCHANGE_RefreshRevealHandle);
+ rrh->exchange = exchange;
rrh->noreveal_index = noreveal_index;
rrh->reveal_cb = reveal_cb;
rrh->reveal_cb_cls = reveal_cb_cls;
rrh->md = md;
- rrh->url = MAH_path_to_url (rrh->mint,
+ rrh->url = MAH_path_to_url (rrh->exchange,
"/refresh/reveal");
eh = curl_easy_init ();
@@ -2025,7 +2030,7 @@ TALER_MINT_refresh_reveal (struct TALER_MINT_Handle *mint,
curl_easy_setopt (eh,
CURLOPT_WRITEDATA,
&rrh->db));
- ctx = MAH_handle_to_context (rrh->mint);
+ ctx = MAH_handle_to_context (rrh->exchange);
rrh->job = MAC_job_add (ctx,
eh,
GNUNET_YES,
@@ -2042,7 +2047,7 @@ TALER_MINT_refresh_reveal (struct TALER_MINT_Handle *mint,
* @param rrh the refresh reval handle
*/
void
-TALER_MINT_refresh_reveal_cancel (struct TALER_MINT_RefreshRevealHandle *rrh)
+TALER_EXCHANGE_refresh_reveal_cancel (struct TALER_EXCHANGE_RefreshRevealHandle *rrh)
{
if (NULL != rrh->job)
{
@@ -2058,4 +2063,4 @@ TALER_MINT_refresh_reveal_cancel (struct TALER_MINT_RefreshRevealHandle *rrh)
}
-/* end of mint_api_refresh.c */
+/* end of exchange_api_refresh.c */
diff --git a/src/mint-lib/mint_api_refresh_link.c b/src/exchange-lib/exchange_api_refresh_link.c
similarity index 77%
rename from src/mint-lib/mint_api_refresh_link.c
rename to src/exchange-lib/exchange_api_refresh_link.c
index dcd2326ca..8bb40d7f4 100644
--- a/src/mint-lib/mint_api_refresh_link.c
+++ b/src/exchange-lib/exchange_api_refresh_link.c
@@ -15,32 +15,31 @@
*/
/**
- * @file mint-lib/mint_api_refresh_link.c
- * @brief Implementation of the /refresh/link request of the mint's HTTP API
+ * @file exchange-lib/exchange_api_refresh_link.c
+ * @brief Implementation of the /refresh/link request of the exchange's HTTP API
* @author Christian Grothoff
*/
#include "platform.h"
#include
-#include
#include /* just for HTTP status codes */
#include
-#include "taler_mint_service.h"
-#include "mint_api_json.h"
-#include "mint_api_context.h"
-#include "mint_api_handle.h"
+#include "taler_exchange_service.h"
+#include "taler_json_lib.h"
+#include "exchange_api_context.h"
+#include "exchange_api_handle.h"
#include "taler_signatures.h"
/**
* @brief A /refresh/link Handle
*/
-struct TALER_MINT_RefreshLinkHandle
+struct TALER_EXCHANGE_RefreshLinkHandle
{
/**
- * The connection to mint this request handle will use
+ * The connection to exchange this request handle will use
*/
- struct TALER_MINT_Handle *mint;
+ struct TALER_EXCHANGE_Handle *exchange;
/**
* The url for this request.
@@ -55,7 +54,7 @@ struct TALER_MINT_RefreshLinkHandle
/**
* Function to call with the result.
*/
- TALER_MINT_RefreshLinkCallback link_cb;
+ TALER_EXCHANGE_RefreshLinkCallback link_cb;
/**
* Closure for @e cb.
@@ -89,7 +88,7 @@ struct TALER_MINT_RefreshLinkHandle
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
static int
-parse_refresh_link_coin (const struct TALER_MINT_RefreshLinkHandle *rlh,
+parse_refresh_link_coin (const struct TALER_EXCHANGE_RefreshLinkHandle *rlh,
json_t *json,
const struct TALER_TransferPublicKeyP *trans_pub,
const struct TALER_EncryptedLinkSecretP *secret_enc,
@@ -99,13 +98,13 @@ parse_refresh_link_coin (const struct TALER_MINT_RefreshLinkHandle *rlh,
{
void *link_enc;
size_t link_enc_size;
- struct GNUNET_CRYPTO_rsa_Signature *bsig;
- struct GNUNET_CRYPTO_rsa_PublicKey *rpub;
- struct MAJ_Specification spec[] = {
- MAJ_spec_varsize ("link_enc", &link_enc, &link_enc_size),
- MAJ_spec_rsa_public_key ("denom_pub", &rpub),
- MAJ_spec_rsa_signature ("ev_sig", &bsig),
- MAJ_spec_end
+ struct GNUNET_CRYPTO_RsaSignature *bsig;
+ struct GNUNET_CRYPTO_RsaPublicKey *rpub;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_varsize ("link_enc", &link_enc, &link_enc_size),
+ GNUNET_JSON_spec_rsa_public_key ("denom_pub", &rpub),
+ GNUNET_JSON_spec_rsa_signature ("ev_sig", &bsig),
+ GNUNET_JSON_spec_end()
};
struct TALER_RefreshLinkEncrypted *rle;
struct TALER_RefreshLinkDecrypted *rld;
@@ -113,8 +112,9 @@ parse_refresh_link_coin (const struct TALER_MINT_RefreshLinkHandle *rlh,
/* parse reply */
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -126,7 +126,7 @@ parse_refresh_link_coin (const struct TALER_MINT_RefreshLinkHandle *rlh,
if (NULL == rle)
{
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
@@ -136,7 +136,7 @@ parse_refresh_link_coin (const struct TALER_MINT_RefreshLinkHandle *rlh,
&secret))
{
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
rld = TALER_refresh_decrypt (rle,
@@ -144,7 +144,7 @@ parse_refresh_link_coin (const struct TALER_MINT_RefreshLinkHandle *rlh,
if (NULL == rld)
{
GNUNET_break_op (0);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
@@ -158,7 +158,7 @@ parse_refresh_link_coin (const struct TALER_MINT_RefreshLinkHandle *rlh,
/* clean up */
GNUNET_free (rld);
pub->rsa_public_key = GNUNET_CRYPTO_rsa_public_key_dup (rpub);
- MAJ_parse_free (spec);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_OK;
}
@@ -172,7 +172,7 @@ parse_refresh_link_coin (const struct TALER_MINT_RefreshLinkHandle *rlh,
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
static int
-parse_refresh_link_ok (struct TALER_MINT_RefreshLinkHandle *rlh,
+parse_refresh_link_ok (struct TALER_EXCHANGE_RefreshLinkHandle *rlh,
json_t *json)
{
unsigned int session;
@@ -199,15 +199,16 @@ parse_refresh_link_ok (struct TALER_MINT_RefreshLinkHandle *rlh,
for (session=0;sessionmint = mint;
+ rlh = GNUNET_new (struct TALER_EXCHANGE_RefreshLinkHandle);
+ rlh->exchange = exchange;
rlh->link_cb = link_cb;
rlh->link_cb_cls = link_cb_cls;
rlh->coin_priv = *coin_priv;
- rlh->url = MAH_path_to_url (mint, arg_str);
+ rlh->url = MAH_path_to_url (exchange, arg_str);
GNUNET_free (arg_str);
eh = curl_easy_init ();
@@ -449,7 +451,7 @@ TALER_MINT_refresh_link (struct TALER_MINT_Handle *mint,
curl_easy_setopt (eh,
CURLOPT_WRITEDATA,
&rlh->db));
- ctx = MAH_handle_to_context (mint);
+ ctx = MAH_handle_to_context (exchange);
rlh->job = MAC_job_add (ctx,
eh,
GNUNET_YES,
@@ -466,7 +468,7 @@ TALER_MINT_refresh_link (struct TALER_MINT_Handle *mint,
* @param rlh the refresh link handle
*/
void
-TALER_MINT_refresh_link_cancel (struct TALER_MINT_RefreshLinkHandle *rlh)
+TALER_EXCHANGE_refresh_link_cancel (struct TALER_EXCHANGE_RefreshLinkHandle *rlh)
{
if (NULL != rlh->job)
{
@@ -479,4 +481,4 @@ TALER_MINT_refresh_link_cancel (struct TALER_MINT_RefreshLinkHandle *rlh)
}
-/* end of mint_api_refresh_link.c */
+/* end of exchange_api_refresh_link.c */
diff --git a/src/mint-lib/mint_api_reserve.c b/src/exchange-lib/exchange_api_reserve.c
similarity index 79%
rename from src/mint-lib/mint_api_reserve.c
rename to src/exchange-lib/exchange_api_reserve.c
index 1f8140cff..8c3663244 100644
--- a/src/mint-lib/mint_api_reserve.c
+++ b/src/exchange-lib/exchange_api_reserve.c
@@ -15,8 +15,8 @@
*/
/**
- * @file mint-lib/mint_api_reserve.c
- * @brief Implementation of the /reserve requests of the mint's HTTP API
+ * @file exchange-lib/exchange_api_reserve.c
+ * @brief Implementation of the /reserve requests of the exchange's HTTP API
* @author Christian Grothoff
*/
#include "platform.h"
@@ -24,10 +24,11 @@
#include
#include /* just for HTTP status codes */
#include
-#include "taler_mint_service.h"
-#include "mint_api_json.h"
-#include "mint_api_context.h"
-#include "mint_api_handle.h"
+#include
+#include "taler_exchange_service.h"
+#include "taler_json_lib.h"
+#include "exchange_api_context.h"
+#include "exchange_api_handle.h"
#include "taler_signatures.h"
@@ -36,13 +37,13 @@
/**
* @brief A Withdraw Status Handle
*/
-struct TALER_MINT_ReserveStatusHandle
+struct TALER_EXCHANGE_ReserveStatusHandle
{
/**
- * The connection to mint this request handle will use
+ * The connection to exchange this request handle will use
*/
- struct TALER_MINT_Handle *mint;
+ struct TALER_EXCHANGE_Handle *exchange;
/**
* The url for this request.
@@ -57,7 +58,7 @@ struct TALER_MINT_ReserveStatusHandle
/**
* Function to call with the result.
*/
- TALER_MINT_ReserveStatusResultCallback cb;
+ TALER_EXCHANGE_ReserveStatusResultCallback cb;
/**
* Public key of the reserve we are querying.
@@ -98,7 +99,7 @@ parse_reserve_history (json_t *history,
const char *currency,
struct TALER_Amount *balance,
unsigned int history_length,
- struct TALER_MINT_ReserveHistory *rhistory)
+ struct TALER_EXCHANGE_ReserveHistory *rhistory)
{
struct GNUNET_HashCode uuid[history_length];
unsigned int uuid_off;
@@ -116,19 +117,20 @@ parse_reserve_history (json_t *history,
json_t *transaction;
struct TALER_Amount amount;
const char *type;
- struct MAJ_Specification hist_spec[] = {
- MAJ_spec_string ("type", &type),
- MAJ_spec_amount ("amount",
+ struct GNUNET_JSON_Specification hist_spec[] = {
+ GNUNET_JSON_spec_string ("type", &type),
+ TALER_JSON_spec_amount ("amount",
&amount),
/* 'wire' and 'signature' are optional depending on 'type'! */
- MAJ_spec_end
+ GNUNET_JSON_spec_end()
};
transaction = json_array_get (history,
off);
if (GNUNET_OK !=
- MAJ_parse_json (transaction,
- hist_spec))
+ GNUNET_JSON_parse (transaction,
+ hist_spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -140,13 +142,13 @@ parse_reserve_history (json_t *history,
{
json_t *wire;
- rhistory[off].type = TALER_MINT_RTT_DEPOSIT;
+ rhistory[off].type = TALER_EXCHANGE_RTT_DEPOSIT;
if (GNUNET_OK !=
TALER_amount_add (&total_in,
&total_in,
&amount))
{
- /* overflow in history already!? inconceivable! Bad mint! */
+ /* overflow in history already!? inconceivable! Bad exchange! */
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
@@ -170,19 +172,20 @@ parse_reserve_history (json_t *history,
struct TALER_ReserveSignatureP sig;
struct TALER_WithdrawRequestPS withdraw_purpose;
struct TALER_Amount amount_from_purpose;
- struct MAJ_Specification withdraw_spec[] = {
- MAJ_spec_fixed_auto ("signature",
+ struct GNUNET_JSON_Specification withdraw_spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("signature",
&sig),
- MAJ_spec_fixed_auto ("details",
+ GNUNET_JSON_spec_fixed_auto ("details",
&withdraw_purpose),
- MAJ_spec_end
+ GNUNET_JSON_spec_end()
};
unsigned int i;
- rhistory[off].type = TALER_MINT_RTT_WITHDRAWAL;
+ rhistory[off].type = TALER_EXCHANGE_RTT_WITHDRAWAL;
if (GNUNET_OK !=
- MAJ_parse_json (transaction,
- withdraw_spec))
+ GNUNET_JSON_parse (transaction,
+ withdraw_spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -195,7 +198,7 @@ parse_reserve_history (json_t *history,
&reserve_pub->eddsa_pub))
{
GNUNET_break_op (0);
- MAJ_parse_free (withdraw_spec);
+ GNUNET_JSON_parse_free (withdraw_spec);
return GNUNET_SYSERR;
}
TALER_amount_ntoh (&amount_from_purpose,
@@ -204,13 +207,13 @@ parse_reserve_history (json_t *history,
&amount_from_purpose))
{
GNUNET_break_op (0);
- MAJ_parse_free (withdraw_spec);
+ GNUNET_JSON_parse_free (withdraw_spec);
return GNUNET_SYSERR;
}
rhistory[off].details.out_authorization_sig = json_object_get (transaction,
"signature");
/* Check check that the same withdraw transaction
- isn't listed twice by the mint. We use the
+ isn't listed twice by the exchange. We use the
"uuid" array to remember the hashes of all
purposes, and compare the hashes to find
duplicates. */
@@ -224,7 +227,7 @@ parse_reserve_history (json_t *history,
sizeof (struct GNUNET_HashCode)))
{
GNUNET_break_op (0);
- MAJ_parse_free (withdraw_spec);
+ GNUNET_JSON_parse_free (withdraw_spec);
return GNUNET_SYSERR;
}
}
@@ -235,9 +238,9 @@ parse_reserve_history (json_t *history,
&total_out,
&amount))
{
- /* overflow in history already!? inconceivable! Bad mint! */
+ /* overflow in history already!? inconceivable! Bad exchange! */
GNUNET_break_op (0);
- MAJ_parse_free (withdraw_spec);
+ GNUNET_JSON_parse_free (withdraw_spec);
return GNUNET_SYSERR;
}
/* end type==WITHDRAW */
@@ -256,7 +259,7 @@ parse_reserve_history (json_t *history,
&total_in,
&total_out))
{
- /* total_in < total_out, why did the mint ever allow this!? */
+ /* total_in < total_out, why did the exchange ever allow this!? */
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
@@ -269,14 +272,14 @@ parse_reserve_history (json_t *history,
* Function called when we're done processing the
* HTTP /reserve/status request.
*
- * @param cls the `struct TALER_MINT_ReserveStatusHandle`
+ * @param cls the `struct TALER_EXCHANGE_ReserveStatusHandle`
* @param eh curl handle of the request that finished
*/
static void
handle_reserve_status_finished (void *cls,
CURL *eh)
{
- struct TALER_MINT_ReserveStatusHandle *wsh = cls;
+ struct TALER_EXCHANGE_ReserveStatusHandle *wsh = cls;
long response_code;
json_t *json;
@@ -295,14 +298,15 @@ handle_reserve_status_finished (void *cls,
unsigned int len;
struct TALER_Amount balance;
struct TALER_Amount balance_from_history;
- struct MAJ_Specification spec[] = {
- MAJ_spec_amount ("balance", &balance),
- MAJ_spec_end
+ struct GNUNET_JSON_Specification spec[] = {
+ TALER_JSON_spec_amount ("balance", &balance),
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
response_code = 0;
@@ -318,7 +322,7 @@ handle_reserve_status_finished (void *cls,
}
len = json_array_size (history);
{
- struct TALER_MINT_ReserveHistory rhistory[len];
+ struct TALER_EXCHANGE_ReserveHistory rhistory[len];
if (GNUNET_OK !=
parse_reserve_history (history,
@@ -336,7 +340,7 @@ handle_reserve_status_finished (void *cls,
TALER_amount_cmp (&balance_from_history,
&balance))
{
- /* mint cannot add up balances!? */
+ /* exchange cannot add up balances!? */
GNUNET_break_op (0);
response_code = 0;
break;
@@ -352,7 +356,7 @@ handle_reserve_status_finished (void *cls,
}
break;
case MHD_HTTP_BAD_REQUEST:
- /* This should never happen, either us or the mint is buggy
+ /* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
case MHD_HTTP_NOT_FOUND:
@@ -379,40 +383,40 @@ handle_reserve_status_finished (void *cls,
NULL,
0, NULL);
json_decref (json);
- TALER_MINT_reserve_status_cancel (wsh);
+ TALER_EXCHANGE_reserve_status_cancel (wsh);
}
/**
* Submit a request to obtain the transaction history of a reserve
- * from the mint. Note that while we return the full response to the
+ * from the exchange. Note that while we return the full response to the
* caller for further processing, we do already verify that the
* response is well-formed (i.e. that signatures included in the
- * response are all valid and add up to the balance). If the mint's
+ * response are all valid and add up to the balance). If the exchange's
* reply is not well-formed, we return an HTTP status code of zero to
* @a cb.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param reserve_pub public key of the reserve to inspect
* @param cb the callback to call when a reply for this request is available
* @param cb_cls closure for the above callback
* @return a handle for this request; NULL if the inputs are invalid (i.e.
* signatures fail to verify). In this case, the callback is not called.
*/
-struct TALER_MINT_ReserveStatusHandle *
-TALER_MINT_reserve_status (struct TALER_MINT_Handle *mint,
+struct TALER_EXCHANGE_ReserveStatusHandle *
+TALER_EXCHANGE_reserve_status (struct TALER_EXCHANGE_Handle *exchange,
const struct TALER_ReservePublicKeyP *reserve_pub,
- TALER_MINT_ReserveStatusResultCallback cb,
+ TALER_EXCHANGE_ReserveStatusResultCallback cb,
void *cb_cls)
{
- struct TALER_MINT_ReserveStatusHandle *wsh;
- struct TALER_MINT_Context *ctx;
+ struct TALER_EXCHANGE_ReserveStatusHandle *wsh;
+ struct TALER_EXCHANGE_Context *ctx;
CURL *eh;
char *pub_str;
char *arg_str;
if (GNUNET_YES !=
- MAH_handle_is_ready (mint))
+ MAH_handle_is_ready (exchange))
{
GNUNET_break (0);
return NULL;
@@ -423,12 +427,12 @@ TALER_MINT_reserve_status (struct TALER_MINT_Handle *mint,
"/reserve/status?reserve_pub=%s",
pub_str);
GNUNET_free (pub_str);
- wsh = GNUNET_new (struct TALER_MINT_ReserveStatusHandle);
- wsh->mint = mint;
+ wsh = GNUNET_new (struct TALER_EXCHANGE_ReserveStatusHandle);
+ wsh->exchange = exchange;
wsh->cb = cb;
wsh->cb_cls = cb_cls;
wsh->reserve_pub = *reserve_pub;
- wsh->url = MAH_path_to_url (mint,
+ wsh->url = MAH_path_to_url (exchange,
arg_str);
GNUNET_free (arg_str);
@@ -445,7 +449,7 @@ TALER_MINT_reserve_status (struct TALER_MINT_Handle *mint,
curl_easy_setopt (eh,
CURLOPT_WRITEDATA,
&wsh->db));
- ctx = MAH_handle_to_context (mint);
+ ctx = MAH_handle_to_context (exchange);
wsh->job = MAC_job_add (ctx,
eh,
GNUNET_NO,
@@ -462,7 +466,7 @@ TALER_MINT_reserve_status (struct TALER_MINT_Handle *mint,
* @param wsh the withdraw status request handle
*/
void
-TALER_MINT_reserve_status_cancel (struct TALER_MINT_ReserveStatusHandle *wsh)
+TALER_EXCHANGE_reserve_status_cancel (struct TALER_EXCHANGE_ReserveStatusHandle *wsh)
{
if (NULL != wsh->job)
{
@@ -480,13 +484,13 @@ TALER_MINT_reserve_status_cancel (struct TALER_MINT_ReserveStatusHandle *wsh)
/**
* @brief A Withdraw Sign Handle
*/
-struct TALER_MINT_ReserveWithdrawHandle
+struct TALER_EXCHANGE_ReserveWithdrawHandle
{
/**
- * The connection to mint this request handle will use
+ * The connection to exchange this request handle will use
*/
- struct TALER_MINT_Handle *mint;
+ struct TALER_EXCHANGE_Handle *exchange;
/**
* The url for this request.
@@ -506,7 +510,7 @@ struct TALER_MINT_ReserveWithdrawHandle
/**
* Function to call with the result.
*/
- TALER_MINT_ReserveWithdrawResultCallback cb;
+ TALER_EXCHANGE_ReserveWithdrawResultCallback cb;
/**
* Key used to blind the value.
@@ -516,7 +520,7 @@ struct TALER_MINT_ReserveWithdrawHandle
/**
* Denomination key we are withdrawing.
*/
- const struct TALER_MINT_DenomPublicKey *pk;
+ const struct TALER_EXCHANGE_DenomPublicKey *pk;
/**
* Closure for @a cb.
@@ -544,7 +548,7 @@ struct TALER_MINT_ReserveWithdrawHandle
/**
* We got a 200 OK response for the /reserve/withdraw operation.
* Extract the coin's signature and return it to the caller.
- * The signature we get from the mint is for the blinded value.
+ * The signature we get from the exchange is for the blinded value.
* Thus, we first must unblind it and then should verify its
* validity against our coin's hash.
*
@@ -552,24 +556,25 @@ struct TALER_MINT_ReserveWithdrawHandle
* to the application via the callback.
*
* @param wsh operation handle
- * @param json reply from the mint
+ * @param json reply from the exchange
* @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
*/
static int
-reserve_withdraw_ok (struct TALER_MINT_ReserveWithdrawHandle *wsh,
+reserve_withdraw_ok (struct TALER_EXCHANGE_ReserveWithdrawHandle *wsh,
json_t *json)
{
- struct GNUNET_CRYPTO_rsa_Signature *blind_sig;
- struct GNUNET_CRYPTO_rsa_Signature *sig;
+ struct GNUNET_CRYPTO_RsaSignature *blind_sig;
+ struct GNUNET_CRYPTO_RsaSignature *sig;
struct TALER_DenominationSignature dsig;
- struct MAJ_Specification spec[] = {
- MAJ_spec_rsa_signature ("ev_sig", &blind_sig),
- MAJ_spec_end
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_rsa_signature ("ev_sig", &blind_sig),
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -605,15 +610,15 @@ reserve_withdraw_ok (struct TALER_MINT_ReserveWithdrawHandle *wsh,
* Check the signatures on the withdraw transactions in the provided
* history and that the balances add up. We don't do anything directly
* with the information, as the JSON will be returned to the application.
- * However, our job is ensuring that the mint followed the protocol, and
+ * However, our job is ensuring that the exchange followed the protocol, and
* this in particular means checking all of the signatures in the history.
*
* @param wsh operation handle
- * @param json reply from the mint
+ * @param json reply from the exchange
* @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
*/
static int
-reserve_withdraw_payment_required (struct TALER_MINT_ReserveWithdrawHandle *wsh,
+reserve_withdraw_payment_required (struct TALER_EXCHANGE_ReserveWithdrawHandle *wsh,
json_t *json)
{
struct TALER_Amount balance;
@@ -621,14 +626,15 @@ reserve_withdraw_payment_required (struct TALER_MINT_ReserveWithdrawHandle *wsh,
struct TALER_Amount requested_amount;
json_t *history;
size_t len;
- struct MAJ_Specification spec[] = {
- MAJ_spec_amount ("balance", &balance),
- MAJ_spec_end
+ struct GNUNET_JSON_Specification spec[] = {
+ TALER_JSON_spec_amount ("balance", &balance),
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -645,7 +651,7 @@ reserve_withdraw_payment_required (struct TALER_MINT_ReserveWithdrawHandle *wsh,
total incoming and outgoing amounts */
len = json_array_size (history);
{
- struct TALER_MINT_ReserveHistory rhistory[len];
+ struct TALER_EXCHANGE_ReserveHistory rhistory[len];
if (GNUNET_OK !=
parse_reserve_history (history,
@@ -664,7 +670,7 @@ reserve_withdraw_payment_required (struct TALER_MINT_ReserveWithdrawHandle *wsh,
TALER_amount_cmp (&balance_from_history,
&balance))
{
- /* mint cannot add up balances!? */
+ /* exchange cannot add up balances!? */
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
@@ -695,14 +701,14 @@ reserve_withdraw_payment_required (struct TALER_MINT_ReserveWithdrawHandle *wsh,
* Function called when we're done processing the
* HTTP /reserve/withdraw request.
*
- * @param cls the `struct TALER_MINT_ReserveWithdrawHandle`
+ * @param cls the `struct TALER_EXCHANGE_ReserveWithdrawHandle`
* @param eh curl handle of the request that finished
*/
static void
handle_reserve_withdraw_finished (void *cls,
CURL *eh)
{
- struct TALER_MINT_ReserveWithdrawHandle *wsh = cls;
+ struct TALER_EXCHANGE_ReserveWithdrawHandle *wsh = cls;
long response_code;
json_t *json;
@@ -724,11 +730,11 @@ handle_reserve_withdraw_finished (void *cls,
}
break;
case MHD_HTTP_BAD_REQUEST:
- /* This should never happen, either us or the mint is buggy
+ /* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
case MHD_HTTP_PAYMENT_REQUIRED:
- /* The mint says that the reserve has insufficient funds;
+ /* The exchange says that the reserve has insufficient funds;
check the signatures in the history... */
if (GNUNET_OK !=
reserve_withdraw_payment_required (wsh,
@@ -740,12 +746,12 @@ handle_reserve_withdraw_finished (void *cls,
break;
case MHD_HTTP_UNAUTHORIZED:
GNUNET_break (0);
- /* Nothing really to verify, mint says one of the signatures is
+ /* Nothing really to verify, exchange says one of the signatures is
invalid; as we checked them, this should never happen, we
should pass the JSON reply to the application */
break;
case MHD_HTTP_NOT_FOUND:
- /* Nothing really to verify, the mint basically just says
+ /* Nothing really to verify, the exchange basically just says
that it doesn't know this reserve. Can happen if we
query before the wire transfer went through.
We should simply pass the JSON reply to the application. */
@@ -769,18 +775,18 @@ handle_reserve_withdraw_finished (void *cls,
NULL,
json);
json_decref (json);
- TALER_MINT_reserve_withdraw_cancel (wsh);
+ TALER_EXCHANGE_reserve_withdraw_cancel (wsh);
}
/**
- * Withdraw a coin from the mint using a /reserve/withdraw request. Note
+ * Withdraw a coin from the exchange using a /reserve/withdraw request. Note
* that to ensure that no money is lost in case of hardware failures,
* the caller must have committed (most of) the arguments to disk
* before calling, and be ready to repeat the request with the same
* arguments in case of failures.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param pk kind of coin to create
* @param reserve_priv private key of the reserve to withdraw from
* @param coin_priv where to store the coin's private key,
@@ -790,31 +796,31 @@ handle_reserve_withdraw_finished (void *cls,
* @param res_cb the callback to call when the final result for this request is available
* @param res_cb_cls closure for the above callback
* @return #GNUNET_OK on success, #GNUNET_SYSERR
- * if the inputs are invalid (i.e. denomination key not with this mint).
+ * if the inputs are invalid (i.e. denomination key not with this exchange).
* In this case, the callback is not called.
*/
-struct TALER_MINT_ReserveWithdrawHandle *
-TALER_MINT_reserve_withdraw (struct TALER_MINT_Handle *mint,
- const struct TALER_MINT_DenomPublicKey *pk,
+struct TALER_EXCHANGE_ReserveWithdrawHandle *
+TALER_EXCHANGE_reserve_withdraw (struct TALER_EXCHANGE_Handle *exchange,
+ const struct TALER_EXCHANGE_DenomPublicKey *pk,
const struct TALER_ReservePrivateKeyP *reserve_priv,
const struct TALER_CoinSpendPrivateKeyP *coin_priv,
const struct TALER_DenominationBlindingKey *blinding_key,
- TALER_MINT_ReserveWithdrawResultCallback res_cb,
+ TALER_EXCHANGE_ReserveWithdrawResultCallback res_cb,
void *res_cb_cls)
{
- struct TALER_MINT_ReserveWithdrawHandle *wsh;
+ struct TALER_EXCHANGE_ReserveWithdrawHandle *wsh;
struct TALER_WithdrawRequestPS req;
struct TALER_ReserveSignatureP reserve_sig;
struct TALER_CoinSpendPublicKeyP coin_pub;
- struct TALER_MINT_Context *ctx;
+ struct TALER_EXCHANGE_Context *ctx;
struct TALER_Amount amount_with_fee;
char *coin_ev;
size_t coin_ev_size;
json_t *withdraw_obj;
CURL *eh;
- wsh = GNUNET_new (struct TALER_MINT_ReserveWithdrawHandle);
- wsh->mint = mint;
+ wsh = GNUNET_new (struct TALER_EXCHANGE_ReserveWithdrawHandle);
+ wsh->exchange = exchange;
wsh->cb = res_cb;
wsh->cb_cls = res_cb_cls;
wsh->pk = pk;
@@ -838,7 +844,7 @@ TALER_MINT_reserve_withdraw (struct TALER_MINT_Handle *mint,
&pk->fee_withdraw,
&pk->value))
{
- /* mint gave us denomination keys that overflow like this!? */
+ /* exchange gave us denomination keys that overflow like this!? */
GNUNET_break_op (0);
GNUNET_free (coin_ev);
GNUNET_free (wsh);
@@ -859,17 +865,17 @@ TALER_MINT_reserve_withdraw (struct TALER_MINT_Handle *mint,
&reserve_sig.eddsa_signature));
withdraw_obj = json_pack ("{s:o, s:o," /* denom_pub and coin_ev */
" s:o, s:o}",/* reserve_pub and reserve_sig */
- "denom_pub", TALER_json_from_rsa_public_key (pk->key.rsa_public_key),
- "coin_ev", TALER_json_from_data (coin_ev,
+ "denom_pub", GNUNET_JSON_from_rsa_public_key (pk->key.rsa_public_key),
+ "coin_ev", GNUNET_JSON_from_data (coin_ev,
coin_ev_size),
- "reserve_pub", TALER_json_from_data (&wsh->reserve_pub,
+ "reserve_pub", GNUNET_JSON_from_data (&wsh->reserve_pub,
sizeof (struct TALER_ReservePublicKeyP)),
- "reserve_sig", TALER_json_from_data (&reserve_sig,
+ "reserve_sig", GNUNET_JSON_from_data (&reserve_sig,
sizeof (reserve_sig)));
GNUNET_free (coin_ev);
wsh->blinding_key = blinding_key;
- wsh->url = MAH_path_to_url (mint, "/reserve/withdraw");
+ wsh->url = MAH_path_to_url (exchange, "/reserve/withdraw");
eh = curl_easy_init ();
GNUNET_assert (NULL != (wsh->json_enc =
@@ -896,7 +902,7 @@ TALER_MINT_reserve_withdraw (struct TALER_MINT_Handle *mint,
curl_easy_setopt (eh,
CURLOPT_WRITEDATA,
&wsh->db));
- ctx = MAH_handle_to_context (mint);
+ ctx = MAH_handle_to_context (exchange);
wsh->job = MAC_job_add (ctx,
eh,
GNUNET_YES,
@@ -913,7 +919,7 @@ TALER_MINT_reserve_withdraw (struct TALER_MINT_Handle *mint,
* @param sign the withdraw sign request handle
*/
void
-TALER_MINT_reserve_withdraw_cancel (struct TALER_MINT_ReserveWithdrawHandle *sign)
+TALER_EXCHANGE_reserve_withdraw_cancel (struct TALER_EXCHANGE_ReserveWithdrawHandle *sign)
{
if (NULL != sign->job)
{
@@ -927,4 +933,4 @@ TALER_MINT_reserve_withdraw_cancel (struct TALER_MINT_ReserveWithdrawHandle *sig
}
-/* end of mint_api_reserve.c */
+/* end of exchange_api_reserve.c */
diff --git a/src/exchange-lib/exchange_api_wire.c b/src/exchange-lib/exchange_api_wire.c
new file mode 100644
index 000000000..0e93a9d20
--- /dev/null
+++ b/src/exchange-lib/exchange_api_wire.c
@@ -0,0 +1,318 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2014, 2015, 2016 Inria and GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+
+*/
+/**
+ * @file exchange-lib/exchange_api_wire.c
+ * @brief Implementation of the /wire request of the exchange's HTTP API
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include
+#include
+#include /* just for HTTP status codes */
+#include
+#include "taler_exchange_service.h"
+#include "taler_json_lib.h"
+#include "taler_wire_plugin.h"
+#include "exchange_api_common.h"
+#include "exchange_api_context.h"
+#include "exchange_api_handle.h"
+
+
+/**
+ * @brief A Wire Handle
+ */
+struct TALER_EXCHANGE_WireHandle
+{
+
+ /**
+ * The connection to exchange this request handle will use
+ */
+ struct TALER_EXCHANGE_Handle *exchange;
+
+ /**
+ * The url for this request.
+ */
+ char *url;
+
+ /**
+ * Handle for the request.
+ */
+ struct MAC_Job *job;
+
+ /**
+ * Function to call with the result.
+ */
+ TALER_EXCHANGE_WireResultCallback cb;
+
+ /**
+ * Closure for @a cb.
+ */
+ void *cb_cls;
+
+ /**
+ * Download buffer
+ */
+ struct MAC_DownloadBuffer db;
+
+ /**
+ * Set to the "methods" JSON array returned by the
+ * /wire request.
+ */
+ json_t *methods;
+
+ /**
+ * Current iteration offset in the @e methods array.
+ */
+ unsigned int methods_off;
+
+};
+
+
+/**
+ * Verify that the signature on the "200 OK" response
+ * for /wire/METHOD from the exchange is valid.
+ *
+ * @param wh wire handle with key material
+ * @param method method to verify the reply for
+ * @param json json reply with the signature
+ * @return #GNUNET_SYSERR if @a json is invalid,
+ * #GNUNET_NO if the method is unknown,
+ * #GNUNET_OK if the json is valid
+ */
+static int
+verify_wire_method_signature_ok (const struct TALER_EXCHANGE_WireHandle *wh,
+ const char *method,
+ json_t *json)
+{
+ const struct TALER_EXCHANGE_Keys *key_state;
+ struct TALER_WIRE_Plugin *plugin;
+ char *lib_name;
+ int ret;
+
+ key_state = TALER_EXCHANGE_get_keys (wh->exchange);
+ (void) GNUNET_asprintf (&lib_name,
+ "libtaler_plugin_wire_%s",
+ method);
+ plugin = GNUNET_PLUGIN_load (lib_name,
+ NULL);
+ if (NULL == plugin)
+ {
+ GNUNET_free (lib_name);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Wire transfer method `%s' not supported\n",
+ method);
+ return GNUNET_NO;
+ }
+ plugin->library_name = lib_name;
+ ret = plugin->wire_validate (plugin->cls,
+ json,
+ &key_state->master_pub);
+ GNUNET_PLUGIN_unload (lib_name,
+ plugin);
+ GNUNET_free (lib_name);
+ return (GNUNET_YES == ret) ? GNUNET_OK : GNUNET_SYSERR;
+}
+
+
+/**
+ * Function called when we're done processing the
+ * HTTP /wire request.
+ *
+ * @param cls the `struct TALER_EXCHANGE_WireHandle`
+ * @param eh the curl request handle
+ */
+static void
+handle_wire_finished (void *cls,
+ CURL *eh)
+{
+ struct TALER_EXCHANGE_WireHandle *wh = cls;
+ long response_code;
+ json_t *json;
+
+ wh->job = NULL;
+ json = MAC_download_get_result (&wh->db,
+ eh,
+ &response_code);
+ switch (response_code)
+ {
+ case 0:
+ break;
+ case MHD_HTTP_OK:
+ {
+ const char *key;
+ json_t *method;
+ json_t *keep;
+ int ret;
+
+ /* We 'keep' methods that we support and that are well-formed;
+ we fail (by setting response_code=0) if any method that we do
+ support fails to verify. */
+ keep = json_object ();
+ json_object_foreach (json, key, method) {
+ ret = verify_wire_method_signature_ok (wh,
+ key,
+ method);
+ if (GNUNET_SYSERR == ret)
+ {
+ /* bogus reply */
+ GNUNET_break_op (0);
+ response_code = 0;
+ }
+ /* GNUNET_NO: not understood by us, simply skip! */
+ if (GNUNET_OK == ret)
+ {
+ /* supported and valid, keep! */
+ json_object_set (keep,
+ key,
+ method);
+ }
+ }
+ if (0 != response_code)
+ {
+ /* all supported methods were valid, use 'keep' for 'json' */
+ json_decref (json);
+ json = keep;
+ break;
+ }
+ else
+ {
+ /* some supported methods were invalid, release 'keep', preserve
+ full 'json' for application-level error handling. */
+ json_decref (keep);
+ }
+ }
+ break;
+ case MHD_HTTP_BAD_REQUEST:
+ /* This should never happen, either us or the exchange is buggy
+ (or API version conflict); just pass JSON reply to the application */
+ break;
+ case MHD_HTTP_NOT_FOUND:
+ /* Nothing really to verify, this should never
+ happen, we should pass the JSON reply to the application */
+ break;
+ case MHD_HTTP_INTERNAL_SERVER_ERROR:
+ /* Server had an internal issue; we should retry, but this API
+ leaves this to the application */
+ break;
+ default:
+ /* unexpected response code */
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unexpected response code %u\n",
+ response_code);
+ GNUNET_break (0);
+ response_code = 0;
+ break;
+ }
+ wh->cb (wh->cb_cls,
+ response_code,
+ json);
+ if (NULL != json)
+ json_decref (json);
+ TALER_EXCHANGE_wire_cancel (wh);
+}
+
+
+/**
+ * Obtain information about a exchange's wire instructions.
+ * A exchange may provide wire instructions for creating
+ * a reserve. The wire instructions also indicate
+ * which wire formats merchants may use with the exchange.
+ * This API is typically used by a wallet for wiring
+ * funds, and possibly by a merchant to determine
+ * supported wire formats.
+ *
+ * Note that while we return the (main) response verbatim to the
+ * caller for further processing, we do already verify that the
+ * response is well-formed (i.e. that signatures included in the
+ * response are all valid). If the exchange's reply is not well-formed,
+ * we return an HTTP status code of zero to @a cb.
+ *
+ * @param exchange the exchange handle; the exchange must be ready to operate
+ * @param wire_cb the callback to call when a reply for this request is available
+ * @param wire_cb_cls closure for the above callback
+ * @return a handle for this request
+ */
+struct TALER_EXCHANGE_WireHandle *
+TALER_EXCHANGE_wire (struct TALER_EXCHANGE_Handle *exchange,
+ TALER_EXCHANGE_WireResultCallback wire_cb,
+ void *wire_cb_cls)
+{
+ struct TALER_EXCHANGE_WireHandle *wh;
+ struct TALER_EXCHANGE_Context *ctx;
+ CURL *eh;
+
+ if (GNUNET_YES !=
+ MAH_handle_is_ready (exchange))
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
+ wh = GNUNET_new (struct TALER_EXCHANGE_WireHandle);
+ wh->exchange = exchange;
+ wh->cb = wire_cb;
+ wh->cb_cls = wire_cb_cls;
+ wh->url = MAH_path_to_url (exchange, "/wire");
+
+ eh = curl_easy_init ();
+ GNUNET_assert (CURLE_OK ==
+ curl_easy_setopt (eh,
+ CURLOPT_URL,
+ wh->url));
+ GNUNET_assert (CURLE_OK ==
+ curl_easy_setopt (eh,
+ CURLOPT_WRITEFUNCTION,
+ &MAC_download_cb));
+ GNUNET_assert (CURLE_OK ==
+ curl_easy_setopt (eh,
+ CURLOPT_WRITEDATA,
+ &wh->db));
+ ctx = MAH_handle_to_context (exchange);
+ wh->job = MAC_job_add (ctx,
+ eh,
+ GNUNET_YES,
+ &handle_wire_finished,
+ wh);
+ return wh;
+}
+
+
+/**
+ * Cancel a wire information request. This function cannot be used
+ * on a request handle if a response is already served for it.
+ *
+ * @param wh the wire information request handle
+ */
+void
+TALER_EXCHANGE_wire_cancel (struct TALER_EXCHANGE_WireHandle *wh)
+{
+ if (NULL != wh->job)
+ {
+ MAC_job_cancel (wh->job);
+ wh->job = NULL;
+ }
+ if (NULL != wh->methods)
+ {
+ json_decref (wh->methods);
+ wh->methods = NULL;
+ }
+ GNUNET_free_non_null (wh->db.buf);
+ GNUNET_free (wh->url);
+ GNUNET_free (wh);
+}
+
+
+/* end of exchange_api_wire.c */
diff --git a/src/mint-lib/mint_api_wire_deposits.c b/src/exchange-lib/exchange_api_wire_deposits.c
similarity index 52%
rename from src/mint-lib/mint_api_wire_deposits.c
rename to src/exchange-lib/exchange_api_wire_deposits.c
index f71c5b696..49a50f640 100644
--- a/src/mint-lib/mint_api_wire_deposits.c
+++ b/src/exchange-lib/exchange_api_wire_deposits.c
@@ -15,8 +15,8 @@
*/
/**
- * @file mint-lib/mint_api_wire_deposits.c
- * @brief Implementation of the /wire/deposits request of the mint's HTTP API
+ * @file exchange-lib/exchange_api_wire_deposits.c
+ * @brief Implementation of the /wire/deposits request of the exchange's HTTP API
* @author Christian Grothoff
*/
#include "platform.h"
@@ -24,24 +24,24 @@
#include
#include /* just for HTTP status codes */
#include
-#include "taler_mint_service.h"
-#include "mint_api_common.h"
-#include "mint_api_json.h"
-#include "mint_api_context.h"
-#include "mint_api_handle.h"
+#include "taler_exchange_service.h"
+#include "exchange_api_common.h"
+#include "taler_json_lib.h"
+#include "exchange_api_context.h"
+#include "exchange_api_handle.h"
#include "taler_signatures.h"
/**
* @brief A /wire/deposits Handle
*/
-struct TALER_MINT_WireDepositsHandle
+struct TALER_EXCHANGE_WireDepositsHandle
{
/**
- * The connection to mint this request handle will use
+ * The connection to exchange this request handle will use
*/
- struct TALER_MINT_Handle *mint;
+ struct TALER_EXCHANGE_Handle *exchange;
/**
* The url for this request.
@@ -56,7 +56,7 @@ struct TALER_MINT_WireDepositsHandle
/**
* Function to call with the result.
*/
- TALER_MINT_WireDepositsCallback cb;
+ TALER_EXCHANGE_WireDepositsCallback cb;
/**
* Closure for @a cb.
@@ -75,14 +75,14 @@ struct TALER_MINT_WireDepositsHandle
* Function called when we're done processing the
* HTTP /wire/deposits request.
*
- * @param cls the `struct TALER_MINT_WireDepositsHandle`
+ * @param cls the `struct TALER_EXCHANGE_WireDepositsHandle`
* @param eh the curl request handle
*/
static void
handle_wire_deposits_finished (void *cls,
CURL *eh)
{
- struct TALER_MINT_WireDepositsHandle *wdh = cls;
+ struct TALER_EXCHANGE_WireDepositsHandle *wdh = cls;
long response_code;
json_t *json;
@@ -101,17 +101,22 @@ handle_wire_deposits_finished (void *cls,
struct TALER_Amount total_amount;
struct TALER_MerchantPublicKeyP merchant_pub;
unsigned int num_details;
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("H_wire", &h_wire),
- MAJ_spec_fixed_auto ("merchant_pub", &merchant_pub),
- MAJ_spec_amount ("total_amount", &total_amount),
- MAJ_spec_json ("details", &details_j),
- MAJ_spec_end
+ struct TALER_ExchangePublicKeyP exchange_pub;
+ struct TALER_ExchangeSignatureP exchange_sig;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("H_wire", &h_wire),
+ GNUNET_JSON_spec_fixed_auto ("exchange_pub", &exchange_pub),
+ GNUNET_JSON_spec_fixed_auto ("exchange_sig", &exchange_sig),
+ GNUNET_JSON_spec_fixed_auto ("merchant_pub", &merchant_pub),
+ TALER_JSON_spec_amount ("total_amount", &total_amount),
+ GNUNET_JSON_spec_json ("details", &details_j),
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
response_code = 0;
@@ -121,28 +126,69 @@ handle_wire_deposits_finished (void *cls,
{
struct TALER_WireDepositDetails details[num_details];
unsigned int i;
+ struct GNUNET_HashContext *hash_context;
+ struct TALER_WireDepositDetailP dd;
+ struct TALER_WireDepositDataPS wdp;
+ hash_context = GNUNET_CRYPTO_hash_context_start ();
for (i=0;ih_contract),
- MAJ_spec_amount ("deposit_value", &detail->coin_value),
- MAJ_spec_amount ("deposit_fee", &detail->coin_fee),
- MAJ_spec_uint64 ("transaction_id", &detail->transaction_id),
- MAJ_spec_fixed_auto ("coin_pub", &detail->coin_pub),
- MAJ_spec_end
+ struct GNUNET_JSON_Specification spec_detail[] = {
+ GNUNET_JSON_spec_fixed_auto ("H_contract", &detail->h_contract),
+ TALER_JSON_spec_amount ("deposit_value", &detail->coin_value),
+ TALER_JSON_spec_amount ("deposit_fee", &detail->coin_fee),
+ GNUNET_JSON_spec_uint64 ("transaction_id", &detail->transaction_id),
+ GNUNET_JSON_spec_fixed_auto ("coin_pub", &detail->coin_pub),
+ GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
- MAJ_parse_json (detail_j,
- spec_detail))
+ GNUNET_JSON_parse (detail_j,
+ spec_detail,
+ NULL, NULL))
{
GNUNET_break_op (0);
response_code = 0;
break;
}
+ /* build up big hash for signature checking later */
+ dd.h_contract = detail->h_contract;
+ dd.transaction_id = GNUNET_htonll (detail->transaction_id);
+ dd.coin_pub = detail->coin_pub;
+ TALER_amount_hton (&dd.deposit_value,
+ &detail->coin_value);
+ TALER_amount_hton (&dd.deposit_fee,
+ &detail->coin_fee);
+ GNUNET_CRYPTO_hash_context_read (hash_context,
+ &dd,
+ sizeof (struct TALER_WireDepositDetailP));
+ }
+ /* Check signature */
+ wdp.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT);
+ wdp.purpose.size = htonl (sizeof (struct TALER_WireDepositDataPS));
+ TALER_amount_hton (&wdp.total,
+ &total_amount);
+ wdp.merchant_pub = merchant_pub;
+ wdp.h_wire = h_wire;
+ GNUNET_CRYPTO_hash_context_finish (hash_context,
+ &wdp.h_details);
+ if ( (0 == response_code /* avoid crypto if things are already wrong */) &&
+ (GNUNET_OK !=
+ TALER_EXCHANGE_test_signing_key (TALER_EXCHANGE_get_keys (wdh->exchange),
+ &exchange_pub)) )
+ {
+ GNUNET_break_op (0);
+ response_code = 0;
+ }
+ if ( (0 == response_code /* avoid crypto if things are already wrong */) &&
+ (GNUNET_OK !=
+ TALER_EXCHANGE_test_signing_key (TALER_EXCHANGE_get_keys (wdh->exchange),
+ &exchange_pub)) )
+ {
+ GNUNET_break_op (0);
+ response_code = 0;
}
if (0 == response_code)
break;
@@ -154,22 +200,22 @@ handle_wire_deposits_finished (void *cls,
num_details,
details);
json_decref (json);
- TALER_MINT_wire_deposits_cancel (wdh);
+ TALER_EXCHANGE_wire_deposits_cancel (wdh);
return;
}
}
break;
case MHD_HTTP_BAD_REQUEST:
- /* This should never happen, either us or the mint is buggy
+ /* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
case MHD_HTTP_UNAUTHORIZED:
- /* Nothing really to verify, mint says one of the signatures is
+ /* Nothing really to verify, exchange says one of the signatures is
invalid; as we checked them, this should never happen, we
should pass the JSON reply to the application */
break;
case MHD_HTTP_NOT_FOUND:
- /* Mint does not know about transaction;
+ /* Exchange does not know about transaction;
we should pass the reply to the application */
break;
case MHD_HTTP_INTERNAL_SERVER_ERROR:
@@ -190,41 +236,41 @@ handle_wire_deposits_finished (void *cls,
json,
NULL, NULL, 0, NULL);
json_decref (json);
- TALER_MINT_wire_deposits_cancel (wdh);
+ TALER_EXCHANGE_wire_deposits_cancel (wdh);
}
/**
- * Query the mint about which transactions were combined
+ * Query the exchange about which transactions were combined
* to create a wire transfer.
*
- * @param mint mint to query
+ * @param exchange exchange to query
* @param wtid raw wire transfer identifier to get information about
* @param cb callback to call
* @param cb_cls closure for @a cb
* @return handle to cancel operation
*/
-struct TALER_MINT_WireDepositsHandle *
-TALER_MINT_wire_deposits (struct TALER_MINT_Handle *mint,
- const struct TALER_WireTransferIdentifierRawP *wtid,
- TALER_MINT_WireDepositsCallback cb,
- void *cb_cls)
+struct TALER_EXCHANGE_WireDepositsHandle *
+TALER_EXCHANGE_wire_deposits (struct TALER_EXCHANGE_Handle *exchange,
+ const struct TALER_WireTransferIdentifierRawP *wtid,
+ TALER_EXCHANGE_WireDepositsCallback cb,
+ void *cb_cls)
{
- struct TALER_MINT_WireDepositsHandle *wdh;
- struct TALER_MINT_Context *ctx;
+ struct TALER_EXCHANGE_WireDepositsHandle *wdh;
+ struct TALER_EXCHANGE_Context *ctx;
char *buf;
char *path;
CURL *eh;
if (GNUNET_YES !=
- MAH_handle_is_ready (mint))
+ MAH_handle_is_ready (exchange))
{
GNUNET_break (0);
return NULL;
}
- wdh = GNUNET_new (struct TALER_MINT_WireDepositsHandle);
- wdh->mint = mint;
+ wdh = GNUNET_new (struct TALER_EXCHANGE_WireDepositsHandle);
+ wdh->exchange = exchange;
wdh->cb = cb;
wdh->cb_cls = cb_cls;
@@ -233,7 +279,7 @@ TALER_MINT_wire_deposits (struct TALER_MINT_Handle *mint,
GNUNET_asprintf (&path,
"/wire/deposits?wtid=%s",
buf);
- wdh->url = MAH_path_to_url (wdh->mint,
+ wdh->url = MAH_path_to_url (wdh->exchange,
path);
GNUNET_free (buf);
GNUNET_free (path);
@@ -251,7 +297,7 @@ TALER_MINT_wire_deposits (struct TALER_MINT_Handle *mint,
curl_easy_setopt (eh,
CURLOPT_WRITEDATA,
&wdh->db));
- ctx = MAH_handle_to_context (mint);
+ ctx = MAH_handle_to_context (exchange);
wdh->job = MAC_job_add (ctx,
eh,
GNUNET_YES,
@@ -268,7 +314,7 @@ TALER_MINT_wire_deposits (struct TALER_MINT_Handle *mint,
* @param wdh the wire deposits request handle
*/
void
-TALER_MINT_wire_deposits_cancel (struct TALER_MINT_WireDepositsHandle *wdh)
+TALER_EXCHANGE_wire_deposits_cancel (struct TALER_EXCHANGE_WireDepositsHandle *wdh)
{
if (NULL != wdh->job)
{
@@ -281,4 +327,4 @@ TALER_MINT_wire_deposits_cancel (struct TALER_MINT_WireDepositsHandle *wdh)
}
-/* end of mint_api_wire_deposits.c */
+/* end of exchange_api_wire_deposits.c */
diff --git a/src/mint-lib/test_mint_api.c b/src/exchange-lib/test_exchange_api.c
similarity index 85%
rename from src/mint-lib/test_mint_api.c
rename to src/exchange-lib/test_exchange_api.c
index b243cc2cf..3659e119e 100644
--- a/src/mint-lib/test_mint_api.c
+++ b/src/exchange-lib/test_exchange_api.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014, 2015, 2016 GNUnet e.V.
+ Copyright (C) 2014, 2015, 2016 GNUnet e.V. and Inria
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -14,15 +14,16 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mint/test_mint_api.c
- * @brief testcase to test mint's HTTP API interface
+ * @file exchange/test_exchange_api.c
+ * @brief testcase to test exchange's HTTP API interface
* @author Sree Harsha Totakura
* @author Christian Grothoff
*/
#include "platform.h"
#include "taler_util.h"
#include "taler_signatures.h"
-#include "taler_mint_service.h"
+#include "taler_exchange_service.h"
+#include "taler_json_lib.h"
#include
#include
@@ -39,12 +40,12 @@
/**
* Main execution context for the main loop.
*/
-static struct TALER_MINT_Context *ctx;
+static struct TALER_EXCHANGE_Context *ctx;
/**
- * Handle to access the mint.
+ * Handle to access the exchange.
*/
-static struct TALER_MINT_Handle *mint;
+static struct TALER_EXCHANGE_Handle *exchange;
/**
* Task run on shutdown.
@@ -103,23 +104,23 @@ enum OpCode
OC_REFRESH_REVEAL,
/**
- * Verify mint's /refresh/link by linking original private key to
+ * Verify exchange's /refresh/link by linking original private key to
* results from #OC_REFRESH_REVEAL step.
*/
OC_REFRESH_LINK,
/**
- * Verify the mint's /wire-method.
+ * Verify the exchange's /wire-method.
*/
OC_WIRE,
/**
- * Verify mint's /wire/deposits method.
+ * Verify exchange's /wire/deposits method.
*/
OC_WIRE_DEPOSITS,
/**
- * Verify mint's /deposit/wtid method.
+ * Verify exchange's /deposit/wtid method.
*/
OC_DEPOSIT_WTID
@@ -159,10 +160,10 @@ struct FreshCoin
* use. Otherwise, this will be set (by the interpreter) to the
* denomination PK matching @e amount.
*/
- const struct TALER_MINT_DenomPublicKey *pk;
+ const struct TALER_EXCHANGE_DenomPublicKey *pk;
/**
- * Set (by the interpreter) to the mint's signature over the
+ * Set (by the interpreter) to the exchange's signature over the
* coin's public key.
*/
struct TALER_DenominationSignature sig;
@@ -176,7 +177,7 @@ struct FreshCoin
/**
- * Details for a mint operation to execute.
+ * Details for a exchange operation to execute.
*/
struct Command
{
@@ -233,7 +234,7 @@ struct Command
/**
* Set to the API's handle during the operation.
*/
- struct TALER_MINT_AdminAddIncomingHandle *aih;
+ struct TALER_EXCHANGE_AdminAddIncomingHandle *aih;
} admin_add_incoming;
@@ -252,7 +253,7 @@ struct Command
/**
* Set to the API's handle during the operation.
*/
- struct TALER_MINT_ReserveStatusHandle *wsh;
+ struct TALER_EXCHANGE_ReserveStatusHandle *wsh;
/**
* Expected reserve balance.
@@ -274,7 +275,7 @@ struct Command
/**
* String describing the denomination value we should withdraw.
- * A corresponding denomination key must exist in the mint's
+ * A corresponding denomination key must exist in the exchange's
* offerings. Can be NULL if @e pk is set instead.
*/
const char *amount;
@@ -284,10 +285,10 @@ struct Command
* use. Otherwise, this will be set (by the interpreter) to the
* denomination PK matching @e amount.
*/
- const struct TALER_MINT_DenomPublicKey *pk;
+ const struct TALER_EXCHANGE_DenomPublicKey *pk;
/**
- * Set (by the interpreter) to the mint's signature over the
+ * Set (by the interpreter) to the exchange's signature over the
* coin's public key.
*/
struct TALER_DenominationSignature sig;
@@ -305,7 +306,7 @@ struct Command
/**
* Withdraw handle (while operation is running).
*/
- struct TALER_MINT_ReserveWithdrawHandle *wsh;
+ struct TALER_EXCHANGE_ReserveWithdrawHandle *wsh;
} reserve_withdraw;
@@ -362,7 +363,7 @@ struct Command
/**
* Deposit handle while operation is running.
*/
- struct TALER_MINT_DepositHandle *dh;
+ struct TALER_EXCHANGE_DepositHandle *dh;
} deposit;
@@ -386,12 +387,12 @@ struct Command
* Array of the public keys corresponding to
* the @e fresh_amounts, set by the interpreter.
*/
- const struct TALER_MINT_DenomPublicKey **fresh_pks;
+ const struct TALER_EXCHANGE_DenomPublicKey **fresh_pks;
/**
* Melt handle while operation is running.
*/
- struct TALER_MINT_RefreshMeltHandle *rmh;
+ struct TALER_EXCHANGE_RefreshMeltHandle *rmh;
/**
* Data used in the refresh operation, set by the interpreter.
@@ -405,7 +406,7 @@ struct Command
/**
* Set by the interpreter (upon completion) to the noreveal
- * index selected by the mint.
+ * index selected by the exchange.
*/
uint16_t noreveal_index;
@@ -425,7 +426,7 @@ struct Command
/**
* Reveal handle while operation is running.
*/
- struct TALER_MINT_RefreshRevealHandle *rrh;
+ struct TALER_EXCHANGE_RefreshRevealHandle *rrh;
/**
* Number of fresh coins withdrawn, set by the interpreter.
@@ -454,7 +455,7 @@ struct Command
/**
* Link handle while operation is running.
*/
- struct TALER_MINT_RefreshLinkHandle *rlh;
+ struct TALER_EXCHANGE_RefreshLinkHandle *rlh;
/**
* Which of the melted coins should be used for the linkage?
@@ -471,7 +472,7 @@ struct Command
/**
* Handle to the wire request.
*/
- struct TALER_MINT_WireHandle *wh;
+ struct TALER_EXCHANGE_WireHandle *wh;
/**
* Format we expect to see, others will be *ignored*.
@@ -488,7 +489,7 @@ struct Command
/**
* Handle to the wire deposits request.
*/
- struct TALER_MINT_WireDepositsHandle *wdh;
+ struct TALER_EXCHANGE_WireDepositsHandle *wdh;
/**
* Reference to a /deposit/wtid command. If set, we use the
@@ -514,7 +515,7 @@ struct Command
/**
* Handle to the deposit wtid request.
*/
- struct TALER_MINT_DepositWtidHandle *dwh;
+ struct TALER_EXCHANGE_DepositWtidHandle *dwh;
/**
* Which /deposit operation should we obtain WTID data for?
@@ -545,9 +546,9 @@ struct Command
struct InterpreterState
{
/**
- * Keys from the mint.
+ * Keys from the exchange.
*/
- const struct TALER_MINT_Keys *keys;
+ const struct TALER_EXCHANGE_Keys *keys;
/**
* Commands the interpreter will run.
@@ -572,11 +573,9 @@ struct InterpreterState
* Task that runs the context's event loop with the GNUnet scheduler.
*
* @param cls unused
- * @param tc scheduler context (unused)
*/
static void
-context_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+context_task (void *cls);
/**
@@ -637,14 +636,12 @@ find_command (const struct InterpreterState *is,
/**
- * Run the main interpreter loop that performs mint operations.
+ * Run the main interpreter loop that performs exchange operations.
*
* @param cls contains the `struct InterpreterState`
- * @param tc scheduler context
*/
static void
-interpreter_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+interpreter_run (void *cls);
/**
@@ -652,8 +649,8 @@ interpreter_run (void *cls,
*
* @param cls closure with the interpreter state
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
- * 0 if the mint's reply is bogus (fails to follow the protocol)
- * @param full_response full response from the mint (for logging, in case of errors)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
+ * @param full_response full response from the exchange (for logging, in case of errors)
*/
static void
add_incoming_cb (void *cls,
@@ -685,12 +682,12 @@ add_incoming_cb (void *cls,
* @return #GNUNET_OK if they match, #GNUNET_SYSERR if not
*/
static int
-compare_admin_add_incoming_history (const struct TALER_MINT_ReserveHistory *h,
+compare_admin_add_incoming_history (const struct TALER_EXCHANGE_ReserveHistory *h,
const struct Command *cmd)
{
struct TALER_Amount amount;
- if (TALER_MINT_RTT_DEPOSIT != h->type)
+ if (TALER_EXCHANGE_RTT_DEPOSIT != h->type)
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -717,13 +714,13 @@ compare_admin_add_incoming_history (const struct TALER_MINT_ReserveHistory *h,
* @return #GNUNET_OK if they match, #GNUNET_SYSERR if not
*/
static int
-compare_reserve_withdraw_history (const struct TALER_MINT_ReserveHistory *h,
+compare_reserve_withdraw_history (const struct TALER_EXCHANGE_ReserveHistory *h,
const struct Command *cmd)
{
struct TALER_Amount amount;
struct TALER_Amount amount_with_fee;
- if (TALER_MINT_RTT_WITHDRAWAL != h->type)
+ if (TALER_EXCHANGE_RTT_WITHDRAWAL != h->type)
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -750,7 +747,7 @@ compare_reserve_withdraw_history (const struct TALER_MINT_ReserveHistory *h,
*
* @param cls closure with the interpreter state
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
- * 0 if the mint's reply is bogus (fails to follow the protocol)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param[in] json original response in JSON format (useful only for diagnostics)
* @param balance current balance in the reserve, NULL on error
* @param history_length number of entries in the transaction history, 0 on error
@@ -762,7 +759,7 @@ reserve_status_cb (void *cls,
json_t *json,
const struct TALER_Amount *balance,
unsigned int history_length,
- const struct TALER_MINT_ReserveHistory *history)
+ const struct TALER_EXCHANGE_ReserveHistory *history)
{
struct InterpreterState *is = cls;
struct Command *cmd = &is->commands[is->ip];
@@ -868,9 +865,9 @@ reserve_status_cb (void *cls,
*
* @param cls closure with the interpreter state
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
- * 0 if the mint's reply is bogus (fails to follow the protocol)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param sig signature over the coin, NULL on error
- * @param full_response full response from the mint (for logging, in case of errors)
+ * @param full_response full response from the exchange (for logging, in case of errors)
*/
static void
reserve_withdraw_cb (void *cls,
@@ -924,7 +921,7 @@ reserve_withdraw_cb (void *cls,
*
* @param cls closure with the interpreter state
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful deposit;
- * 0 if the mint's reply is bogus (fails to follow the protocol)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param obj the received JSON reply, should be kept as proof (and, in case of errors,
* be forwarded to the customer)
*/
@@ -958,10 +955,10 @@ deposit_cb (void *cls,
*
* @param cls closure with the interpreter state
* @param http_status HTTP response code, never #MHD_HTTP_OK (200) as for successful intermediate response this callback is skipped.
- * 0 if the mint's reply is bogus (fails to follow the protocol)
- * @param noreveal_index choice by the mint in the cut-and-choose protocol,
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
+ * @param noreveal_index choice by the exchange in the cut-and-choose protocol,
* UINT16_MAX on error
- * @param full_response full response from the mint (for logging, in case of errors)
+ * @param full_response full response from the exchange (for logging, in case of errors)
*/
static void
melt_cb (void *cls,
@@ -995,11 +992,11 @@ melt_cb (void *cls,
*
* @param cls closure with the interpreter state
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
- * 0 if the mint's reply is bogus (fails to follow the protocol)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param num_coins number of fresh coins created, length of the @a sigs and @a coin_privs arrays, 0 if the operation failed
* @param coin_privs array of @a num_coins private keys for the coins that were created, NULL on error
* @param sigs array of signature over @a num_coins coins, NULL on error
- * @param full_response full response from the mint (for logging, in case of errors)
+ * @param full_response full response from the exchange (for logging, in case of errors)
*/
static void
reveal_cb (void *cls,
@@ -1027,6 +1024,7 @@ reveal_cb (void *cls,
}
ref = find_command (is,
cmd->details.refresh_reveal.melt_ref);
+ GNUNET_assert (NULL != ref);
cmd->details.refresh_reveal.num_fresh_coins = num_coins;
switch (http_status)
{
@@ -1059,12 +1057,12 @@ reveal_cb (void *cls,
*
* @param cls closure with the interpreter state
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
- * 0 if the mint's reply is bogus (fails to follow the protocol)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param num_coins number of fresh coins created, length of the @a sigs and @a coin_privs arrays, 0 if the operation failed
* @param coin_privs array of @a num_coins private keys for the coins that were created, NULL on error
* @param sigs array of signature over @a num_coins coins, NULL on error
* @param pubs array of public keys for the @a sigs, NULL on error
- * @param full_response full response from the mint (for logging, in case of errors)
+ * @param full_response full response from the exchange (for logging, in case of errors)
*/
static void
link_cb (void *cls,
@@ -1095,6 +1093,7 @@ link_cb (void *cls,
}
ref = find_command (is,
cmd->details.refresh_link.reveal_ref);
+ GNUNET_assert (NULL != ref);
switch (http_status)
{
case MHD_HTTP_OK:
@@ -1159,13 +1158,13 @@ link_cb (void *cls,
* @param amount coin value to look for
* @return NULL if no matching key was found
*/
-static const struct TALER_MINT_DenomPublicKey *
-find_pk (const struct TALER_MINT_Keys *keys,
+static const struct TALER_EXCHANGE_DenomPublicKey *
+find_pk (const struct TALER_EXCHANGE_Keys *keys,
const struct TALER_Amount *amount)
{
unsigned int i;
struct GNUNET_TIME_Absolute now;
- struct TALER_MINT_DenomPublicKey *pk;
+ struct TALER_EXCHANGE_DenomPublicKey *pk;
char *str;
now = GNUNET_TIME_absolute_get ();
@@ -1208,78 +1207,59 @@ find_pk (const struct TALER_MINT_Keys *keys,
/**
* Callbacks called with the result(s) of a
- * wire format inquiry request to the mint.
- *
- * The callback is invoked multiple times, once for each supported @a
- * method. Finally, it is invoked one more time with cls/0/NULL/NULL
- * to indicate the end of the iteration. If any request fails to
- * generate a valid response from the mint, @a http_status will also
- * be zero and the iteration will also end. Thus, the iteration
- * always ends with a final call with an @a http_status of 0. If the
- * @a http_status is already 0 on the first call, then the response to
- * the /wire request was invalid. Later, clients can tell the
- * difference between @a http_status of 0 indicating a failed
- * /wire/method request and a regular end of the iteration by @a
- * method being non-NULL. If the mint simply correctly asserts that
- * it does not support any methods, @a method will be NULL but the @a
- * http_status will be #MHD_HTTP_OK for the first call (followed by a
- * cls/0/NULL/NULL call to signal the end of the iteration).
+ * wire format inquiry request to the exchange.
*
* @param cls closure with the interpreter state
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful request;
- * 0 if the mint's reply is bogus (fails to follow the protocol)
- * @param method wire format method supported, i.e. "test" or "sepa", or NULL
- * if already the /wire request failed.
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param obj the received JSON reply, if successful this should be the wire
- * format details as provided by /wire/METHOD/, or NULL if the
- * reply was not in JSON format (in this case, the client might
- * want to do an HTTP request to /wire/METHOD/ with a browser to
- * provide more information to the user about the @a method).
+ * format details as provided by /wire.
*/
static void
wire_cb (void *cls,
unsigned int http_status,
- const char *method,
json_t *obj)
{
struct InterpreterState *is = cls;
struct Command *cmd = &is->commands[is->ip];
- if (0 == http_status)
- {
- /* 0 always signals the end of the iteration */
- cmd->details.wire.wh = NULL;
- }
- else if ( (NULL != method) &&
- (0 != strcasecmp (method,
- cmd->details.wire.format)) )
- {
- /* not the method we care about, skip */
- return;
- }
+ cmd->details.wire.wh = NULL;
if (cmd->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s/%s\n",
+ "Unexpected response code %u to command %s\n",
http_status,
- cmd->label,
- method);
+ cmd->label);
json_dumpf (obj, stderr, 0);
fail (is);
return;
}
- if (0 == http_status)
+ switch (http_status)
{
- /* end of iteration, move to next command */
- is->ip++;
- is->task = GNUNET_SCHEDULER_add_now (&interpreter_run,
- is);
- return;
+ case MHD_HTTP_OK:
+ {
+ json_t *method;
+
+ method = json_object_get (obj,
+ cmd->details.wire.format);
+ if (NULL == method)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Expected method `%s' not included in response to command %s\n",
+ cmd->details.wire.format,
+ cmd->label);
+ json_dumpf (obj, stderr, 0);
+ fail (is);
+ return;
+ }
+ }
+ break;
+ default:
+ break;
}
- /* For now, we only support to be called only once
- with a "positive" result; so we switch to an
- expected value of 0 for the 2nd iteration */
- cmd->expected_response_code = 0;
+ is->ip++;
+ is->task = GNUNET_SCHEDULER_add_now (&interpreter_run,
+ is);
}
@@ -1288,12 +1268,12 @@ wire_cb (void *cls,
* of the coin transactions that were combined into the wire transfer.
*
* @param cls closure
- * @param http_status HTTP status code we got, 0 on mint protocol violation
+ * @param http_status HTTP status code we got, 0 on exchange protocol violation
* @param json original json reply (may include signatures, those have then been
* validated already)
- * @param wtid extracted wire transfer identifier, or NULL if the mint could
+ * @param wtid extracted wire transfer identifier, or NULL if the exchange could
* not provide any (set only if @a http_status is #MHD_HTTP_OK)
- * @param total_amount total amount of the wire transfer, or NULL if the mint could
+ * @param total_amount total amount of the wire transfer, or NULL if the exchange could
* not provide any @a wtid (set only if @a http_status is #MHD_HTTP_OK)
* @param details_length length of the @a details array
* @param details array with details about the combined transactions
@@ -1312,8 +1292,6 @@ wire_deposits_cb (void *cls,
const struct Command *ref;
cmd->details.wire_deposits.wdh = NULL;
- ref = find_command (is,
- cmd->details.wire_deposits.wtid_ref);
if (cmd->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -1327,6 +1305,9 @@ wire_deposits_cb (void *cls,
switch (http_status)
{
case MHD_HTTP_OK:
+ ref = find_command (is,
+ cmd->details.wire_deposits.wtid_ref);
+ GNUNET_assert (NULL != ref);
if (0 != TALER_amount_cmp (total_amount,
&ref->details.deposit_wtid.total_amount_expected))
{
@@ -1345,6 +1326,7 @@ wire_deposits_cb (void *cls,
dep = find_command (is,
ref->details.deposit_wtid.deposit_ref);
+ GNUNET_assert (NULL != dep);
GNUNET_CRYPTO_hash (dep->details.deposit.wire_details,
strlen (dep->details.deposit.wire_details),
&hw);
@@ -1376,14 +1358,14 @@ wire_deposits_cb (void *cls,
* Function called with detailed wire transfer data.
*
* @param cls closure
- * @param http_status HTTP status code we got, 0 on mint protocol violation
+ * @param http_status HTTP status code we got, 0 on exchange protocol violation
* @param json original json reply (may include signatures, those have then been
* validated already)
- * @param wtid wire transfer identifier used by the mint, NULL if mint did not
+ * @param wtid wire transfer identifier used by the exchange, NULL if exchange did not
* yet execute the transaction
* @param execution_time actual or planned execution time for the wire transfer
* @param coin_contribution contribution to the @a total_amount of the deposited coin (may be NULL)
- * @param total_amount total amount of the wire transfer, or NULL if the mint could
+ * @param total_amount total amount of the wire transfer, or NULL if the exchange could
* not provide any @a wtid (set only if @a http_status is #MHD_HTTP_OK)
*/
static void
@@ -1425,14 +1407,12 @@ deposit_wtid_cb (void *cls,
/**
- * Run the main interpreter loop that performs mint operations.
+ * Run the main interpreter loop that performs exchange operations.
*
* @param cls contains the `struct InterpreterState`
- * @param tc scheduler context
*/
static void
-interpreter_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+interpreter_run (void *cls)
{
struct InterpreterState *is = cls;
struct Command *cmd = &is->commands[is->ip];
@@ -1442,8 +1422,10 @@ interpreter_run (void *cls,
struct TALER_Amount amount;
struct GNUNET_TIME_Absolute execution_date;
json_t *wire;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
is->task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
fprintf (stderr,
@@ -1502,9 +1484,9 @@ interpreter_run (void *cls,
return;
}
execution_date = GNUNET_TIME_absolute_get ();
- TALER_round_abs_time (&execution_date);
+ GNUNET_TIME_round_abs (&execution_date);
cmd->details.admin_add_incoming.aih
- = TALER_MINT_admin_add_incoming (mint,
+ = TALER_EXCHANGE_admin_add_incoming (exchange,
&reserve_pub,
&amount,
execution_date,
@@ -1529,7 +1511,7 @@ interpreter_run (void *cls,
GNUNET_CRYPTO_eddsa_key_get_public (&ref->details.admin_add_incoming.reserve_priv.eddsa_priv,
&reserve_pub.eddsa_pub);
cmd->details.reserve_status.wsh
- = TALER_MINT_reserve_status (mint,
+ = TALER_EXCHANGE_reserve_status (exchange,
&reserve_pub,
&reserve_status_cb,
is);
@@ -1580,7 +1562,7 @@ interpreter_run (void *cls,
cmd->details.reserve_withdraw.blinding_key.rsa_blinding_key
= GNUNET_CRYPTO_rsa_blinding_key_create (GNUNET_CRYPTO_rsa_public_key_len (cmd->details.reserve_withdraw.pk->key.rsa_public_key));
cmd->details.reserve_withdraw.wsh
- = TALER_MINT_reserve_withdraw (mint,
+ = TALER_EXCHANGE_reserve_withdraw (exchange,
cmd->details.reserve_withdraw.pk,
&ref->details.admin_add_incoming.reserve_priv,
&cmd->details.reserve_withdraw.coin_priv,
@@ -1599,7 +1581,7 @@ interpreter_run (void *cls,
{
struct GNUNET_HashCode h_contract;
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
- const struct TALER_MINT_DenomPublicKey *coin_pk;
+ const struct TALER_EXCHANGE_DenomPublicKey *coin_pk;
const struct TALER_DenominationSignature *coin_pk_sig;
struct TALER_CoinSpendPublicKeyP coin_pub;
struct TALER_CoinSpendSignatureP coin_sig;
@@ -1664,7 +1646,7 @@ interpreter_run (void *cls,
fail (is);
return;
}
- TALER_hash_json (contract,
+ TALER_JSON_hash (contract,
&h_contract);
wire = json_loads (cmd->details.deposit.wire_details,
JSON_REJECT_DUPLICATES,
@@ -1698,7 +1680,7 @@ interpreter_run (void *cls,
wire_deadline = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_DAYS);
timestamp = GNUNET_TIME_absolute_get ();
- TALER_round_abs_time (×tamp);
+ GNUNET_TIME_round_abs (×tamp);
{
struct TALER_DepositRequestPS dr;
@@ -1706,7 +1688,7 @@ interpreter_run (void *cls,
dr.purpose.size = htonl (sizeof (struct TALER_DepositRequestPS));
dr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_DEPOSIT);
dr.h_contract = h_contract;
- TALER_hash_json (wire,
+ TALER_JSON_hash (wire,
&dr.h_wire);
dr.timestamp = GNUNET_TIME_absolute_hton (timestamp);
dr.refund_deadline = GNUNET_TIME_absolute_hton (refund_deadline);
@@ -1723,7 +1705,7 @@ interpreter_run (void *cls,
&coin_sig.eddsa_signature));
}
cmd->details.deposit.dh
- = TALER_MINT_deposit (mint,
+ = TALER_EXCHANGE_deposit (exchange,
&amount,
wire_deadline,
wire,
@@ -1764,13 +1746,13 @@ interpreter_run (void *cls,
cmd->details.refresh_melt.fresh_pks
= GNUNET_new_array (num_fresh_coins,
- const struct TALER_MINT_DenomPublicKey *);
+ const struct TALER_EXCHANGE_DenomPublicKey *);
{
struct TALER_CoinSpendPrivateKeyP melt_privs[num_melted_coins];
struct TALER_Amount melt_amounts[num_melted_coins];
struct TALER_DenominationSignature melt_sigs[num_melted_coins];
- struct TALER_MINT_DenomPublicKey melt_pks[num_melted_coins];
- struct TALER_MINT_DenomPublicKey fresh_pks[num_fresh_coins];
+ struct TALER_EXCHANGE_DenomPublicKey melt_pks[num_melted_coins];
+ struct TALER_EXCHANGE_DenomPublicKey fresh_pks[num_fresh_coins];
unsigned int i;
for (i=0;idetails.refresh_melt.fresh_pks[i];
}
cmd->details.refresh_melt.refresh_data
- = TALER_MINT_refresh_prepare (num_melted_coins,
+ = TALER_EXCHANGE_refresh_prepare (num_melted_coins,
melt_privs,
melt_amounts,
melt_sigs,
@@ -1831,7 +1813,7 @@ interpreter_run (void *cls,
return;
}
cmd->details.refresh_melt.rmh
- = TALER_MINT_refresh_melt (mint,
+ = TALER_EXCHANGE_refresh_melt (exchange,
cmd->details.refresh_melt.refresh_data_length,
cmd->details.refresh_melt.refresh_data,
&melt_cb,
@@ -1849,13 +1831,14 @@ interpreter_run (void *cls,
case OC_REFRESH_REVEAL:
ref = find_command (is,
cmd->details.refresh_reveal.melt_ref);
+ GNUNET_assert (NULL != ref);
cmd->details.refresh_reveal.rrh
- = TALER_MINT_refresh_reveal (mint,
- ref->details.refresh_melt.refresh_data_length,
- ref->details.refresh_melt.refresh_data,
- ref->details.refresh_melt.noreveal_index,
- &reveal_cb,
- is);
+ = TALER_EXCHANGE_refresh_reveal (exchange,
+ ref->details.refresh_melt.refresh_data_length,
+ ref->details.refresh_melt.refresh_data,
+ ref->details.refresh_melt.noreveal_index,
+ &reveal_cb,
+ is);
if (NULL == cmd->details.refresh_reveal.rrh)
{
GNUNET_break (0);
@@ -1868,9 +1851,11 @@ interpreter_run (void *cls,
/* find reveal command */
ref = find_command (is,
cmd->details.refresh_link.reveal_ref);
+ GNUNET_assert (NULL != ref);
/* find melt command */
ref = find_command (is,
ref->details.refresh_reveal.melt_ref);
+ GNUNET_assert (NULL != ref);
/* find reserve_withdraw command */
{
unsigned int idx;
@@ -1885,14 +1870,15 @@ interpreter_run (void *cls,
md = &ref->details.refresh_melt.melted_coins[idx];
ref = find_command (is,
md->coin_ref);
+ GNUNET_assert (NULL != ref);
}
GNUNET_assert (OC_WITHDRAW_SIGN == ref->oc);
/* finally, use private key from withdraw sign command */
cmd->details.refresh_link.rlh
- = TALER_MINT_refresh_link (mint,
- &ref->details.reserve_withdraw.coin_priv,
- &link_cb,
- is);
+ = TALER_EXCHANGE_refresh_link (exchange,
+ &ref->details.reserve_withdraw.coin_priv,
+ &link_cb,
+ is);
if (NULL == cmd->details.refresh_link.rlh)
{
GNUNET_break (0);
@@ -1902,9 +1888,9 @@ interpreter_run (void *cls,
trigger_context_task ();
return;
case OC_WIRE:
- cmd->details.wire.wh = TALER_MINT_wire (mint,
- &wire_cb,
- is);
+ cmd->details.wire.wh = TALER_EXCHANGE_wire (exchange,
+ &wire_cb,
+ is);
trigger_context_task ();
return;
case OC_WIRE_DEPOSITS:
@@ -1916,10 +1902,10 @@ interpreter_run (void *cls,
cmd->details.wire_deposits.wtid = ref->details.deposit_wtid.wtid;
}
cmd->details.wire_deposits.wdh
- = TALER_MINT_wire_deposits (mint,
- &cmd->details.wire_deposits.wtid,
- &wire_deposits_cb,
- is);
+ = TALER_EXCHANGE_wire_deposits (exchange,
+ &cmd->details.wire_deposits.wtid,
+ &wire_deposits_cb,
+ is);
trigger_context_task ();
return;
case OC_DEPOSIT_WTID:
@@ -1964,18 +1950,18 @@ interpreter_run (void *cls,
JSON_REJECT_DUPLICATES,
NULL);
GNUNET_assert (NULL != wire);
- TALER_hash_json (wire,
+ TALER_JSON_hash (wire,
&h_wire);
json_decref (wire);
contract = json_loads (ref->details.deposit.contract,
JSON_REJECT_DUPLICATES,
NULL);
GNUNET_assert (NULL != contract);
- TALER_hash_json (contract,
+ TALER_JSON_hash (contract,
&h_contract);
json_decref (contract);
cmd->details.deposit_wtid.dwh
- = TALER_MINT_deposit_wtid (mint,
+ = TALER_EXCHANGE_deposit_wtid (exchange,
&ref->details.deposit.merchant_priv,
&h_wire,
&h_contract,
@@ -2003,11 +1989,9 @@ interpreter_run (void *cls,
* Cleans up our state.
*
* @param cls the interpreter state.
- * @param tc unused
*/
static void
-do_shutdown (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown (void *cls)
{
struct InterpreterState *is = cls;
struct Command *cmd;
@@ -2028,7 +2012,7 @@ do_shutdown (void *cls,
"Command %u (%s) did not complete\n",
i,
cmd->label);
- TALER_MINT_admin_add_incoming_cancel (cmd->details.admin_add_incoming.aih);
+ TALER_EXCHANGE_admin_add_incoming_cancel (cmd->details.admin_add_incoming.aih);
cmd->details.admin_add_incoming.aih = NULL;
}
break;
@@ -2039,7 +2023,7 @@ do_shutdown (void *cls,
"Command %u (%s) did not complete\n",
i,
cmd->label);
- TALER_MINT_reserve_status_cancel (cmd->details.reserve_status.wsh);
+ TALER_EXCHANGE_reserve_status_cancel (cmd->details.reserve_status.wsh);
cmd->details.reserve_status.wsh = NULL;
}
break;
@@ -2050,7 +2034,7 @@ do_shutdown (void *cls,
"Command %u (%s) did not complete\n",
i,
cmd->label);
- TALER_MINT_reserve_withdraw_cancel (cmd->details.reserve_withdraw.wsh);
+ TALER_EXCHANGE_reserve_withdraw_cancel (cmd->details.reserve_withdraw.wsh);
cmd->details.reserve_withdraw.wsh = NULL;
}
if (NULL != cmd->details.reserve_withdraw.sig.rsa_signature)
@@ -2071,7 +2055,7 @@ do_shutdown (void *cls,
"Command %u (%s) did not complete\n",
i,
cmd->label);
- TALER_MINT_deposit_cancel (cmd->details.deposit.dh);
+ TALER_EXCHANGE_deposit_cancel (cmd->details.deposit.dh);
cmd->details.deposit.dh = NULL;
}
break;
@@ -2082,7 +2066,7 @@ do_shutdown (void *cls,
"Command %u (%s) did not complete\n",
i,
cmd->label);
- TALER_MINT_refresh_melt_cancel (cmd->details.refresh_melt.rmh);
+ TALER_EXCHANGE_refresh_melt_cancel (cmd->details.refresh_melt.rmh);
cmd->details.refresh_melt.rmh = NULL;
}
GNUNET_free_non_null (cmd->details.refresh_melt.fresh_pks);
@@ -2098,7 +2082,7 @@ do_shutdown (void *cls,
"Command %u (%s) did not complete\n",
i,
cmd->label);
- TALER_MINT_refresh_reveal_cancel (cmd->details.refresh_reveal.rrh);
+ TALER_EXCHANGE_refresh_reveal_cancel (cmd->details.refresh_reveal.rrh);
cmd->details.refresh_reveal.rrh = NULL;
}
{
@@ -2120,7 +2104,7 @@ do_shutdown (void *cls,
"Command %u (%s) did not complete\n",
i,
cmd->label);
- TALER_MINT_refresh_link_cancel (cmd->details.refresh_link.rlh);
+ TALER_EXCHANGE_refresh_link_cancel (cmd->details.refresh_link.rlh);
cmd->details.refresh_link.rlh = NULL;
}
break;
@@ -2131,7 +2115,7 @@ do_shutdown (void *cls,
"Command %u (%s) did not complete\n",
i,
cmd->label);
- TALER_MINT_wire_cancel (cmd->details.wire.wh);
+ TALER_EXCHANGE_wire_cancel (cmd->details.wire.wh);
cmd->details.wire.wh = NULL;
}
break;
@@ -2142,7 +2126,7 @@ do_shutdown (void *cls,
"Command %u (%s) did not complete\n",
i,
cmd->label);
- TALER_MINT_wire_deposits_cancel (cmd->details.wire_deposits.wdh);
+ TALER_EXCHANGE_wire_deposits_cancel (cmd->details.wire_deposits.wdh);
cmd->details.wire_deposits.wdh = NULL;
}
break;
@@ -2153,7 +2137,7 @@ do_shutdown (void *cls,
"Command %u (%s) did not complete\n",
i,
cmd->label);
- TALER_MINT_deposit_wtid_cancel (cmd->details.deposit_wtid.dwh);
+ TALER_EXCHANGE_deposit_wtid_cancel (cmd->details.deposit_wtid.dwh);
cmd->details.deposit_wtid.dwh = NULL;
}
break;
@@ -2177,14 +2161,14 @@ do_shutdown (void *cls,
GNUNET_SCHEDULER_cancel (ctx_task);
ctx_task = NULL;
}
- if (NULL != mint)
+ if (NULL != exchange)
{
- TALER_MINT_disconnect (mint);
- mint = NULL;
+ TALER_EXCHANGE_disconnect (exchange);
+ exchange = NULL;
}
if (NULL != ctx)
{
- TALER_MINT_fini (ctx);
+ TALER_EXCHANGE_fini (ctx);
ctx = NULL;
}
}
@@ -2192,15 +2176,15 @@ do_shutdown (void *cls,
/**
* Functions of this type are called to provide the retrieved signing and
- * denomination keys of the mint. No TALER_MINT_*() functions should be called
+ * denomination keys of the exchange. No TALER_EXCHANGE_*() functions should be called
* in this callback.
*
* @param cls closure
- * @param keys information about keys of the mint
+ * @param keys information about keys of the exchange
*/
static void
cert_cb (void *cls,
- const struct TALER_MINT_Keys *keys)
+ const struct TALER_EXCHANGE_Keys *keys)
{
struct InterpreterState *is = cls;
@@ -2228,11 +2212,9 @@ cert_cb (void *cls,
* Task that runs the context's event loop with the GNUnet scheduler.
*
* @param cls unused
- * @param tc scheduler context (unused)
*/
static void
-context_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+context_task (void *cls)
{
long timeout;
int max_fd;
@@ -2244,13 +2226,13 @@ context_task (void *cls,
struct GNUNET_TIME_Relative delay;
ctx_task = NULL;
- TALER_MINT_perform (ctx);
+ TALER_EXCHANGE_perform (ctx);
max_fd = -1;
timeout = -1;
FD_ZERO (&read_fd_set);
FD_ZERO (&write_fd_set);
FD_ZERO (&except_fd_set);
- TALER_MINT_get_select_info (ctx,
+ TALER_EXCHANGE_get_select_info (ctx,
&read_fd_set,
&write_fd_set,
&except_fd_set,
@@ -2284,13 +2266,9 @@ context_task (void *cls,
* Main function that will be run by the scheduler.
*
* @param cls closure
- * @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used (for saving, can be NULL!)
- * @param config configuration
*/
static void
-run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run (void *cls)
{
struct InterpreterState *is;
static struct MeltDetails melt_coins_1[] = {
@@ -2328,14 +2306,14 @@ run (void *cls,
#if WIRE_TEST
{ .oc = OC_WIRE,
.label = "wire-test",
- /* /wire/test replies with a 302 redirect */
- .expected_response_code = MHD_HTTP_FOUND,
+ /* expecting 'test' method in response */
+ .expected_response_code = MHD_HTTP_OK,
.details.wire.format = "test" },
#endif
#if WIRE_SEPA
{ .oc = OC_WIRE,
.label = "wire-sepa",
- /* /wire/sepa replies with a 200 redirect */
+ /* expecting 'sepa' method in response */
.expected_response_code = MHD_HTTP_OK,
.details.wire.format = "sepa" },
#endif
@@ -2349,7 +2327,7 @@ run (void *cls,
{ .oc = OC_ADMIN_ADD_INCOMING,
.label = "create-reserve-1",
.expected_response_code = MHD_HTTP_OK,
- .details.admin_add_incoming.wire = "{ \"type\":\"TEST\", \"bank\":\"source bank\", \"account\":42 }",
+ .details.admin_add_incoming.wire = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
.details.admin_add_incoming.amount = "EUR:5.01" },
/* Withdraw a 5 EUR coin, at fee of 1 ct */
{ .oc = OC_WITHDRAW_SIGN,
@@ -2370,7 +2348,7 @@ run (void *cls,
.expected_response_code = MHD_HTTP_OK,
.details.deposit.amount = "EUR:5",
.details.deposit.coin_ref = "withdraw-coin-1",
- .details.deposit.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":42 }",
+ .details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
.details.deposit.contract = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }",
.details.deposit.transaction_id = 1 },
@@ -2387,7 +2365,7 @@ run (void *cls,
.expected_response_code = MHD_HTTP_FORBIDDEN,
.details.deposit.amount = "EUR:5",
.details.deposit.coin_ref = "withdraw-coin-1",
- .details.deposit.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":43 }",
+ .details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":43 }",
.details.deposit.contract = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }",
.details.deposit.transaction_id = 1 },
/* Try to double-spend the 5 EUR coin at the same merchant (but different
@@ -2397,7 +2375,7 @@ run (void *cls,
.expected_response_code = MHD_HTTP_FORBIDDEN,
.details.deposit.amount = "EUR:5",
.details.deposit.coin_ref = "withdraw-coin-1",
- .details.deposit.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":42 }",
+ .details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
.details.deposit.contract = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }",
.details.deposit.transaction_id = 2 },
/* Try to double-spend the 5 EUR coin at the same merchant (but different
@@ -2407,7 +2385,7 @@ run (void *cls,
.expected_response_code = MHD_HTTP_FORBIDDEN,
.details.deposit.amount = "EUR:5",
.details.deposit.coin_ref = "withdraw-coin-1",
- .details.deposit.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":42 }",
+ .details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
.details.deposit.contract = "{ \"items\":[{ \"name\":\"ice cream\", \"value\":2 } ] }",
.details.deposit.transaction_id = 1 },
@@ -2417,7 +2395,7 @@ run (void *cls,
{ .oc = OC_ADMIN_ADD_INCOMING,
.label = "refresh-create-reserve-1",
.expected_response_code = MHD_HTTP_OK,
- .details.admin_add_incoming.wire = "{ \"type\":\"TEST\", \"bank\":\"source bank\", \"account\":424 }",
+ .details.admin_add_incoming.wire = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":424 }",
.details.admin_add_incoming.amount = "EUR:5.01" },
/* Withdraw a 5 EUR coin, at fee of 1 ct */
{ .oc = OC_WITHDRAW_SIGN,
@@ -2432,7 +2410,7 @@ run (void *cls,
.expected_response_code = MHD_HTTP_OK,
.details.deposit.amount = "EUR:1",
.details.deposit.coin_ref = "refresh-withdraw-coin-1",
- .details.deposit.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":42 }",
+ .details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
.details.deposit.contract = "{ \"items\" : [ { \"name\":\"ice cream\", \"value\":\"EUR:1\" } ] }",
.details.deposit.transaction_id = 42421 },
@@ -2466,7 +2444,7 @@ run (void *cls,
.details.deposit.amount = "EUR:1",
.details.deposit.coin_ref = "refresh-reveal-1",
.details.deposit.coin_idx = 0,
- .details.deposit.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":42 }",
+ .details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
.details.deposit.contract = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":3 } ] }",
.details.deposit.transaction_id = 2 },
@@ -2478,7 +2456,7 @@ run (void *cls,
.details.deposit.amount = "EUR:0.1",
.details.deposit.coin_ref = "refresh-reveal-1",
.details.deposit.coin_idx = 4,
- .details.deposit.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":42 }",
+ .details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
.details.deposit.contract = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":3 } ] }",
.details.deposit.transaction_id = 2 },
@@ -2496,20 +2474,20 @@ run (void *cls,
/* ************** Test tracking API ******************** */
/* Try resolving a deposit's WTID, as we never triggered
execution of transactions, the answer should be that
- the mint knows about the deposit, but has no WTID yet. */
+ the exchange knows about the deposit, but has no WTID yet. */
{ .oc = OC_DEPOSIT_WTID,
.label = "deposit-wtid-found",
.expected_response_code = MHD_HTTP_ACCEPTED,
.details.deposit_wtid.deposit_ref = "deposit-simple" },
/* Try resolving a deposit's WTID for a failed deposit.
As the deposit failed, the answer should be that
- the mint does NOT know about the deposit. */
+ the exchange does NOT know about the deposit. */
{ .oc = OC_DEPOSIT_WTID,
.label = "deposit-wtid-failing",
.expected_response_code = MHD_HTTP_NOT_FOUND,
.details.deposit_wtid.deposit_ref = "deposit-double-2" },
/* Try resolving an undefined (all zeros) WTID; this
- should fail as obviously the mint didn't use that
+ should fail as obviously the exchange didn't use that
WTID value for any transaction. */
{ .oc = OC_WIRE_DEPOSITS,
.label = "wire-deposit-failing",
@@ -2529,15 +2507,15 @@ run (void *cls,
is = GNUNET_new (struct InterpreterState);
is->commands = commands;
- ctx = TALER_MINT_init ();
+ ctx = TALER_EXCHANGE_init ();
GNUNET_assert (NULL != ctx);
ctx_task = GNUNET_SCHEDULER_add_now (&context_task,
ctx);
- mint = TALER_MINT_connect (ctx,
- "http://localhost:8081",
- &cert_cb, is,
- TALER_MINT_OPTION_END);
- GNUNET_assert (NULL != mint);
+ exchange = TALER_EXCHANGE_connect (ctx,
+ "http://localhost:8081",
+ &cert_cb, is,
+ TALER_EXCHANGE_OPTION_END);
+ GNUNET_assert (NULL != exchange);
shutdown_task
= GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 150),
@@ -2546,7 +2524,7 @@ run (void *cls,
/**
- * Main function for the testcase for the mint API.
+ * Main function for the testcase for the exchange API.
*
* @param argc expected to be 1
* @param argv expected to only contain the program name
@@ -2556,30 +2534,32 @@ main (int argc,
char * const *argv)
{
struct GNUNET_OS_Process *proc;
- struct GNUNET_OS_Process *mintd;
+ struct GNUNET_OS_Process *exchanged;
- GNUNET_log_setup ("test-mint-api",
+ GNUNET_log_setup ("test-exchange-api",
"WARNING",
NULL);
+ /* These might get in the way... */
+ unsetenv ("XDG_DATA_HOME");
+ unsetenv ("XDG_CONFIG_HOME");
proc = GNUNET_OS_start_process (GNUNET_NO,
GNUNET_OS_INHERIT_STD_ALL,
NULL, NULL, NULL,
- "taler-mint-keyup",
- "taler-mint-keyup",
- "-d", "test-mint-home",
- "-m", "test-mint-home/master.priv",
+ "taler-exchange-keyup",
+ "taler-exchange-keyup",
+ "-c", "test_exchange_api.conf",
NULL);
GNUNET_OS_process_wait (proc);
GNUNET_OS_process_destroy (proc);
- mintd = GNUNET_OS_start_process (GNUNET_NO,
- GNUNET_OS_INHERIT_STD_ALL,
- NULL, NULL, NULL,
- "taler-mint-httpd",
- "taler-mint-httpd",
- "-d", "test-mint-home",
- NULL);
+ exchanged = GNUNET_OS_start_process (GNUNET_NO,
+ GNUNET_OS_INHERIT_STD_ALL,
+ NULL, NULL, NULL,
+ "taler-exchange-httpd",
+ "taler-exchange-httpd",
+ "-c", "test_exchange_api.conf",
+ NULL);
/* give child time to start and bind against the socket */
- fprintf (stderr, "Waiting for taler-mint-httpd to be ready");
+ fprintf (stderr, "Waiting for taler-exchange-httpd to be ready");
do
{
fprintf (stderr, ".");
@@ -2589,11 +2569,11 @@ main (int argc,
fprintf (stderr, "\n");
result = GNUNET_SYSERR;
GNUNET_SCHEDULER_run (&run, NULL);
- GNUNET_OS_process_kill (mintd,
+ GNUNET_OS_process_kill (exchanged,
SIGTERM);
- GNUNET_OS_process_wait (mintd);
- GNUNET_OS_process_destroy (mintd);
+ GNUNET_OS_process_wait (exchanged);
+ GNUNET_OS_process_destroy (exchanged);
return (GNUNET_OK == result) ? 0 : 1;
}
-/* end of test_mint_api.c */
+/* end of test_exchange_api.c */
diff --git a/src/exchange-lib/test_exchange_api.conf b/src/exchange-lib/test_exchange_api.conf
new file mode 100644
index 000000000..281ac7361
--- /dev/null
+++ b/src/exchange-lib/test_exchange_api.conf
@@ -0,0 +1,95 @@
+# This file is in the public domain.
+#
+[PATHS]
+# Persistant data storage for the testcase
+TALER_TEST_HOME = test_exchange_api_home/
+
+[exchange]
+# Currency supported by the exchange (can only be one)
+CURRENCY = EUR
+
+# Wire format supported by the exchange
+# We use 'test' for testing of the actual
+# coin operations, and 'sepa' to test SEPA-specific routines.
+WIREFORMAT = test sepa
+
+# HTTP port the exchange listens to
+PORT = 8081
+
+# Master public key used to sign the exchange's various keys
+MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
+
+# How to access our database
+DB = postgres
+
+# Is this is a testcase, use transient DB actions?
+TESTRUN = YES
+
+[exchangedb-postgres]
+DB_CONN_STR = "postgres:///talercheck"
+
+[wire-incoming-test]
+# This is the response we give out for the /wire request. It provides
+# wallets with the bank information for transfers to the exchange.
+TEST_RESPONSE_FILE = ${TALER_CONFIG_HOME}/test.json
+
+[wire-outgoing-test]
+# What is the main website of the bank?
+BANK_URI = "http://localhost:8082/"
+# Into which account at the 'bank' should (incoming) wire transfers be made?
+BANK_ACCOUNT_NUMBER = 2
+
+[coin_eur_ct_1]
+value = EUR:0.01
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.00
+fee_deposit = EUR:0.00
+fee_refresh = EUR:0.01
+rsa_keysize = 1024
+
+[coin_eur_ct_10]
+value = EUR:0.10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+rsa_keysize = 1024
+
+[coin_eur_1]
+value = EUR:1
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+rsa_keysize = 1024
+
+[coin_eur_5]
+value = EUR:5
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+rsa_keysize = 1024
+
+[coin_eur_10]
+value = EUR:10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+rsa_keysize = 1024
diff --git a/src/exchange-lib/test_exchange_api_home/.config/taler/sepa.json b/src/exchange-lib/test_exchange_api_home/.config/taler/sepa.json
new file mode 100644
index 000000000..b435ce86b
--- /dev/null
+++ b/src/exchange-lib/test_exchange_api_home/.config/taler/sepa.json
@@ -0,0 +1,9 @@
+{
+ "name": "Max Musterman",
+ "bic": "COBADEFF370",
+ "type": "sepa",
+ "sig": "4EVRC2MCJPXQC8MC00831DNWEXMZAP4JQDDE1A7R6KR3MANG24RC1VQ55AX5A2E35S58VW1VSTENFTPHG5MWG9BSN8B8WXSV21KKW20",
+ "address": "Musterstadt",
+ "salt": "3KTM1ZRMWGEQPQ254S4R5R4Q8XM0ZYWTCTE01TZ76MVBSQ6RX7A5DR08WXVH1DCHR1R7ACRB7X0EVC2XDW1CBZM9WFSD9TRMZ90BR98",
+ "iban": "DE89370400440532013000"
+}
\ No newline at end of file
diff --git a/src/exchange-lib/test_exchange_api_home/.config/taler/test.json b/src/exchange-lib/test_exchange_api_home/.config/taler/test.json
new file mode 100644
index 000000000..be5e92c11
--- /dev/null
+++ b/src/exchange-lib/test_exchange_api_home/.config/taler/test.json
@@ -0,0 +1,8 @@
+{
+ "salt": "AZPRFVJ58NM6M7J5CZQPJAH3EW5DYM52AEZ9Y1C1ER3W94QV8D8TQKF6CK8MYQRA9QMSKDQTGZ306ZS9GQ0M6R01CJ20KPP49WFDZK8",
+ "name": "The exchange",
+ "account_number": 3,
+ "bank_uri": "http://localhost:8082/",
+ "type": "test",
+ "sig": "RPQXP9S4P8PQP7HEZQNRSZCT0ATNEP8GW0P5TPM34V5RX86FCD670V44R9NETSYDDKB8SZV7TKY9PAJYTY51D3VDWY9XXQ5BPFRXR28"
+}
\ No newline at end of file
diff --git a/src/mint-lib/test-mint-home/master.priv b/src/exchange-lib/test_exchange_api_home/.local/share/taler/exchange/offline-keys/master.priv
similarity index 100%
rename from src/mint-lib/test-mint-home/master.priv
rename to src/exchange-lib/test_exchange_api_home/.local/share/taler/exchange/offline-keys/master.priv
diff --git a/src/exchange-tools/Makefile.am b/src/exchange-tools/Makefile.am
new file mode 100644
index 000000000..631f3af20
--- /dev/null
+++ b/src/exchange-tools/Makefile.am
@@ -0,0 +1,96 @@
+# This Makefile.am is in the public domain
+AM_CPPFLAGS = -I$(top_srcdir)/src/include
+
+pkgcfgdir = $(prefix)/share/taler/config.d/
+
+pkgcfg_DATA = \
+ auditor.conf \
+ exchange-signkeys.conf \
+ coins.conf
+
+
+if USE_COVERAGE
+ AM_CFLAGS = --coverage -O0
+ XLIB = -lgcov
+endif
+
+bin_PROGRAMS = \
+ taler-auditor-sign \
+ taler-exchange-keyup \
+ taler-exchange-keycheck \
+ taler-exchange-reservemod \
+ taler-exchange-wire \
+ taler-exchange-dbinit
+
+taler_exchange_keyup_SOURCES = \
+ taler-exchange-keyup.c
+taler_exchange_keyup_LDADD = \
+ $(LIBGCRYPT_LIBS) \
+ $(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/pq/libtalerpq.la \
+ $(top_builddir)/src/exchangedb/libtalerexchangedb.la \
+ -lgnunetutil $(XLIB)
+taler_exchange_keyup_LDFLAGS = $(POSTGRESQL_LDFLAGS)
+
+taler_auditor_sign_SOURCES = \
+ taler-auditor-sign.c
+taler_auditor_sign_LDADD = \
+ $(LIBGCRYPT_LIBS) \
+ $(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/exchangedb/libtalerexchangedb.la \
+ -lgnunetutil $(XLIB)
+
+
+taler_exchange_wire_SOURCES = \
+ taler-exchange-wire.c
+taler_exchange_wire_LDADD = \
+ $(LIBGCRYPT_LIBS) \
+ $(top_builddir)/src/wire/libtalerwire.la \
+ $(top_builddir)/src/util/libtalerutil.la \
+ -lgnunetjson \
+ -lgnunetutil \
+ -ljansson $(XLIB)
+taler_exchange_wire_LDFLAGS = $(POSTGRESQL_LDFLAGS)
+
+taler_exchange_keycheck_SOURCES = \
+ taler-exchange-keycheck.c
+taler_exchange_keycheck_LDADD = \
+ $(LIBGCRYPT_LIBS) \
+ $(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/exchangedb/libtalerexchangedb.la \
+ -lgnunetutil $(XLIB)
+taler_exchange_keycheck_LDFLAGS = $(POSTGRESQL_LDFLAGS)
+
+taler_exchange_reservemod_SOURCES = \
+ taler-exchange-reservemod.c
+taler_exchange_reservemod_LDADD = \
+ $(LIBGCRYPT_LIBS) \
+ $(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/pq/libtalerpq.la \
+ $(top_builddir)/src/exchangedb/libtalerexchangedb.la \
+ -lgnunetutil -ljansson $(XLIB)
+taler_exchange_reservemod_LDFLAGS = \
+ $(POSTGRESQL_LDFLAGS)
+taler_exchange_reservemod_CPPFLAGS = \
+ -I$(top_srcdir)/src/include \
+ -I$(top_srcdir)/src/pq/ \
+ $(POSTGRESQL_CPPFLAGS)
+
+taler_exchange_dbinit_SOURCES = \
+ taler-exchange-dbinit.c
+taler_exchange_dbinit_LDADD = \
+ $(LIBGCRYPT_LIBS) \
+ $(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/pq/libtalerpq.la \
+ $(top_builddir)/src/exchangedb/libtalerexchangedb.la \
+ -lgnunetutil $(XLIB)
+taler_exchange_dbinit_LDFLAGS = \
+ $(POSTGRESQL_LDFLAGS)
+taler_exchange_dbinit_CPPFLAGS = \
+ -I$(top_srcdir)/src/include \
+ -I$(top_srcdir)/src/pq/ \
+ $(POSTGRESQL_CPPFLAGS)
+
+
+EXTRA_DIST = \
+ auditor.conf
diff --git a/src/exchange-tools/auditor.conf b/src/exchange-tools/auditor.conf
new file mode 100644
index 000000000..7eb5f8ae9
--- /dev/null
+++ b/src/exchange-tools/auditor.conf
@@ -0,0 +1,12 @@
+# This configuration file is in the public domain
+#
+# It cointains options for the auditor.
+
+[auditor]
+
+# Where do we store the auditor's private key?
+AUDITOR_PRIV_FILE = ${TALER_DATA_HOME}/auditor/offline-keys/auditor.priv
+
+# What is the Web site of the auditor (i.e. to file complaints about
+# a misbehaving exchange)?
+# AUDITOR_URL = https://auditor.taler.net/
diff --git a/src/exchange-tools/coins.conf b/src/exchange-tools/coins.conf
new file mode 100644
index 000000000..90bf7064c
--- /dev/null
+++ b/src/exchange-tools/coins.conf
@@ -0,0 +1,25 @@
+# This configuration file is in the public domain
+#
+# This is a template file for coin definitions. There are no
+# reasonable defaults, as legal and business concerns influence each
+# value given.
+#
+# Note that while we only give one section here, you can define
+# any number of coins by providing many "coin_" sections.
+#
+# Coin definitions are detected because the section name begins with
+# "coin_". The rest of the name is free, but of course following the
+# convention of "coin_$CURRENCY[_$SUBUNIT]_$VALUE" make sense.
+#
+# [coin_eur_ct_1]
+
+# All options are mandatory!
+# value = EUR:0.01
+# duration_overlap = 60 minutes
+# duration_withdraw = 7 days
+# duration_spend = 2 years
+# duration_legal = 3 years
+# fee_withdraw = EUR:0.00
+# fee_deposit = EUR:0.00
+# fee_refresh = EUR:0.01
+# rsa_keysize = 1024
diff --git a/src/exchange-tools/exchange-signkeys.conf b/src/exchange-tools/exchange-signkeys.conf
new file mode 100644
index 000000000..3146f09b2
--- /dev/null
+++ b/src/exchange-tools/exchange-signkeys.conf
@@ -0,0 +1,16 @@
+# General data for signing keys.
+[exchange_keys]
+
+# how long is one signkey valid?
+signkey_duration = 4 weeks
+
+# how long are the signatures with the signkey valid?
+legal_duration = 2 years
+
+# how long do we generate denomination and signing keys
+# ahead of time?
+lookahead_sign = 32 weeks 1 day
+
+# how long do we provide to clients denomination and signing keys
+# ahead of time?
+lookahead_provide = 4 weeks 1 day
diff --git a/src/mint-tools/taler-auditor-sign.c b/src/exchange-tools/taler-auditor-sign.c
similarity index 65%
rename from src/mint-tools/taler-auditor-sign.c
rename to src/exchange-tools/taler-auditor-sign.c
index 7e6d3b12a..d5a3a9403 100644
--- a/src/mint-tools/taler-auditor-sign.c
+++ b/src/exchange-tools/taler-auditor-sign.c
@@ -15,12 +15,12 @@
*/
/**
* @file taler-auditor-sign.c
- * @brief Tool used by the auditor to sign the mint's master key and the
+ * @brief Tool used by the auditor to sign the exchange's master key and the
* denomination key(s).
* @author Christian Grothoff
*/
#include
-#include "taler_mintdb_lib.h"
+#include "taler_exchangedb_lib.h"
/**
@@ -34,15 +34,15 @@ static int verbose;
static char *auditor_key_file;
/**
- * Mint's public key (in Crockford base32 encoding).
+ * Exchange's public key (in Crockford base32 encoding).
*/
-static char *mint_public_key;
+static char *exchange_public_key;
/**
- * File with the Mint's denomination keys to sign, itself
- * signed by the Mint's public key.
+ * File with the Exchange's denomination keys to sign, itself
+ * signed by the Exchange's public key.
*/
-static char *mint_request_file;
+static char *exchange_request_file;
/**
* Where should we write the auditor's signature?
@@ -50,10 +50,20 @@ static char *mint_request_file;
static char *output_file;
/**
- * Master public key of the mint.
+ * URL of the auditor (informative for the user).
+ */
+static char *auditor_url;
+
+/**
+ * Master public key of the exchange.
*/
static struct TALER_MasterPublicKeyP master_public_key;
+/**
+ * Our configuration.
+ */
+static struct GNUNET_CONFIGURATION_Handle *cfg;
+
/**
* Print denomination key details for diagnostics.
@@ -114,8 +124,8 @@ print_dk (const struct TALER_DenominationKeyValidityPS *dk)
/**
* The main function of the taler-auditor-sign tool. This tool is used
- * to sign a mint's master and denomination keys, affirming that the
- * auditor is aware of them and will validate the mint's database with
+ * to sign a exchange's master and denomination keys, affirming that the
+ * auditor is aware of them and will validate the exchange's database with
* respect to these keys.
*
* @param argc number of arguments from the command line
@@ -126,18 +136,23 @@ int
main (int argc,
char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'a', "auditor-key", "FILE",
+ char *cfgfile = NULL;
+ const struct GNUNET_GETOPT_CommandLineOption options[] = {
+ {'a', "auditor-key", "FILENAME",
"file containing the private key of the auditor", 1,
&GNUNET_GETOPT_set_filename, &auditor_key_file},
- TALER_GETOPT_OPTION_HELP ("Private key of the auditor to use for signing"),
- {'m', "mint-key", "KEY",
- "public key of the mint (Crockford base32 encoded)", 1,
- &GNUNET_GETOPT_set_filename, &mint_public_key},
- {'r', "mint-request", "FILE",
- "set of keys the mint requested the auditor to sign", 1,
- &GNUNET_GETOPT_set_string, &mint_request_file},
- {'o', "output", "FILE",
+ GNUNET_GETOPT_OPTION_CFG_FILE (&cfgfile),
+ GNUNET_GETOPT_OPTION_HELP ("Private key of the auditor to use for signing"),
+ {'m', "exchange-key", "KEY",
+ "public key of the exchange (Crockford base32 encoded)", 1,
+ &GNUNET_GETOPT_set_filename, &exchange_public_key},
+ {'u', "auditor-url", "URL",
+ "URL of the auditor (informative link for the user)", 1,
+ &GNUNET_GETOPT_set_string, &auditor_url},
+ {'r', "exchange-request", "FILENAME",
+ "set of keys the exchange requested the auditor to sign", 1,
+ &GNUNET_GETOPT_set_string, &exchange_request_file},
+ {'o', "output", "FILENAME",
"where to write our signature", 1,
&GNUNET_GETOPT_set_string, &output_file},
GNUNET_GETOPT_OPTION_VERSION (VERSION "-" VCS_VERSION),
@@ -150,22 +165,49 @@ main (int argc,
struct GNUNET_DISK_FileHandle *fh;
struct TALER_DenominationKeyValidityPS *dks;
unsigned int dks_len;
- struct TALER_MintKeyValidityPS kv;
+ struct TALER_ExchangeKeyValidityPS kv;
off_t in_size;
unsigned int i;
GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-mint-keyup",
+ GNUNET_log_setup ("taler-auditor-sign",
"WARNING",
NULL));
- if (GNUNET_GETOPT_run ("taler-mint-keyup",
+ if (GNUNET_GETOPT_run ("taler-auditor-sign",
options,
argc, argv) < 0)
return 1;
- if (NULL == auditor_key_file)
+ cfg = GNUNET_CONFIGURATION_create ();
+ if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg,
+ cfgfile))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Malformed configuration file `%s', exit ...\n"),
+ cfgfile);
+ GNUNET_free_non_null (cfgfile);
+ return 1;
+ }
+ GNUNET_free_non_null (cfgfile);
+ if ( (NULL == auditor_key_file) &&
+ (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ "auditor",
+ "AUDITOR_PRIV_FILE",
+ &auditor_key_file)) )
{
fprintf (stderr,
- "Auditor key file not given\n");
+ "Auditor key file not given in neither configuration nor command-line\n");
+ return 1;
+ }
+ if ( (NULL == auditor_url) &&
+ (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "auditor",
+ "AUDITOR_URL",
+ &auditor_url)) )
+ {
+ fprintf (stderr,
+ "Auditor URL not given\n");
return 1;
}
eddsa_priv = GNUNET_CRYPTO_eddsa_key_create_from_file (auditor_key_file);
@@ -178,40 +220,40 @@ main (int argc,
}
GNUNET_CRYPTO_eddsa_key_get_public (eddsa_priv,
&apub.eddsa_pub);
- if (NULL == mint_public_key)
+ if (NULL == exchange_public_key)
{
fprintf (stderr,
- "Mint public key not given\n");
+ "Exchange public key not given\n");
GNUNET_free (eddsa_priv);
return 1;
}
if (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (mint_public_key,
- strlen (mint_public_key),
+ GNUNET_STRINGS_string_to_data (exchange_public_key,
+ strlen (exchange_public_key),
&master_public_key,
sizeof (master_public_key)))
{
fprintf (stderr,
"Public key `%s' malformed\n",
- mint_public_key);
+ exchange_public_key);
GNUNET_free (eddsa_priv);
return 1;
}
- if (NULL == mint_request_file)
+ if (NULL == exchange_request_file)
{
fprintf (stderr,
- "Mint signing request not given\n");
+ "Exchange signing request not given\n");
GNUNET_free (eddsa_priv);
return 1;
}
- fh = GNUNET_DISK_file_open (mint_request_file,
+ fh = GNUNET_DISK_file_open (exchange_request_file,
GNUNET_DISK_OPEN_READ,
GNUNET_DISK_PERM_NONE);
if (NULL == fh)
{
fprintf (stderr,
"Failed to open file `%s': %s\n",
- mint_request_file,
+ exchange_request_file,
STRERROR (errno));
GNUNET_free (eddsa_priv);
return 1;
@@ -222,7 +264,7 @@ main (int argc,
{
fprintf (stderr,
"Failed to obtain input file size `%s': %s\n",
- mint_request_file,
+ exchange_request_file,
STRERROR (errno));
GNUNET_DISK_file_close (fh);
GNUNET_free (eddsa_priv);
@@ -232,14 +274,17 @@ main (int argc,
{
fprintf (stderr,
"Input file size of file `%s' is invalid\n",
- mint_request_file);
+ exchange_request_file);
GNUNET_DISK_file_close (fh);
GNUNET_free (eddsa_priv);
return 1;
}
dks_len = in_size / sizeof (struct TALER_DenominationKeyValidityPS);
- kv.purpose.purpose = htonl (TALER_SIGNATURE_AUDITOR_MINT_KEYS);
- kv.purpose.size = htonl (sizeof (struct TALER_MintKeyValidityPS));
+ kv.purpose.purpose = htonl (TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS);
+ kv.purpose.size = htonl (sizeof (struct TALER_ExchangeKeyValidityPS));
+ GNUNET_CRYPTO_hash (auditor_url,
+ strlen (auditor_url) + 1,
+ &kv.auditor_url_hash);
kv.master = master_public_key;
dks = GNUNET_new_array (dks_len,
struct TALER_DenominationKeyValidityPS);
@@ -252,7 +297,7 @@ main (int argc,
{
fprintf (stderr,
"Failed to read input file `%s': %s\n",
- mint_request_file,
+ exchange_request_file,
STRERROR (errno));
GNUNET_DISK_file_close (fh);
GNUNET_free (sigs);
@@ -281,8 +326,6 @@ main (int argc,
GNUNET_CRYPTO_eddsa_sign (eddsa_priv,
&kv.purpose,
&sigs[i].eddsa_sig);
-
-
}
if (NULL == output_file)
@@ -297,12 +340,13 @@ main (int argc,
/* write result to disk */
if (GNUNET_OK !=
- TALER_MINTDB_auditor_write (output_file,
- &apub,
- sigs,
- &master_public_key,
- dks_len,
- dks))
+ TALER_EXCHANGEDB_auditor_write (output_file,
+ &apub,
+ auditor_url,
+ sigs,
+ &master_public_key,
+ dks_len,
+ dks))
{
fprintf (stderr,
"Failed to write to file `%s': %s\n",
@@ -312,6 +356,7 @@ main (int argc,
GNUNET_free (dks);
return 1;
}
+
GNUNET_free (sigs);
GNUNET_free (dks);
GNUNET_free (eddsa_priv);
diff --git a/src/mint-tools/taler-mint-dbinit.c b/src/exchange-tools/taler-exchange-dbinit.c
similarity index 57%
rename from src/mint-tools/taler-mint-dbinit.c
rename to src/exchange-tools/taler-exchange-dbinit.c
index 2d9f77764..9f301854f 100644
--- a/src/mint-tools/taler-mint-dbinit.c
+++ b/src/exchange-tools/taler-exchange-dbinit.c
@@ -14,34 +14,18 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mint-tools/taler-mint-dbinit.c
- * @brief Create tables for the mint database.
+ * @file exchange-tools/taler-exchange-dbinit.c
+ * @brief Create tables for the exchange database.
* @author Florian Dold
*/
#include "platform.h"
#include
-#include
-#include "taler_mintdb_plugin.h"
-
-/**
- * Mint directory with the keys.
- */
-static char *mint_base_dir;
-
-/**
- * Our configuration.
- */
-static struct GNUNET_CONFIGURATION_Handle *cfg;
-
-/**
- * Our DB plugin.
- */
-static struct TALER_MINTDB_Plugin *plugin;
+#include "taler_exchangedb_plugin.h"
/**
* The main function of the database initialization tool.
- * Used to initialize the Taler Mint's database.
+ * Used to initialize the Taler Exchange's database.
*
* @param argc number of arguments from the command line
* @param argv command line arguments
@@ -51,42 +35,42 @@ int
main (int argc,
char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'d', "mint-dir", "DIR",
- "mint directory", 1,
- &GNUNET_GETOPT_set_filename, &mint_base_dir},
- GNUNET_GETOPT_OPTION_HELP ("Initialize Taler Mint database"),
+ char *cfgfile = NULL;
+ const struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_CFG_FILE (&cfgfile),
+ GNUNET_GETOPT_OPTION_HELP ("Initialize Taler Exchange database"),
GNUNET_GETOPT_OPTION_VERSION (VERSION "-" VCS_VERSION),
GNUNET_GETOPT_OPTION_END
};
+ struct GNUNET_CONFIGURATION_Handle *cfg;
+ struct TALER_EXCHANGEDB_Plugin *plugin;
- if (GNUNET_GETOPT_run ("taler-mint-dbinit",
+ if (GNUNET_GETOPT_run ("taler-exchange-dbinit",
options,
argc, argv) < 0)
return 1;
GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-mint-dbinit",
+ GNUNET_log_setup ("taler-exchange-dbinit",
"INFO",
NULL));
- if (NULL == mint_base_dir)
+ cfg = GNUNET_CONFIGURATION_create ();
+ if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg,
+ cfgfile))
{
- fprintf (stderr,
- "Mint base directory not given.\n");
- return 1;
- }
- cfg = TALER_config_load (mint_base_dir);
- if (NULL == cfg)
- {
- fprintf (stderr,
- "Failed to load mint configuration.\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Malformed configuration file `%s', exit ...\n"),
+ cfgfile);
+ GNUNET_free_non_null (cfgfile);
return 1;
}
+ GNUNET_free_non_null (cfgfile);
if (NULL ==
- (plugin = TALER_MINTDB_plugin_load (cfg)))
+ (plugin = TALER_EXCHANGEDB_plugin_load (cfg)))
{
fprintf (stderr,
"Failed to initialize database plugin.\n");
+ GNUNET_CONFIGURATION_destroy (cfg);
return 1;
}
if (GNUNET_OK !=
@@ -95,11 +79,13 @@ main (int argc,
{
fprintf (stderr,
"Failed to initialize database.\n");
- TALER_MINTDB_plugin_unload (plugin);
+ TALER_EXCHANGEDB_plugin_unload (plugin);
+ GNUNET_CONFIGURATION_destroy (cfg);
return 1;
}
- TALER_MINTDB_plugin_unload (plugin);
+ TALER_EXCHANGEDB_plugin_unload (plugin);
+ GNUNET_CONFIGURATION_destroy (cfg);
return 0;
}
-/* end of taler-mint-dbinit.c */
+/* end of taler-exchange-dbinit.c */
diff --git a/src/mint-tools/taler-mint-keycheck.c b/src/exchange-tools/taler-exchange-keycheck.c
similarity index 71%
rename from src/mint-tools/taler-mint-keycheck.c
rename to src/exchange-tools/taler-exchange-keycheck.c
index 4fa2707f8..064f2249e 100644
--- a/src/mint-tools/taler-mint-keycheck.c
+++ b/src/exchange-tools/taler-exchange-keycheck.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
+ Copyright (C) 2014, 2015, 2016 GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -14,9 +14,9 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-keycheck.c
- * @brief Check mint keys for validity. Reads the signing and denomination
- * keys from the mint directory and checks to make sure they are
+ * @file taler-exchange-keycheck.c
+ * @brief Check exchange keys for validity. Reads the signing and denomination
+ * keys from the exchange directory and checks to make sure they are
* well-formed. This is purely a diagnostic tool.
* @author Florian Dold
* @author Benedikt Mueller
@@ -24,12 +24,12 @@
*/
#include
#include
-#include "taler_mintdb_lib.h"
+#include "taler_exchangedb_lib.h"
/**
- * Mint directory with the keys.
+ * Exchange directory with the keys.
*/
-static char *mint_directory;
+static char *exchange_directory;
/**
* Our configuration.
@@ -50,7 +50,7 @@ static struct GNUNET_CONFIGURATION_Handle *kcfg;
static int
signkeys_iter (void *cls,
const char *filename,
- const struct TALER_MINTDB_PrivateSigningKeyInformationP *ski)
+ const struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP *ski)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Iterating over key `%s' for start time %s\n",
@@ -59,8 +59,8 @@ signkeys_iter (void *cls,
(GNUNET_TIME_absolute_ntoh (ski->issue.start)));
if (ntohl (ski->issue.purpose.size) !=
- (sizeof (struct TALER_MintSigningKeyValidityPS) -
- offsetof (struct TALER_MintSigningKeyValidityPS,
+ (sizeof (struct TALER_ExchangeSigningKeyValidityPS) -
+ offsetof (struct TALER_ExchangeSigningKeyValidityPS,
purpose)))
{
fprintf (stderr,
@@ -101,11 +101,11 @@ signkeys_iter (void *cls,
* #GNUNET_NO if not
*/
static int
-mint_signkeys_check ()
+exchange_signkeys_check ()
{
- if (0 > TALER_MINTDB_signing_keys_iterate (mint_directory,
- &signkeys_iter,
- NULL))
+ if (0 > TALER_EXCHANGEDB_signing_keys_iterate (exchange_directory,
+ &signkeys_iter,
+ NULL))
return GNUNET_NO;
return GNUNET_OK;
}
@@ -124,7 +124,7 @@ mint_signkeys_check ()
static int
denomkeys_iter (void *cls,
const char *alias,
- const struct TALER_MINTDB_DenominationKeyIssueInformation *dki)
+ const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki)
{
struct GNUNET_HashCode hc;
@@ -183,11 +183,11 @@ denomkeys_iter (void *cls,
* #GNUNET_NO if not
*/
static int
-mint_denomkeys_check ()
+exchange_denomkeys_check ()
{
- if (0 > TALER_MINTDB_denomination_keys_iterate (mint_directory,
- &denomkeys_iter,
- NULL))
+ if (0 > TALER_EXCHANGEDB_denomination_keys_iterate (exchange_directory,
+ &denomkeys_iter,
+ NULL))
return GNUNET_NO;
return GNUNET_OK;
}
@@ -203,39 +203,47 @@ mint_denomkeys_check ()
int
main (int argc, char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- GNUNET_GETOPT_OPTION_HELP ("gnunet-mint-keycheck OPTIONS"),
- {'d', "directory", "DIRECTORY",
- "mint directory with keys to check", 1,
- &GNUNET_GETOPT_set_filename, &mint_directory},
+ char *cfgfile;
+ const struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_CFG_FILE (&cfgfile),
+ GNUNET_GETOPT_OPTION_HELP ("gnunet-exchange-keycheck OPTIONS"),
GNUNET_GETOPT_OPTION_END
};
GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-mint-keycheck",
+ GNUNET_log_setup ("taler-exchange-keycheck",
"WARNING",
NULL));
- if (GNUNET_GETOPT_run ("taler-mint-keycheck",
+ if (GNUNET_GETOPT_run ("taler-exchange-keycheck",
options,
argc, argv) < 0)
return 1;
- if (NULL == mint_directory)
+ kcfg = GNUNET_CONFIGURATION_create ();
+ if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (kcfg,
+ cfgfile))
{
- fprintf (stderr,
- "Mint directory not given\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Malformed configuration file `%s', exit ...\n"),
+ cfgfile);
+ GNUNET_free_non_null (cfgfile);
+ return 1;
+ }
+ GNUNET_free_non_null (cfgfile);
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (kcfg,
+ "exchange",
+ "KEYDIR",
+ &exchange_directory))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "KEYDIR");
return 1;
}
- kcfg = TALER_config_load (mint_directory);
- if (NULL == kcfg)
- {
- fprintf (stderr,
- "Failed to load mint configuration\n");
- return 1;
- }
- if ( (GNUNET_OK != mint_signkeys_check ()) ||
- (GNUNET_OK != mint_denomkeys_check ()) )
+ if ( (GNUNET_OK != exchange_signkeys_check ()) ||
+ (GNUNET_OK != exchange_denomkeys_check ()) )
{
GNUNET_CONFIGURATION_destroy (kcfg);
return 1;
@@ -244,4 +252,4 @@ main (int argc, char *const *argv)
return 0;
}
-/* end of taler-mint-keycheck.c */
+/* end of taler-exchange-keycheck.c */
diff --git a/src/mint-tools/taler-mint-keyup.c b/src/exchange-tools/taler-exchange-keyup.c
similarity index 85%
rename from src/mint-tools/taler-mint-keyup.c
rename to src/exchange-tools/taler-exchange-keyup.c
index b82554b94..ab2123a15 100644
--- a/src/mint-tools/taler-mint-keyup.c
+++ b/src/exchange-tools/taler-exchange-keyup.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
+ Copyright (C) 2014, 2015, 2016 GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -14,15 +14,15 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-keyup.c
- * @brief Update the mint's keys for coins and signatures,
- * using the mint's offline master key.
+ * @file taler-exchange-keyup.c
+ * @brief Update the exchange's keys for coins and signatures,
+ * using the exchange's offline master key.
* @author Florian Dold
* @author Benedikt Mueller
* @author Christian Grothoff
*/
#include
-#include "taler_mintdb_lib.h"
+#include "taler_exchangedb_lib.h"
/**
* When generating filenames from a cryptographic hash, we do not use
@@ -169,9 +169,9 @@ static char *auditorrequestfile;
static FILE *auditor_output_file;
/**
- * Director of the mint, containing the keys.
+ * Director of the exchange, containing the keys.
*/
-static char *mint_directory;
+static char *exchange_directory;
/**
* Time to pretend when the key update is executed.
@@ -179,7 +179,7 @@ static char *mint_directory;
static char *pretend_time_str;
/**
- * Handle to the mint's configuration
+ * Handle to the exchange's configuration
*/
static struct GNUNET_CONFIGURATION_Handle *kcfg;
@@ -190,12 +190,12 @@ static struct GNUNET_CONFIGURATION_Handle *kcfg;
static struct GNUNET_TIME_Absolute now;
/**
- * Master private key of the mint.
+ * Master private key of the exchange.
*/
static struct TALER_MasterPrivateKeyP master_priv;
/**
- * Master public key of the mint.
+ * Master public key of the exchange.
*/
static struct TALER_MasterPublicKeyP master_public_key;
@@ -210,7 +210,7 @@ static struct GNUNET_TIME_Absolute lookahead_sign_stamp;
* keys created at time @a start.
*
* @param start time at which we create the signing key
- * @return name of the directory we should use, basically "$MINTDIR/$TIME/";
+ * @return name of the directory we should use, basically "$EXCHANGEDIR/$TIME/";
* (valid until next call to this function)
*/
static const char *
@@ -220,8 +220,8 @@ get_signkey_file (struct GNUNET_TIME_Absolute start)
GNUNET_snprintf (dir,
sizeof (dir),
- "%s" DIR_SEPARATOR_STR TALER_MINTDB_DIR_SIGNING_KEYS DIR_SEPARATOR_STR "%llu",
- mint_directory,
+ "%s" DIR_SEPARATOR_STR TALER_EXCHANGEDB_DIR_SIGNING_KEYS DIR_SEPARATOR_STR "%llu",
+ exchange_directory,
(unsigned long long) start.abs_value_us);
return dir;
}
@@ -265,7 +265,7 @@ hash_coin_type (const struct CoinTypeParams *p,
/**
* Obtain the name of the directory we should use to store coins of
* the given type. The directory name has the format
- * "$MINTDIR/$VALUE/$HASH/" where "$VALUE" represents the value of the
+ * "$EXCHANGEDIR/$VALUE/$HASH/" where "$VALUE" represents the value of the
* coin and "$HASH" encodes all of the coin's parameters, generating a
* unique string for each type of coin. Note that the "$HASH"
* includes neither the absolute creation time nor the key of the
@@ -299,8 +299,8 @@ get_cointype_dir (const struct CoinTypeParams *p)
GNUNET_snprintf (dir,
sizeof (dir),
- "%s" DIR_SEPARATOR_STR TALER_MINTDB_DIR_DENOMINATION_KEYS DIR_SEPARATOR_STR "%s-%s",
- mint_directory,
+ "%s" DIR_SEPARATOR_STR TALER_EXCHANGEDB_DIR_DENOMINATION_KEYS DIR_SEPARATOR_STR "%s-%s",
+ exchange_directory,
val_str,
hash_str);
GNUNET_free (hash_str);
@@ -434,7 +434,7 @@ get_anchor (const char *dir,
/**
- * Create a mint signing key (for signing mint messages, not for coins)
+ * Create a exchange signing key (for signing exchange messages, not for coins)
* and assert its correctness by signing it with the master key.
*
* @param start start time of the validity period for the key
@@ -446,10 +446,10 @@ static void
create_signkey_issue_priv (struct GNUNET_TIME_Absolute start,
struct GNUNET_TIME_Relative duration,
struct GNUNET_TIME_Absolute end,
- struct TALER_MINTDB_PrivateSigningKeyInformationP *pi)
+ struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP *pi)
{
struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
- struct TALER_MintSigningKeyValidityPS *issue = &pi->issue;
+ struct TALER_ExchangeSigningKeyValidityPS *issue = &pi->issue;
priv = GNUNET_CRYPTO_eddsa_key_create ();
pi->signkey_priv.eddsa_priv = *priv;
@@ -462,8 +462,8 @@ create_signkey_issue_priv (struct GNUNET_TIME_Absolute start,
GNUNET_CRYPTO_eddsa_key_get_public (&pi->signkey_priv.eddsa_priv,
&issue->signkey_pub.eddsa_pub);
issue->purpose.purpose = htonl (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY);
- issue->purpose.size = htonl (sizeof (struct TALER_MintSigningKeyValidityPS) -
- offsetof (struct TALER_MintSigningKeyValidityPS,
+ issue->purpose.size = htonl (sizeof (struct TALER_ExchangeSigningKeyValidityPS) -
+ offsetof (struct TALER_ExchangeSigningKeyValidityPS,
purpose));
GNUNET_assert (GNUNET_OK ==
@@ -480,7 +480,7 @@ create_signkey_issue_priv (struct GNUNET_TIME_Absolute start,
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
static int
-mint_keys_update_signkeys ()
+exchange_keys_update_signkeys ()
{
struct GNUNET_TIME_Relative signkey_duration;
struct GNUNET_TIME_Relative legal_duration;
@@ -489,23 +489,23 @@ mint_keys_update_signkeys ()
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (kcfg,
- "mint_keys",
+ "exchange_keys",
"signkey_duration",
&signkey_duration))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint_keys",
+ "exchange_keys",
"signkey_duration");
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (kcfg,
- "mint_keys",
+ "exchange_keys",
"legal_duration",
&legal_duration))
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "mint_keys",
+ "exchange_keys",
"legal_duration",
"fails to specify valid timeframe");
return GNUNET_SYSERR;
@@ -513,15 +513,15 @@ mint_keys_update_signkeys ()
if (signkey_duration.rel_value_us > legal_duration.rel_value_us)
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "mint_keys",
+ "exchange_keys",
"legal_duration",
"must be longer than signkey_duration");
return GNUNET_SYSERR;
}
- TALER_round_rel_time (&signkey_duration);
+ GNUNET_TIME_round_rel (&signkey_duration);
GNUNET_asprintf (&signkey_dir,
- "%s" DIR_SEPARATOR_STR TALER_MINTDB_DIR_SIGNING_KEYS,
- mint_directory);
+ "%s" DIR_SEPARATOR_STR TALER_EXCHANGEDB_DIR_SIGNING_KEYS,
+ exchange_directory);
/* make sure the directory exists */
if (GNUNET_OK !=
GNUNET_DISK_directory_create (signkey_dir))
@@ -539,7 +539,7 @@ mint_keys_update_signkeys ()
while (anchor.abs_value_us < lookahead_sign_stamp.abs_value_us)
{
const char *skf;
- struct TALER_MINTDB_PrivateSigningKeyInformationP signkey_issue;
+ struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP signkey_issue;
ssize_t nwrite;
struct GNUNET_TIME_Absolute end;
@@ -557,9 +557,9 @@ mint_keys_update_signkeys ()
&signkey_issue);
nwrite = GNUNET_DISK_fn_write (skf,
&signkey_issue,
- sizeof (struct TALER_MINTDB_PrivateSigningKeyInformationP),
+ sizeof (struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP),
GNUNET_DISK_PERM_USER_WRITE | GNUNET_DISK_PERM_USER_READ);
- if (sizeof (struct TALER_MINTDB_PrivateSigningKeyInformationP) != nwrite)
+ if (sizeof (struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP) != nwrite)
{
fprintf (stderr,
"Failed to write to file `%s': %s\n",
@@ -600,7 +600,7 @@ get_cointype_params (const char *ct,
"duration_withdraw");
return GNUNET_SYSERR;
}
- TALER_round_rel_time (¶ms->duration_withdraw);
+ GNUNET_TIME_round_rel (¶ms->duration_withdraw);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (kcfg,
ct,
@@ -612,7 +612,7 @@ get_cointype_params (const char *ct,
"duration_spend");
return GNUNET_SYSERR;
}
- TALER_round_rel_time (¶ms->duration_spend);
+ GNUNET_TIME_round_rel (¶ms->duration_spend);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (kcfg,
ct,
@@ -624,7 +624,7 @@ get_cointype_params (const char *ct,
"duration_legal");
return GNUNET_SYSERR;
}
- TALER_round_rel_time (¶ms->duration_legal);
+ GNUNET_TIME_round_rel (¶ms->duration_legal);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (kcfg,
ct,
@@ -633,10 +633,10 @@ get_cointype_params (const char *ct,
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
ct,
- "mint_denom_duration_overlap");
+ "exchange_denom_duration_overlap");
return GNUNET_SYSERR;
}
- TALER_round_rel_time (¶ms->duration_overlap);
+ GNUNET_TIME_round_rel (¶ms->duration_overlap);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_number (kcfg,
ct,
@@ -722,7 +722,7 @@ get_cointype_params (const char *ct,
*/
static void
create_denomkey_issue (const struct CoinTypeParams *params,
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki)
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki)
{
dki->denom_priv.rsa_private_key
= GNUNET_CRYPTO_rsa_private_key_create (params->rsa_keysize);
@@ -769,13 +769,13 @@ create_denomkey_issue (const struct CoinTypeParams *params,
* @param coin_alias name of the coin's section in the configuration
*/
static void
-mint_keys_update_cointype (void *cls,
+exchange_keys_update_cointype (void *cls,
const char *coin_alias)
{
int *ret = cls;
struct CoinTypeParams p;
const char *dkf;
- struct TALER_MINTDB_DenominationKeyIssueInformation denomkey_issue;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation denomkey_issue;
if (0 != strncasecmp (coin_alias,
"coin_",
@@ -808,7 +808,7 @@ mint_keys_update_cointype (void *cls,
create_denomkey_issue (&p,
&denomkey_issue);
if (GNUNET_OK !=
- TALER_MINTDB_denomination_key_write (dkf,
+ TALER_EXCHANGEDB_denomination_key_write (dkf,
&denomkey_issue))
{
fprintf (stderr,
@@ -842,28 +842,28 @@ mint_keys_update_cointype (void *cls,
/**
- * Update all of the denomination keys of the mint.
+ * Update all of the denomination keys of the exchange.
*
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
static int
-mint_keys_update_denomkeys ()
+exchange_keys_update_denomkeys ()
{
int ok;
ok = GNUNET_OK;
GNUNET_CONFIGURATION_iterate_sections (kcfg,
- &mint_keys_update_cointype,
+ &exchange_keys_update_cointype,
&ok);
return ok;
}
/**
- * The main function of the taler-mint-keyup tool. This tool is used
- * to create the signing and denomination keys for the mint. It uses
+ * The main function of the taler-exchange-keyup tool. This tool is used
+ * to create the signing and denomination keys for the exchange. It uses
* the long-term offline private key and writes the (additional) key
- * files to the respective mint directory (from where they can then be
+ * files to the respective exchange directory (from where they can then be
* copied to the online server). Note that we need (at least) the
* most recent generated previous keys so as to align the validity
* periods.
@@ -876,11 +876,10 @@ int
main (int argc,
char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'d', "mint-dir", "DIR",
- "mint directory with keys to update", 1,
- &GNUNET_GETOPT_set_filename, &mint_directory},
- TALER_GETOPT_OPTION_HELP ("Setup signing and denomination keys for a Taler mint"),
+ char *cfgfile = NULL;
+ const struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_CFG_FILE (&cfgfile),
+ GNUNET_GETOPT_OPTION_HELP ("Setup signing and denomination keys for a Taler exchange"),
{'m', "master-key", "FILE",
"master key file (private key)", 1,
&GNUNET_GETOPT_set_filename, &masterkeyfile},
@@ -897,20 +896,25 @@ main (int argc,
struct GNUNET_CRYPTO_EddsaPrivateKey *eddsa_priv;
GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-mint-keyup",
+ GNUNET_log_setup ("taler-exchange-keyup",
"WARNING",
NULL));
- if (GNUNET_GETOPT_run ("taler-mint-keyup",
+ if (GNUNET_GETOPT_run ("taler-exchange-keyup",
options,
argc, argv) < 0)
return 1;
- if (NULL == mint_directory)
+ kcfg = GNUNET_CONFIGURATION_create ();
+ if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (kcfg,
+ cfgfile))
{
- fprintf (stderr,
- "Mint directory not given\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Malformed configuration file `%s', exit ...\n"),
+ cfgfile);
+ GNUNET_free_non_null (cfgfile);
return 1;
}
+ GNUNET_free_non_null (cfgfile);
if (NULL != pretend_time_str)
{
if (GNUNET_OK !=
@@ -927,19 +931,27 @@ main (int argc,
{
now = GNUNET_TIME_absolute_get ();
}
- TALER_round_abs_time (&now);
-
- kcfg = TALER_config_load (mint_directory);
- if (NULL == kcfg)
+ GNUNET_TIME_round_abs (&now);
+ if ( (NULL == masterkeyfile) &&
+ (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (kcfg,
+ "exchange",
+ "MASTER_PRIV_FILE",
+ &masterkeyfile)) )
{
fprintf (stderr,
- "Failed to load mint configuration\n");
+ "Master key file not given in neither configuration nor command-line\n");
return 1;
}
- if (NULL == masterkeyfile)
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (kcfg,
+ "exchange",
+ "KEYDIR",
+ &exchange_directory))
{
- fprintf (stderr,
- "Master key file not given\n");
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "KEYDIR");
return 1;
}
eddsa_priv = GNUNET_CRYPTO_eddsa_key_create_from_file (masterkeyfile);
@@ -975,13 +987,13 @@ main (int argc,
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_data (kcfg,
- "mint",
+ "exchange",
"master_public_key",
&master_public_key_from_cfg,
sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint",
+ "exchange",
"master_public_key");
return 1;
}
@@ -991,7 +1003,7 @@ main (int argc,
sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "mint",
+ "exchange",
"master_public_key",
_("does not match with private key"));
return 1;
@@ -1000,33 +1012,33 @@ main (int argc,
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (kcfg,
- "mint_keys",
+ "exchange_keys",
"lookahead_sign",
&lookahead_sign))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint_keys",
+ "exchange_keys",
"lookahead_sign");
return GNUNET_SYSERR;
}
if (0 == lookahead_sign.rel_value_us)
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "mint_keys",
+ "exchange_keys",
"lookahead_sign",
_("must not be zero"));
return GNUNET_SYSERR;
}
- TALER_round_rel_time (&lookahead_sign);
+ GNUNET_TIME_round_rel (&lookahead_sign);
lookahead_sign_stamp = GNUNET_TIME_absolute_add (now,
lookahead_sign);
/* finally, do actual work */
- if (GNUNET_OK != mint_keys_update_signkeys ())
+ if (GNUNET_OK != exchange_keys_update_signkeys ())
return 1;
- if (GNUNET_OK != mint_keys_update_denomkeys ())
+ if (GNUNET_OK != exchange_keys_update_denomkeys ())
return 1;
if (NULL != auditor_output_file)
{
@@ -1036,4 +1048,4 @@ main (int argc,
return 0;
}
-/* end of taler-mint-keyup.c */
+/* end of taler-exchange-keyup.c */
diff --git a/src/mint-tools/taler-mint-reservemod.c b/src/exchange-tools/taler-exchange-reservemod.c
similarity index 76%
rename from src/mint-tools/taler-mint-reservemod.c
rename to src/exchange-tools/taler-exchange-reservemod.c
index 38d27054a..3494e88a0 100644
--- a/src/mint-tools/taler-mint-reservemod.c
+++ b/src/exchange-tools/taler-exchange-reservemod.c
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-reservemod.c
+ * @file taler-exchange-reservemod.c
* @brief Modify reserves. Allows manipulation of reserve balances.
* @author Florian Dold
* @author Benedikt Mueller
@@ -23,22 +23,22 @@
#include
#include
#include
-#include "taler_mintdb_plugin.h"
+#include "taler_exchangedb_plugin.h"
/**
- * Director of the mint, containing the keys.
+ * Director of the exchange, containing the keys.
*/
-static char *mint_directory;
+static char *exchange_directory;
/**
- * Handle to the mint's configuration
+ * Handle to the exchange's configuration
*/
static struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Our DB plugin.
*/
-static struct TALER_MINTDB_Plugin *plugin;
+static struct TALER_EXCHANGEDB_Plugin *plugin;
/**
@@ -51,6 +51,7 @@ static struct TALER_MINTDB_Plugin *plugin;
int
main (int argc, char *const *argv)
{
+ char *cfgfile = NULL;
char *reserve_pub_str = NULL;
char *add_str = NULL;
struct TALER_Amount add_value;
@@ -58,18 +59,16 @@ main (int argc, char *const *argv)
json_t *jdetails;
json_error_t error;
struct TALER_ReservePublicKeyP reserve_pub;
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
const struct GNUNET_GETOPT_CommandLineOption options[] = {
{'a', "add", "DENOM",
"value to add", 1,
&GNUNET_GETOPT_set_string, &add_str},
- {'d', "mint-dir", "DIR",
- "mint directory with keys to update", 1,
- &GNUNET_GETOPT_set_filename, &mint_directory},
- {'D', "details", "JSON",
+ GNUNET_GETOPT_OPTION_CFG_FILE (&cfgfile),
+ {'d', "details", "JSON",
"details about the bank transaction which justify why we add this amount", 1,
&GNUNET_GETOPT_set_string, &details},
- TALER_GETOPT_OPTION_HELP ("Deposit funds into a Taler reserve"),
+ GNUNET_GETOPT_OPTION_HELP ("Deposit funds into a Taler reserve"),
{'R', "reserve", "KEY",
"reserve (public key) to modify", 1,
&GNUNET_GETOPT_set_string, &reserve_pub_str},
@@ -79,18 +78,37 @@ main (int argc, char *const *argv)
int ret;
GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-mint-reservemod",
+ GNUNET_log_setup ("taler-exchange-reservemod",
"WARNING",
NULL));
- if (GNUNET_GETOPT_run ("taler-mint-reservemod",
+ if (GNUNET_GETOPT_run ("taler-exchange-reservemod",
options,
argc, argv) < 0)
return 1;
- if (NULL == mint_directory)
+ cfg = GNUNET_CONFIGURATION_create ();
+ if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg,
+ cfgfile))
{
- fprintf (stderr,
- "Mint directory not given\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Malformed configuration file `%s', exit ...\n"),
+ cfgfile);
+ GNUNET_free_non_null (cfgfile);
+ GNUNET_free_non_null (add_str);
+ GNUNET_free_non_null (details);
+ GNUNET_free_non_null (reserve_pub_str);
+ return 1;
+ }
+ GNUNET_free_non_null (cfgfile);
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ "exchange",
+ "KEYDIR",
+ &exchange_directory))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "KEYDIR");
GNUNET_free_non_null (add_str);
GNUNET_free_non_null (details);
GNUNET_free_non_null (reserve_pub_str);
@@ -133,19 +151,9 @@ main (int argc, char *const *argv)
return 1;
}
- cfg = TALER_config_load (mint_directory);
- if (NULL == cfg)
- {
- fprintf (stderr,
- "Failed to load mint configuration\n");
- GNUNET_free_non_null (add_str);
- GNUNET_free_non_null (details);
- GNUNET_free_non_null (reserve_pub_str);
- return 1;
- }
ret = 1;
if (NULL ==
- (plugin = TALER_MINTDB_plugin_load (cfg)))
+ (plugin = TALER_EXCHANGEDB_plugin_load (cfg)))
{
fprintf (stderr,
"Failed to initialize database plugin.\n");
@@ -194,7 +202,7 @@ main (int argc, char *const *argv)
ret = 0;
cleanup:
if (NULL != plugin)
- TALER_MINTDB_plugin_unload (plugin);
+ TALER_EXCHANGEDB_plugin_unload (plugin);
if (NULL != cfg)
GNUNET_CONFIGURATION_destroy (cfg);
GNUNET_free_non_null (add_str);
@@ -203,4 +211,4 @@ main (int argc, char *const *argv)
return ret;
}
-/* end taler-mint-reservemod.c */
+/* end taler-exchange-reservemod.c */
diff --git a/src/exchange-tools/taler-exchange-wire.c b/src/exchange-tools/taler-exchange-wire.c
new file mode 100644
index 000000000..c57e45f09
--- /dev/null
+++ b/src/exchange-tools/taler-exchange-wire.c
@@ -0,0 +1,214 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2015, 2016 Inria
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+*/
+/**
+ * @file taler-exchange-wire.c
+ * @brief Create signed response for /wire requests.
+ * @author Christian Grothoff
+ */
+#include
+#include
+#include
+#include "taler_crypto_lib.h"
+#include "taler_wire_lib.h"
+#include "taler_signatures.h"
+
+
+/**
+ * Filename of the master private key.
+ */
+static char *masterkeyfile;
+
+/**
+ * Account holder information in JSON format.
+ */
+static char *json_in;
+
+/**
+ * Which wire method is this for?
+ */
+static char *method;
+
+/**
+ * Where to write the result.
+ */
+static char *output_filename;
+
+/**
+ * Our configuration.
+ */
+static struct GNUNET_CONFIGURATION_Handle *cfg;
+
+
+/**
+ * The main function of the taler-exchange-sepa tool. This tool is used
+ * to sign the SEPA bank account details using the master key.
+ *
+ * @param argc number of arguments from the command line
+ * @param argv command line arguments
+ * @return 0 ok, 1 on error
+ */
+int
+main (int argc,
+ char *const *argv)
+{
+ char *cfgfile = NULL;
+ const struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_CFG_FILE (&cfgfile),
+ {'j', "json", "JSON",
+ "account information in JSON format", 1,
+ &GNUNET_GETOPT_set_string, &json_in},
+ {'m', "master-key", "FILE",
+ "master key file (private key)", 1,
+ &GNUNET_GETOPT_set_filename, &masterkeyfile},
+ {'t', "type", "METHOD",
+ "which wire transfer method (i.e. 'test' or 'sepa') is this for?", 1,
+ &GNUNET_GETOPT_set_string, &method},
+ {'o', "output", "FILE",
+ "where to write the result", 1,
+ &GNUNET_GETOPT_set_filename, &output_filename},
+ GNUNET_GETOPT_OPTION_HELP ("Setup /wire response"),
+ GNUNET_GETOPT_OPTION_VERSION (VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_OPTION_END
+ };
+ struct GNUNET_CRYPTO_EddsaPrivateKey *eddsa_priv;
+ struct TALER_MasterPrivateKeyP key;
+ struct TALER_MasterSignatureP sig;
+ json_t *j;
+ json_error_t err;
+ char *json_out;
+ struct GNUNET_HashCode salt;
+ struct TALER_WIRE_Plugin *plugin;
+
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_log_setup ("taler-exchange-wire",
+ "WARNING",
+ NULL));
+
+ if (GNUNET_GETOPT_run ("taler-exchange-wire",
+ options,
+ argc, argv) < 0)
+ return 1;
+ cfg = GNUNET_CONFIGURATION_create ();
+ if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg,
+ cfgfile))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Malformed configuration file `%s', exit ...\n"),
+ cfgfile);
+ GNUNET_free_non_null (cfgfile);
+ return 1;
+ }
+ GNUNET_free_non_null (cfgfile);
+ if ( (NULL == masterkeyfile) &&
+ (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ "exchange-master",
+ "MASTER_PRIV_FILE",
+ &masterkeyfile)) )
+ {
+ fprintf (stderr,
+ "Master key file not given in neither configuration nor command-line\n");
+ return 1;
+ }
+ eddsa_priv = GNUNET_CRYPTO_eddsa_key_create_from_file (masterkeyfile);
+ if (NULL == eddsa_priv)
+ {
+ fprintf (stderr,
+ "Failed to initialize master key from file `%s'\n",
+ masterkeyfile);
+ return 1;
+ }
+ if (NULL == json_in)
+ {
+ fprintf (stderr,
+ "Required -j argument missing\n");
+ return 1;
+ }
+ if (NULL == method)
+ {
+ fprintf (stderr,
+ "Required -t argument missing\n");
+ return 1;
+ }
+ j = json_loads (json_in,
+ JSON_REJECT_DUPLICATES,
+ &err);
+ if (NULL == j)
+ {
+ fprintf (stderr,
+ "Failed to parse JSON: %s (at offset %u)\n",
+ err.text,
+ (unsigned int) err.position);
+ return 1;
+ }
+ key.eddsa_priv = *eddsa_priv;
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
+ &salt,
+ sizeof (salt));
+ plugin = TALER_WIRE_plugin_load (cfg,
+ method);
+ if (NULL == plugin)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Wire transfer method `%s' not supported\n",
+ method);
+ return 1;
+ }
+ if (GNUNET_OK !=
+ plugin->sign_wire_details (plugin->cls,
+ j,
+ &key,
+ &salt,
+ &sig))
+ {
+ /* sign function should have logged applicable errors */
+ json_decref (j);
+ TALER_WIRE_plugin_unload (plugin);
+ return 1;
+ }
+ TALER_WIRE_plugin_unload (plugin);
+ GNUNET_free (eddsa_priv);
+
+ /* add signature and salt to JSON message */
+ json_object_set_new (j,
+ "salt",
+ GNUNET_JSON_from_data (&salt,
+ sizeof (salt)));
+ json_object_set_new (j,
+ "sig",
+ GNUNET_JSON_from_data (&sig,
+ sizeof (sig)));
+
+ /* dump result to stdout */
+ json_out = json_dumps (j, JSON_INDENT(2));
+ json_decref (j);
+ GNUNET_assert (NULL != json_out);
+
+ if (NULL != output_filename)
+ {
+ fclose (stdout);
+ stdout = fopen (output_filename,
+ "w+");
+ }
+ fprintf (stdout,
+ "%s",
+ json_out);
+ fflush (stdout);
+ free (json_out);
+ return 0;
+}
+
+/* end of taler-exchange-wire.c */
diff --git a/src/exchange/.gitignore b/src/exchange/.gitignore
new file mode 100644
index 000000000..a1e5e9aa7
--- /dev/null
+++ b/src/exchange/.gitignore
@@ -0,0 +1,6 @@
+taler-exchange-dbinit
+taler-exchange-keycheck
+taler-exchange-keyup
+taler-exchange-pursemod
+taler-exchange-reservemod
+taler-exchange-httpd
\ No newline at end of file
diff --git a/src/exchange/Makefile.am b/src/exchange/Makefile.am
new file mode 100644
index 000000000..a283e78b8
--- /dev/null
+++ b/src/exchange/Makefile.am
@@ -0,0 +1,95 @@
+# This Makefile.am is in the public domain
+AM_CPPFLAGS = -I$(top_srcdir)/src/include
+
+if USE_COVERAGE
+ AM_CFLAGS = --coverage -O0
+ XLIB = -lgcov
+endif
+
+pkgcfgdir = $(prefix)/share/taler/config.d/
+
+pkgcfg_DATA = \
+ exchange.conf
+
+bin_PROGRAMS = \
+ taler-exchange-aggregator \
+ taler-exchange-httpd
+
+taler_exchange_aggregator_SOURCES = \
+ taler-exchange-aggregator.c
+taler_exchange_aggregator_LDADD = \
+ $(LIBGCRYPT_LIBS) \
+ $(top_builddir)/src/json/libtalerjson.la \
+ $(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/wire/libtalerwire.la \
+ $(top_builddir)/src/exchangedb/libtalerexchangedb.la \
+ -ljansson \
+ -lgnunetutil
+
+taler_exchange_httpd_SOURCES = \
+ taler-exchange-httpd.c taler-exchange-httpd.h \
+ taler-exchange-httpd_admin.c taler-exchange-httpd_admin.h \
+ taler-exchange-httpd_db.c taler-exchange-httpd_db.h \
+ taler-exchange-httpd_deposit.c taler-exchange-httpd_deposit.h \
+ taler-exchange-httpd_keystate.c taler-exchange-httpd_keystate.h \
+ taler-exchange-httpd_mhd.c taler-exchange-httpd_mhd.h \
+ taler-exchange-httpd_parsing.c taler-exchange-httpd_parsing.h \
+ taler-exchange-httpd_refresh.c taler-exchange-httpd_refresh.h \
+ taler-exchange-httpd_reserve.c taler-exchange-httpd_reserve.h \
+ taler-exchange-httpd_responses.c taler-exchange-httpd_responses.h \
+ taler-exchange-httpd_tracking.c taler-exchange-httpd_tracking.h \
+ taler-exchange-httpd_wire.c taler-exchange-httpd_wire.h \
+ taler-exchange-httpd_validation.c taler-exchange-httpd_validation.h
+taler_exchange_httpd_LDADD = \
+ $(LIBGCRYPT_LIBS) \
+ $(top_builddir)/src/wire/libtalerwire.la \
+ $(top_builddir)/src/json/libtalerjson.la \
+ $(top_builddir)/src/exchangedb/libtalerexchangedb.la \
+ $(top_builddir)/src/util/libtalerutil.la \
+ -lmicrohttpd \
+ -lgnunetutil \
+ -lgnunetjson \
+ -ljansson \
+ -lpthread
+
+if HAVE_DEVELOPER
+taler_exchange_httpd_SOURCES += \
+ taler-exchange-httpd_test.c taler-exchange-httpd_test.h
+endif
+
+check_SCRIPTS = \
+ test_taler_exchange_httpd.sh
+
+if HAVE_EXPENSIVE_TESTS
+check_SCRIPTS += \
+ test_taler_exchange_httpd_afl.sh
+endif
+
+test_taler_exchange_aggregator_postgres_SOURCES = \
+ test_taler_exchange_aggregator.c
+test_taler_exchange_aggregator_postgres_LDADD = \
+ $(LIBGCRYPT_LIBS) \
+ $(top_builddir)/src/exchangedb/libtalerexchangedb.la \
+ $(top_builddir)/src/json/libtalerjson.la \
+ $(top_builddir)/src/util/libtalerutil.la \
+ -lmicrohttpd \
+ -lgnunetutil \
+ -lgnunetjson \
+ -ljansson \
+ -lpthread
+
+check_PROGRAMS = \
+ test_taler_exchange_aggregator-postgres
+
+AM_TESTS_ENVIRONMENT=export TALER_PREFIX=$${TALER_PREFIX:-@libdir@};export PATH=$${TALER_PREFIX:-@prefix@}/bin:$$PATH;
+
+TESTS = \
+ $(check_SCRIPTS) \
+ $(check_PROGRAMS)
+
+
+EXTRA_DIST = \
+ test-taler-exchange-aggregator-postgres.conf \
+ test_taler_exchange_httpd_home/.local/share/taler/exchange/offline-keys/master.priv \
+ test_taler_exchange_httpd.conf \
+ exchange.conf
diff --git a/src/mint/afl-tests/id:000000,orig:admin_add_incoming.req b/src/exchange/afl-tests/id:000000,orig:admin_add_incoming.req
similarity index 100%
rename from src/mint/afl-tests/id:000000,orig:admin_add_incoming.req
rename to src/exchange/afl-tests/id:000000,orig:admin_add_incoming.req
diff --git a/src/mint/afl-tests/id:000001,orig:deposit.req b/src/exchange/afl-tests/id:000001,orig:deposit.req
similarity index 100%
rename from src/mint/afl-tests/id:000001,orig:deposit.req
rename to src/exchange/afl-tests/id:000001,orig:deposit.req
diff --git a/src/mint/afl-tests/id:000001,sig:06,src:000004,op:flip1,pos:21060 b/src/exchange/afl-tests/id:000001,sig:06,src:000004,op:flip1,pos:21060
similarity index 100%
rename from src/mint/afl-tests/id:000001,sig:06,src:000004,op:flip1,pos:21060
rename to src/exchange/afl-tests/id:000001,sig:06,src:000004,op:flip1,pos:21060
diff --git a/src/mint/afl-tests/id:000002,orig:keys.req b/src/exchange/afl-tests/id:000002,orig:keys.req
similarity index 100%
rename from src/mint/afl-tests/id:000002,orig:keys.req
rename to src/exchange/afl-tests/id:000002,orig:keys.req
diff --git a/src/mint/afl-tests/id:000003,orig:refresh_link.req b/src/exchange/afl-tests/id:000003,orig:refresh_link.req
similarity index 100%
rename from src/mint/afl-tests/id:000003,orig:refresh_link.req
rename to src/exchange/afl-tests/id:000003,orig:refresh_link.req
diff --git a/src/mint/afl-tests/id:000004,orig:refresh_melt.req b/src/exchange/afl-tests/id:000004,orig:refresh_melt.req
similarity index 100%
rename from src/mint/afl-tests/id:000004,orig:refresh_melt.req
rename to src/exchange/afl-tests/id:000004,orig:refresh_melt.req
diff --git a/src/mint/afl-tests/id:000005,orig:refresh_reveal.req b/src/exchange/afl-tests/id:000005,orig:refresh_reveal.req
similarity index 100%
rename from src/mint/afl-tests/id:000005,orig:refresh_reveal.req
rename to src/exchange/afl-tests/id:000005,orig:refresh_reveal.req
diff --git a/src/mint/afl-tests/id:000006,orig:reserve_status.req b/src/exchange/afl-tests/id:000006,orig:reserve_status.req
similarity index 100%
rename from src/mint/afl-tests/id:000006,orig:reserve_status.req
rename to src/exchange/afl-tests/id:000006,orig:reserve_status.req
diff --git a/src/mint/afl-tests/id:000007,orig:reserve_withdraw.req b/src/exchange/afl-tests/id:000007,orig:reserve_withdraw.req
similarity index 100%
rename from src/mint/afl-tests/id:000007,orig:reserve_withdraw.req
rename to src/exchange/afl-tests/id:000007,orig:reserve_withdraw.req
diff --git a/src/mint/afl-tests/id:000008,orig:wire.req b/src/exchange/afl-tests/id:000008,orig:wire.req
similarity index 100%
rename from src/mint/afl-tests/id:000008,orig:wire.req
rename to src/exchange/afl-tests/id:000008,orig:wire.req
diff --git a/src/mint/afl-tests/id:000009,orig:wire_sepa.req b/src/exchange/afl-tests/id:000009,orig:wire_sepa.req
similarity index 100%
rename from src/mint/afl-tests/id:000009,orig:wire_sepa.req
rename to src/exchange/afl-tests/id:000009,orig:wire_sepa.req
diff --git a/src/mint/afl-tests/id:000010,orig:wire_test.req b/src/exchange/afl-tests/id:000010,orig:wire_test.req
similarity index 100%
rename from src/mint/afl-tests/id:000010,orig:wire_test.req
rename to src/exchange/afl-tests/id:000010,orig:wire_test.req
diff --git a/src/mint/afl-tests/id:000011,src:000000,op:flip1,pos:1,+cov b/src/exchange/afl-tests/id:000011,src:000000,op:flip1,pos:1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000011,src:000000,op:flip1,pos:1,+cov
rename to src/exchange/afl-tests/id:000011,src:000000,op:flip1,pos:1,+cov
diff --git a/src/mint/afl-tests/id:000011,src:000000,op:flip1,pos:2,+cov b/src/exchange/afl-tests/id:000011,src:000000,op:flip1,pos:2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000011,src:000000,op:flip1,pos:2,+cov
rename to src/exchange/afl-tests/id:000011,src:000000,op:flip1,pos:2,+cov
diff --git a/src/mint/afl-tests/id:000012,src:000000,op:flip1,pos:3,+cov b/src/exchange/afl-tests/id:000012,src:000000,op:flip1,pos:3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000012,src:000000,op:flip1,pos:3,+cov
rename to src/exchange/afl-tests/id:000012,src:000000,op:flip1,pos:3,+cov
diff --git a/src/mint/afl-tests/id:000012,src:000000,op:flip1,pos:4,+cov b/src/exchange/afl-tests/id:000012,src:000000,op:flip1,pos:4,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000012,src:000000,op:flip1,pos:4,+cov
rename to src/exchange/afl-tests/id:000012,src:000000,op:flip1,pos:4,+cov
diff --git a/src/mint/afl-tests/id:000013,src:000000,op:flip1,pos:4,+cov b/src/exchange/afl-tests/id:000013,src:000000,op:flip1,pos:4,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000013,src:000000,op:flip1,pos:4,+cov
rename to src/exchange/afl-tests/id:000013,src:000000,op:flip1,pos:4,+cov
diff --git a/src/mint/afl-tests/id:000013,src:000000,op:flip1,pos:5,+cov b/src/exchange/afl-tests/id:000013,src:000000,op:flip1,pos:5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000013,src:000000,op:flip1,pos:5,+cov
rename to src/exchange/afl-tests/id:000013,src:000000,op:flip1,pos:5,+cov
diff --git a/src/mint/afl-tests/id:000014,src:000000,op:flip1,pos:5,+cov b/src/exchange/afl-tests/id:000014,src:000000,op:flip1,pos:5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000014,src:000000,op:flip1,pos:5,+cov
rename to src/exchange/afl-tests/id:000014,src:000000,op:flip1,pos:5,+cov
diff --git a/src/mint/afl-tests/id:000015,src:000000,op:flip1,pos:5,+cov b/src/exchange/afl-tests/id:000015,src:000000,op:flip1,pos:5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000015,src:000000,op:flip1,pos:5,+cov
rename to src/exchange/afl-tests/id:000015,src:000000,op:flip1,pos:5,+cov
diff --git a/src/mint/afl-tests/id:000015,src:000000,op:flip1,pos:8,+cov b/src/exchange/afl-tests/id:000015,src:000000,op:flip1,pos:8,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000015,src:000000,op:flip1,pos:8,+cov
rename to src/exchange/afl-tests/id:000015,src:000000,op:flip1,pos:8,+cov
diff --git a/src/mint/afl-tests/id:000016,src:000000,op:flip1,pos:11 b/src/exchange/afl-tests/id:000016,src:000000,op:flip1,pos:11
similarity index 100%
rename from src/mint/afl-tests/id:000016,src:000000,op:flip1,pos:11
rename to src/exchange/afl-tests/id:000016,src:000000,op:flip1,pos:11
diff --git a/src/mint/afl-tests/id:000016,src:000000,op:flip1,pos:5,+cov b/src/exchange/afl-tests/id:000016,src:000000,op:flip1,pos:5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000016,src:000000,op:flip1,pos:5,+cov
rename to src/exchange/afl-tests/id:000016,src:000000,op:flip1,pos:5,+cov
diff --git a/src/mint/afl-tests/id:000017,src:000000,op:flip1,pos:13,+cov b/src/exchange/afl-tests/id:000017,src:000000,op:flip1,pos:13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000017,src:000000,op:flip1,pos:13,+cov
rename to src/exchange/afl-tests/id:000017,src:000000,op:flip1,pos:13,+cov
diff --git a/src/mint/afl-tests/id:000017,src:000000,op:flip1,pos:7,+cov b/src/exchange/afl-tests/id:000017,src:000000,op:flip1,pos:7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000017,src:000000,op:flip1,pos:7,+cov
rename to src/exchange/afl-tests/id:000017,src:000000,op:flip1,pos:7,+cov
diff --git a/src/mint/afl-tests/id:000018,src:000000,op:flip1,pos:13,+cov b/src/exchange/afl-tests/id:000018,src:000000,op:flip1,pos:13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000018,src:000000,op:flip1,pos:13,+cov
rename to src/exchange/afl-tests/id:000018,src:000000,op:flip1,pos:13,+cov
diff --git a/src/mint/afl-tests/id:000018,src:000000,op:flip1,pos:9,+cov b/src/exchange/afl-tests/id:000018,src:000000,op:flip1,pos:9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000018,src:000000,op:flip1,pos:9,+cov
rename to src/exchange/afl-tests/id:000018,src:000000,op:flip1,pos:9,+cov
diff --git a/src/mint/afl-tests/id:000019,src:000000,op:flip1,pos:11 b/src/exchange/afl-tests/id:000019,src:000000,op:flip1,pos:11
similarity index 100%
rename from src/mint/afl-tests/id:000019,src:000000,op:flip1,pos:11
rename to src/exchange/afl-tests/id:000019,src:000000,op:flip1,pos:11
diff --git a/src/mint/afl-tests/id:000019,src:000000,op:flip1,pos:19,+cov b/src/exchange/afl-tests/id:000019,src:000000,op:flip1,pos:19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000019,src:000000,op:flip1,pos:19,+cov
rename to src/exchange/afl-tests/id:000019,src:000000,op:flip1,pos:19,+cov
diff --git a/src/mint/afl-tests/id:000020,src:000000,op:flip1,pos:12,+cov b/src/exchange/afl-tests/id:000020,src:000000,op:flip1,pos:12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000020,src:000000,op:flip1,pos:12,+cov
rename to src/exchange/afl-tests/id:000020,src:000000,op:flip1,pos:12,+cov
diff --git a/src/mint/afl-tests/id:000020,src:000000,op:flip1,pos:19,+cov b/src/exchange/afl-tests/id:000020,src:000000,op:flip1,pos:19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000020,src:000000,op:flip1,pos:19,+cov
rename to src/exchange/afl-tests/id:000020,src:000000,op:flip1,pos:19,+cov
diff --git a/src/mint/afl-tests/id:000021,src:000000,op:flip1,pos:13,+cov b/src/exchange/afl-tests/id:000021,src:000000,op:flip1,pos:13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000021,src:000000,op:flip1,pos:13,+cov
rename to src/exchange/afl-tests/id:000021,src:000000,op:flip1,pos:13,+cov
diff --git a/src/mint/afl-tests/id:000021,src:000000,op:flip1,pos:21,+cov b/src/exchange/afl-tests/id:000021,src:000000,op:flip1,pos:21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000021,src:000000,op:flip1,pos:21,+cov
rename to src/exchange/afl-tests/id:000021,src:000000,op:flip1,pos:21,+cov
diff --git a/src/mint/afl-tests/id:000022,src:000000,op:flip1,pos:17,+cov b/src/exchange/afl-tests/id:000022,src:000000,op:flip1,pos:17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000022,src:000000,op:flip1,pos:17,+cov
rename to src/exchange/afl-tests/id:000022,src:000000,op:flip1,pos:17,+cov
diff --git a/src/mint/afl-tests/id:000022,src:000000,op:flip1,pos:23,+cov b/src/exchange/afl-tests/id:000022,src:000000,op:flip1,pos:23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000022,src:000000,op:flip1,pos:23,+cov
rename to src/exchange/afl-tests/id:000022,src:000000,op:flip1,pos:23,+cov
diff --git a/src/mint/afl-tests/id:000023,src:000000,op:flip1,pos:22,+cov b/src/exchange/afl-tests/id:000023,src:000000,op:flip1,pos:22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000023,src:000000,op:flip1,pos:22,+cov
rename to src/exchange/afl-tests/id:000023,src:000000,op:flip1,pos:22,+cov
diff --git a/src/mint/afl-tests/id:000023,src:000000,op:flip1,pos:24,+cov b/src/exchange/afl-tests/id:000023,src:000000,op:flip1,pos:24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000023,src:000000,op:flip1,pos:24,+cov
rename to src/exchange/afl-tests/id:000023,src:000000,op:flip1,pos:24,+cov
diff --git a/src/mint/afl-tests/id:000024,src:000000,op:flip1,pos:24,+cov b/src/exchange/afl-tests/id:000024,src:000000,op:flip1,pos:24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000024,src:000000,op:flip1,pos:24,+cov
rename to src/exchange/afl-tests/id:000024,src:000000,op:flip1,pos:24,+cov
diff --git a/src/mint/afl-tests/id:000025,src:000000,op:flip1,pos:24,+cov b/src/exchange/afl-tests/id:000025,src:000000,op:flip1,pos:24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000025,src:000000,op:flip1,pos:24,+cov
rename to src/exchange/afl-tests/id:000025,src:000000,op:flip1,pos:24,+cov
diff --git a/src/mint/afl-tests/id:000026,src:000000,op:flip1,pos:25,+cov b/src/exchange/afl-tests/id:000026,src:000000,op:flip1,pos:25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000026,src:000000,op:flip1,pos:25,+cov
rename to src/exchange/afl-tests/id:000026,src:000000,op:flip1,pos:25,+cov
diff --git a/src/mint/afl-tests/id:000027,src:000000,op:flip1,pos:26,+cov b/src/exchange/afl-tests/id:000027,src:000000,op:flip1,pos:26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000027,src:000000,op:flip1,pos:26,+cov
rename to src/exchange/afl-tests/id:000027,src:000000,op:flip1,pos:26,+cov
diff --git a/src/mint/afl-tests/id:000028,src:000000,op:flip1,pos:26,+cov b/src/exchange/afl-tests/id:000028,src:000000,op:flip1,pos:26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000028,src:000000,op:flip1,pos:26,+cov
rename to src/exchange/afl-tests/id:000028,src:000000,op:flip1,pos:26,+cov
diff --git a/src/mint/afl-tests/id:000029,src:000000,op:flip1,pos:26,+cov b/src/exchange/afl-tests/id:000029,src:000000,op:flip1,pos:26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000029,src:000000,op:flip1,pos:26,+cov
rename to src/exchange/afl-tests/id:000029,src:000000,op:flip1,pos:26,+cov
diff --git a/src/mint/afl-tests/id:000029,src:000000,op:flip1,pos:27,+cov b/src/exchange/afl-tests/id:000029,src:000000,op:flip1,pos:27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000029,src:000000,op:flip1,pos:27,+cov
rename to src/exchange/afl-tests/id:000029,src:000000,op:flip1,pos:27,+cov
diff --git a/src/mint/afl-tests/id:000030,src:000000,op:flip1,pos:27 b/src/exchange/afl-tests/id:000030,src:000000,op:flip1,pos:27
similarity index 100%
rename from src/mint/afl-tests/id:000030,src:000000,op:flip1,pos:27
rename to src/exchange/afl-tests/id:000030,src:000000,op:flip1,pos:27
diff --git a/src/mint/afl-tests/id:000030,src:000000,op:flip1,pos:27,+cov b/src/exchange/afl-tests/id:000030,src:000000,op:flip1,pos:27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000030,src:000000,op:flip1,pos:27,+cov
rename to src/exchange/afl-tests/id:000030,src:000000,op:flip1,pos:27,+cov
diff --git a/src/mint/afl-tests/id:000031,src:000000,op:flip1,pos:27,+cov b/src/exchange/afl-tests/id:000031,src:000000,op:flip1,pos:27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000031,src:000000,op:flip1,pos:27,+cov
rename to src/exchange/afl-tests/id:000031,src:000000,op:flip1,pos:27,+cov
diff --git a/src/mint/afl-tests/id:000031,src:000000,op:flip1,pos:28,+cov b/src/exchange/afl-tests/id:000031,src:000000,op:flip1,pos:28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000031,src:000000,op:flip1,pos:28,+cov
rename to src/exchange/afl-tests/id:000031,src:000000,op:flip1,pos:28,+cov
diff --git a/src/mint/afl-tests/id:000032,src:000000,op:flip1,pos:28,+cov b/src/exchange/afl-tests/id:000032,src:000000,op:flip1,pos:28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000032,src:000000,op:flip1,pos:28,+cov
rename to src/exchange/afl-tests/id:000032,src:000000,op:flip1,pos:28,+cov
diff --git a/src/mint/afl-tests/id:000032,src:000000,op:flip1,pos:30,+cov b/src/exchange/afl-tests/id:000032,src:000000,op:flip1,pos:30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000032,src:000000,op:flip1,pos:30,+cov
rename to src/exchange/afl-tests/id:000032,src:000000,op:flip1,pos:30,+cov
diff --git a/src/mint/afl-tests/id:000033,src:000000,op:flip1,pos:28,+cov b/src/exchange/afl-tests/id:000033,src:000000,op:flip1,pos:28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000033,src:000000,op:flip1,pos:28,+cov
rename to src/exchange/afl-tests/id:000033,src:000000,op:flip1,pos:28,+cov
diff --git a/src/mint/afl-tests/id:000033,src:000000,op:flip1,pos:30,+cov b/src/exchange/afl-tests/id:000033,src:000000,op:flip1,pos:30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000033,src:000000,op:flip1,pos:30,+cov
rename to src/exchange/afl-tests/id:000033,src:000000,op:flip1,pos:30,+cov
diff --git a/src/mint/afl-tests/id:000034,src:000000,op:flip1,pos:28,+cov b/src/exchange/afl-tests/id:000034,src:000000,op:flip1,pos:28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000034,src:000000,op:flip1,pos:28,+cov
rename to src/exchange/afl-tests/id:000034,src:000000,op:flip1,pos:28,+cov
diff --git a/src/mint/afl-tests/id:000034,src:000000,op:flip1,pos:30,+cov b/src/exchange/afl-tests/id:000034,src:000000,op:flip1,pos:30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000034,src:000000,op:flip1,pos:30,+cov
rename to src/exchange/afl-tests/id:000034,src:000000,op:flip1,pos:30,+cov
diff --git a/src/mint/afl-tests/id:000035,src:000000,op:flip1,pos:30,+cov b/src/exchange/afl-tests/id:000035,src:000000,op:flip1,pos:30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000035,src:000000,op:flip1,pos:30,+cov
rename to src/exchange/afl-tests/id:000035,src:000000,op:flip1,pos:30,+cov
diff --git a/src/mint/afl-tests/id:000036,src:000000,op:flip1,pos:31,+cov b/src/exchange/afl-tests/id:000036,src:000000,op:flip1,pos:31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000036,src:000000,op:flip1,pos:31,+cov
rename to src/exchange/afl-tests/id:000036,src:000000,op:flip1,pos:31,+cov
diff --git a/src/mint/afl-tests/id:000037,src:000000,op:flip1,pos:32,+cov b/src/exchange/afl-tests/id:000037,src:000000,op:flip1,pos:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000037,src:000000,op:flip1,pos:32,+cov
rename to src/exchange/afl-tests/id:000037,src:000000,op:flip1,pos:32,+cov
diff --git a/src/mint/afl-tests/id:000038,src:000000,op:flip1,pos:32 b/src/exchange/afl-tests/id:000038,src:000000,op:flip1,pos:32
similarity index 100%
rename from src/mint/afl-tests/id:000038,src:000000,op:flip1,pos:32
rename to src/exchange/afl-tests/id:000038,src:000000,op:flip1,pos:32
diff --git a/src/mint/afl-tests/id:000038,src:000000,op:flip1,pos:32,+cov b/src/exchange/afl-tests/id:000038,src:000000,op:flip1,pos:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000038,src:000000,op:flip1,pos:32,+cov
rename to src/exchange/afl-tests/id:000038,src:000000,op:flip1,pos:32,+cov
diff --git a/src/mint/afl-tests/id:000039,src:000000,op:flip1,pos:32,+cov b/src/exchange/afl-tests/id:000039,src:000000,op:flip1,pos:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000039,src:000000,op:flip1,pos:32,+cov
rename to src/exchange/afl-tests/id:000039,src:000000,op:flip1,pos:32,+cov
diff --git a/src/mint/afl-tests/id:000039,src:000000,op:flip1,pos:34,+cov b/src/exchange/afl-tests/id:000039,src:000000,op:flip1,pos:34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000039,src:000000,op:flip1,pos:34,+cov
rename to src/exchange/afl-tests/id:000039,src:000000,op:flip1,pos:34,+cov
diff --git a/src/mint/afl-tests/id:000040,src:000000,op:flip1,pos:32,+cov b/src/exchange/afl-tests/id:000040,src:000000,op:flip1,pos:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000040,src:000000,op:flip1,pos:32,+cov
rename to src/exchange/afl-tests/id:000040,src:000000,op:flip1,pos:32,+cov
diff --git a/src/mint/afl-tests/id:000040,src:000000,op:flip1,pos:34,+cov b/src/exchange/afl-tests/id:000040,src:000000,op:flip1,pos:34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000040,src:000000,op:flip1,pos:34,+cov
rename to src/exchange/afl-tests/id:000040,src:000000,op:flip1,pos:34,+cov
diff --git a/src/mint/afl-tests/id:000041,src:000000,op:flip1,pos:34,+cov b/src/exchange/afl-tests/id:000041,src:000000,op:flip1,pos:34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000041,src:000000,op:flip1,pos:34,+cov
rename to src/exchange/afl-tests/id:000041,src:000000,op:flip1,pos:34,+cov
diff --git a/src/mint/afl-tests/id:000041,src:000000,op:flip1,pos:36,+cov b/src/exchange/afl-tests/id:000041,src:000000,op:flip1,pos:36,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000041,src:000000,op:flip1,pos:36,+cov
rename to src/exchange/afl-tests/id:000041,src:000000,op:flip1,pos:36,+cov
diff --git a/src/mint/afl-tests/id:000042,src:000000,op:flip1,pos:36,+cov b/src/exchange/afl-tests/id:000042,src:000000,op:flip1,pos:36,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000042,src:000000,op:flip1,pos:36,+cov
rename to src/exchange/afl-tests/id:000042,src:000000,op:flip1,pos:36,+cov
diff --git a/src/mint/afl-tests/id:000043,src:000000,op:flip1,pos:37,+cov b/src/exchange/afl-tests/id:000043,src:000000,op:flip1,pos:37,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000043,src:000000,op:flip1,pos:37,+cov
rename to src/exchange/afl-tests/id:000043,src:000000,op:flip1,pos:37,+cov
diff --git a/src/mint/afl-tests/id:000043,src:000000,op:flip1,pos:38 b/src/exchange/afl-tests/id:000043,src:000000,op:flip1,pos:38
similarity index 100%
rename from src/mint/afl-tests/id:000043,src:000000,op:flip1,pos:38
rename to src/exchange/afl-tests/id:000043,src:000000,op:flip1,pos:38
diff --git a/src/mint/afl-tests/id:000044,src:000000,op:flip1,pos:38 b/src/exchange/afl-tests/id:000044,src:000000,op:flip1,pos:38
similarity index 100%
rename from src/mint/afl-tests/id:000044,src:000000,op:flip1,pos:38
rename to src/exchange/afl-tests/id:000044,src:000000,op:flip1,pos:38
diff --git a/src/mint/afl-tests/id:000044,src:000000,op:flip1,pos:38,+cov b/src/exchange/afl-tests/id:000044,src:000000,op:flip1,pos:38,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000044,src:000000,op:flip1,pos:38,+cov
rename to src/exchange/afl-tests/id:000044,src:000000,op:flip1,pos:38,+cov
diff --git a/src/mint/afl-tests/id:000045,src:000000,op:flip1,pos:38,+cov b/src/exchange/afl-tests/id:000045,src:000000,op:flip1,pos:38,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000045,src:000000,op:flip1,pos:38,+cov
rename to src/exchange/afl-tests/id:000045,src:000000,op:flip1,pos:38,+cov
diff --git a/src/mint/afl-tests/id:000045,src:000000,op:flip1,pos:39,+cov b/src/exchange/afl-tests/id:000045,src:000000,op:flip1,pos:39,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000045,src:000000,op:flip1,pos:39,+cov
rename to src/exchange/afl-tests/id:000045,src:000000,op:flip1,pos:39,+cov
diff --git a/src/mint/afl-tests/id:000046,src:000000,op:flip1,pos:39,+cov b/src/exchange/afl-tests/id:000046,src:000000,op:flip1,pos:39,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000046,src:000000,op:flip1,pos:39,+cov
rename to src/exchange/afl-tests/id:000046,src:000000,op:flip1,pos:39,+cov
diff --git a/src/mint/afl-tests/id:000047,src:000000,op:flip1,pos:39 b/src/exchange/afl-tests/id:000047,src:000000,op:flip1,pos:39
similarity index 100%
rename from src/mint/afl-tests/id:000047,src:000000,op:flip1,pos:39
rename to src/exchange/afl-tests/id:000047,src:000000,op:flip1,pos:39
diff --git a/src/mint/afl-tests/id:000047,src:000000,op:flip1,pos:39,+cov b/src/exchange/afl-tests/id:000047,src:000000,op:flip1,pos:39,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000047,src:000000,op:flip1,pos:39,+cov
rename to src/exchange/afl-tests/id:000047,src:000000,op:flip1,pos:39,+cov
diff --git a/src/mint/afl-tests/id:000048,src:000000,op:flip1,pos:39,+cov b/src/exchange/afl-tests/id:000048,src:000000,op:flip1,pos:39,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000048,src:000000,op:flip1,pos:39,+cov
rename to src/exchange/afl-tests/id:000048,src:000000,op:flip1,pos:39,+cov
diff --git a/src/mint/afl-tests/id:000048,src:000000,op:flip1,pos:40,+cov b/src/exchange/afl-tests/id:000048,src:000000,op:flip1,pos:40,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000048,src:000000,op:flip1,pos:40,+cov
rename to src/exchange/afl-tests/id:000048,src:000000,op:flip1,pos:40,+cov
diff --git a/src/mint/afl-tests/id:000049,src:000000,op:flip1,pos:41,+cov b/src/exchange/afl-tests/id:000049,src:000000,op:flip1,pos:41,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000049,src:000000,op:flip1,pos:41,+cov
rename to src/exchange/afl-tests/id:000049,src:000000,op:flip1,pos:41,+cov
diff --git a/src/mint/afl-tests/id:000050,src:000000,op:flip1,pos:41,+cov b/src/exchange/afl-tests/id:000050,src:000000,op:flip1,pos:41,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000050,src:000000,op:flip1,pos:41,+cov
rename to src/exchange/afl-tests/id:000050,src:000000,op:flip1,pos:41,+cov
diff --git a/src/mint/afl-tests/id:000050,src:000000,op:flip1,pos:42,+cov b/src/exchange/afl-tests/id:000050,src:000000,op:flip1,pos:42,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000050,src:000000,op:flip1,pos:42,+cov
rename to src/exchange/afl-tests/id:000050,src:000000,op:flip1,pos:42,+cov
diff --git a/src/mint/afl-tests/id:000051,src:000000,op:flip1,pos:41,+cov b/src/exchange/afl-tests/id:000051,src:000000,op:flip1,pos:41,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000051,src:000000,op:flip1,pos:41,+cov
rename to src/exchange/afl-tests/id:000051,src:000000,op:flip1,pos:41,+cov
diff --git a/src/mint/afl-tests/id:000051,src:000000,op:flip1,pos:47,+cov b/src/exchange/afl-tests/id:000051,src:000000,op:flip1,pos:47,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000051,src:000000,op:flip1,pos:47,+cov
rename to src/exchange/afl-tests/id:000051,src:000000,op:flip1,pos:47,+cov
diff --git a/src/mint/afl-tests/id:000052,src:000000,op:flip1,pos:42,+cov b/src/exchange/afl-tests/id:000052,src:000000,op:flip1,pos:42,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000052,src:000000,op:flip1,pos:42,+cov
rename to src/exchange/afl-tests/id:000052,src:000000,op:flip1,pos:42,+cov
diff --git a/src/mint/afl-tests/id:000052,src:000000,op:flip1,pos:47,+cov b/src/exchange/afl-tests/id:000052,src:000000,op:flip1,pos:47,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000052,src:000000,op:flip1,pos:47,+cov
rename to src/exchange/afl-tests/id:000052,src:000000,op:flip1,pos:47,+cov
diff --git a/src/mint/afl-tests/id:000053,src:000000,op:flip1,pos:42,+cov b/src/exchange/afl-tests/id:000053,src:000000,op:flip1,pos:42,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000053,src:000000,op:flip1,pos:42,+cov
rename to src/exchange/afl-tests/id:000053,src:000000,op:flip1,pos:42,+cov
diff --git a/src/mint/afl-tests/id:000053,src:000000,op:flip1,pos:47,+cov b/src/exchange/afl-tests/id:000053,src:000000,op:flip1,pos:47,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000053,src:000000,op:flip1,pos:47,+cov
rename to src/exchange/afl-tests/id:000053,src:000000,op:flip1,pos:47,+cov
diff --git a/src/mint/afl-tests/id:000054,src:000000,op:flip1,pos:43,+cov b/src/exchange/afl-tests/id:000054,src:000000,op:flip1,pos:43,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000054,src:000000,op:flip1,pos:43,+cov
rename to src/exchange/afl-tests/id:000054,src:000000,op:flip1,pos:43,+cov
diff --git a/src/mint/afl-tests/id:000054,src:000000,op:flip1,pos:49,+cov b/src/exchange/afl-tests/id:000054,src:000000,op:flip1,pos:49,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000054,src:000000,op:flip1,pos:49,+cov
rename to src/exchange/afl-tests/id:000054,src:000000,op:flip1,pos:49,+cov
diff --git a/src/mint/afl-tests/id:000055,src:000000,op:flip1,pos:43,+cov b/src/exchange/afl-tests/id:000055,src:000000,op:flip1,pos:43,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000055,src:000000,op:flip1,pos:43,+cov
rename to src/exchange/afl-tests/id:000055,src:000000,op:flip1,pos:43,+cov
diff --git a/src/mint/afl-tests/id:000055,src:000000,op:flip1,pos:52,+cov b/src/exchange/afl-tests/id:000055,src:000000,op:flip1,pos:52,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000055,src:000000,op:flip1,pos:52,+cov
rename to src/exchange/afl-tests/id:000055,src:000000,op:flip1,pos:52,+cov
diff --git a/src/mint/afl-tests/id:000056,src:000000,op:flip1,pos:44,+cov b/src/exchange/afl-tests/id:000056,src:000000,op:flip1,pos:44,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000056,src:000000,op:flip1,pos:44,+cov
rename to src/exchange/afl-tests/id:000056,src:000000,op:flip1,pos:44,+cov
diff --git a/src/mint/afl-tests/id:000056,src:000000,op:flip1,pos:52,+cov b/src/exchange/afl-tests/id:000056,src:000000,op:flip1,pos:52,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000056,src:000000,op:flip1,pos:52,+cov
rename to src/exchange/afl-tests/id:000056,src:000000,op:flip1,pos:52,+cov
diff --git a/src/mint/afl-tests/id:000057,src:000000,op:flip1,pos:47,+cov b/src/exchange/afl-tests/id:000057,src:000000,op:flip1,pos:47,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000057,src:000000,op:flip1,pos:47,+cov
rename to src/exchange/afl-tests/id:000057,src:000000,op:flip1,pos:47,+cov
diff --git a/src/mint/afl-tests/id:000057,src:000000,op:flip1,pos:54,+cov b/src/exchange/afl-tests/id:000057,src:000000,op:flip1,pos:54,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000057,src:000000,op:flip1,pos:54,+cov
rename to src/exchange/afl-tests/id:000057,src:000000,op:flip1,pos:54,+cov
diff --git a/src/mint/afl-tests/id:000058,src:000000,op:flip1,pos:47,+cov b/src/exchange/afl-tests/id:000058,src:000000,op:flip1,pos:47,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000058,src:000000,op:flip1,pos:47,+cov
rename to src/exchange/afl-tests/id:000058,src:000000,op:flip1,pos:47,+cov
diff --git a/src/mint/afl-tests/id:000058,src:000000,op:flip1,pos:54,+cov b/src/exchange/afl-tests/id:000058,src:000000,op:flip1,pos:54,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000058,src:000000,op:flip1,pos:54,+cov
rename to src/exchange/afl-tests/id:000058,src:000000,op:flip1,pos:54,+cov
diff --git a/src/mint/afl-tests/id:000059,src:000000,op:flip1,pos:48,+cov b/src/exchange/afl-tests/id:000059,src:000000,op:flip1,pos:48,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000059,src:000000,op:flip1,pos:48,+cov
rename to src/exchange/afl-tests/id:000059,src:000000,op:flip1,pos:48,+cov
diff --git a/src/mint/afl-tests/id:000059,src:000000,op:flip1,pos:55,+cov b/src/exchange/afl-tests/id:000059,src:000000,op:flip1,pos:55,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000059,src:000000,op:flip1,pos:55,+cov
rename to src/exchange/afl-tests/id:000059,src:000000,op:flip1,pos:55,+cov
diff --git a/src/mint/afl-tests/id:000060,src:000000,op:flip1,pos:49,+cov b/src/exchange/afl-tests/id:000060,src:000000,op:flip1,pos:49,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000060,src:000000,op:flip1,pos:49,+cov
rename to src/exchange/afl-tests/id:000060,src:000000,op:flip1,pos:49,+cov
diff --git a/src/mint/afl-tests/id:000060,src:000000,op:flip1,pos:56,+cov b/src/exchange/afl-tests/id:000060,src:000000,op:flip1,pos:56,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000060,src:000000,op:flip1,pos:56,+cov
rename to src/exchange/afl-tests/id:000060,src:000000,op:flip1,pos:56,+cov
diff --git a/src/mint/afl-tests/id:000061,src:000000,op:flip1,pos:50,+cov b/src/exchange/afl-tests/id:000061,src:000000,op:flip1,pos:50,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000061,src:000000,op:flip1,pos:50,+cov
rename to src/exchange/afl-tests/id:000061,src:000000,op:flip1,pos:50,+cov
diff --git a/src/mint/afl-tests/id:000061,src:000000,op:flip1,pos:59,+cov b/src/exchange/afl-tests/id:000061,src:000000,op:flip1,pos:59,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000061,src:000000,op:flip1,pos:59,+cov
rename to src/exchange/afl-tests/id:000061,src:000000,op:flip1,pos:59,+cov
diff --git a/src/mint/afl-tests/id:000062,src:000000,op:flip1,pos:51,+cov b/src/exchange/afl-tests/id:000062,src:000000,op:flip1,pos:51,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000062,src:000000,op:flip1,pos:51,+cov
rename to src/exchange/afl-tests/id:000062,src:000000,op:flip1,pos:51,+cov
diff --git a/src/mint/afl-tests/id:000062,src:000000,op:flip1,pos:60,+cov b/src/exchange/afl-tests/id:000062,src:000000,op:flip1,pos:60,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000062,src:000000,op:flip1,pos:60,+cov
rename to src/exchange/afl-tests/id:000062,src:000000,op:flip1,pos:60,+cov
diff --git a/src/mint/afl-tests/id:000063,src:000000,op:flip1,pos:54 b/src/exchange/afl-tests/id:000063,src:000000,op:flip1,pos:54
similarity index 100%
rename from src/mint/afl-tests/id:000063,src:000000,op:flip1,pos:54
rename to src/exchange/afl-tests/id:000063,src:000000,op:flip1,pos:54
diff --git a/src/mint/afl-tests/id:000063,src:000000,op:flip1,pos:61,+cov b/src/exchange/afl-tests/id:000063,src:000000,op:flip1,pos:61,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000063,src:000000,op:flip1,pos:61,+cov
rename to src/exchange/afl-tests/id:000063,src:000000,op:flip1,pos:61,+cov
diff --git a/src/mint/afl-tests/id:000064,src:000000,op:flip1,pos:55,+cov b/src/exchange/afl-tests/id:000064,src:000000,op:flip1,pos:55,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000064,src:000000,op:flip1,pos:55,+cov
rename to src/exchange/afl-tests/id:000064,src:000000,op:flip1,pos:55,+cov
diff --git a/src/mint/afl-tests/id:000064,src:000000,op:flip1,pos:62,+cov b/src/exchange/afl-tests/id:000064,src:000000,op:flip1,pos:62,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000064,src:000000,op:flip1,pos:62,+cov
rename to src/exchange/afl-tests/id:000064,src:000000,op:flip1,pos:62,+cov
diff --git a/src/mint/afl-tests/id:000065,src:000000,op:flip1,pos:55,+cov b/src/exchange/afl-tests/id:000065,src:000000,op:flip1,pos:55,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000065,src:000000,op:flip1,pos:55,+cov
rename to src/exchange/afl-tests/id:000065,src:000000,op:flip1,pos:55,+cov
diff --git a/src/mint/afl-tests/id:000065,src:000000,op:flip1,pos:63,+cov b/src/exchange/afl-tests/id:000065,src:000000,op:flip1,pos:63,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000065,src:000000,op:flip1,pos:63,+cov
rename to src/exchange/afl-tests/id:000065,src:000000,op:flip1,pos:63,+cov
diff --git a/src/mint/afl-tests/id:000066,src:000000,op:flip1,pos:56,+cov b/src/exchange/afl-tests/id:000066,src:000000,op:flip1,pos:56,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000066,src:000000,op:flip1,pos:56,+cov
rename to src/exchange/afl-tests/id:000066,src:000000,op:flip1,pos:56,+cov
diff --git a/src/mint/afl-tests/id:000066,src:000000,op:flip1,pos:63,+cov b/src/exchange/afl-tests/id:000066,src:000000,op:flip1,pos:63,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000066,src:000000,op:flip1,pos:63,+cov
rename to src/exchange/afl-tests/id:000066,src:000000,op:flip1,pos:63,+cov
diff --git a/src/mint/afl-tests/id:000067,src:000000,op:flip1,pos:58,+cov b/src/exchange/afl-tests/id:000067,src:000000,op:flip1,pos:58,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000067,src:000000,op:flip1,pos:58,+cov
rename to src/exchange/afl-tests/id:000067,src:000000,op:flip1,pos:58,+cov
diff --git a/src/mint/afl-tests/id:000067,src:000000,op:flip1,pos:65,+cov b/src/exchange/afl-tests/id:000067,src:000000,op:flip1,pos:65,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000067,src:000000,op:flip1,pos:65,+cov
rename to src/exchange/afl-tests/id:000067,src:000000,op:flip1,pos:65,+cov
diff --git a/src/mint/afl-tests/id:000068,src:000000,op:flip1,pos:60,+cov b/src/exchange/afl-tests/id:000068,src:000000,op:flip1,pos:60,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000068,src:000000,op:flip1,pos:60,+cov
rename to src/exchange/afl-tests/id:000068,src:000000,op:flip1,pos:60,+cov
diff --git a/src/mint/afl-tests/id:000068,src:000000,op:flip1,pos:66,+cov b/src/exchange/afl-tests/id:000068,src:000000,op:flip1,pos:66,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000068,src:000000,op:flip1,pos:66,+cov
rename to src/exchange/afl-tests/id:000068,src:000000,op:flip1,pos:66,+cov
diff --git a/src/mint/afl-tests/id:000069,src:000000,op:flip1,pos:61,+cov b/src/exchange/afl-tests/id:000069,src:000000,op:flip1,pos:61,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000069,src:000000,op:flip1,pos:61,+cov
rename to src/exchange/afl-tests/id:000069,src:000000,op:flip1,pos:61,+cov
diff --git a/src/mint/afl-tests/id:000069,src:000000,op:flip1,pos:67,+cov b/src/exchange/afl-tests/id:000069,src:000000,op:flip1,pos:67,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000069,src:000000,op:flip1,pos:67,+cov
rename to src/exchange/afl-tests/id:000069,src:000000,op:flip1,pos:67,+cov
diff --git a/src/mint/afl-tests/id:000070,src:000000,op:flip1,pos:62,+cov b/src/exchange/afl-tests/id:000070,src:000000,op:flip1,pos:62,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000070,src:000000,op:flip1,pos:62,+cov
rename to src/exchange/afl-tests/id:000070,src:000000,op:flip1,pos:62,+cov
diff --git a/src/mint/afl-tests/id:000070,src:000000,op:flip1,pos:69,+cov b/src/exchange/afl-tests/id:000070,src:000000,op:flip1,pos:69,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000070,src:000000,op:flip1,pos:69,+cov
rename to src/exchange/afl-tests/id:000070,src:000000,op:flip1,pos:69,+cov
diff --git a/src/mint/afl-tests/id:000071,src:000000,op:flip1,pos:62,+cov b/src/exchange/afl-tests/id:000071,src:000000,op:flip1,pos:62,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000071,src:000000,op:flip1,pos:62,+cov
rename to src/exchange/afl-tests/id:000071,src:000000,op:flip1,pos:62,+cov
diff --git a/src/mint/afl-tests/id:000071,src:000000,op:flip1,pos:74,+cov b/src/exchange/afl-tests/id:000071,src:000000,op:flip1,pos:74,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000071,src:000000,op:flip1,pos:74,+cov
rename to src/exchange/afl-tests/id:000071,src:000000,op:flip1,pos:74,+cov
diff --git a/src/mint/afl-tests/id:000072,src:000000,op:flip1,pos:63,+cov b/src/exchange/afl-tests/id:000072,src:000000,op:flip1,pos:63,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000072,src:000000,op:flip1,pos:63,+cov
rename to src/exchange/afl-tests/id:000072,src:000000,op:flip1,pos:63,+cov
diff --git a/src/mint/afl-tests/id:000072,src:000000,op:flip1,pos:76,+cov b/src/exchange/afl-tests/id:000072,src:000000,op:flip1,pos:76,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000072,src:000000,op:flip1,pos:76,+cov
rename to src/exchange/afl-tests/id:000072,src:000000,op:flip1,pos:76,+cov
diff --git a/src/mint/afl-tests/id:000073,src:000000,op:flip1,pos:64,+cov b/src/exchange/afl-tests/id:000073,src:000000,op:flip1,pos:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000073,src:000000,op:flip1,pos:64,+cov
rename to src/exchange/afl-tests/id:000073,src:000000,op:flip1,pos:64,+cov
diff --git a/src/mint/afl-tests/id:000073,src:000000,op:flip1,pos:81,+cov b/src/exchange/afl-tests/id:000073,src:000000,op:flip1,pos:81,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000073,src:000000,op:flip1,pos:81,+cov
rename to src/exchange/afl-tests/id:000073,src:000000,op:flip1,pos:81,+cov
diff --git a/src/mint/afl-tests/id:000074,src:000000,op:flip1,pos:65,+cov b/src/exchange/afl-tests/id:000074,src:000000,op:flip1,pos:65,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000074,src:000000,op:flip1,pos:65,+cov
rename to src/exchange/afl-tests/id:000074,src:000000,op:flip1,pos:65,+cov
diff --git a/src/mint/afl-tests/id:000074,src:000000,op:flip1,pos:82,+cov b/src/exchange/afl-tests/id:000074,src:000000,op:flip1,pos:82,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000074,src:000000,op:flip1,pos:82,+cov
rename to src/exchange/afl-tests/id:000074,src:000000,op:flip1,pos:82,+cov
diff --git a/src/mint/afl-tests/id:000075,src:000000,op:flip1,pos:71,+cov b/src/exchange/afl-tests/id:000075,src:000000,op:flip1,pos:71,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000075,src:000000,op:flip1,pos:71,+cov
rename to src/exchange/afl-tests/id:000075,src:000000,op:flip1,pos:71,+cov
diff --git a/src/mint/afl-tests/id:000075,src:000000,op:flip1,pos:82,+cov b/src/exchange/afl-tests/id:000075,src:000000,op:flip1,pos:82,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000075,src:000000,op:flip1,pos:82,+cov
rename to src/exchange/afl-tests/id:000075,src:000000,op:flip1,pos:82,+cov
diff --git a/src/mint/afl-tests/id:000076,src:000000,op:flip1,pos:71 b/src/exchange/afl-tests/id:000076,src:000000,op:flip1,pos:71
similarity index 100%
rename from src/mint/afl-tests/id:000076,src:000000,op:flip1,pos:71
rename to src/exchange/afl-tests/id:000076,src:000000,op:flip1,pos:71
diff --git a/src/mint/afl-tests/id:000076,src:000000,op:flip1,pos:83,+cov b/src/exchange/afl-tests/id:000076,src:000000,op:flip1,pos:83,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000076,src:000000,op:flip1,pos:83,+cov
rename to src/exchange/afl-tests/id:000076,src:000000,op:flip1,pos:83,+cov
diff --git a/src/mint/afl-tests/id:000077,src:000000,op:flip1,pos:72,+cov b/src/exchange/afl-tests/id:000077,src:000000,op:flip1,pos:72,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000077,src:000000,op:flip1,pos:72,+cov
rename to src/exchange/afl-tests/id:000077,src:000000,op:flip1,pos:72,+cov
diff --git a/src/mint/afl-tests/id:000077,src:000000,op:flip1,pos:85,+cov b/src/exchange/afl-tests/id:000077,src:000000,op:flip1,pos:85,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000077,src:000000,op:flip1,pos:85,+cov
rename to src/exchange/afl-tests/id:000077,src:000000,op:flip1,pos:85,+cov
diff --git a/src/mint/afl-tests/id:000078,src:000000,op:flip1,pos:73,+cov b/src/exchange/afl-tests/id:000078,src:000000,op:flip1,pos:73,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000078,src:000000,op:flip1,pos:73,+cov
rename to src/exchange/afl-tests/id:000078,src:000000,op:flip1,pos:73,+cov
diff --git a/src/mint/afl-tests/id:000078,src:000000,op:flip1,pos:87,+cov b/src/exchange/afl-tests/id:000078,src:000000,op:flip1,pos:87,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000078,src:000000,op:flip1,pos:87,+cov
rename to src/exchange/afl-tests/id:000078,src:000000,op:flip1,pos:87,+cov
diff --git a/src/mint/afl-tests/id:000079,src:000000,op:flip1,pos:74,+cov b/src/exchange/afl-tests/id:000079,src:000000,op:flip1,pos:74,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000079,src:000000,op:flip1,pos:74,+cov
rename to src/exchange/afl-tests/id:000079,src:000000,op:flip1,pos:74,+cov
diff --git a/src/mint/afl-tests/id:000079,src:000000,op:flip1,pos:87,+cov b/src/exchange/afl-tests/id:000079,src:000000,op:flip1,pos:87,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000079,src:000000,op:flip1,pos:87,+cov
rename to src/exchange/afl-tests/id:000079,src:000000,op:flip1,pos:87,+cov
diff --git a/src/mint/afl-tests/id:000080,src:000000,op:flip1,pos:75,+cov b/src/exchange/afl-tests/id:000080,src:000000,op:flip1,pos:75,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000080,src:000000,op:flip1,pos:75,+cov
rename to src/exchange/afl-tests/id:000080,src:000000,op:flip1,pos:75,+cov
diff --git a/src/mint/afl-tests/id:000080,src:000000,op:flip1,pos:87,+cov b/src/exchange/afl-tests/id:000080,src:000000,op:flip1,pos:87,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000080,src:000000,op:flip1,pos:87,+cov
rename to src/exchange/afl-tests/id:000080,src:000000,op:flip1,pos:87,+cov
diff --git a/src/mint/afl-tests/id:000081,src:000000,op:flip1,pos:75,+cov b/src/exchange/afl-tests/id:000081,src:000000,op:flip1,pos:75,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000081,src:000000,op:flip1,pos:75,+cov
rename to src/exchange/afl-tests/id:000081,src:000000,op:flip1,pos:75,+cov
diff --git a/src/mint/afl-tests/id:000081,src:000000,op:flip1,pos:90,+cov b/src/exchange/afl-tests/id:000081,src:000000,op:flip1,pos:90,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000081,src:000000,op:flip1,pos:90,+cov
rename to src/exchange/afl-tests/id:000081,src:000000,op:flip1,pos:90,+cov
diff --git a/src/mint/afl-tests/id:000082,src:000000,op:flip1,pos:76,+cov b/src/exchange/afl-tests/id:000082,src:000000,op:flip1,pos:76,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000082,src:000000,op:flip1,pos:76,+cov
rename to src/exchange/afl-tests/id:000082,src:000000,op:flip1,pos:76,+cov
diff --git a/src/mint/afl-tests/id:000082,src:000000,op:flip1,pos:92,+cov b/src/exchange/afl-tests/id:000082,src:000000,op:flip1,pos:92,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000082,src:000000,op:flip1,pos:92,+cov
rename to src/exchange/afl-tests/id:000082,src:000000,op:flip1,pos:92,+cov
diff --git a/src/mint/afl-tests/id:000083,src:000000,op:flip1,pos:78,+cov b/src/exchange/afl-tests/id:000083,src:000000,op:flip1,pos:78,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000083,src:000000,op:flip1,pos:78,+cov
rename to src/exchange/afl-tests/id:000083,src:000000,op:flip1,pos:78,+cov
diff --git a/src/mint/afl-tests/id:000083,src:000000,op:flip1,pos:93,+cov b/src/exchange/afl-tests/id:000083,src:000000,op:flip1,pos:93,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000083,src:000000,op:flip1,pos:93,+cov
rename to src/exchange/afl-tests/id:000083,src:000000,op:flip1,pos:93,+cov
diff --git a/src/mint/afl-tests/id:000084,src:000000,op:flip1,pos:80,+cov b/src/exchange/afl-tests/id:000084,src:000000,op:flip1,pos:80,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000084,src:000000,op:flip1,pos:80,+cov
rename to src/exchange/afl-tests/id:000084,src:000000,op:flip1,pos:80,+cov
diff --git a/src/mint/afl-tests/id:000084,src:000000,op:flip1,pos:95,+cov b/src/exchange/afl-tests/id:000084,src:000000,op:flip1,pos:95,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000084,src:000000,op:flip1,pos:95,+cov
rename to src/exchange/afl-tests/id:000084,src:000000,op:flip1,pos:95,+cov
diff --git a/src/mint/afl-tests/id:000085,src:000000,op:flip1,pos:80,+cov b/src/exchange/afl-tests/id:000085,src:000000,op:flip1,pos:80,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000085,src:000000,op:flip1,pos:80,+cov
rename to src/exchange/afl-tests/id:000085,src:000000,op:flip1,pos:80,+cov
diff --git a/src/mint/afl-tests/id:000085,src:000000,op:flip1,pos:95,+cov b/src/exchange/afl-tests/id:000085,src:000000,op:flip1,pos:95,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000085,src:000000,op:flip1,pos:95,+cov
rename to src/exchange/afl-tests/id:000085,src:000000,op:flip1,pos:95,+cov
diff --git a/src/mint/afl-tests/id:000086,src:000000,op:flip1,pos:81,+cov b/src/exchange/afl-tests/id:000086,src:000000,op:flip1,pos:81,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000086,src:000000,op:flip1,pos:81,+cov
rename to src/exchange/afl-tests/id:000086,src:000000,op:flip1,pos:81,+cov
diff --git a/src/mint/afl-tests/id:000086,src:000000,op:flip1,pos:96,+cov b/src/exchange/afl-tests/id:000086,src:000000,op:flip1,pos:96,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000086,src:000000,op:flip1,pos:96,+cov
rename to src/exchange/afl-tests/id:000086,src:000000,op:flip1,pos:96,+cov
diff --git a/src/mint/afl-tests/id:000087,src:000000,op:flip1,pos:82,+cov b/src/exchange/afl-tests/id:000087,src:000000,op:flip1,pos:82,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000087,src:000000,op:flip1,pos:82,+cov
rename to src/exchange/afl-tests/id:000087,src:000000,op:flip1,pos:82,+cov
diff --git a/src/mint/afl-tests/id:000087,src:000000,op:flip1,pos:96,+cov b/src/exchange/afl-tests/id:000087,src:000000,op:flip1,pos:96,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000087,src:000000,op:flip1,pos:96,+cov
rename to src/exchange/afl-tests/id:000087,src:000000,op:flip1,pos:96,+cov
diff --git a/src/mint/afl-tests/id:000088,src:000000,op:flip1,pos:100,+cov b/src/exchange/afl-tests/id:000088,src:000000,op:flip1,pos:100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000088,src:000000,op:flip1,pos:100,+cov
rename to src/exchange/afl-tests/id:000088,src:000000,op:flip1,pos:100,+cov
diff --git a/src/mint/afl-tests/id:000088,src:000000,op:flip1,pos:82,+cov b/src/exchange/afl-tests/id:000088,src:000000,op:flip1,pos:82,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000088,src:000000,op:flip1,pos:82,+cov
rename to src/exchange/afl-tests/id:000088,src:000000,op:flip1,pos:82,+cov
diff --git a/src/mint/afl-tests/id:000089,src:000000,op:flip1,pos:105 b/src/exchange/afl-tests/id:000089,src:000000,op:flip1,pos:105
similarity index 100%
rename from src/mint/afl-tests/id:000089,src:000000,op:flip1,pos:105
rename to src/exchange/afl-tests/id:000089,src:000000,op:flip1,pos:105
diff --git a/src/mint/afl-tests/id:000089,src:000000,op:flip1,pos:84,+cov b/src/exchange/afl-tests/id:000089,src:000000,op:flip1,pos:84,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000089,src:000000,op:flip1,pos:84,+cov
rename to src/exchange/afl-tests/id:000089,src:000000,op:flip1,pos:84,+cov
diff --git a/src/mint/afl-tests/id:000090,src:000000,op:flip1,pos:113,+cov b/src/exchange/afl-tests/id:000090,src:000000,op:flip1,pos:113,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000090,src:000000,op:flip1,pos:113,+cov
rename to src/exchange/afl-tests/id:000090,src:000000,op:flip1,pos:113,+cov
diff --git a/src/mint/afl-tests/id:000090,src:000000,op:flip1,pos:84,+cov b/src/exchange/afl-tests/id:000090,src:000000,op:flip1,pos:84,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000090,src:000000,op:flip1,pos:84,+cov
rename to src/exchange/afl-tests/id:000090,src:000000,op:flip1,pos:84,+cov
diff --git a/src/mint/afl-tests/id:000091,src:000000,op:flip1,pos:114,+cov b/src/exchange/afl-tests/id:000091,src:000000,op:flip1,pos:114,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000091,src:000000,op:flip1,pos:114,+cov
rename to src/exchange/afl-tests/id:000091,src:000000,op:flip1,pos:114,+cov
diff --git a/src/mint/afl-tests/id:000091,src:000000,op:flip1,pos:91,+cov b/src/exchange/afl-tests/id:000091,src:000000,op:flip1,pos:91,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000091,src:000000,op:flip1,pos:91,+cov
rename to src/exchange/afl-tests/id:000091,src:000000,op:flip1,pos:91,+cov
diff --git a/src/mint/afl-tests/id:000092,src:000000,op:flip1,pos:121,+cov b/src/exchange/afl-tests/id:000092,src:000000,op:flip1,pos:121,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000092,src:000000,op:flip1,pos:121,+cov
rename to src/exchange/afl-tests/id:000092,src:000000,op:flip1,pos:121,+cov
diff --git a/src/mint/afl-tests/id:000092,src:000000,op:flip1,pos:92,+cov b/src/exchange/afl-tests/id:000092,src:000000,op:flip1,pos:92,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000092,src:000000,op:flip1,pos:92,+cov
rename to src/exchange/afl-tests/id:000092,src:000000,op:flip1,pos:92,+cov
diff --git a/src/mint/afl-tests/id:000093,src:000000,op:flip1,pos:123,+cov b/src/exchange/afl-tests/id:000093,src:000000,op:flip1,pos:123,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000093,src:000000,op:flip1,pos:123,+cov
rename to src/exchange/afl-tests/id:000093,src:000000,op:flip1,pos:123,+cov
diff --git a/src/mint/afl-tests/id:000093,src:000000,op:flip1,pos:93,+cov b/src/exchange/afl-tests/id:000093,src:000000,op:flip1,pos:93,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000093,src:000000,op:flip1,pos:93,+cov
rename to src/exchange/afl-tests/id:000093,src:000000,op:flip1,pos:93,+cov
diff --git a/src/mint/afl-tests/id:000094,src:000000,op:flip1,pos:126,+cov b/src/exchange/afl-tests/id:000094,src:000000,op:flip1,pos:126,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000094,src:000000,op:flip1,pos:126,+cov
rename to src/exchange/afl-tests/id:000094,src:000000,op:flip1,pos:126,+cov
diff --git a/src/mint/afl-tests/id:000094,src:000000,op:flip1,pos:95,+cov b/src/exchange/afl-tests/id:000094,src:000000,op:flip1,pos:95,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000094,src:000000,op:flip1,pos:95,+cov
rename to src/exchange/afl-tests/id:000094,src:000000,op:flip1,pos:95,+cov
diff --git a/src/mint/afl-tests/id:000095,src:000000,op:flip1,pos:135,+cov b/src/exchange/afl-tests/id:000095,src:000000,op:flip1,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000095,src:000000,op:flip1,pos:135,+cov
rename to src/exchange/afl-tests/id:000095,src:000000,op:flip1,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000095,src:000000,op:flip1,pos:96,+cov b/src/exchange/afl-tests/id:000095,src:000000,op:flip1,pos:96,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000095,src:000000,op:flip1,pos:96,+cov
rename to src/exchange/afl-tests/id:000095,src:000000,op:flip1,pos:96,+cov
diff --git a/src/mint/afl-tests/id:000096,src:000000,op:flip1,pos:135,+cov b/src/exchange/afl-tests/id:000096,src:000000,op:flip1,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000096,src:000000,op:flip1,pos:135,+cov
rename to src/exchange/afl-tests/id:000096,src:000000,op:flip1,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000096,src:000000,op:flip1,pos:96,+cov b/src/exchange/afl-tests/id:000096,src:000000,op:flip1,pos:96,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000096,src:000000,op:flip1,pos:96,+cov
rename to src/exchange/afl-tests/id:000096,src:000000,op:flip1,pos:96,+cov
diff --git a/src/mint/afl-tests/id:000097,src:000000,op:flip1,pos:135,+cov b/src/exchange/afl-tests/id:000097,src:000000,op:flip1,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000097,src:000000,op:flip1,pos:135,+cov
rename to src/exchange/afl-tests/id:000097,src:000000,op:flip1,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000097,src:000000,op:flip1,pos:97,+cov b/src/exchange/afl-tests/id:000097,src:000000,op:flip1,pos:97,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000097,src:000000,op:flip1,pos:97,+cov
rename to src/exchange/afl-tests/id:000097,src:000000,op:flip1,pos:97,+cov
diff --git a/src/mint/afl-tests/id:000098,src:000000,op:flip1,pos:105 b/src/exchange/afl-tests/id:000098,src:000000,op:flip1,pos:105
similarity index 100%
rename from src/mint/afl-tests/id:000098,src:000000,op:flip1,pos:105
rename to src/exchange/afl-tests/id:000098,src:000000,op:flip1,pos:105
diff --git a/src/mint/afl-tests/id:000098,src:000000,op:flip1,pos:136,+cov b/src/exchange/afl-tests/id:000098,src:000000,op:flip1,pos:136,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000098,src:000000,op:flip1,pos:136,+cov
rename to src/exchange/afl-tests/id:000098,src:000000,op:flip1,pos:136,+cov
diff --git a/src/mint/afl-tests/id:000099,src:000000,op:flip1,pos:106 b/src/exchange/afl-tests/id:000099,src:000000,op:flip1,pos:106
similarity index 100%
rename from src/mint/afl-tests/id:000099,src:000000,op:flip1,pos:106
rename to src/exchange/afl-tests/id:000099,src:000000,op:flip1,pos:106
diff --git a/src/mint/afl-tests/id:000099,src:000000,op:flip1,pos:136,+cov b/src/exchange/afl-tests/id:000099,src:000000,op:flip1,pos:136,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000099,src:000000,op:flip1,pos:136,+cov
rename to src/exchange/afl-tests/id:000099,src:000000,op:flip1,pos:136,+cov
diff --git a/src/mint/afl-tests/id:000100,src:000000,op:flip1,pos:113,+cov b/src/exchange/afl-tests/id:000100,src:000000,op:flip1,pos:113,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000100,src:000000,op:flip1,pos:113,+cov
rename to src/exchange/afl-tests/id:000100,src:000000,op:flip1,pos:113,+cov
diff --git a/src/mint/afl-tests/id:000100,src:000000,op:flip1,pos:136,+cov b/src/exchange/afl-tests/id:000100,src:000000,op:flip1,pos:136,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000100,src:000000,op:flip1,pos:136,+cov
rename to src/exchange/afl-tests/id:000100,src:000000,op:flip1,pos:136,+cov
diff --git a/src/mint/afl-tests/id:000101,src:000000,op:flip1,pos:114,+cov b/src/exchange/afl-tests/id:000101,src:000000,op:flip1,pos:114,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000101,src:000000,op:flip1,pos:114,+cov
rename to src/exchange/afl-tests/id:000101,src:000000,op:flip1,pos:114,+cov
diff --git a/src/mint/afl-tests/id:000101,src:000000,op:flip1,pos:136,+cov b/src/exchange/afl-tests/id:000101,src:000000,op:flip1,pos:136,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000101,src:000000,op:flip1,pos:136,+cov
rename to src/exchange/afl-tests/id:000101,src:000000,op:flip1,pos:136,+cov
diff --git a/src/mint/afl-tests/id:000102,src:000000,op:flip1,pos:121,+cov b/src/exchange/afl-tests/id:000102,src:000000,op:flip1,pos:121,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000102,src:000000,op:flip1,pos:121,+cov
rename to src/exchange/afl-tests/id:000102,src:000000,op:flip1,pos:121,+cov
diff --git a/src/mint/afl-tests/id:000102,src:000000,op:flip1,pos:137,+cov b/src/exchange/afl-tests/id:000102,src:000000,op:flip1,pos:137,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000102,src:000000,op:flip1,pos:137,+cov
rename to src/exchange/afl-tests/id:000102,src:000000,op:flip1,pos:137,+cov
diff --git a/src/mint/afl-tests/id:000103,src:000000,op:flip1,pos:130,+cov b/src/exchange/afl-tests/id:000103,src:000000,op:flip1,pos:130,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000103,src:000000,op:flip1,pos:130,+cov
rename to src/exchange/afl-tests/id:000103,src:000000,op:flip1,pos:130,+cov
diff --git a/src/mint/afl-tests/id:000103,src:000000,op:flip1,pos:138,+cov b/src/exchange/afl-tests/id:000103,src:000000,op:flip1,pos:138,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000103,src:000000,op:flip1,pos:138,+cov
rename to src/exchange/afl-tests/id:000103,src:000000,op:flip1,pos:138,+cov
diff --git a/src/mint/afl-tests/id:000104,src:000000,op:flip1,pos:136,+cov b/src/exchange/afl-tests/id:000104,src:000000,op:flip1,pos:136,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000104,src:000000,op:flip1,pos:136,+cov
rename to src/exchange/afl-tests/id:000104,src:000000,op:flip1,pos:136,+cov
diff --git a/src/mint/afl-tests/id:000104,src:000000,op:flip1,pos:138,+cov b/src/exchange/afl-tests/id:000104,src:000000,op:flip1,pos:138,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000104,src:000000,op:flip1,pos:138,+cov
rename to src/exchange/afl-tests/id:000104,src:000000,op:flip1,pos:138,+cov
diff --git a/src/mint/afl-tests/id:000105,src:000000,op:flip1,pos:137,+cov b/src/exchange/afl-tests/id:000105,src:000000,op:flip1,pos:137,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000105,src:000000,op:flip1,pos:137,+cov
rename to src/exchange/afl-tests/id:000105,src:000000,op:flip1,pos:137,+cov
diff --git a/src/mint/afl-tests/id:000105,src:000000,op:flip1,pos:139,+cov b/src/exchange/afl-tests/id:000105,src:000000,op:flip1,pos:139,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000105,src:000000,op:flip1,pos:139,+cov
rename to src/exchange/afl-tests/id:000105,src:000000,op:flip1,pos:139,+cov
diff --git a/src/mint/afl-tests/id:000106,src:000000,op:flip1,pos:137,+cov b/src/exchange/afl-tests/id:000106,src:000000,op:flip1,pos:137,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000106,src:000000,op:flip1,pos:137,+cov
rename to src/exchange/afl-tests/id:000106,src:000000,op:flip1,pos:137,+cov
diff --git a/src/mint/afl-tests/id:000106,src:000000,op:flip1,pos:139,+cov b/src/exchange/afl-tests/id:000106,src:000000,op:flip1,pos:139,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000106,src:000000,op:flip1,pos:139,+cov
rename to src/exchange/afl-tests/id:000106,src:000000,op:flip1,pos:139,+cov
diff --git a/src/mint/afl-tests/id:000107,src:000000,op:flip1,pos:139,+cov b/src/exchange/afl-tests/id:000107,src:000000,op:flip1,pos:139,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000107,src:000000,op:flip1,pos:139,+cov
rename to src/exchange/afl-tests/id:000107,src:000000,op:flip1,pos:139,+cov
diff --git a/src/mint/afl-tests/id:000107,src:000000,op:flip1,pos:140,+cov b/src/exchange/afl-tests/id:000107,src:000000,op:flip1,pos:140,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000107,src:000000,op:flip1,pos:140,+cov
rename to src/exchange/afl-tests/id:000107,src:000000,op:flip1,pos:140,+cov
diff --git a/src/mint/afl-tests/id:000108,src:000000,op:flip1,pos:140,+cov b/src/exchange/afl-tests/id:000108,src:000000,op:flip1,pos:140,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000108,src:000000,op:flip1,pos:140,+cov
rename to src/exchange/afl-tests/id:000108,src:000000,op:flip1,pos:140,+cov
diff --git a/src/mint/afl-tests/id:000108,src:000000,op:flip1,pos:141,+cov b/src/exchange/afl-tests/id:000108,src:000000,op:flip1,pos:141,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000108,src:000000,op:flip1,pos:141,+cov
rename to src/exchange/afl-tests/id:000108,src:000000,op:flip1,pos:141,+cov
diff --git a/src/mint/afl-tests/id:000109,src:000000,op:flip1,pos:140,+cov b/src/exchange/afl-tests/id:000109,src:000000,op:flip1,pos:140,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000109,src:000000,op:flip1,pos:140,+cov
rename to src/exchange/afl-tests/id:000109,src:000000,op:flip1,pos:140,+cov
diff --git a/src/mint/afl-tests/id:000109,src:000000,op:flip1,pos:141,+cov b/src/exchange/afl-tests/id:000109,src:000000,op:flip1,pos:141,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000109,src:000000,op:flip1,pos:141,+cov
rename to src/exchange/afl-tests/id:000109,src:000000,op:flip1,pos:141,+cov
diff --git a/src/mint/afl-tests/id:000110,src:000000,op:flip1,pos:141,+cov b/src/exchange/afl-tests/id:000110,src:000000,op:flip1,pos:141,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000110,src:000000,op:flip1,pos:141,+cov
rename to src/exchange/afl-tests/id:000110,src:000000,op:flip1,pos:141,+cov
diff --git a/src/mint/afl-tests/id:000110,src:000000,op:flip1,pos:143,+cov b/src/exchange/afl-tests/id:000110,src:000000,op:flip1,pos:143,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000110,src:000000,op:flip1,pos:143,+cov
rename to src/exchange/afl-tests/id:000110,src:000000,op:flip1,pos:143,+cov
diff --git a/src/mint/afl-tests/id:000111,src:000000,op:flip1,pos:141,+cov b/src/exchange/afl-tests/id:000111,src:000000,op:flip1,pos:141,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000111,src:000000,op:flip1,pos:141,+cov
rename to src/exchange/afl-tests/id:000111,src:000000,op:flip1,pos:141,+cov
diff --git a/src/mint/afl-tests/id:000111,src:000000,op:flip1,pos:145,+cov b/src/exchange/afl-tests/id:000111,src:000000,op:flip1,pos:145,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000111,src:000000,op:flip1,pos:145,+cov
rename to src/exchange/afl-tests/id:000111,src:000000,op:flip1,pos:145,+cov
diff --git a/src/mint/afl-tests/id:000112,src:000000,op:flip1,pos:142,+cov b/src/exchange/afl-tests/id:000112,src:000000,op:flip1,pos:142,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000112,src:000000,op:flip1,pos:142,+cov
rename to src/exchange/afl-tests/id:000112,src:000000,op:flip1,pos:142,+cov
diff --git a/src/mint/afl-tests/id:000112,src:000000,op:flip1,pos:147,+cov b/src/exchange/afl-tests/id:000112,src:000000,op:flip1,pos:147,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000112,src:000000,op:flip1,pos:147,+cov
rename to src/exchange/afl-tests/id:000112,src:000000,op:flip1,pos:147,+cov
diff --git a/src/mint/afl-tests/id:000113,src:000000,op:flip1,pos:143,+cov b/src/exchange/afl-tests/id:000113,src:000000,op:flip1,pos:143,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000113,src:000000,op:flip1,pos:143,+cov
rename to src/exchange/afl-tests/id:000113,src:000000,op:flip1,pos:143,+cov
diff --git a/src/mint/afl-tests/id:000113,src:000000,op:flip1,pos:147,+cov b/src/exchange/afl-tests/id:000113,src:000000,op:flip1,pos:147,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000113,src:000000,op:flip1,pos:147,+cov
rename to src/exchange/afl-tests/id:000113,src:000000,op:flip1,pos:147,+cov
diff --git a/src/mint/afl-tests/id:000114,src:000000,op:flip1,pos:144,+cov b/src/exchange/afl-tests/id:000114,src:000000,op:flip1,pos:144,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000114,src:000000,op:flip1,pos:144,+cov
rename to src/exchange/afl-tests/id:000114,src:000000,op:flip1,pos:144,+cov
diff --git a/src/mint/afl-tests/id:000114,src:000000,op:flip1,pos:150,+cov b/src/exchange/afl-tests/id:000114,src:000000,op:flip1,pos:150,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000114,src:000000,op:flip1,pos:150,+cov
rename to src/exchange/afl-tests/id:000114,src:000000,op:flip1,pos:150,+cov
diff --git a/src/mint/afl-tests/id:000115,src:000000,op:flip1,pos:147,+cov b/src/exchange/afl-tests/id:000115,src:000000,op:flip1,pos:147,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000115,src:000000,op:flip1,pos:147,+cov
rename to src/exchange/afl-tests/id:000115,src:000000,op:flip1,pos:147,+cov
diff --git a/src/mint/afl-tests/id:000115,src:000000,op:flip1,pos:153,+cov b/src/exchange/afl-tests/id:000115,src:000000,op:flip1,pos:153,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000115,src:000000,op:flip1,pos:153,+cov
rename to src/exchange/afl-tests/id:000115,src:000000,op:flip1,pos:153,+cov
diff --git a/src/mint/afl-tests/id:000116,src:000000,op:flip1,pos:150,+cov b/src/exchange/afl-tests/id:000116,src:000000,op:flip1,pos:150,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000116,src:000000,op:flip1,pos:150,+cov
rename to src/exchange/afl-tests/id:000116,src:000000,op:flip1,pos:150,+cov
diff --git a/src/mint/afl-tests/id:000116,src:000000,op:flip1,pos:154,+cov b/src/exchange/afl-tests/id:000116,src:000000,op:flip1,pos:154,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000116,src:000000,op:flip1,pos:154,+cov
rename to src/exchange/afl-tests/id:000116,src:000000,op:flip1,pos:154,+cov
diff --git a/src/mint/afl-tests/id:000117,src:000000,op:flip1,pos:151,+cov b/src/exchange/afl-tests/id:000117,src:000000,op:flip1,pos:151,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000117,src:000000,op:flip1,pos:151,+cov
rename to src/exchange/afl-tests/id:000117,src:000000,op:flip1,pos:151,+cov
diff --git a/src/mint/afl-tests/id:000117,src:000000,op:flip1,pos:155,+cov b/src/exchange/afl-tests/id:000117,src:000000,op:flip1,pos:155,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000117,src:000000,op:flip1,pos:155,+cov
rename to src/exchange/afl-tests/id:000117,src:000000,op:flip1,pos:155,+cov
diff --git a/src/mint/afl-tests/id:000118,src:000000,op:flip1,pos:151,+cov b/src/exchange/afl-tests/id:000118,src:000000,op:flip1,pos:151,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000118,src:000000,op:flip1,pos:151,+cov
rename to src/exchange/afl-tests/id:000118,src:000000,op:flip1,pos:151,+cov
diff --git a/src/mint/afl-tests/id:000118,src:000000,op:flip1,pos:157,+cov b/src/exchange/afl-tests/id:000118,src:000000,op:flip1,pos:157,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000118,src:000000,op:flip1,pos:157,+cov
rename to src/exchange/afl-tests/id:000118,src:000000,op:flip1,pos:157,+cov
diff --git a/src/mint/afl-tests/id:000119,src:000000,op:flip1,pos:154,+cov b/src/exchange/afl-tests/id:000119,src:000000,op:flip1,pos:154,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000119,src:000000,op:flip1,pos:154,+cov
rename to src/exchange/afl-tests/id:000119,src:000000,op:flip1,pos:154,+cov
diff --git a/src/mint/afl-tests/id:000119,src:000000,op:flip1,pos:158,+cov b/src/exchange/afl-tests/id:000119,src:000000,op:flip1,pos:158,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000119,src:000000,op:flip1,pos:158,+cov
rename to src/exchange/afl-tests/id:000119,src:000000,op:flip1,pos:158,+cov
diff --git a/src/mint/afl-tests/id:000120,src:000000,op:flip1,pos:155,+cov b/src/exchange/afl-tests/id:000120,src:000000,op:flip1,pos:155,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000120,src:000000,op:flip1,pos:155,+cov
rename to src/exchange/afl-tests/id:000120,src:000000,op:flip1,pos:155,+cov
diff --git a/src/mint/afl-tests/id:000120,src:000000,op:flip1,pos:158,+cov b/src/exchange/afl-tests/id:000120,src:000000,op:flip1,pos:158,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000120,src:000000,op:flip1,pos:158,+cov
rename to src/exchange/afl-tests/id:000120,src:000000,op:flip1,pos:158,+cov
diff --git a/src/mint/afl-tests/id:000121,src:000000,op:flip1,pos:156,+cov b/src/exchange/afl-tests/id:000121,src:000000,op:flip1,pos:156,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000121,src:000000,op:flip1,pos:156,+cov
rename to src/exchange/afl-tests/id:000121,src:000000,op:flip1,pos:156,+cov
diff --git a/src/mint/afl-tests/id:000121,src:000000,op:flip1,pos:159,+cov b/src/exchange/afl-tests/id:000121,src:000000,op:flip1,pos:159,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000121,src:000000,op:flip1,pos:159,+cov
rename to src/exchange/afl-tests/id:000121,src:000000,op:flip1,pos:159,+cov
diff --git a/src/mint/afl-tests/id:000122,src:000000,op:flip1,pos:157,+cov b/src/exchange/afl-tests/id:000122,src:000000,op:flip1,pos:157,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000122,src:000000,op:flip1,pos:157,+cov
rename to src/exchange/afl-tests/id:000122,src:000000,op:flip1,pos:157,+cov
diff --git a/src/mint/afl-tests/id:000122,src:000000,op:flip1,pos:159,+cov b/src/exchange/afl-tests/id:000122,src:000000,op:flip1,pos:159,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000122,src:000000,op:flip1,pos:159,+cov
rename to src/exchange/afl-tests/id:000122,src:000000,op:flip1,pos:159,+cov
diff --git a/src/mint/afl-tests/id:000123,src:000000,op:flip1,pos:160,+cov b/src/exchange/afl-tests/id:000123,src:000000,op:flip1,pos:160,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000123,src:000000,op:flip1,pos:160,+cov
rename to src/exchange/afl-tests/id:000123,src:000000,op:flip1,pos:160,+cov
diff --git a/src/mint/afl-tests/id:000123,src:000000,op:flip1,pos:161,+cov b/src/exchange/afl-tests/id:000123,src:000000,op:flip1,pos:161,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000123,src:000000,op:flip1,pos:161,+cov
rename to src/exchange/afl-tests/id:000123,src:000000,op:flip1,pos:161,+cov
diff --git a/src/mint/afl-tests/id:000124,src:000000,op:flip1,pos:161,+cov b/src/exchange/afl-tests/id:000124,src:000000,op:flip1,pos:161,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000124,src:000000,op:flip1,pos:161,+cov
rename to src/exchange/afl-tests/id:000124,src:000000,op:flip1,pos:161,+cov
diff --git a/src/mint/afl-tests/id:000124,src:000000,op:flip1,pos:164,+cov b/src/exchange/afl-tests/id:000124,src:000000,op:flip1,pos:164,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000124,src:000000,op:flip1,pos:164,+cov
rename to src/exchange/afl-tests/id:000124,src:000000,op:flip1,pos:164,+cov
diff --git a/src/mint/afl-tests/id:000125,src:000000,op:flip1,pos:161,+cov b/src/exchange/afl-tests/id:000125,src:000000,op:flip1,pos:161,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000125,src:000000,op:flip1,pos:161,+cov
rename to src/exchange/afl-tests/id:000125,src:000000,op:flip1,pos:161,+cov
diff --git a/src/mint/afl-tests/id:000125,src:000000,op:flip1,pos:166,+cov b/src/exchange/afl-tests/id:000125,src:000000,op:flip1,pos:166,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000125,src:000000,op:flip1,pos:166,+cov
rename to src/exchange/afl-tests/id:000125,src:000000,op:flip1,pos:166,+cov
diff --git a/src/mint/afl-tests/id:000126,src:000000,op:flip1,pos:163 b/src/exchange/afl-tests/id:000126,src:000000,op:flip1,pos:163
similarity index 100%
rename from src/mint/afl-tests/id:000126,src:000000,op:flip1,pos:163
rename to src/exchange/afl-tests/id:000126,src:000000,op:flip1,pos:163
diff --git a/src/mint/afl-tests/id:000126,src:000000,op:flip1,pos:166,+cov b/src/exchange/afl-tests/id:000126,src:000000,op:flip1,pos:166,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000126,src:000000,op:flip1,pos:166,+cov
rename to src/exchange/afl-tests/id:000126,src:000000,op:flip1,pos:166,+cov
diff --git a/src/mint/afl-tests/id:000127,src:000000,op:flip1,pos:166,+cov b/src/exchange/afl-tests/id:000127,src:000000,op:flip1,pos:166,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000127,src:000000,op:flip1,pos:166,+cov
rename to src/exchange/afl-tests/id:000127,src:000000,op:flip1,pos:166,+cov
diff --git a/src/mint/afl-tests/id:000127,src:000000,op:flip1,pos:167,+cov b/src/exchange/afl-tests/id:000127,src:000000,op:flip1,pos:167,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000127,src:000000,op:flip1,pos:167,+cov
rename to src/exchange/afl-tests/id:000127,src:000000,op:flip1,pos:167,+cov
diff --git a/src/mint/afl-tests/id:000128,src:000000,op:flip1,pos:167,+cov b/src/exchange/afl-tests/id:000128,src:000000,op:flip1,pos:167,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000128,src:000000,op:flip1,pos:167,+cov
rename to src/exchange/afl-tests/id:000128,src:000000,op:flip1,pos:167,+cov
diff --git a/src/mint/afl-tests/id:000128,src:000000,op:flip1,pos:170,+cov b/src/exchange/afl-tests/id:000128,src:000000,op:flip1,pos:170,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000128,src:000000,op:flip1,pos:170,+cov
rename to src/exchange/afl-tests/id:000128,src:000000,op:flip1,pos:170,+cov
diff --git a/src/mint/afl-tests/id:000129,src:000000,op:flip1,pos:168,+cov b/src/exchange/afl-tests/id:000129,src:000000,op:flip1,pos:168,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000129,src:000000,op:flip1,pos:168,+cov
rename to src/exchange/afl-tests/id:000129,src:000000,op:flip1,pos:168,+cov
diff --git a/src/mint/afl-tests/id:000129,src:000000,op:flip1,pos:173,+cov b/src/exchange/afl-tests/id:000129,src:000000,op:flip1,pos:173,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000129,src:000000,op:flip1,pos:173,+cov
rename to src/exchange/afl-tests/id:000129,src:000000,op:flip1,pos:173,+cov
diff --git a/src/mint/afl-tests/id:000130,src:000000,op:flip1,pos:171,+cov b/src/exchange/afl-tests/id:000130,src:000000,op:flip1,pos:171,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000130,src:000000,op:flip1,pos:171,+cov
rename to src/exchange/afl-tests/id:000130,src:000000,op:flip1,pos:171,+cov
diff --git a/src/mint/afl-tests/id:000130,src:000000,op:flip1,pos:173,+cov b/src/exchange/afl-tests/id:000130,src:000000,op:flip1,pos:173,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000130,src:000000,op:flip1,pos:173,+cov
rename to src/exchange/afl-tests/id:000130,src:000000,op:flip1,pos:173,+cov
diff --git a/src/mint/afl-tests/id:000131,src:000000,op:flip1,pos:172,+cov b/src/exchange/afl-tests/id:000131,src:000000,op:flip1,pos:172,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000131,src:000000,op:flip1,pos:172,+cov
rename to src/exchange/afl-tests/id:000131,src:000000,op:flip1,pos:172,+cov
diff --git a/src/mint/afl-tests/id:000131,src:000000,op:flip1,pos:174,+cov b/src/exchange/afl-tests/id:000131,src:000000,op:flip1,pos:174,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000131,src:000000,op:flip1,pos:174,+cov
rename to src/exchange/afl-tests/id:000131,src:000000,op:flip1,pos:174,+cov
diff --git a/src/mint/afl-tests/id:000132,src:000000,op:flip1,pos:173,+cov b/src/exchange/afl-tests/id:000132,src:000000,op:flip1,pos:173,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000132,src:000000,op:flip1,pos:173,+cov
rename to src/exchange/afl-tests/id:000132,src:000000,op:flip1,pos:173,+cov
diff --git a/src/mint/afl-tests/id:000132,src:000000,op:flip1,pos:176,+cov b/src/exchange/afl-tests/id:000132,src:000000,op:flip1,pos:176,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000132,src:000000,op:flip1,pos:176,+cov
rename to src/exchange/afl-tests/id:000132,src:000000,op:flip1,pos:176,+cov
diff --git a/src/mint/afl-tests/id:000133,src:000000,op:flip1,pos:173,+cov b/src/exchange/afl-tests/id:000133,src:000000,op:flip1,pos:173,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000133,src:000000,op:flip1,pos:173,+cov
rename to src/exchange/afl-tests/id:000133,src:000000,op:flip1,pos:173,+cov
diff --git a/src/mint/afl-tests/id:000133,src:000000,op:flip1,pos:178,+cov b/src/exchange/afl-tests/id:000133,src:000000,op:flip1,pos:178,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000133,src:000000,op:flip1,pos:178,+cov
rename to src/exchange/afl-tests/id:000133,src:000000,op:flip1,pos:178,+cov
diff --git a/src/mint/afl-tests/id:000134,src:000000,op:flip1,pos:174,+cov b/src/exchange/afl-tests/id:000134,src:000000,op:flip1,pos:174,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000134,src:000000,op:flip1,pos:174,+cov
rename to src/exchange/afl-tests/id:000134,src:000000,op:flip1,pos:174,+cov
diff --git a/src/mint/afl-tests/id:000134,src:000000,op:flip1,pos:178,+cov b/src/exchange/afl-tests/id:000134,src:000000,op:flip1,pos:178,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000134,src:000000,op:flip1,pos:178,+cov
rename to src/exchange/afl-tests/id:000134,src:000000,op:flip1,pos:178,+cov
diff --git a/src/mint/afl-tests/id:000135,src:000000,op:flip1,pos:179,+cov b/src/exchange/afl-tests/id:000135,src:000000,op:flip1,pos:179,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000135,src:000000,op:flip1,pos:179,+cov
rename to src/exchange/afl-tests/id:000135,src:000000,op:flip1,pos:179,+cov
diff --git a/src/mint/afl-tests/id:000135,src:000000,op:flip1,pos:180 b/src/exchange/afl-tests/id:000135,src:000000,op:flip1,pos:180
similarity index 100%
rename from src/mint/afl-tests/id:000135,src:000000,op:flip1,pos:180
rename to src/exchange/afl-tests/id:000135,src:000000,op:flip1,pos:180
diff --git a/src/mint/afl-tests/id:000136,src:000000,op:flip1,pos:182,+cov b/src/exchange/afl-tests/id:000136,src:000000,op:flip1,pos:182,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000136,src:000000,op:flip1,pos:182,+cov
rename to src/exchange/afl-tests/id:000136,src:000000,op:flip1,pos:182,+cov
diff --git a/src/mint/afl-tests/id:000136,src:000000,op:flip1,pos:183,+cov b/src/exchange/afl-tests/id:000136,src:000000,op:flip1,pos:183,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000136,src:000000,op:flip1,pos:183,+cov
rename to src/exchange/afl-tests/id:000136,src:000000,op:flip1,pos:183,+cov
diff --git a/src/mint/afl-tests/id:000137,src:000000,op:flip1,pos:182,+cov b/src/exchange/afl-tests/id:000137,src:000000,op:flip1,pos:182,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000137,src:000000,op:flip1,pos:182,+cov
rename to src/exchange/afl-tests/id:000137,src:000000,op:flip1,pos:182,+cov
diff --git a/src/mint/afl-tests/id:000137,src:000000,op:flip1,pos:184,+cov b/src/exchange/afl-tests/id:000137,src:000000,op:flip1,pos:184,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000137,src:000000,op:flip1,pos:184,+cov
rename to src/exchange/afl-tests/id:000137,src:000000,op:flip1,pos:184,+cov
diff --git a/src/mint/afl-tests/id:000138,src:000000,op:flip1,pos:183 b/src/exchange/afl-tests/id:000138,src:000000,op:flip1,pos:183
similarity index 100%
rename from src/mint/afl-tests/id:000138,src:000000,op:flip1,pos:183
rename to src/exchange/afl-tests/id:000138,src:000000,op:flip1,pos:183
diff --git a/src/mint/afl-tests/id:000138,src:000000,op:flip1,pos:185,+cov b/src/exchange/afl-tests/id:000138,src:000000,op:flip1,pos:185,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000138,src:000000,op:flip1,pos:185,+cov
rename to src/exchange/afl-tests/id:000138,src:000000,op:flip1,pos:185,+cov
diff --git a/src/mint/afl-tests/id:000139,src:000000,op:flip1,pos:183,+cov b/src/exchange/afl-tests/id:000139,src:000000,op:flip1,pos:183,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000139,src:000000,op:flip1,pos:183,+cov
rename to src/exchange/afl-tests/id:000139,src:000000,op:flip1,pos:183,+cov
diff --git a/src/mint/afl-tests/id:000139,src:000000,op:flip1,pos:190 b/src/exchange/afl-tests/id:000139,src:000000,op:flip1,pos:190
similarity index 100%
rename from src/mint/afl-tests/id:000139,src:000000,op:flip1,pos:190
rename to src/exchange/afl-tests/id:000139,src:000000,op:flip1,pos:190
diff --git a/src/mint/afl-tests/id:000140,src:000000,op:flip1,pos:185,+cov b/src/exchange/afl-tests/id:000140,src:000000,op:flip1,pos:185,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000140,src:000000,op:flip1,pos:185,+cov
rename to src/exchange/afl-tests/id:000140,src:000000,op:flip1,pos:185,+cov
diff --git a/src/mint/afl-tests/id:000140,src:000000,op:flip1,pos:200,+cov b/src/exchange/afl-tests/id:000140,src:000000,op:flip1,pos:200,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000140,src:000000,op:flip1,pos:200,+cov
rename to src/exchange/afl-tests/id:000140,src:000000,op:flip1,pos:200,+cov
diff --git a/src/mint/afl-tests/id:000141,src:000000,op:flip1,pos:185,+cov b/src/exchange/afl-tests/id:000141,src:000000,op:flip1,pos:185,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000141,src:000000,op:flip1,pos:185,+cov
rename to src/exchange/afl-tests/id:000141,src:000000,op:flip1,pos:185,+cov
diff --git a/src/mint/afl-tests/id:000141,src:000000,op:flip1,pos:205,+cov b/src/exchange/afl-tests/id:000141,src:000000,op:flip1,pos:205,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000141,src:000000,op:flip1,pos:205,+cov
rename to src/exchange/afl-tests/id:000141,src:000000,op:flip1,pos:205,+cov
diff --git a/src/mint/afl-tests/id:000142,src:000000,op:flip1,pos:190 b/src/exchange/afl-tests/id:000142,src:000000,op:flip1,pos:190
similarity index 100%
rename from src/mint/afl-tests/id:000142,src:000000,op:flip1,pos:190
rename to src/exchange/afl-tests/id:000142,src:000000,op:flip1,pos:190
diff --git a/src/mint/afl-tests/id:000142,src:000000,op:flip1,pos:211,+cov b/src/exchange/afl-tests/id:000142,src:000000,op:flip1,pos:211,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000142,src:000000,op:flip1,pos:211,+cov
rename to src/exchange/afl-tests/id:000142,src:000000,op:flip1,pos:211,+cov
diff --git a/src/mint/afl-tests/id:000143,src:000000,op:flip1,pos:193,+cov b/src/exchange/afl-tests/id:000143,src:000000,op:flip1,pos:193,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000143,src:000000,op:flip1,pos:193,+cov
rename to src/exchange/afl-tests/id:000143,src:000000,op:flip1,pos:193,+cov
diff --git a/src/mint/afl-tests/id:000143,src:000000,op:flip1,pos:238,+cov b/src/exchange/afl-tests/id:000143,src:000000,op:flip1,pos:238,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000143,src:000000,op:flip1,pos:238,+cov
rename to src/exchange/afl-tests/id:000143,src:000000,op:flip1,pos:238,+cov
diff --git a/src/mint/afl-tests/id:000144,src:000000,op:flip1,pos:200,+cov b/src/exchange/afl-tests/id:000144,src:000000,op:flip1,pos:200,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000144,src:000000,op:flip1,pos:200,+cov
rename to src/exchange/afl-tests/id:000144,src:000000,op:flip1,pos:200,+cov
diff --git a/src/mint/afl-tests/id:000144,src:000000,op:flip1,pos:238,+cov b/src/exchange/afl-tests/id:000144,src:000000,op:flip1,pos:238,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000144,src:000000,op:flip1,pos:238,+cov
rename to src/exchange/afl-tests/id:000144,src:000000,op:flip1,pos:238,+cov
diff --git a/src/mint/afl-tests/id:000145,src:000000,op:flip1,pos:211,+cov b/src/exchange/afl-tests/id:000145,src:000000,op:flip1,pos:211,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000145,src:000000,op:flip1,pos:211,+cov
rename to src/exchange/afl-tests/id:000145,src:000000,op:flip1,pos:211,+cov
diff --git a/src/mint/afl-tests/id:000145,src:000000,op:flip1,pos:241,+cov b/src/exchange/afl-tests/id:000145,src:000000,op:flip1,pos:241,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000145,src:000000,op:flip1,pos:241,+cov
rename to src/exchange/afl-tests/id:000145,src:000000,op:flip1,pos:241,+cov
diff --git a/src/mint/afl-tests/id:000146,src:000000,op:flip1,pos:223,+cov b/src/exchange/afl-tests/id:000146,src:000000,op:flip1,pos:223,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000146,src:000000,op:flip1,pos:223,+cov
rename to src/exchange/afl-tests/id:000146,src:000000,op:flip1,pos:223,+cov
diff --git a/src/mint/afl-tests/id:000146,src:000000,op:flip1,pos:245 b/src/exchange/afl-tests/id:000146,src:000000,op:flip1,pos:245
similarity index 100%
rename from src/mint/afl-tests/id:000146,src:000000,op:flip1,pos:245
rename to src/exchange/afl-tests/id:000146,src:000000,op:flip1,pos:245
diff --git a/src/mint/afl-tests/id:000147,src:000000,op:flip1,pos:245 b/src/exchange/afl-tests/id:000147,src:000000,op:flip1,pos:245
similarity index 100%
rename from src/mint/afl-tests/id:000147,src:000000,op:flip1,pos:245
rename to src/exchange/afl-tests/id:000147,src:000000,op:flip1,pos:245
diff --git a/src/mint/afl-tests/id:000147,src:000000,op:flip1,pos:255,+cov b/src/exchange/afl-tests/id:000147,src:000000,op:flip1,pos:255,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000147,src:000000,op:flip1,pos:255,+cov
rename to src/exchange/afl-tests/id:000147,src:000000,op:flip1,pos:255,+cov
diff --git a/src/mint/afl-tests/id:000148,src:000000,op:flip1,pos:262,+cov b/src/exchange/afl-tests/id:000148,src:000000,op:flip1,pos:262,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000148,src:000000,op:flip1,pos:262,+cov
rename to src/exchange/afl-tests/id:000148,src:000000,op:flip1,pos:262,+cov
diff --git a/src/mint/afl-tests/id:000149,src:000000,op:flip1,pos:268,+cov b/src/exchange/afl-tests/id:000149,src:000000,op:flip1,pos:268,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000149,src:000000,op:flip1,pos:268,+cov
rename to src/exchange/afl-tests/id:000149,src:000000,op:flip1,pos:268,+cov
diff --git a/src/mint/afl-tests/id:000149,src:000000,op:flip1,pos:270,+cov b/src/exchange/afl-tests/id:000149,src:000000,op:flip1,pos:270,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000149,src:000000,op:flip1,pos:270,+cov
rename to src/exchange/afl-tests/id:000149,src:000000,op:flip1,pos:270,+cov
diff --git a/src/mint/afl-tests/id:000150,src:000000,op:flip1,pos:269,+cov b/src/exchange/afl-tests/id:000150,src:000000,op:flip1,pos:269,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000150,src:000000,op:flip1,pos:269,+cov
rename to src/exchange/afl-tests/id:000150,src:000000,op:flip1,pos:269,+cov
diff --git a/src/mint/afl-tests/id:000150,src:000000,op:flip1,pos:279,+cov b/src/exchange/afl-tests/id:000150,src:000000,op:flip1,pos:279,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000150,src:000000,op:flip1,pos:279,+cov
rename to src/exchange/afl-tests/id:000150,src:000000,op:flip1,pos:279,+cov
diff --git a/src/mint/afl-tests/id:000151,src:000000,op:flip1,pos:270,+cov b/src/exchange/afl-tests/id:000151,src:000000,op:flip1,pos:270,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000151,src:000000,op:flip1,pos:270,+cov
rename to src/exchange/afl-tests/id:000151,src:000000,op:flip1,pos:270,+cov
diff --git a/src/mint/afl-tests/id:000151,src:000000,op:flip1,pos:279,+cov b/src/exchange/afl-tests/id:000151,src:000000,op:flip1,pos:279,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000151,src:000000,op:flip1,pos:279,+cov
rename to src/exchange/afl-tests/id:000151,src:000000,op:flip1,pos:279,+cov
diff --git a/src/mint/afl-tests/id:000152,src:000000,op:flip1,pos:271,+cov b/src/exchange/afl-tests/id:000152,src:000000,op:flip1,pos:271,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000152,src:000000,op:flip1,pos:271,+cov
rename to src/exchange/afl-tests/id:000152,src:000000,op:flip1,pos:271,+cov
diff --git a/src/mint/afl-tests/id:000152,src:000000,op:flip1,pos:283,+cov b/src/exchange/afl-tests/id:000152,src:000000,op:flip1,pos:283,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000152,src:000000,op:flip1,pos:283,+cov
rename to src/exchange/afl-tests/id:000152,src:000000,op:flip1,pos:283,+cov
diff --git a/src/mint/afl-tests/id:000153,src:000000,op:flip1,pos:271,+cov b/src/exchange/afl-tests/id:000153,src:000000,op:flip1,pos:271,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000153,src:000000,op:flip1,pos:271,+cov
rename to src/exchange/afl-tests/id:000153,src:000000,op:flip1,pos:271,+cov
diff --git a/src/mint/afl-tests/id:000153,src:000000,op:flip1,pos:291,+cov b/src/exchange/afl-tests/id:000153,src:000000,op:flip1,pos:291,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000153,src:000000,op:flip1,pos:291,+cov
rename to src/exchange/afl-tests/id:000153,src:000000,op:flip1,pos:291,+cov
diff --git a/src/mint/afl-tests/id:000154,src:000000,op:flip1,pos:274,+cov b/src/exchange/afl-tests/id:000154,src:000000,op:flip1,pos:274,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000154,src:000000,op:flip1,pos:274,+cov
rename to src/exchange/afl-tests/id:000154,src:000000,op:flip1,pos:274,+cov
diff --git a/src/mint/afl-tests/id:000154,src:000000,op:flip1,pos:298,+cov b/src/exchange/afl-tests/id:000154,src:000000,op:flip1,pos:298,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000154,src:000000,op:flip1,pos:298,+cov
rename to src/exchange/afl-tests/id:000154,src:000000,op:flip1,pos:298,+cov
diff --git a/src/mint/afl-tests/id:000155,src:000000,op:flip1,pos:279,+cov b/src/exchange/afl-tests/id:000155,src:000000,op:flip1,pos:279,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000155,src:000000,op:flip1,pos:279,+cov
rename to src/exchange/afl-tests/id:000155,src:000000,op:flip1,pos:279,+cov
diff --git a/src/mint/afl-tests/id:000155,src:000000,op:flip1,pos:302,+cov b/src/exchange/afl-tests/id:000155,src:000000,op:flip1,pos:302,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000155,src:000000,op:flip1,pos:302,+cov
rename to src/exchange/afl-tests/id:000155,src:000000,op:flip1,pos:302,+cov
diff --git a/src/mint/afl-tests/id:000156,src:000000,op:flip1,pos:281,+cov b/src/exchange/afl-tests/id:000156,src:000000,op:flip1,pos:281,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000156,src:000000,op:flip1,pos:281,+cov
rename to src/exchange/afl-tests/id:000156,src:000000,op:flip1,pos:281,+cov
diff --git a/src/mint/afl-tests/id:000156,src:000000,op:flip1,pos:305,+cov b/src/exchange/afl-tests/id:000156,src:000000,op:flip1,pos:305,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000156,src:000000,op:flip1,pos:305,+cov
rename to src/exchange/afl-tests/id:000156,src:000000,op:flip1,pos:305,+cov
diff --git a/src/mint/afl-tests/id:000157,src:000000,op:flip1,pos:283,+cov b/src/exchange/afl-tests/id:000157,src:000000,op:flip1,pos:283,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000157,src:000000,op:flip1,pos:283,+cov
rename to src/exchange/afl-tests/id:000157,src:000000,op:flip1,pos:283,+cov
diff --git a/src/mint/afl-tests/id:000157,src:000000,op:flip1,pos:307,+cov b/src/exchange/afl-tests/id:000157,src:000000,op:flip1,pos:307,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000157,src:000000,op:flip1,pos:307,+cov
rename to src/exchange/afl-tests/id:000157,src:000000,op:flip1,pos:307,+cov
diff --git a/src/mint/afl-tests/id:000158,src:000000,op:flip1,pos:291,+cov b/src/exchange/afl-tests/id:000158,src:000000,op:flip1,pos:291,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000158,src:000000,op:flip1,pos:291,+cov
rename to src/exchange/afl-tests/id:000158,src:000000,op:flip1,pos:291,+cov
diff --git a/src/mint/afl-tests/id:000158,src:000000,op:flip1,pos:313,+cov b/src/exchange/afl-tests/id:000158,src:000000,op:flip1,pos:313,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000158,src:000000,op:flip1,pos:313,+cov
rename to src/exchange/afl-tests/id:000158,src:000000,op:flip1,pos:313,+cov
diff --git a/src/mint/afl-tests/id:000159,src:000000,op:flip1,pos:298,+cov b/src/exchange/afl-tests/id:000159,src:000000,op:flip1,pos:298,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000159,src:000000,op:flip1,pos:298,+cov
rename to src/exchange/afl-tests/id:000159,src:000000,op:flip1,pos:298,+cov
diff --git a/src/mint/afl-tests/id:000159,src:000000,op:flip1,pos:313,+cov b/src/exchange/afl-tests/id:000159,src:000000,op:flip1,pos:313,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000159,src:000000,op:flip1,pos:313,+cov
rename to src/exchange/afl-tests/id:000159,src:000000,op:flip1,pos:313,+cov
diff --git a/src/mint/afl-tests/id:000160,src:000000,op:flip1,pos:299,+cov b/src/exchange/afl-tests/id:000160,src:000000,op:flip1,pos:299,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000160,src:000000,op:flip1,pos:299,+cov
rename to src/exchange/afl-tests/id:000160,src:000000,op:flip1,pos:299,+cov
diff --git a/src/mint/afl-tests/id:000160,src:000000,op:flip1,pos:314,+cov b/src/exchange/afl-tests/id:000160,src:000000,op:flip1,pos:314,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000160,src:000000,op:flip1,pos:314,+cov
rename to src/exchange/afl-tests/id:000160,src:000000,op:flip1,pos:314,+cov
diff --git a/src/mint/afl-tests/id:000161,src:000000,op:flip1,pos:306,+cov b/src/exchange/afl-tests/id:000161,src:000000,op:flip1,pos:306,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000161,src:000000,op:flip1,pos:306,+cov
rename to src/exchange/afl-tests/id:000161,src:000000,op:flip1,pos:306,+cov
diff --git a/src/mint/afl-tests/id:000161,src:000000,op:flip1,pos:314,+cov b/src/exchange/afl-tests/id:000161,src:000000,op:flip1,pos:314,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000161,src:000000,op:flip1,pos:314,+cov
rename to src/exchange/afl-tests/id:000161,src:000000,op:flip1,pos:314,+cov
diff --git a/src/mint/afl-tests/id:000162,src:000000,op:flip1,pos:308,+cov b/src/exchange/afl-tests/id:000162,src:000000,op:flip1,pos:308,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000162,src:000000,op:flip1,pos:308,+cov
rename to src/exchange/afl-tests/id:000162,src:000000,op:flip1,pos:308,+cov
diff --git a/src/mint/afl-tests/id:000162,src:000000,op:flip1,pos:315,+cov b/src/exchange/afl-tests/id:000162,src:000000,op:flip1,pos:315,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000162,src:000000,op:flip1,pos:315,+cov
rename to src/exchange/afl-tests/id:000162,src:000000,op:flip1,pos:315,+cov
diff --git a/src/mint/afl-tests/id:000163,src:000000,op:flip1,pos:312,+cov b/src/exchange/afl-tests/id:000163,src:000000,op:flip1,pos:312,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000163,src:000000,op:flip1,pos:312,+cov
rename to src/exchange/afl-tests/id:000163,src:000000,op:flip1,pos:312,+cov
diff --git a/src/mint/afl-tests/id:000163,src:000000,op:flip1,pos:316,+cov b/src/exchange/afl-tests/id:000163,src:000000,op:flip1,pos:316,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000163,src:000000,op:flip1,pos:316,+cov
rename to src/exchange/afl-tests/id:000163,src:000000,op:flip1,pos:316,+cov
diff --git a/src/mint/afl-tests/id:000164,src:000000,op:flip1,pos:315,+cov b/src/exchange/afl-tests/id:000164,src:000000,op:flip1,pos:315,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000164,src:000000,op:flip1,pos:315,+cov
rename to src/exchange/afl-tests/id:000164,src:000000,op:flip1,pos:315,+cov
diff --git a/src/mint/afl-tests/id:000164,src:000000,op:flip1,pos:317 b/src/exchange/afl-tests/id:000164,src:000000,op:flip1,pos:317
similarity index 100%
rename from src/mint/afl-tests/id:000164,src:000000,op:flip1,pos:317
rename to src/exchange/afl-tests/id:000164,src:000000,op:flip1,pos:317
diff --git a/src/mint/afl-tests/id:000165,src:000000,op:flip1,pos:316,+cov b/src/exchange/afl-tests/id:000165,src:000000,op:flip1,pos:316,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000165,src:000000,op:flip1,pos:316,+cov
rename to src/exchange/afl-tests/id:000165,src:000000,op:flip1,pos:316,+cov
diff --git a/src/mint/afl-tests/id:000165,src:000000,op:flip1,pos:317,+cov b/src/exchange/afl-tests/id:000165,src:000000,op:flip1,pos:317,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000165,src:000000,op:flip1,pos:317,+cov
rename to src/exchange/afl-tests/id:000165,src:000000,op:flip1,pos:317,+cov
diff --git a/src/mint/afl-tests/id:000166,src:000000,op:flip1,pos:316,+cov b/src/exchange/afl-tests/id:000166,src:000000,op:flip1,pos:316,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000166,src:000000,op:flip1,pos:316,+cov
rename to src/exchange/afl-tests/id:000166,src:000000,op:flip1,pos:316,+cov
diff --git a/src/mint/afl-tests/id:000166,src:000000,op:flip1,pos:319,+cov b/src/exchange/afl-tests/id:000166,src:000000,op:flip1,pos:319,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000166,src:000000,op:flip1,pos:319,+cov
rename to src/exchange/afl-tests/id:000166,src:000000,op:flip1,pos:319,+cov
diff --git a/src/mint/afl-tests/id:000167,src:000000,op:flip1,pos:317,+cov b/src/exchange/afl-tests/id:000167,src:000000,op:flip1,pos:317,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000167,src:000000,op:flip1,pos:317,+cov
rename to src/exchange/afl-tests/id:000167,src:000000,op:flip1,pos:317,+cov
diff --git a/src/mint/afl-tests/id:000167,src:000000,op:flip1,pos:320,+cov b/src/exchange/afl-tests/id:000167,src:000000,op:flip1,pos:320,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000167,src:000000,op:flip1,pos:320,+cov
rename to src/exchange/afl-tests/id:000167,src:000000,op:flip1,pos:320,+cov
diff --git a/src/mint/afl-tests/id:000168,src:000000,op:flip1,pos:317,+cov b/src/exchange/afl-tests/id:000168,src:000000,op:flip1,pos:317,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000168,src:000000,op:flip1,pos:317,+cov
rename to src/exchange/afl-tests/id:000168,src:000000,op:flip1,pos:317,+cov
diff --git a/src/mint/afl-tests/id:000168,src:000000,op:flip1,pos:322,+cov b/src/exchange/afl-tests/id:000168,src:000000,op:flip1,pos:322,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000168,src:000000,op:flip1,pos:322,+cov
rename to src/exchange/afl-tests/id:000168,src:000000,op:flip1,pos:322,+cov
diff --git a/src/mint/afl-tests/id:000169,src:000000,op:flip1,pos:318,+cov b/src/exchange/afl-tests/id:000169,src:000000,op:flip1,pos:318,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000169,src:000000,op:flip1,pos:318,+cov
rename to src/exchange/afl-tests/id:000169,src:000000,op:flip1,pos:318,+cov
diff --git a/src/mint/afl-tests/id:000169,src:000000,op:flip1,pos:326,+cov b/src/exchange/afl-tests/id:000169,src:000000,op:flip1,pos:326,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000169,src:000000,op:flip1,pos:326,+cov
rename to src/exchange/afl-tests/id:000169,src:000000,op:flip1,pos:326,+cov
diff --git a/src/mint/afl-tests/id:000170,src:000000,op:flip1,pos:319,+cov b/src/exchange/afl-tests/id:000170,src:000000,op:flip1,pos:319,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000170,src:000000,op:flip1,pos:319,+cov
rename to src/exchange/afl-tests/id:000170,src:000000,op:flip1,pos:319,+cov
diff --git a/src/mint/afl-tests/id:000170,src:000000,op:flip1,pos:328,+cov b/src/exchange/afl-tests/id:000170,src:000000,op:flip1,pos:328,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000170,src:000000,op:flip1,pos:328,+cov
rename to src/exchange/afl-tests/id:000170,src:000000,op:flip1,pos:328,+cov
diff --git a/src/mint/afl-tests/id:000171,src:000000,op:flip1,pos:326,+cov b/src/exchange/afl-tests/id:000171,src:000000,op:flip1,pos:326,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000171,src:000000,op:flip1,pos:326,+cov
rename to src/exchange/afl-tests/id:000171,src:000000,op:flip1,pos:326,+cov
diff --git a/src/mint/afl-tests/id:000171,src:000000,op:flip1,pos:329 b/src/exchange/afl-tests/id:000171,src:000000,op:flip1,pos:329
similarity index 100%
rename from src/mint/afl-tests/id:000171,src:000000,op:flip1,pos:329
rename to src/exchange/afl-tests/id:000171,src:000000,op:flip1,pos:329
diff --git a/src/mint/afl-tests/id:000172,src:000000,op:flip1,pos:327 b/src/exchange/afl-tests/id:000172,src:000000,op:flip1,pos:327
similarity index 100%
rename from src/mint/afl-tests/id:000172,src:000000,op:flip1,pos:327
rename to src/exchange/afl-tests/id:000172,src:000000,op:flip1,pos:327
diff --git a/src/mint/afl-tests/id:000172,src:000000,op:flip1,pos:332,+cov b/src/exchange/afl-tests/id:000172,src:000000,op:flip1,pos:332,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000172,src:000000,op:flip1,pos:332,+cov
rename to src/exchange/afl-tests/id:000172,src:000000,op:flip1,pos:332,+cov
diff --git a/src/mint/afl-tests/id:000173,src:000000,op:flip1,pos:330,+cov b/src/exchange/afl-tests/id:000173,src:000000,op:flip1,pos:330,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000173,src:000000,op:flip1,pos:330,+cov
rename to src/exchange/afl-tests/id:000173,src:000000,op:flip1,pos:330,+cov
diff --git a/src/mint/afl-tests/id:000173,src:000000,op:flip2,pos:8,+cov b/src/exchange/afl-tests/id:000173,src:000000,op:flip2,pos:8,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000173,src:000000,op:flip2,pos:8,+cov
rename to src/exchange/afl-tests/id:000173,src:000000,op:flip2,pos:8,+cov
diff --git a/src/mint/afl-tests/id:000174,src:000000,op:flip1,pos:331,+cov b/src/exchange/afl-tests/id:000174,src:000000,op:flip1,pos:331,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000174,src:000000,op:flip1,pos:331,+cov
rename to src/exchange/afl-tests/id:000174,src:000000,op:flip1,pos:331,+cov
diff --git a/src/mint/afl-tests/id:000174,src:000000,op:flip2,pos:8,+cov b/src/exchange/afl-tests/id:000174,src:000000,op:flip2,pos:8,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000174,src:000000,op:flip2,pos:8,+cov
rename to src/exchange/afl-tests/id:000174,src:000000,op:flip2,pos:8,+cov
diff --git a/src/mint/afl-tests/id:000175,src:000000,op:flip1,pos:338,+cov b/src/exchange/afl-tests/id:000175,src:000000,op:flip1,pos:338,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000175,src:000000,op:flip1,pos:338,+cov
rename to src/exchange/afl-tests/id:000175,src:000000,op:flip1,pos:338,+cov
diff --git a/src/mint/afl-tests/id:000175,src:000000,op:flip2,pos:28,+cov b/src/exchange/afl-tests/id:000175,src:000000,op:flip2,pos:28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000175,src:000000,op:flip2,pos:28,+cov
rename to src/exchange/afl-tests/id:000175,src:000000,op:flip2,pos:28,+cov
diff --git a/src/mint/afl-tests/id:000176,src:000000,op:flip2,pos:30,+cov b/src/exchange/afl-tests/id:000176,src:000000,op:flip2,pos:30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000176,src:000000,op:flip2,pos:30,+cov
rename to src/exchange/afl-tests/id:000176,src:000000,op:flip2,pos:30,+cov
diff --git a/src/mint/afl-tests/id:000176,src:000000,op:flip2,pos:8,+cov b/src/exchange/afl-tests/id:000176,src:000000,op:flip2,pos:8,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000176,src:000000,op:flip2,pos:8,+cov
rename to src/exchange/afl-tests/id:000176,src:000000,op:flip2,pos:8,+cov
diff --git a/src/mint/afl-tests/id:000177,src:000000,op:flip2,pos:25,+cov b/src/exchange/afl-tests/id:000177,src:000000,op:flip2,pos:25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000177,src:000000,op:flip2,pos:25,+cov
rename to src/exchange/afl-tests/id:000177,src:000000,op:flip2,pos:25,+cov
diff --git a/src/mint/afl-tests/id:000177,src:000000,op:flip2,pos:30,+cov b/src/exchange/afl-tests/id:000177,src:000000,op:flip2,pos:30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000177,src:000000,op:flip2,pos:30,+cov
rename to src/exchange/afl-tests/id:000177,src:000000,op:flip2,pos:30,+cov
diff --git a/src/mint/afl-tests/id:000178,src:000000,op:flip2,pos:26,+cov b/src/exchange/afl-tests/id:000178,src:000000,op:flip2,pos:26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000178,src:000000,op:flip2,pos:26,+cov
rename to src/exchange/afl-tests/id:000178,src:000000,op:flip2,pos:26,+cov
diff --git a/src/mint/afl-tests/id:000178,src:000000,op:flip2,pos:31,+cov b/src/exchange/afl-tests/id:000178,src:000000,op:flip2,pos:31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000178,src:000000,op:flip2,pos:31,+cov
rename to src/exchange/afl-tests/id:000178,src:000000,op:flip2,pos:31,+cov
diff --git a/src/mint/afl-tests/id:000179,src:000000,op:flip2,pos:29,+cov b/src/exchange/afl-tests/id:000179,src:000000,op:flip2,pos:29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000179,src:000000,op:flip2,pos:29,+cov
rename to src/exchange/afl-tests/id:000179,src:000000,op:flip2,pos:29,+cov
diff --git a/src/mint/afl-tests/id:000179,src:000000,op:flip2,pos:31,+cov b/src/exchange/afl-tests/id:000179,src:000000,op:flip2,pos:31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000179,src:000000,op:flip2,pos:31,+cov
rename to src/exchange/afl-tests/id:000179,src:000000,op:flip2,pos:31,+cov
diff --git a/src/mint/afl-tests/id:000180,src:000000,op:flip2,pos:30,+cov b/src/exchange/afl-tests/id:000180,src:000000,op:flip2,pos:30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000180,src:000000,op:flip2,pos:30,+cov
rename to src/exchange/afl-tests/id:000180,src:000000,op:flip2,pos:30,+cov
diff --git a/src/mint/afl-tests/id:000180,src:000000,op:flip2,pos:32,+cov b/src/exchange/afl-tests/id:000180,src:000000,op:flip2,pos:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000180,src:000000,op:flip2,pos:32,+cov
rename to src/exchange/afl-tests/id:000180,src:000000,op:flip2,pos:32,+cov
diff --git a/src/mint/afl-tests/id:000181,src:000000,op:flip2,pos:33,+cov b/src/exchange/afl-tests/id:000181,src:000000,op:flip2,pos:33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000181,src:000000,op:flip2,pos:33,+cov
rename to src/exchange/afl-tests/id:000181,src:000000,op:flip2,pos:33,+cov
diff --git a/src/mint/afl-tests/id:000181,src:000000,op:flip2,pos:36,+cov b/src/exchange/afl-tests/id:000181,src:000000,op:flip2,pos:36,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000181,src:000000,op:flip2,pos:36,+cov
rename to src/exchange/afl-tests/id:000181,src:000000,op:flip2,pos:36,+cov
diff --git a/src/mint/afl-tests/id:000182,src:000000,op:flip2,pos:38 b/src/exchange/afl-tests/id:000182,src:000000,op:flip2,pos:38
similarity index 100%
rename from src/mint/afl-tests/id:000182,src:000000,op:flip2,pos:38
rename to src/exchange/afl-tests/id:000182,src:000000,op:flip2,pos:38
diff --git a/src/mint/afl-tests/id:000183,src:000000,op:flip2,pos:39,+cov b/src/exchange/afl-tests/id:000183,src:000000,op:flip2,pos:39,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000183,src:000000,op:flip2,pos:39,+cov
rename to src/exchange/afl-tests/id:000183,src:000000,op:flip2,pos:39,+cov
diff --git a/src/mint/afl-tests/id:000184,src:000000,op:flip2,pos:40,+cov b/src/exchange/afl-tests/id:000184,src:000000,op:flip2,pos:40,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000184,src:000000,op:flip2,pos:40,+cov
rename to src/exchange/afl-tests/id:000184,src:000000,op:flip2,pos:40,+cov
diff --git a/src/mint/afl-tests/id:000184,src:000000,op:flip2,pos:43,+cov b/src/exchange/afl-tests/id:000184,src:000000,op:flip2,pos:43,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000184,src:000000,op:flip2,pos:43,+cov
rename to src/exchange/afl-tests/id:000184,src:000000,op:flip2,pos:43,+cov
diff --git a/src/mint/afl-tests/id:000185,src:000000,op:flip2,pos:40,+cov b/src/exchange/afl-tests/id:000185,src:000000,op:flip2,pos:40,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000185,src:000000,op:flip2,pos:40,+cov
rename to src/exchange/afl-tests/id:000185,src:000000,op:flip2,pos:40,+cov
diff --git a/src/mint/afl-tests/id:000185,src:000000,op:flip2,pos:49,+cov b/src/exchange/afl-tests/id:000185,src:000000,op:flip2,pos:49,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000185,src:000000,op:flip2,pos:49,+cov
rename to src/exchange/afl-tests/id:000185,src:000000,op:flip2,pos:49,+cov
diff --git a/src/mint/afl-tests/id:000186,src:000000,op:flip2,pos:40,+cov b/src/exchange/afl-tests/id:000186,src:000000,op:flip2,pos:40,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000186,src:000000,op:flip2,pos:40,+cov
rename to src/exchange/afl-tests/id:000186,src:000000,op:flip2,pos:40,+cov
diff --git a/src/mint/afl-tests/id:000186,src:000000,op:flip2,pos:54,+cov b/src/exchange/afl-tests/id:000186,src:000000,op:flip2,pos:54,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000186,src:000000,op:flip2,pos:54,+cov
rename to src/exchange/afl-tests/id:000186,src:000000,op:flip2,pos:54,+cov
diff --git a/src/mint/afl-tests/id:000187,src:000000,op:flip2,pos:46,+cov b/src/exchange/afl-tests/id:000187,src:000000,op:flip2,pos:46,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000187,src:000000,op:flip2,pos:46,+cov
rename to src/exchange/afl-tests/id:000187,src:000000,op:flip2,pos:46,+cov
diff --git a/src/mint/afl-tests/id:000187,src:000000,op:flip2,pos:60,+cov b/src/exchange/afl-tests/id:000187,src:000000,op:flip2,pos:60,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000187,src:000000,op:flip2,pos:60,+cov
rename to src/exchange/afl-tests/id:000187,src:000000,op:flip2,pos:60,+cov
diff --git a/src/mint/afl-tests/id:000188,src:000000,op:flip2,pos:47,+cov b/src/exchange/afl-tests/id:000188,src:000000,op:flip2,pos:47,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000188,src:000000,op:flip2,pos:47,+cov
rename to src/exchange/afl-tests/id:000188,src:000000,op:flip2,pos:47,+cov
diff --git a/src/mint/afl-tests/id:000188,src:000000,op:flip2,pos:64,+cov b/src/exchange/afl-tests/id:000188,src:000000,op:flip2,pos:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000188,src:000000,op:flip2,pos:64,+cov
rename to src/exchange/afl-tests/id:000188,src:000000,op:flip2,pos:64,+cov
diff --git a/src/mint/afl-tests/id:000189,src:000000,op:flip2,pos:48,+cov b/src/exchange/afl-tests/id:000189,src:000000,op:flip2,pos:48,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000189,src:000000,op:flip2,pos:48,+cov
rename to src/exchange/afl-tests/id:000189,src:000000,op:flip2,pos:48,+cov
diff --git a/src/mint/afl-tests/id:000189,src:000000,op:flip2,pos:69,+cov b/src/exchange/afl-tests/id:000189,src:000000,op:flip2,pos:69,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000189,src:000000,op:flip2,pos:69,+cov
rename to src/exchange/afl-tests/id:000189,src:000000,op:flip2,pos:69,+cov
diff --git a/src/mint/afl-tests/id:000190,src:000000,op:flip2,pos:49,+cov b/src/exchange/afl-tests/id:000190,src:000000,op:flip2,pos:49,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000190,src:000000,op:flip2,pos:49,+cov
rename to src/exchange/afl-tests/id:000190,src:000000,op:flip2,pos:49,+cov
diff --git a/src/mint/afl-tests/id:000190,src:000000,op:flip2,pos:71,+cov b/src/exchange/afl-tests/id:000190,src:000000,op:flip2,pos:71,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000190,src:000000,op:flip2,pos:71,+cov
rename to src/exchange/afl-tests/id:000190,src:000000,op:flip2,pos:71,+cov
diff --git a/src/mint/afl-tests/id:000191,src:000000,op:flip2,pos:53,+cov b/src/exchange/afl-tests/id:000191,src:000000,op:flip2,pos:53,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000191,src:000000,op:flip2,pos:53,+cov
rename to src/exchange/afl-tests/id:000191,src:000000,op:flip2,pos:53,+cov
diff --git a/src/mint/afl-tests/id:000191,src:000000,op:flip2,pos:73,+cov b/src/exchange/afl-tests/id:000191,src:000000,op:flip2,pos:73,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000191,src:000000,op:flip2,pos:73,+cov
rename to src/exchange/afl-tests/id:000191,src:000000,op:flip2,pos:73,+cov
diff --git a/src/mint/afl-tests/id:000192,src:000000,op:flip2,pos:53,+cov b/src/exchange/afl-tests/id:000192,src:000000,op:flip2,pos:53,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000192,src:000000,op:flip2,pos:53,+cov
rename to src/exchange/afl-tests/id:000192,src:000000,op:flip2,pos:53,+cov
diff --git a/src/mint/afl-tests/id:000192,src:000000,op:flip2,pos:73,+cov b/src/exchange/afl-tests/id:000192,src:000000,op:flip2,pos:73,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000192,src:000000,op:flip2,pos:73,+cov
rename to src/exchange/afl-tests/id:000192,src:000000,op:flip2,pos:73,+cov
diff --git a/src/mint/afl-tests/id:000193,src:000000,op:flip2,pos:62,+cov b/src/exchange/afl-tests/id:000193,src:000000,op:flip2,pos:62,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000193,src:000000,op:flip2,pos:62,+cov
rename to src/exchange/afl-tests/id:000193,src:000000,op:flip2,pos:62,+cov
diff --git a/src/mint/afl-tests/id:000193,src:000000,op:flip2,pos:75 b/src/exchange/afl-tests/id:000193,src:000000,op:flip2,pos:75
similarity index 100%
rename from src/mint/afl-tests/id:000193,src:000000,op:flip2,pos:75
rename to src/exchange/afl-tests/id:000193,src:000000,op:flip2,pos:75
diff --git a/src/mint/afl-tests/id:000194,src:000000,op:flip2,pos:68,+cov b/src/exchange/afl-tests/id:000194,src:000000,op:flip2,pos:68,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000194,src:000000,op:flip2,pos:68,+cov
rename to src/exchange/afl-tests/id:000194,src:000000,op:flip2,pos:68,+cov
diff --git a/src/mint/afl-tests/id:000194,src:000000,op:flip2,pos:77,+cov b/src/exchange/afl-tests/id:000194,src:000000,op:flip2,pos:77,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000194,src:000000,op:flip2,pos:77,+cov
rename to src/exchange/afl-tests/id:000194,src:000000,op:flip2,pos:77,+cov
diff --git a/src/mint/afl-tests/id:000195,src:000000,op:flip2,pos:70,+cov b/src/exchange/afl-tests/id:000195,src:000000,op:flip2,pos:70,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000195,src:000000,op:flip2,pos:70,+cov
rename to src/exchange/afl-tests/id:000195,src:000000,op:flip2,pos:70,+cov
diff --git a/src/mint/afl-tests/id:000195,src:000000,op:flip2,pos:81,+cov b/src/exchange/afl-tests/id:000195,src:000000,op:flip2,pos:81,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000195,src:000000,op:flip2,pos:81,+cov
rename to src/exchange/afl-tests/id:000195,src:000000,op:flip2,pos:81,+cov
diff --git a/src/mint/afl-tests/id:000196,src:000000,op:flip2,pos:73,+cov b/src/exchange/afl-tests/id:000196,src:000000,op:flip2,pos:73,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000196,src:000000,op:flip2,pos:73,+cov
rename to src/exchange/afl-tests/id:000196,src:000000,op:flip2,pos:73,+cov
diff --git a/src/mint/afl-tests/id:000196,src:000000,op:flip2,pos:81,+cov b/src/exchange/afl-tests/id:000196,src:000000,op:flip2,pos:81,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000196,src:000000,op:flip2,pos:81,+cov
rename to src/exchange/afl-tests/id:000196,src:000000,op:flip2,pos:81,+cov
diff --git a/src/mint/afl-tests/id:000197,src:000000,op:flip2,pos:73,+cov b/src/exchange/afl-tests/id:000197,src:000000,op:flip2,pos:73,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000197,src:000000,op:flip2,pos:73,+cov
rename to src/exchange/afl-tests/id:000197,src:000000,op:flip2,pos:73,+cov
diff --git a/src/mint/afl-tests/id:000197,src:000000,op:flip2,pos:83,+cov b/src/exchange/afl-tests/id:000197,src:000000,op:flip2,pos:83,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000197,src:000000,op:flip2,pos:83,+cov
rename to src/exchange/afl-tests/id:000197,src:000000,op:flip2,pos:83,+cov
diff --git a/src/mint/afl-tests/id:000198,src:000000,op:flip2,pos:76,+cov b/src/exchange/afl-tests/id:000198,src:000000,op:flip2,pos:76,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000198,src:000000,op:flip2,pos:76,+cov
rename to src/exchange/afl-tests/id:000198,src:000000,op:flip2,pos:76,+cov
diff --git a/src/mint/afl-tests/id:000198,src:000000,op:flip2,pos:84,+cov b/src/exchange/afl-tests/id:000198,src:000000,op:flip2,pos:84,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000198,src:000000,op:flip2,pos:84,+cov
rename to src/exchange/afl-tests/id:000198,src:000000,op:flip2,pos:84,+cov
diff --git a/src/mint/afl-tests/id:000199,src:000000,op:flip2,pos:76,+cov b/src/exchange/afl-tests/id:000199,src:000000,op:flip2,pos:76,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000199,src:000000,op:flip2,pos:76,+cov
rename to src/exchange/afl-tests/id:000199,src:000000,op:flip2,pos:76,+cov
diff --git a/src/mint/afl-tests/id:000199,src:000000,op:flip2,pos:85,+cov b/src/exchange/afl-tests/id:000199,src:000000,op:flip2,pos:85,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000199,src:000000,op:flip2,pos:85,+cov
rename to src/exchange/afl-tests/id:000199,src:000000,op:flip2,pos:85,+cov
diff --git a/src/mint/afl-tests/id:000200,src:000000,op:flip2,pos:80,+cov b/src/exchange/afl-tests/id:000200,src:000000,op:flip2,pos:80,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000200,src:000000,op:flip2,pos:80,+cov
rename to src/exchange/afl-tests/id:000200,src:000000,op:flip2,pos:80,+cov
diff --git a/src/mint/afl-tests/id:000200,src:000000,op:flip2,pos:86,+cov b/src/exchange/afl-tests/id:000200,src:000000,op:flip2,pos:86,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000200,src:000000,op:flip2,pos:86,+cov
rename to src/exchange/afl-tests/id:000200,src:000000,op:flip2,pos:86,+cov
diff --git a/src/mint/afl-tests/id:000201,src:000000,op:flip2,pos:86,+cov b/src/exchange/afl-tests/id:000201,src:000000,op:flip2,pos:86,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000201,src:000000,op:flip2,pos:86,+cov
rename to src/exchange/afl-tests/id:000201,src:000000,op:flip2,pos:86,+cov
diff --git a/src/mint/afl-tests/id:000201,src:000000,op:flip2,pos:89,+cov b/src/exchange/afl-tests/id:000201,src:000000,op:flip2,pos:89,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000201,src:000000,op:flip2,pos:89,+cov
rename to src/exchange/afl-tests/id:000201,src:000000,op:flip2,pos:89,+cov
diff --git a/src/mint/afl-tests/id:000202,src:000000,op:flip2,pos:101,+cov b/src/exchange/afl-tests/id:000202,src:000000,op:flip2,pos:101,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000202,src:000000,op:flip2,pos:101,+cov
rename to src/exchange/afl-tests/id:000202,src:000000,op:flip2,pos:101,+cov
diff --git a/src/mint/afl-tests/id:000202,src:000000,op:flip2,pos:90,+cov b/src/exchange/afl-tests/id:000202,src:000000,op:flip2,pos:90,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000202,src:000000,op:flip2,pos:90,+cov
rename to src/exchange/afl-tests/id:000202,src:000000,op:flip2,pos:90,+cov
diff --git a/src/mint/afl-tests/id:000203,src:000000,op:flip2,pos:114 b/src/exchange/afl-tests/id:000203,src:000000,op:flip2,pos:114
similarity index 100%
rename from src/mint/afl-tests/id:000203,src:000000,op:flip2,pos:114
rename to src/exchange/afl-tests/id:000203,src:000000,op:flip2,pos:114
diff --git a/src/mint/afl-tests/id:000203,src:000000,op:flip2,pos:93,+cov b/src/exchange/afl-tests/id:000203,src:000000,op:flip2,pos:93,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000203,src:000000,op:flip2,pos:93,+cov
rename to src/exchange/afl-tests/id:000203,src:000000,op:flip2,pos:93,+cov
diff --git a/src/mint/afl-tests/id:000204,src:000000,op:flip2,pos:100,+cov b/src/exchange/afl-tests/id:000204,src:000000,op:flip2,pos:100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000204,src:000000,op:flip2,pos:100,+cov
rename to src/exchange/afl-tests/id:000204,src:000000,op:flip2,pos:100,+cov
diff --git a/src/mint/afl-tests/id:000204,src:000000,op:flip2,pos:115,+cov b/src/exchange/afl-tests/id:000204,src:000000,op:flip2,pos:115,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000204,src:000000,op:flip2,pos:115,+cov
rename to src/exchange/afl-tests/id:000204,src:000000,op:flip2,pos:115,+cov
diff --git a/src/mint/afl-tests/id:000205,src:000000,op:flip2,pos:114 b/src/exchange/afl-tests/id:000205,src:000000,op:flip2,pos:114
similarity index 100%
rename from src/mint/afl-tests/id:000205,src:000000,op:flip2,pos:114
rename to src/exchange/afl-tests/id:000205,src:000000,op:flip2,pos:114
diff --git a/src/mint/afl-tests/id:000205,src:000000,op:flip2,pos:116,+cov b/src/exchange/afl-tests/id:000205,src:000000,op:flip2,pos:116,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000205,src:000000,op:flip2,pos:116,+cov
rename to src/exchange/afl-tests/id:000205,src:000000,op:flip2,pos:116,+cov
diff --git a/src/mint/afl-tests/id:000206,src:000000,op:flip2,pos:115,+cov b/src/exchange/afl-tests/id:000206,src:000000,op:flip2,pos:115,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000206,src:000000,op:flip2,pos:115,+cov
rename to src/exchange/afl-tests/id:000206,src:000000,op:flip2,pos:115,+cov
diff --git a/src/mint/afl-tests/id:000206,src:000000,op:flip2,pos:140,+cov b/src/exchange/afl-tests/id:000206,src:000000,op:flip2,pos:140,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000206,src:000000,op:flip2,pos:140,+cov
rename to src/exchange/afl-tests/id:000206,src:000000,op:flip2,pos:140,+cov
diff --git a/src/mint/afl-tests/id:000207,src:000000,op:flip2,pos:116,+cov b/src/exchange/afl-tests/id:000207,src:000000,op:flip2,pos:116,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000207,src:000000,op:flip2,pos:116,+cov
rename to src/exchange/afl-tests/id:000207,src:000000,op:flip2,pos:116,+cov
diff --git a/src/mint/afl-tests/id:000207,src:000000,op:flip2,pos:140,+cov b/src/exchange/afl-tests/id:000207,src:000000,op:flip2,pos:140,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000207,src:000000,op:flip2,pos:140,+cov
rename to src/exchange/afl-tests/id:000207,src:000000,op:flip2,pos:140,+cov
diff --git a/src/mint/afl-tests/id:000208,src:000000,op:flip2,pos:124,+cov b/src/exchange/afl-tests/id:000208,src:000000,op:flip2,pos:124,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000208,src:000000,op:flip2,pos:124,+cov
rename to src/exchange/afl-tests/id:000208,src:000000,op:flip2,pos:124,+cov
diff --git a/src/mint/afl-tests/id:000208,src:000000,op:flip2,pos:146,+cov b/src/exchange/afl-tests/id:000208,src:000000,op:flip2,pos:146,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000208,src:000000,op:flip2,pos:146,+cov
rename to src/exchange/afl-tests/id:000208,src:000000,op:flip2,pos:146,+cov
diff --git a/src/mint/afl-tests/id:000209,src:000000,op:flip2,pos:135,+cov b/src/exchange/afl-tests/id:000209,src:000000,op:flip2,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000209,src:000000,op:flip2,pos:135,+cov
rename to src/exchange/afl-tests/id:000209,src:000000,op:flip2,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000209,src:000000,op:flip2,pos:147,+cov b/src/exchange/afl-tests/id:000209,src:000000,op:flip2,pos:147,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000209,src:000000,op:flip2,pos:147,+cov
rename to src/exchange/afl-tests/id:000209,src:000000,op:flip2,pos:147,+cov
diff --git a/src/mint/afl-tests/id:000210,src:000000,op:flip2,pos:137,+cov b/src/exchange/afl-tests/id:000210,src:000000,op:flip2,pos:137,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000210,src:000000,op:flip2,pos:137,+cov
rename to src/exchange/afl-tests/id:000210,src:000000,op:flip2,pos:137,+cov
diff --git a/src/mint/afl-tests/id:000210,src:000000,op:flip2,pos:148,+cov b/src/exchange/afl-tests/id:000210,src:000000,op:flip2,pos:148,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000210,src:000000,op:flip2,pos:148,+cov
rename to src/exchange/afl-tests/id:000210,src:000000,op:flip2,pos:148,+cov
diff --git a/src/mint/afl-tests/id:000211,src:000000,op:flip2,pos:138,+cov b/src/exchange/afl-tests/id:000211,src:000000,op:flip2,pos:138,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000211,src:000000,op:flip2,pos:138,+cov
rename to src/exchange/afl-tests/id:000211,src:000000,op:flip2,pos:138,+cov
diff --git a/src/mint/afl-tests/id:000211,src:000000,op:flip2,pos:148,+cov b/src/exchange/afl-tests/id:000211,src:000000,op:flip2,pos:148,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000211,src:000000,op:flip2,pos:148,+cov
rename to src/exchange/afl-tests/id:000211,src:000000,op:flip2,pos:148,+cov
diff --git a/src/mint/afl-tests/id:000212,src:000000,op:flip2,pos:138,+cov b/src/exchange/afl-tests/id:000212,src:000000,op:flip2,pos:138,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000212,src:000000,op:flip2,pos:138,+cov
rename to src/exchange/afl-tests/id:000212,src:000000,op:flip2,pos:138,+cov
diff --git a/src/mint/afl-tests/id:000212,src:000000,op:flip2,pos:159,+cov b/src/exchange/afl-tests/id:000212,src:000000,op:flip2,pos:159,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000212,src:000000,op:flip2,pos:159,+cov
rename to src/exchange/afl-tests/id:000212,src:000000,op:flip2,pos:159,+cov
diff --git a/src/mint/afl-tests/id:000213,src:000000,op:flip2,pos:139,+cov b/src/exchange/afl-tests/id:000213,src:000000,op:flip2,pos:139,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000213,src:000000,op:flip2,pos:139,+cov
rename to src/exchange/afl-tests/id:000213,src:000000,op:flip2,pos:139,+cov
diff --git a/src/mint/afl-tests/id:000213,src:000000,op:flip2,pos:161,+cov b/src/exchange/afl-tests/id:000213,src:000000,op:flip2,pos:161,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000213,src:000000,op:flip2,pos:161,+cov
rename to src/exchange/afl-tests/id:000213,src:000000,op:flip2,pos:161,+cov
diff --git a/src/mint/afl-tests/id:000214,src:000000,op:flip2,pos:143,+cov b/src/exchange/afl-tests/id:000214,src:000000,op:flip2,pos:143,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000214,src:000000,op:flip2,pos:143,+cov
rename to src/exchange/afl-tests/id:000214,src:000000,op:flip2,pos:143,+cov
diff --git a/src/mint/afl-tests/id:000214,src:000000,op:flip2,pos:164,+cov b/src/exchange/afl-tests/id:000214,src:000000,op:flip2,pos:164,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000214,src:000000,op:flip2,pos:164,+cov
rename to src/exchange/afl-tests/id:000214,src:000000,op:flip2,pos:164,+cov
diff --git a/src/mint/afl-tests/id:000215,src:000000,op:flip2,pos:146,+cov b/src/exchange/afl-tests/id:000215,src:000000,op:flip2,pos:146,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000215,src:000000,op:flip2,pos:146,+cov
rename to src/exchange/afl-tests/id:000215,src:000000,op:flip2,pos:146,+cov
diff --git a/src/mint/afl-tests/id:000215,src:000000,op:flip2,pos:164,+cov b/src/exchange/afl-tests/id:000215,src:000000,op:flip2,pos:164,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000215,src:000000,op:flip2,pos:164,+cov
rename to src/exchange/afl-tests/id:000215,src:000000,op:flip2,pos:164,+cov
diff --git a/src/mint/afl-tests/id:000216,src:000000,op:flip2,pos:156,+cov b/src/exchange/afl-tests/id:000216,src:000000,op:flip2,pos:156,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000216,src:000000,op:flip2,pos:156,+cov
rename to src/exchange/afl-tests/id:000216,src:000000,op:flip2,pos:156,+cov
diff --git a/src/mint/afl-tests/id:000216,src:000000,op:flip2,pos:166,+cov b/src/exchange/afl-tests/id:000216,src:000000,op:flip2,pos:166,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000216,src:000000,op:flip2,pos:166,+cov
rename to src/exchange/afl-tests/id:000216,src:000000,op:flip2,pos:166,+cov
diff --git a/src/mint/afl-tests/id:000217,src:000000,op:flip2,pos:161,+cov b/src/exchange/afl-tests/id:000217,src:000000,op:flip2,pos:161,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000217,src:000000,op:flip2,pos:161,+cov
rename to src/exchange/afl-tests/id:000217,src:000000,op:flip2,pos:161,+cov
diff --git a/src/mint/afl-tests/id:000217,src:000000,op:flip2,pos:170,+cov b/src/exchange/afl-tests/id:000217,src:000000,op:flip2,pos:170,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000217,src:000000,op:flip2,pos:170,+cov
rename to src/exchange/afl-tests/id:000217,src:000000,op:flip2,pos:170,+cov
diff --git a/src/mint/afl-tests/id:000218,src:000000,op:flip2,pos:171,+cov b/src/exchange/afl-tests/id:000218,src:000000,op:flip2,pos:171,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000218,src:000000,op:flip2,pos:171,+cov
rename to src/exchange/afl-tests/id:000218,src:000000,op:flip2,pos:171,+cov
diff --git a/src/mint/afl-tests/id:000218,src:000000,op:flip2,pos:176,+cov b/src/exchange/afl-tests/id:000218,src:000000,op:flip2,pos:176,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000218,src:000000,op:flip2,pos:176,+cov
rename to src/exchange/afl-tests/id:000218,src:000000,op:flip2,pos:176,+cov
diff --git a/src/mint/afl-tests/id:000219,src:000000,op:flip2,pos:180 b/src/exchange/afl-tests/id:000219,src:000000,op:flip2,pos:180
similarity index 100%
rename from src/mint/afl-tests/id:000219,src:000000,op:flip2,pos:180
rename to src/exchange/afl-tests/id:000219,src:000000,op:flip2,pos:180
diff --git a/src/mint/afl-tests/id:000219,src:000000,op:flip2,pos:185,+cov b/src/exchange/afl-tests/id:000219,src:000000,op:flip2,pos:185,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000219,src:000000,op:flip2,pos:185,+cov
rename to src/exchange/afl-tests/id:000219,src:000000,op:flip2,pos:185,+cov
diff --git a/src/mint/afl-tests/id:000220,src:000000,op:flip2,pos:184,+cov b/src/exchange/afl-tests/id:000220,src:000000,op:flip2,pos:184,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000220,src:000000,op:flip2,pos:184,+cov
rename to src/exchange/afl-tests/id:000220,src:000000,op:flip2,pos:184,+cov
diff --git a/src/mint/afl-tests/id:000220,src:000000,op:flip2,pos:193,+cov b/src/exchange/afl-tests/id:000220,src:000000,op:flip2,pos:193,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000220,src:000000,op:flip2,pos:193,+cov
rename to src/exchange/afl-tests/id:000220,src:000000,op:flip2,pos:193,+cov
diff --git a/src/mint/afl-tests/id:000221,src:000000,op:flip2,pos:211,+cov b/src/exchange/afl-tests/id:000221,src:000000,op:flip2,pos:211,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000221,src:000000,op:flip2,pos:211,+cov
rename to src/exchange/afl-tests/id:000221,src:000000,op:flip2,pos:211,+cov
diff --git a/src/mint/afl-tests/id:000221,src:000000,op:flip2,pos:226,+cov b/src/exchange/afl-tests/id:000221,src:000000,op:flip2,pos:226,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000221,src:000000,op:flip2,pos:226,+cov
rename to src/exchange/afl-tests/id:000221,src:000000,op:flip2,pos:226,+cov
diff --git a/src/mint/afl-tests/id:000222,src:000000,op:flip2,pos:218,+cov b/src/exchange/afl-tests/id:000222,src:000000,op:flip2,pos:218,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000222,src:000000,op:flip2,pos:218,+cov
rename to src/exchange/afl-tests/id:000222,src:000000,op:flip2,pos:218,+cov
diff --git a/src/mint/afl-tests/id:000222,src:000000,op:flip2,pos:232,+cov b/src/exchange/afl-tests/id:000222,src:000000,op:flip2,pos:232,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000222,src:000000,op:flip2,pos:232,+cov
rename to src/exchange/afl-tests/id:000222,src:000000,op:flip2,pos:232,+cov
diff --git a/src/mint/afl-tests/id:000223,src:000000,op:flip2,pos:239,+cov b/src/exchange/afl-tests/id:000223,src:000000,op:flip2,pos:239,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000223,src:000000,op:flip2,pos:239,+cov
rename to src/exchange/afl-tests/id:000223,src:000000,op:flip2,pos:239,+cov
diff --git a/src/mint/afl-tests/id:000223,src:000000,op:flip2,pos:271,+cov b/src/exchange/afl-tests/id:000223,src:000000,op:flip2,pos:271,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000223,src:000000,op:flip2,pos:271,+cov
rename to src/exchange/afl-tests/id:000223,src:000000,op:flip2,pos:271,+cov
diff --git a/src/mint/afl-tests/id:000224,src:000000,op:flip2,pos:241,+cov b/src/exchange/afl-tests/id:000224,src:000000,op:flip2,pos:241,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000224,src:000000,op:flip2,pos:241,+cov
rename to src/exchange/afl-tests/id:000224,src:000000,op:flip2,pos:241,+cov
diff --git a/src/mint/afl-tests/id:000224,src:000000,op:flip2,pos:279,+cov b/src/exchange/afl-tests/id:000224,src:000000,op:flip2,pos:279,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000224,src:000000,op:flip2,pos:279,+cov
rename to src/exchange/afl-tests/id:000224,src:000000,op:flip2,pos:279,+cov
diff --git a/src/mint/afl-tests/id:000225,src:000000,op:flip2,pos:250,+cov b/src/exchange/afl-tests/id:000225,src:000000,op:flip2,pos:250,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000225,src:000000,op:flip2,pos:250,+cov
rename to src/exchange/afl-tests/id:000225,src:000000,op:flip2,pos:250,+cov
diff --git a/src/mint/afl-tests/id:000225,src:000000,op:flip2,pos:308,+cov b/src/exchange/afl-tests/id:000225,src:000000,op:flip2,pos:308,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000225,src:000000,op:flip2,pos:308,+cov
rename to src/exchange/afl-tests/id:000225,src:000000,op:flip2,pos:308,+cov
diff --git a/src/mint/afl-tests/id:000226,src:000000,op:flip2,pos:272,+cov b/src/exchange/afl-tests/id:000226,src:000000,op:flip2,pos:272,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000226,src:000000,op:flip2,pos:272,+cov
rename to src/exchange/afl-tests/id:000226,src:000000,op:flip2,pos:272,+cov
diff --git a/src/mint/afl-tests/id:000226,src:000000,op:flip2,pos:315,+cov b/src/exchange/afl-tests/id:000226,src:000000,op:flip2,pos:315,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000226,src:000000,op:flip2,pos:315,+cov
rename to src/exchange/afl-tests/id:000226,src:000000,op:flip2,pos:315,+cov
diff --git a/src/mint/afl-tests/id:000227,src:000000,op:flip2,pos:277,+cov b/src/exchange/afl-tests/id:000227,src:000000,op:flip2,pos:277,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000227,src:000000,op:flip2,pos:277,+cov
rename to src/exchange/afl-tests/id:000227,src:000000,op:flip2,pos:277,+cov
diff --git a/src/mint/afl-tests/id:000227,src:000000,op:flip2,pos:316,+cov b/src/exchange/afl-tests/id:000227,src:000000,op:flip2,pos:316,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000227,src:000000,op:flip2,pos:316,+cov
rename to src/exchange/afl-tests/id:000227,src:000000,op:flip2,pos:316,+cov
diff --git a/src/mint/afl-tests/id:000228,src:000000,op:flip2,pos:316,+cov b/src/exchange/afl-tests/id:000228,src:000000,op:flip2,pos:316,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000228,src:000000,op:flip2,pos:316,+cov
rename to src/exchange/afl-tests/id:000228,src:000000,op:flip2,pos:316,+cov
diff --git a/src/mint/afl-tests/id:000228,src:000000,op:flip2,pos:317,+cov b/src/exchange/afl-tests/id:000228,src:000000,op:flip2,pos:317,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000228,src:000000,op:flip2,pos:317,+cov
rename to src/exchange/afl-tests/id:000228,src:000000,op:flip2,pos:317,+cov
diff --git a/src/mint/afl-tests/id:000229,src:000000,op:flip2,pos:316,+cov b/src/exchange/afl-tests/id:000229,src:000000,op:flip2,pos:316,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000229,src:000000,op:flip2,pos:316,+cov
rename to src/exchange/afl-tests/id:000229,src:000000,op:flip2,pos:316,+cov
diff --git a/src/mint/afl-tests/id:000229,src:000000,op:flip2,pos:319,+cov b/src/exchange/afl-tests/id:000229,src:000000,op:flip2,pos:319,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000229,src:000000,op:flip2,pos:319,+cov
rename to src/exchange/afl-tests/id:000229,src:000000,op:flip2,pos:319,+cov
diff --git a/src/mint/afl-tests/id:000230,src:000000,op:flip2,pos:316,+cov b/src/exchange/afl-tests/id:000230,src:000000,op:flip2,pos:316,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000230,src:000000,op:flip2,pos:316,+cov
rename to src/exchange/afl-tests/id:000230,src:000000,op:flip2,pos:316,+cov
diff --git a/src/mint/afl-tests/id:000230,src:000000,op:flip2,pos:320,+cov b/src/exchange/afl-tests/id:000230,src:000000,op:flip2,pos:320,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000230,src:000000,op:flip2,pos:320,+cov
rename to src/exchange/afl-tests/id:000230,src:000000,op:flip2,pos:320,+cov
diff --git a/src/mint/afl-tests/id:000231,src:000000,op:flip2,pos:317,+cov b/src/exchange/afl-tests/id:000231,src:000000,op:flip2,pos:317,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000231,src:000000,op:flip2,pos:317,+cov
rename to src/exchange/afl-tests/id:000231,src:000000,op:flip2,pos:317,+cov
diff --git a/src/mint/afl-tests/id:000231,src:000000,op:flip2,pos:326,+cov b/src/exchange/afl-tests/id:000231,src:000000,op:flip2,pos:326,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000231,src:000000,op:flip2,pos:326,+cov
rename to src/exchange/afl-tests/id:000231,src:000000,op:flip2,pos:326,+cov
diff --git a/src/mint/afl-tests/id:000232,src:000000,op:flip2,pos:320,+cov b/src/exchange/afl-tests/id:000232,src:000000,op:flip2,pos:320,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000232,src:000000,op:flip2,pos:320,+cov
rename to src/exchange/afl-tests/id:000232,src:000000,op:flip2,pos:320,+cov
diff --git a/src/mint/afl-tests/id:000232,src:000000,op:flip2,pos:327,+cov b/src/exchange/afl-tests/id:000232,src:000000,op:flip2,pos:327,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000232,src:000000,op:flip2,pos:327,+cov
rename to src/exchange/afl-tests/id:000232,src:000000,op:flip2,pos:327,+cov
diff --git a/src/mint/afl-tests/id:000233,src:000000,op:flip2,pos:321,+cov b/src/exchange/afl-tests/id:000233,src:000000,op:flip2,pos:321,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000233,src:000000,op:flip2,pos:321,+cov
rename to src/exchange/afl-tests/id:000233,src:000000,op:flip2,pos:321,+cov
diff --git a/src/mint/afl-tests/id:000233,src:000000,op:flip2,pos:331,+cov b/src/exchange/afl-tests/id:000233,src:000000,op:flip2,pos:331,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000233,src:000000,op:flip2,pos:331,+cov
rename to src/exchange/afl-tests/id:000233,src:000000,op:flip2,pos:331,+cov
diff --git a/src/mint/afl-tests/id:000234,src:000000,op:flip2,pos:327,+cov b/src/exchange/afl-tests/id:000234,src:000000,op:flip2,pos:327,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000234,src:000000,op:flip2,pos:327,+cov
rename to src/exchange/afl-tests/id:000234,src:000000,op:flip2,pos:327,+cov
diff --git a/src/mint/afl-tests/id:000234,src:000000,op:flip4,pos:5,+cov b/src/exchange/afl-tests/id:000234,src:000000,op:flip4,pos:5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000234,src:000000,op:flip4,pos:5,+cov
rename to src/exchange/afl-tests/id:000234,src:000000,op:flip4,pos:5,+cov
diff --git a/src/mint/afl-tests/id:000235,src:000000,op:flip2,pos:328,+cov b/src/exchange/afl-tests/id:000235,src:000000,op:flip2,pos:328,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000235,src:000000,op:flip2,pos:328,+cov
rename to src/exchange/afl-tests/id:000235,src:000000,op:flip2,pos:328,+cov
diff --git a/src/mint/afl-tests/id:000235,src:000000,op:flip4,pos:20,+cov b/src/exchange/afl-tests/id:000235,src:000000,op:flip4,pos:20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000235,src:000000,op:flip4,pos:20,+cov
rename to src/exchange/afl-tests/id:000235,src:000000,op:flip4,pos:20,+cov
diff --git a/src/mint/afl-tests/id:000236,src:000000,op:flip2,pos:330,+cov b/src/exchange/afl-tests/id:000236,src:000000,op:flip2,pos:330,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000236,src:000000,op:flip2,pos:330,+cov
rename to src/exchange/afl-tests/id:000236,src:000000,op:flip2,pos:330,+cov
diff --git a/src/mint/afl-tests/id:000236,src:000000,op:flip4,pos:27,+cov b/src/exchange/afl-tests/id:000236,src:000000,op:flip4,pos:27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000236,src:000000,op:flip4,pos:27,+cov
rename to src/exchange/afl-tests/id:000236,src:000000,op:flip4,pos:27,+cov
diff --git a/src/mint/afl-tests/id:000237,src:000000,op:flip2,pos:331,+cov b/src/exchange/afl-tests/id:000237,src:000000,op:flip2,pos:331,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000237,src:000000,op:flip2,pos:331,+cov
rename to src/exchange/afl-tests/id:000237,src:000000,op:flip2,pos:331,+cov
diff --git a/src/mint/afl-tests/id:000237,src:000000,op:flip4,pos:30 b/src/exchange/afl-tests/id:000237,src:000000,op:flip4,pos:30
similarity index 100%
rename from src/mint/afl-tests/id:000237,src:000000,op:flip4,pos:30
rename to src/exchange/afl-tests/id:000237,src:000000,op:flip4,pos:30
diff --git a/src/mint/afl-tests/id:000238,src:000000,op:flip4,pos:32 b/src/exchange/afl-tests/id:000238,src:000000,op:flip4,pos:32
similarity index 100%
rename from src/mint/afl-tests/id:000238,src:000000,op:flip4,pos:32
rename to src/exchange/afl-tests/id:000238,src:000000,op:flip4,pos:32
diff --git a/src/mint/afl-tests/id:000238,src:000000,op:flip4,pos:5,+cov b/src/exchange/afl-tests/id:000238,src:000000,op:flip4,pos:5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000238,src:000000,op:flip4,pos:5,+cov
rename to src/exchange/afl-tests/id:000238,src:000000,op:flip4,pos:5,+cov
diff --git a/src/mint/afl-tests/id:000239,src:000000,op:flip4,pos:25,+cov b/src/exchange/afl-tests/id:000239,src:000000,op:flip4,pos:25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000239,src:000000,op:flip4,pos:25,+cov
rename to src/exchange/afl-tests/id:000239,src:000000,op:flip4,pos:25,+cov
diff --git a/src/mint/afl-tests/id:000239,src:000000,op:flip4,pos:34,+cov b/src/exchange/afl-tests/id:000239,src:000000,op:flip4,pos:34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000239,src:000000,op:flip4,pos:34,+cov
rename to src/exchange/afl-tests/id:000239,src:000000,op:flip4,pos:34,+cov
diff --git a/src/mint/afl-tests/id:000240,src:000000,op:flip4,pos:29,+cov b/src/exchange/afl-tests/id:000240,src:000000,op:flip4,pos:29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000240,src:000000,op:flip4,pos:29,+cov
rename to src/exchange/afl-tests/id:000240,src:000000,op:flip4,pos:29,+cov
diff --git a/src/mint/afl-tests/id:000240,src:000000,op:flip4,pos:35 b/src/exchange/afl-tests/id:000240,src:000000,op:flip4,pos:35
similarity index 100%
rename from src/mint/afl-tests/id:000240,src:000000,op:flip4,pos:35
rename to src/exchange/afl-tests/id:000240,src:000000,op:flip4,pos:35
diff --git a/src/mint/afl-tests/id:000241,src:000000,op:flip4,pos:30 b/src/exchange/afl-tests/id:000241,src:000000,op:flip4,pos:30
similarity index 100%
rename from src/mint/afl-tests/id:000241,src:000000,op:flip4,pos:30
rename to src/exchange/afl-tests/id:000241,src:000000,op:flip4,pos:30
diff --git a/src/mint/afl-tests/id:000241,src:000000,op:flip4,pos:36 b/src/exchange/afl-tests/id:000241,src:000000,op:flip4,pos:36
similarity index 100%
rename from src/mint/afl-tests/id:000241,src:000000,op:flip4,pos:36
rename to src/exchange/afl-tests/id:000241,src:000000,op:flip4,pos:36
diff --git a/src/mint/afl-tests/id:000242,src:000000,op:flip4,pos:32 b/src/exchange/afl-tests/id:000242,src:000000,op:flip4,pos:32
similarity index 100%
rename from src/mint/afl-tests/id:000242,src:000000,op:flip4,pos:32
rename to src/exchange/afl-tests/id:000242,src:000000,op:flip4,pos:32
diff --git a/src/mint/afl-tests/id:000242,src:000000,op:flip4,pos:39,+cov b/src/exchange/afl-tests/id:000242,src:000000,op:flip4,pos:39,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000242,src:000000,op:flip4,pos:39,+cov
rename to src/exchange/afl-tests/id:000242,src:000000,op:flip4,pos:39,+cov
diff --git a/src/mint/afl-tests/id:000243,src:000000,op:flip4,pos:37,+cov b/src/exchange/afl-tests/id:000243,src:000000,op:flip4,pos:37,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000243,src:000000,op:flip4,pos:37,+cov
rename to src/exchange/afl-tests/id:000243,src:000000,op:flip4,pos:37,+cov
diff --git a/src/mint/afl-tests/id:000243,src:000000,op:flip4,pos:44,+cov b/src/exchange/afl-tests/id:000243,src:000000,op:flip4,pos:44,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000243,src:000000,op:flip4,pos:44,+cov
rename to src/exchange/afl-tests/id:000243,src:000000,op:flip4,pos:44,+cov
diff --git a/src/mint/afl-tests/id:000244,src:000000,op:flip4,pos:39,+cov b/src/exchange/afl-tests/id:000244,src:000000,op:flip4,pos:39,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000244,src:000000,op:flip4,pos:39,+cov
rename to src/exchange/afl-tests/id:000244,src:000000,op:flip4,pos:39,+cov
diff --git a/src/mint/afl-tests/id:000244,src:000000,op:flip4,pos:48,+cov b/src/exchange/afl-tests/id:000244,src:000000,op:flip4,pos:48,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000244,src:000000,op:flip4,pos:48,+cov
rename to src/exchange/afl-tests/id:000244,src:000000,op:flip4,pos:48,+cov
diff --git a/src/mint/afl-tests/id:000245,src:000000,op:flip4,pos:45,+cov b/src/exchange/afl-tests/id:000245,src:000000,op:flip4,pos:45,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000245,src:000000,op:flip4,pos:45,+cov
rename to src/exchange/afl-tests/id:000245,src:000000,op:flip4,pos:45,+cov
diff --git a/src/mint/afl-tests/id:000245,src:000000,op:flip4,pos:56,+cov b/src/exchange/afl-tests/id:000245,src:000000,op:flip4,pos:56,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000245,src:000000,op:flip4,pos:56,+cov
rename to src/exchange/afl-tests/id:000245,src:000000,op:flip4,pos:56,+cov
diff --git a/src/mint/afl-tests/id:000246,src:000000,op:flip4,pos:47,+cov b/src/exchange/afl-tests/id:000246,src:000000,op:flip4,pos:47,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000246,src:000000,op:flip4,pos:47,+cov
rename to src/exchange/afl-tests/id:000246,src:000000,op:flip4,pos:47,+cov
diff --git a/src/mint/afl-tests/id:000246,src:000000,op:flip4,pos:59,+cov b/src/exchange/afl-tests/id:000246,src:000000,op:flip4,pos:59,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000246,src:000000,op:flip4,pos:59,+cov
rename to src/exchange/afl-tests/id:000246,src:000000,op:flip4,pos:59,+cov
diff --git a/src/mint/afl-tests/id:000247,src:000000,op:flip4,pos:50,+cov b/src/exchange/afl-tests/id:000247,src:000000,op:flip4,pos:50,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000247,src:000000,op:flip4,pos:50,+cov
rename to src/exchange/afl-tests/id:000247,src:000000,op:flip4,pos:50,+cov
diff --git a/src/mint/afl-tests/id:000247,src:000000,op:flip4,pos:65,+cov b/src/exchange/afl-tests/id:000247,src:000000,op:flip4,pos:65,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000247,src:000000,op:flip4,pos:65,+cov
rename to src/exchange/afl-tests/id:000247,src:000000,op:flip4,pos:65,+cov
diff --git a/src/mint/afl-tests/id:000248,src:000000,op:flip4,pos:60,+cov b/src/exchange/afl-tests/id:000248,src:000000,op:flip4,pos:60,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000248,src:000000,op:flip4,pos:60,+cov
rename to src/exchange/afl-tests/id:000248,src:000000,op:flip4,pos:60,+cov
diff --git a/src/mint/afl-tests/id:000248,src:000000,op:flip4,pos:68,+cov b/src/exchange/afl-tests/id:000248,src:000000,op:flip4,pos:68,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000248,src:000000,op:flip4,pos:68,+cov
rename to src/exchange/afl-tests/id:000248,src:000000,op:flip4,pos:68,+cov
diff --git a/src/mint/afl-tests/id:000249,src:000000,op:flip4,pos:68,+cov b/src/exchange/afl-tests/id:000249,src:000000,op:flip4,pos:68,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000249,src:000000,op:flip4,pos:68,+cov
rename to src/exchange/afl-tests/id:000249,src:000000,op:flip4,pos:68,+cov
diff --git a/src/mint/afl-tests/id:000250,src:000000,op:flip4,pos:68,+cov b/src/exchange/afl-tests/id:000250,src:000000,op:flip4,pos:68,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000250,src:000000,op:flip4,pos:68,+cov
rename to src/exchange/afl-tests/id:000250,src:000000,op:flip4,pos:68,+cov
diff --git a/src/mint/afl-tests/id:000250,src:000000,op:flip4,pos:73,+cov b/src/exchange/afl-tests/id:000250,src:000000,op:flip4,pos:73,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000250,src:000000,op:flip4,pos:73,+cov
rename to src/exchange/afl-tests/id:000250,src:000000,op:flip4,pos:73,+cov
diff --git a/src/mint/afl-tests/id:000251,src:000000,op:flip4,pos:74,+cov b/src/exchange/afl-tests/id:000251,src:000000,op:flip4,pos:74,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000251,src:000000,op:flip4,pos:74,+cov
rename to src/exchange/afl-tests/id:000251,src:000000,op:flip4,pos:74,+cov
diff --git a/src/mint/afl-tests/id:000251,src:000000,op:flip4,pos:81,+cov b/src/exchange/afl-tests/id:000251,src:000000,op:flip4,pos:81,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000251,src:000000,op:flip4,pos:81,+cov
rename to src/exchange/afl-tests/id:000251,src:000000,op:flip4,pos:81,+cov
diff --git a/src/mint/afl-tests/id:000252,src:000000,op:flip4,pos:75,+cov b/src/exchange/afl-tests/id:000252,src:000000,op:flip4,pos:75,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000252,src:000000,op:flip4,pos:75,+cov
rename to src/exchange/afl-tests/id:000252,src:000000,op:flip4,pos:75,+cov
diff --git a/src/mint/afl-tests/id:000252,src:000000,op:flip4,pos:82,+cov b/src/exchange/afl-tests/id:000252,src:000000,op:flip4,pos:82,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000252,src:000000,op:flip4,pos:82,+cov
rename to src/exchange/afl-tests/id:000252,src:000000,op:flip4,pos:82,+cov
diff --git a/src/mint/afl-tests/id:000253,src:000000,op:flip4,pos:75,+cov b/src/exchange/afl-tests/id:000253,src:000000,op:flip4,pos:75,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000253,src:000000,op:flip4,pos:75,+cov
rename to src/exchange/afl-tests/id:000253,src:000000,op:flip4,pos:75,+cov
diff --git a/src/mint/afl-tests/id:000253,src:000000,op:flip4,pos:85,+cov b/src/exchange/afl-tests/id:000253,src:000000,op:flip4,pos:85,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000253,src:000000,op:flip4,pos:85,+cov
rename to src/exchange/afl-tests/id:000253,src:000000,op:flip4,pos:85,+cov
diff --git a/src/mint/afl-tests/id:000254,src:000000,op:flip4,pos:76,+cov b/src/exchange/afl-tests/id:000254,src:000000,op:flip4,pos:76,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000254,src:000000,op:flip4,pos:76,+cov
rename to src/exchange/afl-tests/id:000254,src:000000,op:flip4,pos:76,+cov
diff --git a/src/mint/afl-tests/id:000254,src:000000,op:flip4,pos:88,+cov b/src/exchange/afl-tests/id:000254,src:000000,op:flip4,pos:88,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000254,src:000000,op:flip4,pos:88,+cov
rename to src/exchange/afl-tests/id:000254,src:000000,op:flip4,pos:88,+cov
diff --git a/src/mint/afl-tests/id:000255,src:000000,op:flip4,pos:81,+cov b/src/exchange/afl-tests/id:000255,src:000000,op:flip4,pos:81,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000255,src:000000,op:flip4,pos:81,+cov
rename to src/exchange/afl-tests/id:000255,src:000000,op:flip4,pos:81,+cov
diff --git a/src/mint/afl-tests/id:000255,src:000000,op:flip4,pos:91,+cov b/src/exchange/afl-tests/id:000255,src:000000,op:flip4,pos:91,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000255,src:000000,op:flip4,pos:91,+cov
rename to src/exchange/afl-tests/id:000255,src:000000,op:flip4,pos:91,+cov
diff --git a/src/mint/afl-tests/id:000256,src:000000,op:flip4,pos:83,+cov b/src/exchange/afl-tests/id:000256,src:000000,op:flip4,pos:83,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000256,src:000000,op:flip4,pos:83,+cov
rename to src/exchange/afl-tests/id:000256,src:000000,op:flip4,pos:83,+cov
diff --git a/src/mint/afl-tests/id:000256,src:000000,op:flip4,pos:94,+cov b/src/exchange/afl-tests/id:000256,src:000000,op:flip4,pos:94,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000256,src:000000,op:flip4,pos:94,+cov
rename to src/exchange/afl-tests/id:000256,src:000000,op:flip4,pos:94,+cov
diff --git a/src/mint/afl-tests/id:000257,src:000000,op:flip4,pos:86,+cov b/src/exchange/afl-tests/id:000257,src:000000,op:flip4,pos:86,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000257,src:000000,op:flip4,pos:86,+cov
rename to src/exchange/afl-tests/id:000257,src:000000,op:flip4,pos:86,+cov
diff --git a/src/mint/afl-tests/id:000257,src:000000,op:flip4,pos:95,+cov b/src/exchange/afl-tests/id:000257,src:000000,op:flip4,pos:95,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000257,src:000000,op:flip4,pos:95,+cov
rename to src/exchange/afl-tests/id:000257,src:000000,op:flip4,pos:95,+cov
diff --git a/src/mint/afl-tests/id:000258,src:000000,op:flip4,pos:88,+cov b/src/exchange/afl-tests/id:000258,src:000000,op:flip4,pos:88,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000258,src:000000,op:flip4,pos:88,+cov
rename to src/exchange/afl-tests/id:000258,src:000000,op:flip4,pos:88,+cov
diff --git a/src/mint/afl-tests/id:000258,src:000000,op:flip4,pos:95,+cov b/src/exchange/afl-tests/id:000258,src:000000,op:flip4,pos:95,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000258,src:000000,op:flip4,pos:95,+cov
rename to src/exchange/afl-tests/id:000258,src:000000,op:flip4,pos:95,+cov
diff --git a/src/mint/afl-tests/id:000259,src:000000,op:flip4,pos:114 b/src/exchange/afl-tests/id:000259,src:000000,op:flip4,pos:114
similarity index 100%
rename from src/mint/afl-tests/id:000259,src:000000,op:flip4,pos:114
rename to src/exchange/afl-tests/id:000259,src:000000,op:flip4,pos:114
diff --git a/src/mint/afl-tests/id:000259,src:000000,op:flip4,pos:91,+cov b/src/exchange/afl-tests/id:000259,src:000000,op:flip4,pos:91,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000259,src:000000,op:flip4,pos:91,+cov
rename to src/exchange/afl-tests/id:000259,src:000000,op:flip4,pos:91,+cov
diff --git a/src/mint/afl-tests/id:000260,src:000000,op:flip4,pos:112,+cov b/src/exchange/afl-tests/id:000260,src:000000,op:flip4,pos:112,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000260,src:000000,op:flip4,pos:112,+cov
rename to src/exchange/afl-tests/id:000260,src:000000,op:flip4,pos:112,+cov
diff --git a/src/mint/afl-tests/id:000260,src:000000,op:flip4,pos:137,+cov b/src/exchange/afl-tests/id:000260,src:000000,op:flip4,pos:137,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000260,src:000000,op:flip4,pos:137,+cov
rename to src/exchange/afl-tests/id:000260,src:000000,op:flip4,pos:137,+cov
diff --git a/src/mint/afl-tests/id:000261,src:000000,op:flip4,pos:139,+cov b/src/exchange/afl-tests/id:000261,src:000000,op:flip4,pos:139,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000261,src:000000,op:flip4,pos:139,+cov
rename to src/exchange/afl-tests/id:000261,src:000000,op:flip4,pos:139,+cov
diff --git a/src/mint/afl-tests/id:000261,src:000000,op:flip4,pos:147,+cov b/src/exchange/afl-tests/id:000261,src:000000,op:flip4,pos:147,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000261,src:000000,op:flip4,pos:147,+cov
rename to src/exchange/afl-tests/id:000261,src:000000,op:flip4,pos:147,+cov
diff --git a/src/mint/afl-tests/id:000262,src:000000,op:flip4,pos:142,+cov b/src/exchange/afl-tests/id:000262,src:000000,op:flip4,pos:142,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000262,src:000000,op:flip4,pos:142,+cov
rename to src/exchange/afl-tests/id:000262,src:000000,op:flip4,pos:142,+cov
diff --git a/src/mint/afl-tests/id:000262,src:000000,op:flip4,pos:164,+cov b/src/exchange/afl-tests/id:000262,src:000000,op:flip4,pos:164,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000262,src:000000,op:flip4,pos:164,+cov
rename to src/exchange/afl-tests/id:000262,src:000000,op:flip4,pos:164,+cov
diff --git a/src/mint/afl-tests/id:000263,src:000000,op:flip4,pos:147,+cov b/src/exchange/afl-tests/id:000263,src:000000,op:flip4,pos:147,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000263,src:000000,op:flip4,pos:147,+cov
rename to src/exchange/afl-tests/id:000263,src:000000,op:flip4,pos:147,+cov
diff --git a/src/mint/afl-tests/id:000263,src:000000,op:flip4,pos:169,+cov b/src/exchange/afl-tests/id:000263,src:000000,op:flip4,pos:169,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000263,src:000000,op:flip4,pos:169,+cov
rename to src/exchange/afl-tests/id:000263,src:000000,op:flip4,pos:169,+cov
diff --git a/src/mint/afl-tests/id:000264,src:000000,op:flip4,pos:157,+cov b/src/exchange/afl-tests/id:000264,src:000000,op:flip4,pos:157,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000264,src:000000,op:flip4,pos:157,+cov
rename to src/exchange/afl-tests/id:000264,src:000000,op:flip4,pos:157,+cov
diff --git a/src/mint/afl-tests/id:000264,src:000000,op:flip4,pos:172,+cov b/src/exchange/afl-tests/id:000264,src:000000,op:flip4,pos:172,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000264,src:000000,op:flip4,pos:172,+cov
rename to src/exchange/afl-tests/id:000264,src:000000,op:flip4,pos:172,+cov
diff --git a/src/mint/afl-tests/id:000265,src:000000,op:flip4,pos:157,+cov b/src/exchange/afl-tests/id:000265,src:000000,op:flip4,pos:157,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000265,src:000000,op:flip4,pos:157,+cov
rename to src/exchange/afl-tests/id:000265,src:000000,op:flip4,pos:157,+cov
diff --git a/src/mint/afl-tests/id:000265,src:000000,op:flip4,pos:175,+cov b/src/exchange/afl-tests/id:000265,src:000000,op:flip4,pos:175,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000265,src:000000,op:flip4,pos:175,+cov
rename to src/exchange/afl-tests/id:000265,src:000000,op:flip4,pos:175,+cov
diff --git a/src/mint/afl-tests/id:000266,src:000000,op:flip4,pos:176,+cov b/src/exchange/afl-tests/id:000266,src:000000,op:flip4,pos:176,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000266,src:000000,op:flip4,pos:176,+cov
rename to src/exchange/afl-tests/id:000266,src:000000,op:flip4,pos:176,+cov
diff --git a/src/mint/afl-tests/id:000266,src:000000,op:flip4,pos:177,+cov b/src/exchange/afl-tests/id:000266,src:000000,op:flip4,pos:177,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000266,src:000000,op:flip4,pos:177,+cov
rename to src/exchange/afl-tests/id:000266,src:000000,op:flip4,pos:177,+cov
diff --git a/src/mint/afl-tests/id:000267,src:000000,op:flip4,pos:179,+cov b/src/exchange/afl-tests/id:000267,src:000000,op:flip4,pos:179,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000267,src:000000,op:flip4,pos:179,+cov
rename to src/exchange/afl-tests/id:000267,src:000000,op:flip4,pos:179,+cov
diff --git a/src/mint/afl-tests/id:000267,src:000000,op:flip4,pos:225,+cov b/src/exchange/afl-tests/id:000267,src:000000,op:flip4,pos:225,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000267,src:000000,op:flip4,pos:225,+cov
rename to src/exchange/afl-tests/id:000267,src:000000,op:flip4,pos:225,+cov
diff --git a/src/mint/afl-tests/id:000268,src:000000,op:flip4,pos:183,+cov b/src/exchange/afl-tests/id:000268,src:000000,op:flip4,pos:183,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000268,src:000000,op:flip4,pos:183,+cov
rename to src/exchange/afl-tests/id:000268,src:000000,op:flip4,pos:183,+cov
diff --git a/src/mint/afl-tests/id:000268,src:000000,op:flip4,pos:258,+cov b/src/exchange/afl-tests/id:000268,src:000000,op:flip4,pos:258,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000268,src:000000,op:flip4,pos:258,+cov
rename to src/exchange/afl-tests/id:000268,src:000000,op:flip4,pos:258,+cov
diff --git a/src/mint/afl-tests/id:000269,src:000000,op:flip4,pos:262,+cov b/src/exchange/afl-tests/id:000269,src:000000,op:flip4,pos:262,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000269,src:000000,op:flip4,pos:262,+cov
rename to src/exchange/afl-tests/id:000269,src:000000,op:flip4,pos:262,+cov
diff --git a/src/mint/afl-tests/id:000269,src:000000,op:flip4,pos:270,+cov b/src/exchange/afl-tests/id:000269,src:000000,op:flip4,pos:270,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000269,src:000000,op:flip4,pos:270,+cov
rename to src/exchange/afl-tests/id:000269,src:000000,op:flip4,pos:270,+cov
diff --git a/src/mint/afl-tests/id:000270,src:000000,op:flip4,pos:276,+cov b/src/exchange/afl-tests/id:000270,src:000000,op:flip4,pos:276,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000270,src:000000,op:flip4,pos:276,+cov
rename to src/exchange/afl-tests/id:000270,src:000000,op:flip4,pos:276,+cov
diff --git a/src/mint/afl-tests/id:000270,src:000000,op:flip4,pos:280,+cov b/src/exchange/afl-tests/id:000270,src:000000,op:flip4,pos:280,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000270,src:000000,op:flip4,pos:280,+cov
rename to src/exchange/afl-tests/id:000270,src:000000,op:flip4,pos:280,+cov
diff --git a/src/mint/afl-tests/id:000271,src:000000,op:flip4,pos:284,+cov b/src/exchange/afl-tests/id:000271,src:000000,op:flip4,pos:284,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000271,src:000000,op:flip4,pos:284,+cov
rename to src/exchange/afl-tests/id:000271,src:000000,op:flip4,pos:284,+cov
diff --git a/src/mint/afl-tests/id:000271,src:000000,op:flip4,pos:307,+cov b/src/exchange/afl-tests/id:000271,src:000000,op:flip4,pos:307,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000271,src:000000,op:flip4,pos:307,+cov
rename to src/exchange/afl-tests/id:000271,src:000000,op:flip4,pos:307,+cov
diff --git a/src/mint/afl-tests/id:000272,src:000000,op:flip4,pos:314,+cov b/src/exchange/afl-tests/id:000272,src:000000,op:flip4,pos:314,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000272,src:000000,op:flip4,pos:314,+cov
rename to src/exchange/afl-tests/id:000272,src:000000,op:flip4,pos:314,+cov
diff --git a/src/mint/afl-tests/id:000272,src:000000,op:flip4,pos:317,+cov b/src/exchange/afl-tests/id:000272,src:000000,op:flip4,pos:317,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000272,src:000000,op:flip4,pos:317,+cov
rename to src/exchange/afl-tests/id:000272,src:000000,op:flip4,pos:317,+cov
diff --git a/src/mint/afl-tests/id:000273,src:000000,op:flip4,pos:318,+cov b/src/exchange/afl-tests/id:000273,src:000000,op:flip4,pos:318,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000273,src:000000,op:flip4,pos:318,+cov
rename to src/exchange/afl-tests/id:000273,src:000000,op:flip4,pos:318,+cov
diff --git a/src/mint/afl-tests/id:000273,src:000000,op:flip4,pos:328,+cov b/src/exchange/afl-tests/id:000273,src:000000,op:flip4,pos:328,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000273,src:000000,op:flip4,pos:328,+cov
rename to src/exchange/afl-tests/id:000273,src:000000,op:flip4,pos:328,+cov
diff --git a/src/mint/afl-tests/id:000274,src:000000,op:flip4,pos:330,+cov b/src/exchange/afl-tests/id:000274,src:000000,op:flip4,pos:330,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000274,src:000000,op:flip4,pos:330,+cov
rename to src/exchange/afl-tests/id:000274,src:000000,op:flip4,pos:330,+cov
diff --git a/src/mint/afl-tests/id:000275,src:000000,op:flip4,pos:331,+cov b/src/exchange/afl-tests/id:000275,src:000000,op:flip4,pos:331,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000275,src:000000,op:flip4,pos:331,+cov
rename to src/exchange/afl-tests/id:000275,src:000000,op:flip4,pos:331,+cov
diff --git a/src/mint/afl-tests/id:000275,src:000000,op:flip8,pos:32,+cov b/src/exchange/afl-tests/id:000275,src:000000,op:flip8,pos:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000275,src:000000,op:flip8,pos:32,+cov
rename to src/exchange/afl-tests/id:000275,src:000000,op:flip8,pos:32,+cov
diff --git a/src/mint/afl-tests/id:000276,src:000000,op:flip8,pos:43,+cov b/src/exchange/afl-tests/id:000276,src:000000,op:flip8,pos:43,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000276,src:000000,op:flip8,pos:43,+cov
rename to src/exchange/afl-tests/id:000276,src:000000,op:flip8,pos:43,+cov
diff --git a/src/mint/afl-tests/id:000276,src:000000,op:flip8,pos:47,+cov b/src/exchange/afl-tests/id:000276,src:000000,op:flip8,pos:47,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000276,src:000000,op:flip8,pos:47,+cov
rename to src/exchange/afl-tests/id:000276,src:000000,op:flip8,pos:47,+cov
diff --git a/src/mint/afl-tests/id:000277,src:000000,op:flip8,pos:190,+cov b/src/exchange/afl-tests/id:000277,src:000000,op:flip8,pos:190,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000277,src:000000,op:flip8,pos:190,+cov
rename to src/exchange/afl-tests/id:000277,src:000000,op:flip8,pos:190,+cov
diff --git a/src/mint/afl-tests/id:000277,src:000000,op:flip8,pos:52,+cov b/src/exchange/afl-tests/id:000277,src:000000,op:flip8,pos:52,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000277,src:000000,op:flip8,pos:52,+cov
rename to src/exchange/afl-tests/id:000277,src:000000,op:flip8,pos:52,+cov
diff --git a/src/mint/afl-tests/id:000278,src:000000,op:flip16,pos:51,+cov b/src/exchange/afl-tests/id:000278,src:000000,op:flip16,pos:51,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000278,src:000000,op:flip16,pos:51,+cov
rename to src/exchange/afl-tests/id:000278,src:000000,op:flip16,pos:51,+cov
diff --git a/src/mint/afl-tests/id:000278,src:000000,op:flip8,pos:62,+cov b/src/exchange/afl-tests/id:000278,src:000000,op:flip8,pos:62,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000278,src:000000,op:flip8,pos:62,+cov
rename to src/exchange/afl-tests/id:000278,src:000000,op:flip8,pos:62,+cov
diff --git a/src/mint/afl-tests/id:000279,src:000000,op:flip16,pos:219,+cov b/src/exchange/afl-tests/id:000279,src:000000,op:flip16,pos:219,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000279,src:000000,op:flip16,pos:219,+cov
rename to src/exchange/afl-tests/id:000279,src:000000,op:flip16,pos:219,+cov
diff --git a/src/mint/afl-tests/id:000279,src:000000,op:flip8,pos:87,+cov b/src/exchange/afl-tests/id:000279,src:000000,op:flip8,pos:87,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000279,src:000000,op:flip8,pos:87,+cov
rename to src/exchange/afl-tests/id:000279,src:000000,op:flip8,pos:87,+cov
diff --git a/src/mint/afl-tests/id:000280,src:000000,op:flip32,pos:55,+cov b/src/exchange/afl-tests/id:000280,src:000000,op:flip32,pos:55,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000280,src:000000,op:flip32,pos:55,+cov
rename to src/exchange/afl-tests/id:000280,src:000000,op:flip32,pos:55,+cov
diff --git a/src/mint/afl-tests/id:000280,src:000000,op:flip8,pos:88,+cov b/src/exchange/afl-tests/id:000280,src:000000,op:flip8,pos:88,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000280,src:000000,op:flip8,pos:88,+cov
rename to src/exchange/afl-tests/id:000280,src:000000,op:flip8,pos:88,+cov
diff --git a/src/mint/afl-tests/id:000281,src:000000,op:flip32,pos:68,+cov b/src/exchange/afl-tests/id:000281,src:000000,op:flip32,pos:68,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000281,src:000000,op:flip32,pos:68,+cov
rename to src/exchange/afl-tests/id:000281,src:000000,op:flip32,pos:68,+cov
diff --git a/src/mint/afl-tests/id:000281,src:000000,op:flip8,pos:331,+cov b/src/exchange/afl-tests/id:000281,src:000000,op:flip8,pos:331,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000281,src:000000,op:flip8,pos:331,+cov
rename to src/exchange/afl-tests/id:000281,src:000000,op:flip8,pos:331,+cov
diff --git a/src/mint/afl-tests/id:000282,src:000000,op:arith8,pos:4,val:-19 b/src/exchange/afl-tests/id:000282,src:000000,op:arith8,pos:4,val:-19
similarity index 100%
rename from src/mint/afl-tests/id:000282,src:000000,op:arith8,pos:4,val:-19
rename to src/exchange/afl-tests/id:000282,src:000000,op:arith8,pos:4,val:-19
diff --git a/src/mint/afl-tests/id:000282,src:000000,op:flip16,pos:39,+cov b/src/exchange/afl-tests/id:000282,src:000000,op:flip16,pos:39,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000282,src:000000,op:flip16,pos:39,+cov
rename to src/exchange/afl-tests/id:000282,src:000000,op:flip16,pos:39,+cov
diff --git a/src/mint/afl-tests/id:000283,src:000000,op:arith8,pos:4,val:-22 b/src/exchange/afl-tests/id:000283,src:000000,op:arith8,pos:4,val:-22
similarity index 100%
rename from src/mint/afl-tests/id:000283,src:000000,op:arith8,pos:4,val:-22
rename to src/exchange/afl-tests/id:000283,src:000000,op:arith8,pos:4,val:-22
diff --git a/src/mint/afl-tests/id:000283,src:000000,op:flip16,pos:85,+cov b/src/exchange/afl-tests/id:000283,src:000000,op:flip16,pos:85,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000283,src:000000,op:flip16,pos:85,+cov
rename to src/exchange/afl-tests/id:000283,src:000000,op:flip16,pos:85,+cov
diff --git a/src/mint/afl-tests/id:000284,src:000000,op:arith8,pos:5,val:-10,+cov b/src/exchange/afl-tests/id:000284,src:000000,op:arith8,pos:5,val:-10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000284,src:000000,op:arith8,pos:5,val:-10,+cov
rename to src/exchange/afl-tests/id:000284,src:000000,op:arith8,pos:5,val:-10,+cov
diff --git a/src/mint/afl-tests/id:000284,src:000000,op:flip32,pos:49,+cov b/src/exchange/afl-tests/id:000284,src:000000,op:flip32,pos:49,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000284,src:000000,op:flip32,pos:49,+cov
rename to src/exchange/afl-tests/id:000284,src:000000,op:flip32,pos:49,+cov
diff --git a/src/mint/afl-tests/id:000285,src:000000,op:arith8,pos:5,val:-34 b/src/exchange/afl-tests/id:000285,src:000000,op:arith8,pos:5,val:-34
similarity index 100%
rename from src/mint/afl-tests/id:000285,src:000000,op:arith8,pos:5,val:-34
rename to src/exchange/afl-tests/id:000285,src:000000,op:arith8,pos:5,val:-34
diff --git a/src/mint/afl-tests/id:000285,src:000000,op:flip32,pos:62 b/src/exchange/afl-tests/id:000285,src:000000,op:flip32,pos:62
similarity index 100%
rename from src/mint/afl-tests/id:000285,src:000000,op:flip32,pos:62
rename to src/exchange/afl-tests/id:000285,src:000000,op:flip32,pos:62
diff --git a/src/mint/afl-tests/id:000286,src:000000,op:arith8,pos:6,val:-34,+cov b/src/exchange/afl-tests/id:000286,src:000000,op:arith8,pos:6,val:-34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000286,src:000000,op:arith8,pos:6,val:-34,+cov
rename to src/exchange/afl-tests/id:000286,src:000000,op:arith8,pos:6,val:-34,+cov
diff --git a/src/mint/afl-tests/id:000286,src:000000,op:flip32,pos:86,+cov b/src/exchange/afl-tests/id:000286,src:000000,op:flip32,pos:86,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000286,src:000000,op:flip32,pos:86,+cov
rename to src/exchange/afl-tests/id:000286,src:000000,op:flip32,pos:86,+cov
diff --git a/src/mint/afl-tests/id:000287,src:000000,op:arith8,pos:11,val:-34 b/src/exchange/afl-tests/id:000287,src:000000,op:arith8,pos:11,val:-34
similarity index 100%
rename from src/mint/afl-tests/id:000287,src:000000,op:arith8,pos:11,val:-34
rename to src/exchange/afl-tests/id:000287,src:000000,op:arith8,pos:11,val:-34
diff --git a/src/mint/afl-tests/id:000287,src:000000,op:flip32,pos:92,+cov b/src/exchange/afl-tests/id:000287,src:000000,op:flip32,pos:92,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000287,src:000000,op:flip32,pos:92,+cov
rename to src/exchange/afl-tests/id:000287,src:000000,op:flip32,pos:92,+cov
diff --git a/src/mint/afl-tests/id:000288,src:000000,op:arith8,pos:15,val:-10,+cov b/src/exchange/afl-tests/id:000288,src:000000,op:arith8,pos:15,val:-10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000288,src:000000,op:arith8,pos:15,val:-10,+cov
rename to src/exchange/afl-tests/id:000288,src:000000,op:arith8,pos:15,val:-10,+cov
diff --git a/src/mint/afl-tests/id:000288,src:000000,op:arith8,pos:4,val:-19 b/src/exchange/afl-tests/id:000288,src:000000,op:arith8,pos:4,val:-19
similarity index 100%
rename from src/mint/afl-tests/id:000288,src:000000,op:arith8,pos:4,val:-19
rename to src/exchange/afl-tests/id:000288,src:000000,op:arith8,pos:4,val:-19
diff --git a/src/mint/afl-tests/id:000289,src:000000,op:arith8,pos:22,val:+5,+cov b/src/exchange/afl-tests/id:000289,src:000000,op:arith8,pos:22,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000289,src:000000,op:arith8,pos:22,val:+5,+cov
rename to src/exchange/afl-tests/id:000289,src:000000,op:arith8,pos:22,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000289,src:000000,op:arith8,pos:4,val:-22 b/src/exchange/afl-tests/id:000289,src:000000,op:arith8,pos:4,val:-22
similarity index 100%
rename from src/mint/afl-tests/id:000289,src:000000,op:arith8,pos:4,val:-22
rename to src/exchange/afl-tests/id:000289,src:000000,op:arith8,pos:4,val:-22
diff --git a/src/mint/afl-tests/id:000290,src:000000,op:arith8,pos:24,val:+10,+cov b/src/exchange/afl-tests/id:000290,src:000000,op:arith8,pos:24,val:+10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000290,src:000000,op:arith8,pos:24,val:+10,+cov
rename to src/exchange/afl-tests/id:000290,src:000000,op:arith8,pos:24,val:+10,+cov
diff --git a/src/mint/afl-tests/id:000290,src:000000,op:arith8,pos:5,val:-10,+cov b/src/exchange/afl-tests/id:000290,src:000000,op:arith8,pos:5,val:-10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000290,src:000000,op:arith8,pos:5,val:-10,+cov
rename to src/exchange/afl-tests/id:000290,src:000000,op:arith8,pos:5,val:-10,+cov
diff --git a/src/mint/afl-tests/id:000291,src:000000,op:arith8,pos:25,val:-6,+cov b/src/exchange/afl-tests/id:000291,src:000000,op:arith8,pos:25,val:-6,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000291,src:000000,op:arith8,pos:25,val:-6,+cov
rename to src/exchange/afl-tests/id:000291,src:000000,op:arith8,pos:25,val:-6,+cov
diff --git a/src/mint/afl-tests/id:000291,src:000000,op:arith8,pos:5,val:-34 b/src/exchange/afl-tests/id:000291,src:000000,op:arith8,pos:5,val:-34
similarity index 100%
rename from src/mint/afl-tests/id:000291,src:000000,op:arith8,pos:5,val:-34
rename to src/exchange/afl-tests/id:000291,src:000000,op:arith8,pos:5,val:-34
diff --git a/src/mint/afl-tests/id:000292,src:000000,op:arith8,pos:25,val:-25,+cov b/src/exchange/afl-tests/id:000292,src:000000,op:arith8,pos:25,val:-25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000292,src:000000,op:arith8,pos:25,val:-25,+cov
rename to src/exchange/afl-tests/id:000292,src:000000,op:arith8,pos:25,val:-25,+cov
diff --git a/src/mint/afl-tests/id:000292,src:000000,op:arith8,pos:6,val:-34,+cov b/src/exchange/afl-tests/id:000292,src:000000,op:arith8,pos:6,val:-34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000292,src:000000,op:arith8,pos:6,val:-34,+cov
rename to src/exchange/afl-tests/id:000292,src:000000,op:arith8,pos:6,val:-34,+cov
diff --git a/src/mint/afl-tests/id:000293,src:000000,op:arith8,pos:25,val:-29,+cov b/src/exchange/afl-tests/id:000293,src:000000,op:arith8,pos:25,val:-29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000293,src:000000,op:arith8,pos:25,val:-29,+cov
rename to src/exchange/afl-tests/id:000293,src:000000,op:arith8,pos:25,val:-29,+cov
diff --git a/src/mint/afl-tests/id:000293,src:000000,op:arith8,pos:7,val:-34,+cov b/src/exchange/afl-tests/id:000293,src:000000,op:arith8,pos:7,val:-34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000293,src:000000,op:arith8,pos:7,val:-34,+cov
rename to src/exchange/afl-tests/id:000293,src:000000,op:arith8,pos:7,val:-34,+cov
diff --git a/src/mint/afl-tests/id:000294,src:000000,op:arith8,pos:11,val:-34 b/src/exchange/afl-tests/id:000294,src:000000,op:arith8,pos:11,val:-34
similarity index 100%
rename from src/mint/afl-tests/id:000294,src:000000,op:arith8,pos:11,val:-34
rename to src/exchange/afl-tests/id:000294,src:000000,op:arith8,pos:11,val:-34
diff --git a/src/mint/afl-tests/id:000294,src:000000,op:arith8,pos:26,val:+12,+cov b/src/exchange/afl-tests/id:000294,src:000000,op:arith8,pos:26,val:+12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000294,src:000000,op:arith8,pos:26,val:+12,+cov
rename to src/exchange/afl-tests/id:000294,src:000000,op:arith8,pos:26,val:+12,+cov
diff --git a/src/mint/afl-tests/id:000295,src:000000,op:arith8,pos:15,val:-10,+cov b/src/exchange/afl-tests/id:000295,src:000000,op:arith8,pos:15,val:-10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000295,src:000000,op:arith8,pos:15,val:-10,+cov
rename to src/exchange/afl-tests/id:000295,src:000000,op:arith8,pos:15,val:-10,+cov
diff --git a/src/mint/afl-tests/id:000295,src:000000,op:arith8,pos:26,val:+17,+cov b/src/exchange/afl-tests/id:000295,src:000000,op:arith8,pos:26,val:+17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000295,src:000000,op:arith8,pos:26,val:+17,+cov
rename to src/exchange/afl-tests/id:000295,src:000000,op:arith8,pos:26,val:+17,+cov
diff --git a/src/mint/afl-tests/id:000296,src:000000,op:arith8,pos:25,val:+24,+cov b/src/exchange/afl-tests/id:000296,src:000000,op:arith8,pos:25,val:+24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000296,src:000000,op:arith8,pos:25,val:+24,+cov
rename to src/exchange/afl-tests/id:000296,src:000000,op:arith8,pos:25,val:+24,+cov
diff --git a/src/mint/afl-tests/id:000296,src:000000,op:arith8,pos:27,val:-29,+cov b/src/exchange/afl-tests/id:000296,src:000000,op:arith8,pos:27,val:-29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000296,src:000000,op:arith8,pos:27,val:-29,+cov
rename to src/exchange/afl-tests/id:000296,src:000000,op:arith8,pos:27,val:-29,+cov
diff --git a/src/mint/afl-tests/id:000297,src:000000,op:arith8,pos:27,val:+26,+cov b/src/exchange/afl-tests/id:000297,src:000000,op:arith8,pos:27,val:+26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000297,src:000000,op:arith8,pos:27,val:+26,+cov
rename to src/exchange/afl-tests/id:000297,src:000000,op:arith8,pos:27,val:+26,+cov
diff --git a/src/mint/afl-tests/id:000297,src:000000,op:arith8,pos:27,val:+33,+cov b/src/exchange/afl-tests/id:000297,src:000000,op:arith8,pos:27,val:+33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000297,src:000000,op:arith8,pos:27,val:+33,+cov
rename to src/exchange/afl-tests/id:000297,src:000000,op:arith8,pos:27,val:+33,+cov
diff --git a/src/mint/afl-tests/id:000298,src:000000,op:arith8,pos:28,val:+13,+cov b/src/exchange/afl-tests/id:000298,src:000000,op:arith8,pos:28,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000298,src:000000,op:arith8,pos:28,val:+13,+cov
rename to src/exchange/afl-tests/id:000298,src:000000,op:arith8,pos:28,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000298,src:000000,op:arith8,pos:28,val:+9,+cov b/src/exchange/afl-tests/id:000298,src:000000,op:arith8,pos:28,val:+9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000298,src:000000,op:arith8,pos:28,val:+9,+cov
rename to src/exchange/afl-tests/id:000298,src:000000,op:arith8,pos:28,val:+9,+cov
diff --git a/src/mint/afl-tests/id:000299,src:000000,op:arith8,pos:28,val:-15,+cov b/src/exchange/afl-tests/id:000299,src:000000,op:arith8,pos:28,val:-15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000299,src:000000,op:arith8,pos:28,val:-15,+cov
rename to src/exchange/afl-tests/id:000299,src:000000,op:arith8,pos:28,val:-15,+cov
diff --git a/src/mint/afl-tests/id:000299,src:000000,op:arith8,pos:28,val:-17 b/src/exchange/afl-tests/id:000299,src:000000,op:arith8,pos:28,val:-17
similarity index 100%
rename from src/mint/afl-tests/id:000299,src:000000,op:arith8,pos:28,val:-17
rename to src/exchange/afl-tests/id:000299,src:000000,op:arith8,pos:28,val:-17
diff --git a/src/mint/afl-tests/id:000300,src:000000,op:arith8,pos:28,val:+27,+cov b/src/exchange/afl-tests/id:000300,src:000000,op:arith8,pos:28,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000300,src:000000,op:arith8,pos:28,val:+27,+cov
rename to src/exchange/afl-tests/id:000300,src:000000,op:arith8,pos:28,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000300,src:000000,op:arith8,pos:28,val:-33,+cov b/src/exchange/afl-tests/id:000300,src:000000,op:arith8,pos:28,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000300,src:000000,op:arith8,pos:28,val:-33,+cov
rename to src/exchange/afl-tests/id:000300,src:000000,op:arith8,pos:28,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000301,src:000000,op:arith8,pos:28,val:-31,+cov b/src/exchange/afl-tests/id:000301,src:000000,op:arith8,pos:28,val:-31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000301,src:000000,op:arith8,pos:28,val:-31,+cov
rename to src/exchange/afl-tests/id:000301,src:000000,op:arith8,pos:28,val:-31,+cov
diff --git a/src/mint/afl-tests/id:000301,src:000000,op:arith8,pos:29,val:+14,+cov b/src/exchange/afl-tests/id:000301,src:000000,op:arith8,pos:29,val:+14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000301,src:000000,op:arith8,pos:29,val:+14,+cov
rename to src/exchange/afl-tests/id:000301,src:000000,op:arith8,pos:29,val:+14,+cov
diff --git a/src/mint/afl-tests/id:000302,src:000000,op:arith8,pos:29,val:-29,+cov b/src/exchange/afl-tests/id:000302,src:000000,op:arith8,pos:29,val:-29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000302,src:000000,op:arith8,pos:29,val:-29,+cov
rename to src/exchange/afl-tests/id:000302,src:000000,op:arith8,pos:29,val:-29,+cov
diff --git a/src/mint/afl-tests/id:000302,src:000000,op:arith8,pos:30,val:+3,+cov b/src/exchange/afl-tests/id:000302,src:000000,op:arith8,pos:30,val:+3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000302,src:000000,op:arith8,pos:30,val:+3,+cov
rename to src/exchange/afl-tests/id:000302,src:000000,op:arith8,pos:30,val:+3,+cov
diff --git a/src/mint/afl-tests/id:000303,src:000000,op:arith8,pos:30,val:+18,+cov b/src/exchange/afl-tests/id:000303,src:000000,op:arith8,pos:30,val:+18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000303,src:000000,op:arith8,pos:30,val:+18,+cov
rename to src/exchange/afl-tests/id:000303,src:000000,op:arith8,pos:30,val:+18,+cov
diff --git a/src/mint/afl-tests/id:000303,src:000000,op:arith8,pos:30,val:+31,+cov b/src/exchange/afl-tests/id:000303,src:000000,op:arith8,pos:30,val:+31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000303,src:000000,op:arith8,pos:30,val:+31,+cov
rename to src/exchange/afl-tests/id:000303,src:000000,op:arith8,pos:30,val:+31,+cov
diff --git a/src/mint/afl-tests/id:000304,src:000000,op:arith8,pos:31,val:+19,+cov b/src/exchange/afl-tests/id:000304,src:000000,op:arith8,pos:31,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000304,src:000000,op:arith8,pos:31,val:+19,+cov
rename to src/exchange/afl-tests/id:000304,src:000000,op:arith8,pos:31,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000304,src:000000,op:arith8,pos:31,val:-33,+cov b/src/exchange/afl-tests/id:000304,src:000000,op:arith8,pos:31,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000304,src:000000,op:arith8,pos:31,val:-33,+cov
rename to src/exchange/afl-tests/id:000304,src:000000,op:arith8,pos:31,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000305,src:000000,op:arith8,pos:31,val:-29,+cov b/src/exchange/afl-tests/id:000305,src:000000,op:arith8,pos:31,val:-29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000305,src:000000,op:arith8,pos:31,val:-29,+cov
rename to src/exchange/afl-tests/id:000305,src:000000,op:arith8,pos:31,val:-29,+cov
diff --git a/src/mint/afl-tests/id:000305,src:000000,op:arith8,pos:32,val:+19,+cov b/src/exchange/afl-tests/id:000305,src:000000,op:arith8,pos:32,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000305,src:000000,op:arith8,pos:32,val:+19,+cov
rename to src/exchange/afl-tests/id:000305,src:000000,op:arith8,pos:32,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000306,src:000000,op:arith8,pos:31,val:-33,+cov b/src/exchange/afl-tests/id:000306,src:000000,op:arith8,pos:31,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000306,src:000000,op:arith8,pos:31,val:-33,+cov
rename to src/exchange/afl-tests/id:000306,src:000000,op:arith8,pos:31,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000306,src:000000,op:arith8,pos:33,val:+15,+cov b/src/exchange/afl-tests/id:000306,src:000000,op:arith8,pos:33,val:+15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000306,src:000000,op:arith8,pos:33,val:+15,+cov
rename to src/exchange/afl-tests/id:000306,src:000000,op:arith8,pos:33,val:+15,+cov
diff --git a/src/mint/afl-tests/id:000307,src:000000,op:arith8,pos:31,val:+34,+cov b/src/exchange/afl-tests/id:000307,src:000000,op:arith8,pos:31,val:+34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000307,src:000000,op:arith8,pos:31,val:+34,+cov
rename to src/exchange/afl-tests/id:000307,src:000000,op:arith8,pos:31,val:+34,+cov
diff --git a/src/mint/afl-tests/id:000307,src:000000,op:arith8,pos:33,val:-15,+cov b/src/exchange/afl-tests/id:000307,src:000000,op:arith8,pos:33,val:-15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000307,src:000000,op:arith8,pos:33,val:-15,+cov
rename to src/exchange/afl-tests/id:000307,src:000000,op:arith8,pos:33,val:-15,+cov
diff --git a/src/mint/afl-tests/id:000308,src:000000,op:arith8,pos:32,val:+10,+cov b/src/exchange/afl-tests/id:000308,src:000000,op:arith8,pos:32,val:+10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000308,src:000000,op:arith8,pos:32,val:+10,+cov
rename to src/exchange/afl-tests/id:000308,src:000000,op:arith8,pos:32,val:+10,+cov
diff --git a/src/mint/afl-tests/id:000308,src:000000,op:arith8,pos:34,val:-27,+cov b/src/exchange/afl-tests/id:000308,src:000000,op:arith8,pos:34,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000308,src:000000,op:arith8,pos:34,val:-27,+cov
rename to src/exchange/afl-tests/id:000308,src:000000,op:arith8,pos:34,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000309,src:000000,op:arith8,pos:32,val:-20,+cov b/src/exchange/afl-tests/id:000309,src:000000,op:arith8,pos:32,val:-20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000309,src:000000,op:arith8,pos:32,val:-20,+cov
rename to src/exchange/afl-tests/id:000309,src:000000,op:arith8,pos:32,val:-20,+cov
diff --git a/src/mint/afl-tests/id:000309,src:000000,op:arith8,pos:34,val:+34,+cov b/src/exchange/afl-tests/id:000309,src:000000,op:arith8,pos:34,val:+34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000309,src:000000,op:arith8,pos:34,val:+34,+cov
rename to src/exchange/afl-tests/id:000309,src:000000,op:arith8,pos:34,val:+34,+cov
diff --git a/src/mint/afl-tests/id:000310,src:000000,op:arith8,pos:33,val:+20,+cov b/src/exchange/afl-tests/id:000310,src:000000,op:arith8,pos:33,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000310,src:000000,op:arith8,pos:33,val:+20,+cov
rename to src/exchange/afl-tests/id:000310,src:000000,op:arith8,pos:33,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000310,src:000000,op:arith8,pos:35,val:+18,+cov b/src/exchange/afl-tests/id:000310,src:000000,op:arith8,pos:35,val:+18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000310,src:000000,op:arith8,pos:35,val:+18,+cov
rename to src/exchange/afl-tests/id:000310,src:000000,op:arith8,pos:35,val:+18,+cov
diff --git a/src/mint/afl-tests/id:000311,src:000000,op:arith8,pos:33,val:+24,+cov b/src/exchange/afl-tests/id:000311,src:000000,op:arith8,pos:33,val:+24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000311,src:000000,op:arith8,pos:33,val:+24,+cov
rename to src/exchange/afl-tests/id:000311,src:000000,op:arith8,pos:33,val:+24,+cov
diff --git a/src/mint/afl-tests/id:000311,src:000000,op:arith8,pos:35,val:-27,+cov b/src/exchange/afl-tests/id:000311,src:000000,op:arith8,pos:35,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000311,src:000000,op:arith8,pos:35,val:-27,+cov
rename to src/exchange/afl-tests/id:000311,src:000000,op:arith8,pos:35,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000312,src:000000,op:arith8,pos:34,val:-3,+cov b/src/exchange/afl-tests/id:000312,src:000000,op:arith8,pos:34,val:-3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000312,src:000000,op:arith8,pos:34,val:-3,+cov
rename to src/exchange/afl-tests/id:000312,src:000000,op:arith8,pos:34,val:-3,+cov
diff --git a/src/mint/afl-tests/id:000312,src:000000,op:arith8,pos:35,val:+35,+cov b/src/exchange/afl-tests/id:000312,src:000000,op:arith8,pos:35,val:+35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000312,src:000000,op:arith8,pos:35,val:+35,+cov
rename to src/exchange/afl-tests/id:000312,src:000000,op:arith8,pos:35,val:+35,+cov
diff --git a/src/mint/afl-tests/id:000313,src:000000,op:arith8,pos:34,val:+18,+cov b/src/exchange/afl-tests/id:000313,src:000000,op:arith8,pos:34,val:+18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000313,src:000000,op:arith8,pos:34,val:+18,+cov
rename to src/exchange/afl-tests/id:000313,src:000000,op:arith8,pos:34,val:+18,+cov
diff --git a/src/mint/afl-tests/id:000313,src:000000,op:arith8,pos:36,val:+13,+cov b/src/exchange/afl-tests/id:000313,src:000000,op:arith8,pos:36,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000313,src:000000,op:arith8,pos:36,val:+13,+cov
rename to src/exchange/afl-tests/id:000313,src:000000,op:arith8,pos:36,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000314,src:000000,op:arith8,pos:34,val:-30,+cov b/src/exchange/afl-tests/id:000314,src:000000,op:arith8,pos:34,val:-30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000314,src:000000,op:arith8,pos:34,val:-30,+cov
rename to src/exchange/afl-tests/id:000314,src:000000,op:arith8,pos:34,val:-30,+cov
diff --git a/src/mint/afl-tests/id:000314,src:000000,op:arith8,pos:36,val:+32,+cov b/src/exchange/afl-tests/id:000314,src:000000,op:arith8,pos:36,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000314,src:000000,op:arith8,pos:36,val:+32,+cov
rename to src/exchange/afl-tests/id:000314,src:000000,op:arith8,pos:36,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000315,src:000000,op:arith8,pos:35,val:+17,+cov b/src/exchange/afl-tests/id:000315,src:000000,op:arith8,pos:35,val:+17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000315,src:000000,op:arith8,pos:35,val:+17,+cov
rename to src/exchange/afl-tests/id:000315,src:000000,op:arith8,pos:35,val:+17,+cov
diff --git a/src/mint/afl-tests/id:000315,src:000000,op:arith8,pos:37,val:+24,+cov b/src/exchange/afl-tests/id:000315,src:000000,op:arith8,pos:37,val:+24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000315,src:000000,op:arith8,pos:37,val:+24,+cov
rename to src/exchange/afl-tests/id:000315,src:000000,op:arith8,pos:37,val:+24,+cov
diff --git a/src/mint/afl-tests/id:000316,src:000000,op:arith8,pos:35,val:-19,+cov b/src/exchange/afl-tests/id:000316,src:000000,op:arith8,pos:35,val:-19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000316,src:000000,op:arith8,pos:35,val:-19,+cov
rename to src/exchange/afl-tests/id:000316,src:000000,op:arith8,pos:35,val:-19,+cov
diff --git a/src/mint/afl-tests/id:000316,src:000000,op:arith8,pos:37,val:+32,+cov b/src/exchange/afl-tests/id:000316,src:000000,op:arith8,pos:37,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000316,src:000000,op:arith8,pos:37,val:+32,+cov
rename to src/exchange/afl-tests/id:000316,src:000000,op:arith8,pos:37,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000317,src:000000,op:arith8,pos:36,val:-26,+cov b/src/exchange/afl-tests/id:000317,src:000000,op:arith8,pos:36,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000317,src:000000,op:arith8,pos:36,val:-26,+cov
rename to src/exchange/afl-tests/id:000317,src:000000,op:arith8,pos:36,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000317,src:000000,op:arith8,pos:38,val:-35,+cov b/src/exchange/afl-tests/id:000317,src:000000,op:arith8,pos:38,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000317,src:000000,op:arith8,pos:38,val:-35,+cov
rename to src/exchange/afl-tests/id:000317,src:000000,op:arith8,pos:38,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000318,src:000000,op:arith8,pos:36,val:+27,+cov b/src/exchange/afl-tests/id:000318,src:000000,op:arith8,pos:36,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000318,src:000000,op:arith8,pos:36,val:+27,+cov
rename to src/exchange/afl-tests/id:000318,src:000000,op:arith8,pos:36,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000318,src:000000,op:arith8,pos:39,val:+18,+cov b/src/exchange/afl-tests/id:000318,src:000000,op:arith8,pos:39,val:+18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000318,src:000000,op:arith8,pos:39,val:+18,+cov
rename to src/exchange/afl-tests/id:000318,src:000000,op:arith8,pos:39,val:+18,+cov
diff --git a/src/mint/afl-tests/id:000319,src:000000,op:arith8,pos:36,val:+32,+cov b/src/exchange/afl-tests/id:000319,src:000000,op:arith8,pos:36,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000319,src:000000,op:arith8,pos:36,val:+32,+cov
rename to src/exchange/afl-tests/id:000319,src:000000,op:arith8,pos:36,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000319,src:000000,op:arith8,pos:39,val:-23,+cov b/src/exchange/afl-tests/id:000319,src:000000,op:arith8,pos:39,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000319,src:000000,op:arith8,pos:39,val:-23,+cov
rename to src/exchange/afl-tests/id:000319,src:000000,op:arith8,pos:39,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000320,src:000000,op:arith8,pos:37,val:-9,+cov b/src/exchange/afl-tests/id:000320,src:000000,op:arith8,pos:37,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000320,src:000000,op:arith8,pos:37,val:-9,+cov
rename to src/exchange/afl-tests/id:000320,src:000000,op:arith8,pos:37,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000320,src:000000,op:arith8,pos:39,val:-24,+cov b/src/exchange/afl-tests/id:000320,src:000000,op:arith8,pos:39,val:-24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000320,src:000000,op:arith8,pos:39,val:-24,+cov
rename to src/exchange/afl-tests/id:000320,src:000000,op:arith8,pos:39,val:-24,+cov
diff --git a/src/mint/afl-tests/id:000321,src:000000,op:arith8,pos:37,val:+21 b/src/exchange/afl-tests/id:000321,src:000000,op:arith8,pos:37,val:+21
similarity index 100%
rename from src/mint/afl-tests/id:000321,src:000000,op:arith8,pos:37,val:+21
rename to src/exchange/afl-tests/id:000321,src:000000,op:arith8,pos:37,val:+21
diff --git a/src/mint/afl-tests/id:000321,src:000000,op:arith8,pos:39,val:+25,+cov b/src/exchange/afl-tests/id:000321,src:000000,op:arith8,pos:39,val:+25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000321,src:000000,op:arith8,pos:39,val:+25,+cov
rename to src/exchange/afl-tests/id:000321,src:000000,op:arith8,pos:39,val:+25,+cov
diff --git a/src/mint/afl-tests/id:000322,src:000000,op:arith8,pos:37,val:+24,+cov b/src/exchange/afl-tests/id:000322,src:000000,op:arith8,pos:37,val:+24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000322,src:000000,op:arith8,pos:37,val:+24,+cov
rename to src/exchange/afl-tests/id:000322,src:000000,op:arith8,pos:37,val:+24,+cov
diff --git a/src/mint/afl-tests/id:000322,src:000000,op:arith8,pos:40,val:-21,+cov b/src/exchange/afl-tests/id:000322,src:000000,op:arith8,pos:40,val:-21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000322,src:000000,op:arith8,pos:40,val:-21,+cov
rename to src/exchange/afl-tests/id:000322,src:000000,op:arith8,pos:40,val:-21,+cov
diff --git a/src/mint/afl-tests/id:000323,src:000000,op:arith8,pos:39,val:+13,+cov b/src/exchange/afl-tests/id:000323,src:000000,op:arith8,pos:39,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000323,src:000000,op:arith8,pos:39,val:+13,+cov
rename to src/exchange/afl-tests/id:000323,src:000000,op:arith8,pos:39,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000323,src:000000,op:arith8,pos:41,val:-5,+cov b/src/exchange/afl-tests/id:000323,src:000000,op:arith8,pos:41,val:-5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000323,src:000000,op:arith8,pos:41,val:-5,+cov
rename to src/exchange/afl-tests/id:000323,src:000000,op:arith8,pos:41,val:-5,+cov
diff --git a/src/mint/afl-tests/id:000324,src:000000,op:arith8,pos:39,val:-23,+cov b/src/exchange/afl-tests/id:000324,src:000000,op:arith8,pos:39,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000324,src:000000,op:arith8,pos:39,val:-23,+cov
rename to src/exchange/afl-tests/id:000324,src:000000,op:arith8,pos:39,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000324,src:000000,op:arith8,pos:41,val:+13,+cov b/src/exchange/afl-tests/id:000324,src:000000,op:arith8,pos:41,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000324,src:000000,op:arith8,pos:41,val:+13,+cov
rename to src/exchange/afl-tests/id:000324,src:000000,op:arith8,pos:41,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000325,src:000000,op:arith8,pos:40,val:+20,+cov b/src/exchange/afl-tests/id:000325,src:000000,op:arith8,pos:40,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000325,src:000000,op:arith8,pos:40,val:+20,+cov
rename to src/exchange/afl-tests/id:000325,src:000000,op:arith8,pos:40,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000325,src:000000,op:arith8,pos:41,val:+26,+cov b/src/exchange/afl-tests/id:000325,src:000000,op:arith8,pos:41,val:+26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000325,src:000000,op:arith8,pos:41,val:+26,+cov
rename to src/exchange/afl-tests/id:000325,src:000000,op:arith8,pos:41,val:+26,+cov
diff --git a/src/mint/afl-tests/id:000326,src:000000,op:arith8,pos:40,val:+27,+cov b/src/exchange/afl-tests/id:000326,src:000000,op:arith8,pos:40,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000326,src:000000,op:arith8,pos:40,val:+27,+cov
rename to src/exchange/afl-tests/id:000326,src:000000,op:arith8,pos:40,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000326,src:000000,op:arith8,pos:41,val:+27,+cov b/src/exchange/afl-tests/id:000326,src:000000,op:arith8,pos:41,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000326,src:000000,op:arith8,pos:41,val:+27,+cov
rename to src/exchange/afl-tests/id:000326,src:000000,op:arith8,pos:41,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000327,src:000000,op:arith8,pos:41,val:-33,+cov b/src/exchange/afl-tests/id:000327,src:000000,op:arith8,pos:41,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000327,src:000000,op:arith8,pos:41,val:-33,+cov
rename to src/exchange/afl-tests/id:000327,src:000000,op:arith8,pos:41,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000327,src:000000,op:arith8,pos:42,val:+29,+cov b/src/exchange/afl-tests/id:000327,src:000000,op:arith8,pos:42,val:+29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000327,src:000000,op:arith8,pos:42,val:+29,+cov
rename to src/exchange/afl-tests/id:000327,src:000000,op:arith8,pos:42,val:+29,+cov
diff --git a/src/mint/afl-tests/id:000328,src:000000,op:arith8,pos:41,val:+35,+cov b/src/exchange/afl-tests/id:000328,src:000000,op:arith8,pos:41,val:+35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000328,src:000000,op:arith8,pos:41,val:+35,+cov
rename to src/exchange/afl-tests/id:000328,src:000000,op:arith8,pos:41,val:+35,+cov
diff --git a/src/mint/afl-tests/id:000328,src:000000,op:arith8,pos:43,val:-33,+cov b/src/exchange/afl-tests/id:000328,src:000000,op:arith8,pos:43,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000328,src:000000,op:arith8,pos:43,val:-33,+cov
rename to src/exchange/afl-tests/id:000328,src:000000,op:arith8,pos:43,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000329,src:000000,op:arith8,pos:42,val:-6,+cov b/src/exchange/afl-tests/id:000329,src:000000,op:arith8,pos:42,val:-6,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000329,src:000000,op:arith8,pos:42,val:-6,+cov
rename to src/exchange/afl-tests/id:000329,src:000000,op:arith8,pos:42,val:-6,+cov
diff --git a/src/mint/afl-tests/id:000329,src:000000,op:arith8,pos:44,val:+17,+cov b/src/exchange/afl-tests/id:000329,src:000000,op:arith8,pos:44,val:+17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000329,src:000000,op:arith8,pos:44,val:+17,+cov
rename to src/exchange/afl-tests/id:000329,src:000000,op:arith8,pos:44,val:+17,+cov
diff --git a/src/mint/afl-tests/id:000330,src:000000,op:arith8,pos:42,val:+13,+cov b/src/exchange/afl-tests/id:000330,src:000000,op:arith8,pos:42,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000330,src:000000,op:arith8,pos:42,val:+13,+cov
rename to src/exchange/afl-tests/id:000330,src:000000,op:arith8,pos:42,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000330,src:000000,op:arith8,pos:45,val:-5,+cov b/src/exchange/afl-tests/id:000330,src:000000,op:arith8,pos:45,val:-5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000330,src:000000,op:arith8,pos:45,val:-5,+cov
rename to src/exchange/afl-tests/id:000330,src:000000,op:arith8,pos:45,val:-5,+cov
diff --git a/src/mint/afl-tests/id:000331,src:000000,op:arith8,pos:42,val:+18,+cov b/src/exchange/afl-tests/id:000331,src:000000,op:arith8,pos:42,val:+18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000331,src:000000,op:arith8,pos:42,val:+18,+cov
rename to src/exchange/afl-tests/id:000331,src:000000,op:arith8,pos:42,val:+18,+cov
diff --git a/src/mint/afl-tests/id:000331,src:000000,op:arith8,pos:45,val:-11,+cov b/src/exchange/afl-tests/id:000331,src:000000,op:arith8,pos:45,val:-11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000331,src:000000,op:arith8,pos:45,val:-11,+cov
rename to src/exchange/afl-tests/id:000331,src:000000,op:arith8,pos:45,val:-11,+cov
diff --git a/src/mint/afl-tests/id:000332,src:000000,op:arith8,pos:43,val:-23,+cov b/src/exchange/afl-tests/id:000332,src:000000,op:arith8,pos:43,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000332,src:000000,op:arith8,pos:43,val:-23,+cov
rename to src/exchange/afl-tests/id:000332,src:000000,op:arith8,pos:43,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000332,src:000000,op:arith8,pos:45,val:+19,+cov b/src/exchange/afl-tests/id:000332,src:000000,op:arith8,pos:45,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000332,src:000000,op:arith8,pos:45,val:+19,+cov
rename to src/exchange/afl-tests/id:000332,src:000000,op:arith8,pos:45,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000333,src:000000,op:arith8,pos:43,val:+33,+cov b/src/exchange/afl-tests/id:000333,src:000000,op:arith8,pos:43,val:+33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000333,src:000000,op:arith8,pos:43,val:+33,+cov
rename to src/exchange/afl-tests/id:000333,src:000000,op:arith8,pos:43,val:+33,+cov
diff --git a/src/mint/afl-tests/id:000333,src:000000,op:arith8,pos:51,val:-12,+cov b/src/exchange/afl-tests/id:000333,src:000000,op:arith8,pos:51,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000333,src:000000,op:arith8,pos:51,val:-12,+cov
rename to src/exchange/afl-tests/id:000333,src:000000,op:arith8,pos:51,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000334,src:000000,op:arith8,pos:44,val:+11,+cov b/src/exchange/afl-tests/id:000334,src:000000,op:arith8,pos:44,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000334,src:000000,op:arith8,pos:44,val:+11,+cov
rename to src/exchange/afl-tests/id:000334,src:000000,op:arith8,pos:44,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000334,src:000000,op:arith8,pos:51,val:+14,+cov b/src/exchange/afl-tests/id:000334,src:000000,op:arith8,pos:51,val:+14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000334,src:000000,op:arith8,pos:51,val:+14,+cov
rename to src/exchange/afl-tests/id:000334,src:000000,op:arith8,pos:51,val:+14,+cov
diff --git a/src/mint/afl-tests/id:000335,src:000000,op:arith8,pos:45,val:-24,+cov b/src/exchange/afl-tests/id:000335,src:000000,op:arith8,pos:45,val:-24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000335,src:000000,op:arith8,pos:45,val:-24,+cov
rename to src/exchange/afl-tests/id:000335,src:000000,op:arith8,pos:45,val:-24,+cov
diff --git a/src/mint/afl-tests/id:000335,src:000000,op:arith8,pos:51,val:-22,+cov b/src/exchange/afl-tests/id:000335,src:000000,op:arith8,pos:51,val:-22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000335,src:000000,op:arith8,pos:51,val:-22,+cov
rename to src/exchange/afl-tests/id:000335,src:000000,op:arith8,pos:51,val:-22,+cov
diff --git a/src/mint/afl-tests/id:000336,src:000000,op:arith8,pos:45,val:-27,+cov b/src/exchange/afl-tests/id:000336,src:000000,op:arith8,pos:45,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000336,src:000000,op:arith8,pos:45,val:-27,+cov
rename to src/exchange/afl-tests/id:000336,src:000000,op:arith8,pos:45,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000336,src:000000,op:arith8,pos:51,val:-23,+cov b/src/exchange/afl-tests/id:000336,src:000000,op:arith8,pos:51,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000336,src:000000,op:arith8,pos:51,val:-23,+cov
rename to src/exchange/afl-tests/id:000336,src:000000,op:arith8,pos:51,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000337,src:000000,op:arith8,pos:46,val:+7,+cov b/src/exchange/afl-tests/id:000337,src:000000,op:arith8,pos:46,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000337,src:000000,op:arith8,pos:46,val:+7,+cov
rename to src/exchange/afl-tests/id:000337,src:000000,op:arith8,pos:46,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000337,src:000000,op:arith8,pos:52,val:-14,+cov b/src/exchange/afl-tests/id:000337,src:000000,op:arith8,pos:52,val:-14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000337,src:000000,op:arith8,pos:52,val:-14,+cov
rename to src/exchange/afl-tests/id:000337,src:000000,op:arith8,pos:52,val:-14,+cov
diff --git a/src/mint/afl-tests/id:000338,src:000000,op:arith8,pos:46,val:-21,+cov b/src/exchange/afl-tests/id:000338,src:000000,op:arith8,pos:46,val:-21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000338,src:000000,op:arith8,pos:46,val:-21,+cov
rename to src/exchange/afl-tests/id:000338,src:000000,op:arith8,pos:46,val:-21,+cov
diff --git a/src/mint/afl-tests/id:000338,src:000000,op:arith8,pos:52,val:+28,+cov b/src/exchange/afl-tests/id:000338,src:000000,op:arith8,pos:52,val:+28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000338,src:000000,op:arith8,pos:52,val:+28,+cov
rename to src/exchange/afl-tests/id:000338,src:000000,op:arith8,pos:52,val:+28,+cov
diff --git a/src/mint/afl-tests/id:000339,src:000000,op:arith8,pos:46,val:+31,+cov b/src/exchange/afl-tests/id:000339,src:000000,op:arith8,pos:46,val:+31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000339,src:000000,op:arith8,pos:46,val:+31,+cov
rename to src/exchange/afl-tests/id:000339,src:000000,op:arith8,pos:46,val:+31,+cov
diff --git a/src/mint/afl-tests/id:000339,src:000000,op:arith8,pos:53,val:+9,+cov b/src/exchange/afl-tests/id:000339,src:000000,op:arith8,pos:53,val:+9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000339,src:000000,op:arith8,pos:53,val:+9,+cov
rename to src/exchange/afl-tests/id:000339,src:000000,op:arith8,pos:53,val:+9,+cov
diff --git a/src/mint/afl-tests/id:000340,src:000000,op:arith8,pos:49,val:+16,+cov b/src/exchange/afl-tests/id:000340,src:000000,op:arith8,pos:49,val:+16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000340,src:000000,op:arith8,pos:49,val:+16,+cov
rename to src/exchange/afl-tests/id:000340,src:000000,op:arith8,pos:49,val:+16,+cov
diff --git a/src/mint/afl-tests/id:000340,src:000000,op:arith8,pos:53,val:-11,+cov b/src/exchange/afl-tests/id:000340,src:000000,op:arith8,pos:53,val:-11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000340,src:000000,op:arith8,pos:53,val:-11,+cov
rename to src/exchange/afl-tests/id:000340,src:000000,op:arith8,pos:53,val:-11,+cov
diff --git a/src/mint/afl-tests/id:000341,src:000000,op:arith8,pos:49,val:-26,+cov b/src/exchange/afl-tests/id:000341,src:000000,op:arith8,pos:49,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000341,src:000000,op:arith8,pos:49,val:-26,+cov
rename to src/exchange/afl-tests/id:000341,src:000000,op:arith8,pos:49,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000341,src:000000,op:arith8,pos:53,val:-17,+cov b/src/exchange/afl-tests/id:000341,src:000000,op:arith8,pos:53,val:-17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000341,src:000000,op:arith8,pos:53,val:-17,+cov
rename to src/exchange/afl-tests/id:000341,src:000000,op:arith8,pos:53,val:-17,+cov
diff --git a/src/mint/afl-tests/id:000342,src:000000,op:arith8,pos:49,val:+34,+cov b/src/exchange/afl-tests/id:000342,src:000000,op:arith8,pos:49,val:+34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000342,src:000000,op:arith8,pos:49,val:+34,+cov
rename to src/exchange/afl-tests/id:000342,src:000000,op:arith8,pos:49,val:+34,+cov
diff --git a/src/mint/afl-tests/id:000342,src:000000,op:arith8,pos:53,val:-18,+cov b/src/exchange/afl-tests/id:000342,src:000000,op:arith8,pos:53,val:-18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000342,src:000000,op:arith8,pos:53,val:-18,+cov
rename to src/exchange/afl-tests/id:000342,src:000000,op:arith8,pos:53,val:-18,+cov
diff --git a/src/mint/afl-tests/id:000343,src:000000,op:arith8,pos:50,val:-7,+cov b/src/exchange/afl-tests/id:000343,src:000000,op:arith8,pos:50,val:-7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000343,src:000000,op:arith8,pos:50,val:-7,+cov
rename to src/exchange/afl-tests/id:000343,src:000000,op:arith8,pos:50,val:-7,+cov
diff --git a/src/mint/afl-tests/id:000343,src:000000,op:arith8,pos:53,val:-35,+cov b/src/exchange/afl-tests/id:000343,src:000000,op:arith8,pos:53,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000343,src:000000,op:arith8,pos:53,val:-35,+cov
rename to src/exchange/afl-tests/id:000343,src:000000,op:arith8,pos:53,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000344,src:000000,op:arith8,pos:50,val:+22,+cov b/src/exchange/afl-tests/id:000344,src:000000,op:arith8,pos:50,val:+22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000344,src:000000,op:arith8,pos:50,val:+22,+cov
rename to src/exchange/afl-tests/id:000344,src:000000,op:arith8,pos:50,val:+22,+cov
diff --git a/src/mint/afl-tests/id:000344,src:000000,op:arith8,pos:54,val:-15,+cov b/src/exchange/afl-tests/id:000344,src:000000,op:arith8,pos:54,val:-15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000344,src:000000,op:arith8,pos:54,val:-15,+cov
rename to src/exchange/afl-tests/id:000344,src:000000,op:arith8,pos:54,val:-15,+cov
diff --git a/src/mint/afl-tests/id:000345,src:000000,op:arith8,pos:50,val:+24,+cov b/src/exchange/afl-tests/id:000345,src:000000,op:arith8,pos:50,val:+24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000345,src:000000,op:arith8,pos:50,val:+24,+cov
rename to src/exchange/afl-tests/id:000345,src:000000,op:arith8,pos:50,val:+24,+cov
diff --git a/src/mint/afl-tests/id:000345,src:000000,op:arith8,pos:54,val:-22,+cov b/src/exchange/afl-tests/id:000345,src:000000,op:arith8,pos:54,val:-22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000345,src:000000,op:arith8,pos:54,val:-22,+cov
rename to src/exchange/afl-tests/id:000345,src:000000,op:arith8,pos:54,val:-22,+cov
diff --git a/src/mint/afl-tests/id:000346,src:000000,op:arith8,pos:50,val:-31,+cov b/src/exchange/afl-tests/id:000346,src:000000,op:arith8,pos:50,val:-31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000346,src:000000,op:arith8,pos:50,val:-31,+cov
rename to src/exchange/afl-tests/id:000346,src:000000,op:arith8,pos:50,val:-31,+cov
diff --git a/src/mint/afl-tests/id:000346,src:000000,op:arith8,pos:55,val:-7 b/src/exchange/afl-tests/id:000346,src:000000,op:arith8,pos:55,val:-7
similarity index 100%
rename from src/mint/afl-tests/id:000346,src:000000,op:arith8,pos:55,val:-7
rename to src/exchange/afl-tests/id:000346,src:000000,op:arith8,pos:55,val:-7
diff --git a/src/mint/afl-tests/id:000347,src:000000,op:arith8,pos:51,val:-1,+cov b/src/exchange/afl-tests/id:000347,src:000000,op:arith8,pos:51,val:-1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000347,src:000000,op:arith8,pos:51,val:-1,+cov
rename to src/exchange/afl-tests/id:000347,src:000000,op:arith8,pos:51,val:-1,+cov
diff --git a/src/mint/afl-tests/id:000347,src:000000,op:arith8,pos:55,val:-33,+cov b/src/exchange/afl-tests/id:000347,src:000000,op:arith8,pos:55,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000347,src:000000,op:arith8,pos:55,val:-33,+cov
rename to src/exchange/afl-tests/id:000347,src:000000,op:arith8,pos:55,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000348,src:000000,op:arith8,pos:51,val:+18,+cov b/src/exchange/afl-tests/id:000348,src:000000,op:arith8,pos:51,val:+18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000348,src:000000,op:arith8,pos:51,val:+18,+cov
rename to src/exchange/afl-tests/id:000348,src:000000,op:arith8,pos:51,val:+18,+cov
diff --git a/src/mint/afl-tests/id:000348,src:000000,op:arith8,pos:55,val:-35,+cov b/src/exchange/afl-tests/id:000348,src:000000,op:arith8,pos:55,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000348,src:000000,op:arith8,pos:55,val:-35,+cov
rename to src/exchange/afl-tests/id:000348,src:000000,op:arith8,pos:55,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000349,src:000000,op:arith8,pos:52,val:-6,+cov b/src/exchange/afl-tests/id:000349,src:000000,op:arith8,pos:52,val:-6,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000349,src:000000,op:arith8,pos:52,val:-6,+cov
rename to src/exchange/afl-tests/id:000349,src:000000,op:arith8,pos:52,val:-6,+cov
diff --git a/src/mint/afl-tests/id:000349,src:000000,op:arith8,pos:57,val:-14,+cov b/src/exchange/afl-tests/id:000349,src:000000,op:arith8,pos:57,val:-14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000349,src:000000,op:arith8,pos:57,val:-14,+cov
rename to src/exchange/afl-tests/id:000349,src:000000,op:arith8,pos:57,val:-14,+cov
diff --git a/src/mint/afl-tests/id:000350,src:000000,op:arith8,pos:52,val:+22,+cov b/src/exchange/afl-tests/id:000350,src:000000,op:arith8,pos:52,val:+22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000350,src:000000,op:arith8,pos:52,val:+22,+cov
rename to src/exchange/afl-tests/id:000350,src:000000,op:arith8,pos:52,val:+22,+cov
diff --git a/src/mint/afl-tests/id:000350,src:000000,op:arith8,pos:57,val:+28,+cov b/src/exchange/afl-tests/id:000350,src:000000,op:arith8,pos:57,val:+28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000350,src:000000,op:arith8,pos:57,val:+28,+cov
rename to src/exchange/afl-tests/id:000350,src:000000,op:arith8,pos:57,val:+28,+cov
diff --git a/src/mint/afl-tests/id:000351,src:000000,op:arith8,pos:52,val:-31,+cov b/src/exchange/afl-tests/id:000351,src:000000,op:arith8,pos:52,val:-31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000351,src:000000,op:arith8,pos:52,val:-31,+cov
rename to src/exchange/afl-tests/id:000351,src:000000,op:arith8,pos:52,val:-31,+cov
diff --git a/src/mint/afl-tests/id:000351,src:000000,op:arith8,pos:57,val:-29,+cov b/src/exchange/afl-tests/id:000351,src:000000,op:arith8,pos:57,val:-29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000351,src:000000,op:arith8,pos:57,val:-29,+cov
rename to src/exchange/afl-tests/id:000351,src:000000,op:arith8,pos:57,val:-29,+cov
diff --git a/src/mint/afl-tests/id:000352,src:000000,op:arith8,pos:53,val:-18,+cov b/src/exchange/afl-tests/id:000352,src:000000,op:arith8,pos:53,val:-18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000352,src:000000,op:arith8,pos:53,val:-18,+cov
rename to src/exchange/afl-tests/id:000352,src:000000,op:arith8,pos:53,val:-18,+cov
diff --git a/src/mint/afl-tests/id:000352,src:000000,op:arith8,pos:58,val:-29,+cov b/src/exchange/afl-tests/id:000352,src:000000,op:arith8,pos:58,val:-29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000352,src:000000,op:arith8,pos:58,val:-29,+cov
rename to src/exchange/afl-tests/id:000352,src:000000,op:arith8,pos:58,val:-29,+cov
diff --git a/src/mint/afl-tests/id:000353,src:000000,op:arith8,pos:53,val:+27,+cov b/src/exchange/afl-tests/id:000353,src:000000,op:arith8,pos:53,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000353,src:000000,op:arith8,pos:53,val:+27,+cov
rename to src/exchange/afl-tests/id:000353,src:000000,op:arith8,pos:53,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000353,src:000000,op:arith8,pos:59,val:+10,+cov b/src/exchange/afl-tests/id:000353,src:000000,op:arith8,pos:59,val:+10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000353,src:000000,op:arith8,pos:59,val:+10,+cov
rename to src/exchange/afl-tests/id:000353,src:000000,op:arith8,pos:59,val:+10,+cov
diff --git a/src/mint/afl-tests/id:000354,src:000000,op:arith8,pos:53,val:-27,+cov b/src/exchange/afl-tests/id:000354,src:000000,op:arith8,pos:53,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000354,src:000000,op:arith8,pos:53,val:-27,+cov
rename to src/exchange/afl-tests/id:000354,src:000000,op:arith8,pos:53,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000354,src:000000,op:arith8,pos:59,val:+23,+cov b/src/exchange/afl-tests/id:000354,src:000000,op:arith8,pos:59,val:+23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000354,src:000000,op:arith8,pos:59,val:+23,+cov
rename to src/exchange/afl-tests/id:000354,src:000000,op:arith8,pos:59,val:+23,+cov
diff --git a/src/mint/afl-tests/id:000355,src:000000,op:arith8,pos:53,val:-28,+cov b/src/exchange/afl-tests/id:000355,src:000000,op:arith8,pos:53,val:-28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000355,src:000000,op:arith8,pos:53,val:-28,+cov
rename to src/exchange/afl-tests/id:000355,src:000000,op:arith8,pos:53,val:-28,+cov
diff --git a/src/mint/afl-tests/id:000355,src:000000,op:arith8,pos:62,val:+9,+cov b/src/exchange/afl-tests/id:000355,src:000000,op:arith8,pos:62,val:+9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000355,src:000000,op:arith8,pos:62,val:+9,+cov
rename to src/exchange/afl-tests/id:000355,src:000000,op:arith8,pos:62,val:+9,+cov
diff --git a/src/mint/afl-tests/id:000356,src:000000,op:arith8,pos:55,val:-2,+cov b/src/exchange/afl-tests/id:000356,src:000000,op:arith8,pos:55,val:-2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000356,src:000000,op:arith8,pos:55,val:-2,+cov
rename to src/exchange/afl-tests/id:000356,src:000000,op:arith8,pos:55,val:-2,+cov
diff --git a/src/mint/afl-tests/id:000356,src:000000,op:arith8,pos:62,val:-21,+cov b/src/exchange/afl-tests/id:000356,src:000000,op:arith8,pos:62,val:-21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000356,src:000000,op:arith8,pos:62,val:-21,+cov
rename to src/exchange/afl-tests/id:000356,src:000000,op:arith8,pos:62,val:-21,+cov
diff --git a/src/mint/afl-tests/id:000357,src:000000,op:arith8,pos:55,val:-7 b/src/exchange/afl-tests/id:000357,src:000000,op:arith8,pos:55,val:-7
similarity index 100%
rename from src/mint/afl-tests/id:000357,src:000000,op:arith8,pos:55,val:-7
rename to src/exchange/afl-tests/id:000357,src:000000,op:arith8,pos:55,val:-7
diff --git a/src/mint/afl-tests/id:000357,src:000000,op:arith8,pos:62,val:-23,+cov b/src/exchange/afl-tests/id:000357,src:000000,op:arith8,pos:62,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000357,src:000000,op:arith8,pos:62,val:-23,+cov
rename to src/exchange/afl-tests/id:000357,src:000000,op:arith8,pos:62,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000358,src:000000,op:arith8,pos:55,val:-33,+cov b/src/exchange/afl-tests/id:000358,src:000000,op:arith8,pos:55,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000358,src:000000,op:arith8,pos:55,val:-33,+cov
rename to src/exchange/afl-tests/id:000358,src:000000,op:arith8,pos:55,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000358,src:000000,op:arith8,pos:62,val:-35,+cov b/src/exchange/afl-tests/id:000358,src:000000,op:arith8,pos:62,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000358,src:000000,op:arith8,pos:62,val:-35,+cov
rename to src/exchange/afl-tests/id:000358,src:000000,op:arith8,pos:62,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000359,src:000000,op:arith8,pos:56,val:-17,+cov b/src/exchange/afl-tests/id:000359,src:000000,op:arith8,pos:56,val:-17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000359,src:000000,op:arith8,pos:56,val:-17,+cov
rename to src/exchange/afl-tests/id:000359,src:000000,op:arith8,pos:56,val:-17,+cov
diff --git a/src/mint/afl-tests/id:000359,src:000000,op:arith8,pos:63,val:+3,+cov b/src/exchange/afl-tests/id:000359,src:000000,op:arith8,pos:63,val:+3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000359,src:000000,op:arith8,pos:63,val:+3,+cov
rename to src/exchange/afl-tests/id:000359,src:000000,op:arith8,pos:63,val:+3,+cov
diff --git a/src/mint/afl-tests/id:000360,src:000000,op:arith8,pos:56,val:+34,+cov b/src/exchange/afl-tests/id:000360,src:000000,op:arith8,pos:56,val:+34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000360,src:000000,op:arith8,pos:56,val:+34,+cov
rename to src/exchange/afl-tests/id:000360,src:000000,op:arith8,pos:56,val:+34,+cov
diff --git a/src/mint/afl-tests/id:000360,src:000000,op:arith8,pos:64,val:-5,+cov b/src/exchange/afl-tests/id:000360,src:000000,op:arith8,pos:64,val:-5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000360,src:000000,op:arith8,pos:64,val:-5,+cov
rename to src/exchange/afl-tests/id:000360,src:000000,op:arith8,pos:64,val:-5,+cov
diff --git a/src/mint/afl-tests/id:000361,src:000000,op:arith8,pos:57,val:-23,+cov b/src/exchange/afl-tests/id:000361,src:000000,op:arith8,pos:57,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000361,src:000000,op:arith8,pos:57,val:-23,+cov
rename to src/exchange/afl-tests/id:000361,src:000000,op:arith8,pos:57,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000361,src:000000,op:arith8,pos:64,val:-26,+cov b/src/exchange/afl-tests/id:000361,src:000000,op:arith8,pos:64,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000361,src:000000,op:arith8,pos:64,val:-26,+cov
rename to src/exchange/afl-tests/id:000361,src:000000,op:arith8,pos:64,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000362,src:000000,op:arith8,pos:58,val:+34,+cov b/src/exchange/afl-tests/id:000362,src:000000,op:arith8,pos:58,val:+34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000362,src:000000,op:arith8,pos:58,val:+34,+cov
rename to src/exchange/afl-tests/id:000362,src:000000,op:arith8,pos:58,val:+34,+cov
diff --git a/src/mint/afl-tests/id:000362,src:000000,op:arith8,pos:65,val:-10,+cov b/src/exchange/afl-tests/id:000362,src:000000,op:arith8,pos:65,val:-10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000362,src:000000,op:arith8,pos:65,val:-10,+cov
rename to src/exchange/afl-tests/id:000362,src:000000,op:arith8,pos:65,val:-10,+cov
diff --git a/src/mint/afl-tests/id:000363,src:000000,op:arith8,pos:60,val:-14,+cov b/src/exchange/afl-tests/id:000363,src:000000,op:arith8,pos:60,val:-14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000363,src:000000,op:arith8,pos:60,val:-14,+cov
rename to src/exchange/afl-tests/id:000363,src:000000,op:arith8,pos:60,val:-14,+cov
diff --git a/src/mint/afl-tests/id:000363,src:000000,op:arith8,pos:65,val:-27,+cov b/src/exchange/afl-tests/id:000363,src:000000,op:arith8,pos:65,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000363,src:000000,op:arith8,pos:65,val:-27,+cov
rename to src/exchange/afl-tests/id:000363,src:000000,op:arith8,pos:65,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000364,src:000000,op:arith8,pos:60,val:-15,+cov b/src/exchange/afl-tests/id:000364,src:000000,op:arith8,pos:60,val:-15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000364,src:000000,op:arith8,pos:60,val:-15,+cov
rename to src/exchange/afl-tests/id:000364,src:000000,op:arith8,pos:60,val:-15,+cov
diff --git a/src/mint/afl-tests/id:000364,src:000000,op:arith8,pos:65,val:-30,+cov b/src/exchange/afl-tests/id:000364,src:000000,op:arith8,pos:65,val:-30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000364,src:000000,op:arith8,pos:65,val:-30,+cov
rename to src/exchange/afl-tests/id:000364,src:000000,op:arith8,pos:65,val:-30,+cov
diff --git a/src/mint/afl-tests/id:000365,src:000000,op:arith8,pos:60,val:-27,+cov b/src/exchange/afl-tests/id:000365,src:000000,op:arith8,pos:60,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000365,src:000000,op:arith8,pos:60,val:-27,+cov
rename to src/exchange/afl-tests/id:000365,src:000000,op:arith8,pos:60,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000365,src:000000,op:arith8,pos:66,val:+13,+cov b/src/exchange/afl-tests/id:000365,src:000000,op:arith8,pos:66,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000365,src:000000,op:arith8,pos:66,val:+13,+cov
rename to src/exchange/afl-tests/id:000365,src:000000,op:arith8,pos:66,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000366,src:000000,op:arith8,pos:62,val:+13,+cov b/src/exchange/afl-tests/id:000366,src:000000,op:arith8,pos:62,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000366,src:000000,op:arith8,pos:62,val:+13,+cov
rename to src/exchange/afl-tests/id:000366,src:000000,op:arith8,pos:62,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000366,src:000000,op:arith8,pos:67,val:-9 b/src/exchange/afl-tests/id:000366,src:000000,op:arith8,pos:67,val:-9
similarity index 100%
rename from src/mint/afl-tests/id:000366,src:000000,op:arith8,pos:67,val:-9
rename to src/exchange/afl-tests/id:000366,src:000000,op:arith8,pos:67,val:-9
diff --git a/src/mint/afl-tests/id:000367,src:000000,op:arith8,pos:62,val:-21,+cov b/src/exchange/afl-tests/id:000367,src:000000,op:arith8,pos:62,val:-21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000367,src:000000,op:arith8,pos:62,val:-21,+cov
rename to src/exchange/afl-tests/id:000367,src:000000,op:arith8,pos:62,val:-21,+cov
diff --git a/src/mint/afl-tests/id:000367,src:000000,op:arith8,pos:67,val:+15,+cov b/src/exchange/afl-tests/id:000367,src:000000,op:arith8,pos:67,val:+15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000367,src:000000,op:arith8,pos:67,val:+15,+cov
rename to src/exchange/afl-tests/id:000367,src:000000,op:arith8,pos:67,val:+15,+cov
diff --git a/src/mint/afl-tests/id:000368,src:000000,op:arith8,pos:62,val:-23,+cov b/src/exchange/afl-tests/id:000368,src:000000,op:arith8,pos:62,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000368,src:000000,op:arith8,pos:62,val:-23,+cov
rename to src/exchange/afl-tests/id:000368,src:000000,op:arith8,pos:62,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000368,src:000000,op:arith8,pos:67,val:-35 b/src/exchange/afl-tests/id:000368,src:000000,op:arith8,pos:67,val:-35
similarity index 100%
rename from src/mint/afl-tests/id:000368,src:000000,op:arith8,pos:67,val:-35
rename to src/exchange/afl-tests/id:000368,src:000000,op:arith8,pos:67,val:-35
diff --git a/src/mint/afl-tests/id:000369,src:000000,op:arith8,pos:63,val:+6,+cov b/src/exchange/afl-tests/id:000369,src:000000,op:arith8,pos:63,val:+6,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000369,src:000000,op:arith8,pos:63,val:+6,+cov
rename to src/exchange/afl-tests/id:000369,src:000000,op:arith8,pos:63,val:+6,+cov
diff --git a/src/mint/afl-tests/id:000369,src:000000,op:arith8,pos:72,val:+30,+cov b/src/exchange/afl-tests/id:000369,src:000000,op:arith8,pos:72,val:+30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000369,src:000000,op:arith8,pos:72,val:+30,+cov
rename to src/exchange/afl-tests/id:000369,src:000000,op:arith8,pos:72,val:+30,+cov
diff --git a/src/mint/afl-tests/id:000370,src:000000,op:arith8,pos:63,val:-18,+cov b/src/exchange/afl-tests/id:000370,src:000000,op:arith8,pos:63,val:-18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000370,src:000000,op:arith8,pos:63,val:-18,+cov
rename to src/exchange/afl-tests/id:000370,src:000000,op:arith8,pos:63,val:-18,+cov
diff --git a/src/mint/afl-tests/id:000370,src:000000,op:arith8,pos:72,val:-35,+cov b/src/exchange/afl-tests/id:000370,src:000000,op:arith8,pos:72,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000370,src:000000,op:arith8,pos:72,val:-35,+cov
rename to src/exchange/afl-tests/id:000370,src:000000,op:arith8,pos:72,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000371,src:000000,op:arith8,pos:63,val:-28,+cov b/src/exchange/afl-tests/id:000371,src:000000,op:arith8,pos:63,val:-28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000371,src:000000,op:arith8,pos:63,val:-28,+cov
rename to src/exchange/afl-tests/id:000371,src:000000,op:arith8,pos:63,val:-28,+cov
diff --git a/src/mint/afl-tests/id:000371,src:000000,op:arith8,pos:74,val:+5,+cov b/src/exchange/afl-tests/id:000371,src:000000,op:arith8,pos:74,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000371,src:000000,op:arith8,pos:74,val:+5,+cov
rename to src/exchange/afl-tests/id:000371,src:000000,op:arith8,pos:74,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000372,src:000000,op:arith8,pos:64,val:-5,+cov b/src/exchange/afl-tests/id:000372,src:000000,op:arith8,pos:64,val:-5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000372,src:000000,op:arith8,pos:64,val:-5,+cov
rename to src/exchange/afl-tests/id:000372,src:000000,op:arith8,pos:64,val:-5,+cov
diff --git a/src/mint/afl-tests/id:000372,src:000000,op:arith8,pos:75,val:-23,+cov b/src/exchange/afl-tests/id:000372,src:000000,op:arith8,pos:75,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000372,src:000000,op:arith8,pos:75,val:-23,+cov
rename to src/exchange/afl-tests/id:000372,src:000000,op:arith8,pos:75,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000373,src:000000,op:arith8,pos:64,val:-13,+cov b/src/exchange/afl-tests/id:000373,src:000000,op:arith8,pos:64,val:-13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000373,src:000000,op:arith8,pos:64,val:-13,+cov
rename to src/exchange/afl-tests/id:000373,src:000000,op:arith8,pos:64,val:-13,+cov
diff --git a/src/mint/afl-tests/id:000373,src:000000,op:arith8,pos:75,val:+28,+cov b/src/exchange/afl-tests/id:000373,src:000000,op:arith8,pos:75,val:+28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000373,src:000000,op:arith8,pos:75,val:+28,+cov
rename to src/exchange/afl-tests/id:000373,src:000000,op:arith8,pos:75,val:+28,+cov
diff --git a/src/mint/afl-tests/id:000374,src:000000,op:arith8,pos:64,val:-18,+cov b/src/exchange/afl-tests/id:000374,src:000000,op:arith8,pos:64,val:-18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000374,src:000000,op:arith8,pos:64,val:-18,+cov
rename to src/exchange/afl-tests/id:000374,src:000000,op:arith8,pos:64,val:-18,+cov
diff --git a/src/mint/afl-tests/id:000374,src:000000,op:arith8,pos:76,val:-5,+cov b/src/exchange/afl-tests/id:000374,src:000000,op:arith8,pos:76,val:-5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000374,src:000000,op:arith8,pos:76,val:-5,+cov
rename to src/exchange/afl-tests/id:000374,src:000000,op:arith8,pos:76,val:-5,+cov
diff --git a/src/mint/afl-tests/id:000375,src:000000,op:arith8,pos:64,val:-35,+cov b/src/exchange/afl-tests/id:000375,src:000000,op:arith8,pos:64,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000375,src:000000,op:arith8,pos:64,val:-35,+cov
rename to src/exchange/afl-tests/id:000375,src:000000,op:arith8,pos:64,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000375,src:000000,op:arith8,pos:76,val:-20,+cov b/src/exchange/afl-tests/id:000375,src:000000,op:arith8,pos:76,val:-20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000375,src:000000,op:arith8,pos:76,val:-20,+cov
rename to src/exchange/afl-tests/id:000375,src:000000,op:arith8,pos:76,val:-20,+cov
diff --git a/src/mint/afl-tests/id:000376,src:000000,op:arith8,pos:65,val:-27,+cov b/src/exchange/afl-tests/id:000376,src:000000,op:arith8,pos:65,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000376,src:000000,op:arith8,pos:65,val:-27,+cov
rename to src/exchange/afl-tests/id:000376,src:000000,op:arith8,pos:65,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000376,src:000000,op:arith8,pos:77,val:-5,+cov b/src/exchange/afl-tests/id:000376,src:000000,op:arith8,pos:77,val:-5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000376,src:000000,op:arith8,pos:77,val:-5,+cov
rename to src/exchange/afl-tests/id:000376,src:000000,op:arith8,pos:77,val:-5,+cov
diff --git a/src/mint/afl-tests/id:000377,src:000000,op:arith8,pos:65,val:+29,+cov b/src/exchange/afl-tests/id:000377,src:000000,op:arith8,pos:65,val:+29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000377,src:000000,op:arith8,pos:65,val:+29,+cov
rename to src/exchange/afl-tests/id:000377,src:000000,op:arith8,pos:65,val:+29,+cov
diff --git a/src/mint/afl-tests/id:000377,src:000000,op:arith8,pos:77,val:+25,+cov b/src/exchange/afl-tests/id:000377,src:000000,op:arith8,pos:77,val:+25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000377,src:000000,op:arith8,pos:77,val:+25,+cov
rename to src/exchange/afl-tests/id:000377,src:000000,op:arith8,pos:77,val:+25,+cov
diff --git a/src/mint/afl-tests/id:000378,src:000000,op:arith8,pos:66,val:-20,+cov b/src/exchange/afl-tests/id:000378,src:000000,op:arith8,pos:66,val:-20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000378,src:000000,op:arith8,pos:66,val:-20,+cov
rename to src/exchange/afl-tests/id:000378,src:000000,op:arith8,pos:66,val:-20,+cov
diff --git a/src/mint/afl-tests/id:000378,src:000000,op:arith8,pos:80,val:+20,+cov b/src/exchange/afl-tests/id:000378,src:000000,op:arith8,pos:80,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000378,src:000000,op:arith8,pos:80,val:+20,+cov
rename to src/exchange/afl-tests/id:000378,src:000000,op:arith8,pos:80,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000379,src:000000,op:arith8,pos:66,val:+28,+cov b/src/exchange/afl-tests/id:000379,src:000000,op:arith8,pos:66,val:+28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000379,src:000000,op:arith8,pos:66,val:+28,+cov
rename to src/exchange/afl-tests/id:000379,src:000000,op:arith8,pos:66,val:+28,+cov
diff --git a/src/mint/afl-tests/id:000379,src:000000,op:arith8,pos:81,val:+20,+cov b/src/exchange/afl-tests/id:000379,src:000000,op:arith8,pos:81,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000379,src:000000,op:arith8,pos:81,val:+20,+cov
rename to src/exchange/afl-tests/id:000379,src:000000,op:arith8,pos:81,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000380,src:000000,op:arith8,pos:66,val:-31,+cov b/src/exchange/afl-tests/id:000380,src:000000,op:arith8,pos:66,val:-31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000380,src:000000,op:arith8,pos:66,val:-31,+cov
rename to src/exchange/afl-tests/id:000380,src:000000,op:arith8,pos:66,val:-31,+cov
diff --git a/src/mint/afl-tests/id:000380,src:000000,op:arith8,pos:82,val:-5,+cov b/src/exchange/afl-tests/id:000380,src:000000,op:arith8,pos:82,val:-5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000380,src:000000,op:arith8,pos:82,val:-5,+cov
rename to src/exchange/afl-tests/id:000380,src:000000,op:arith8,pos:82,val:-5,+cov
diff --git a/src/mint/afl-tests/id:000381,src:000000,op:arith8,pos:67,val:-9 b/src/exchange/afl-tests/id:000381,src:000000,op:arith8,pos:67,val:-9
similarity index 100%
rename from src/mint/afl-tests/id:000381,src:000000,op:arith8,pos:67,val:-9
rename to src/exchange/afl-tests/id:000381,src:000000,op:arith8,pos:67,val:-9
diff --git a/src/mint/afl-tests/id:000381,src:000000,op:arith8,pos:83,val:-18,+cov b/src/exchange/afl-tests/id:000381,src:000000,op:arith8,pos:83,val:-18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000381,src:000000,op:arith8,pos:83,val:-18,+cov
rename to src/exchange/afl-tests/id:000381,src:000000,op:arith8,pos:83,val:-18,+cov
diff --git a/src/mint/afl-tests/id:000382,src:000000,op:arith8,pos:67,val:+10,+cov b/src/exchange/afl-tests/id:000382,src:000000,op:arith8,pos:67,val:+10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000382,src:000000,op:arith8,pos:67,val:+10,+cov
rename to src/exchange/afl-tests/id:000382,src:000000,op:arith8,pos:67,val:+10,+cov
diff --git a/src/mint/afl-tests/id:000382,src:000000,op:arith8,pos:84,val:+10,+cov b/src/exchange/afl-tests/id:000382,src:000000,op:arith8,pos:84,val:+10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000382,src:000000,op:arith8,pos:84,val:+10,+cov
rename to src/exchange/afl-tests/id:000382,src:000000,op:arith8,pos:84,val:+10,+cov
diff --git a/src/mint/afl-tests/id:000383,src:000000,op:arith8,pos:67,val:-15,+cov b/src/exchange/afl-tests/id:000383,src:000000,op:arith8,pos:67,val:-15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000383,src:000000,op:arith8,pos:67,val:-15,+cov
rename to src/exchange/afl-tests/id:000383,src:000000,op:arith8,pos:67,val:-15,+cov
diff --git a/src/mint/afl-tests/id:000383,src:000000,op:arith8,pos:84,val:-30,+cov b/src/exchange/afl-tests/id:000383,src:000000,op:arith8,pos:84,val:-30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000383,src:000000,op:arith8,pos:84,val:-30,+cov
rename to src/exchange/afl-tests/id:000383,src:000000,op:arith8,pos:84,val:-30,+cov
diff --git a/src/mint/afl-tests/id:000384,src:000000,op:arith8,pos:67,val:-35 b/src/exchange/afl-tests/id:000384,src:000000,op:arith8,pos:67,val:-35
similarity index 100%
rename from src/mint/afl-tests/id:000384,src:000000,op:arith8,pos:67,val:-35
rename to src/exchange/afl-tests/id:000384,src:000000,op:arith8,pos:67,val:-35
diff --git a/src/mint/afl-tests/id:000384,src:000000,op:arith8,pos:84,val:+34,+cov b/src/exchange/afl-tests/id:000384,src:000000,op:arith8,pos:84,val:+34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000384,src:000000,op:arith8,pos:84,val:+34,+cov
rename to src/exchange/afl-tests/id:000384,src:000000,op:arith8,pos:84,val:+34,+cov
diff --git a/src/mint/afl-tests/id:000385,src:000000,op:arith8,pos:68,val:+32,+cov b/src/exchange/afl-tests/id:000385,src:000000,op:arith8,pos:68,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000385,src:000000,op:arith8,pos:68,val:+32,+cov
rename to src/exchange/afl-tests/id:000385,src:000000,op:arith8,pos:68,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000385,src:000000,op:arith8,pos:86,val:-9,+cov b/src/exchange/afl-tests/id:000385,src:000000,op:arith8,pos:86,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000385,src:000000,op:arith8,pos:86,val:-9,+cov
rename to src/exchange/afl-tests/id:000385,src:000000,op:arith8,pos:86,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000386,src:000000,op:arith8,pos:69,val:+14,+cov b/src/exchange/afl-tests/id:000386,src:000000,op:arith8,pos:69,val:+14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000386,src:000000,op:arith8,pos:69,val:+14,+cov
rename to src/exchange/afl-tests/id:000386,src:000000,op:arith8,pos:69,val:+14,+cov
diff --git a/src/mint/afl-tests/id:000386,src:000000,op:arith8,pos:86,val:-19,+cov b/src/exchange/afl-tests/id:000386,src:000000,op:arith8,pos:86,val:-19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000386,src:000000,op:arith8,pos:86,val:-19,+cov
rename to src/exchange/afl-tests/id:000386,src:000000,op:arith8,pos:86,val:-19,+cov
diff --git a/src/mint/afl-tests/id:000387,src:000000,op:arith8,pos:70,val:-21,+cov b/src/exchange/afl-tests/id:000387,src:000000,op:arith8,pos:70,val:-21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000387,src:000000,op:arith8,pos:70,val:-21,+cov
rename to src/exchange/afl-tests/id:000387,src:000000,op:arith8,pos:70,val:-21,+cov
diff --git a/src/mint/afl-tests/id:000387,src:000000,op:arith8,pos:87,val:+10,+cov b/src/exchange/afl-tests/id:000387,src:000000,op:arith8,pos:87,val:+10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000387,src:000000,op:arith8,pos:87,val:+10,+cov
rename to src/exchange/afl-tests/id:000387,src:000000,op:arith8,pos:87,val:+10,+cov
diff --git a/src/mint/afl-tests/id:000388,src:000000,op:arith8,pos:71,val:+3 b/src/exchange/afl-tests/id:000388,src:000000,op:arith8,pos:71,val:+3
similarity index 100%
rename from src/mint/afl-tests/id:000388,src:000000,op:arith8,pos:71,val:+3
rename to src/exchange/afl-tests/id:000388,src:000000,op:arith8,pos:71,val:+3
diff --git a/src/mint/afl-tests/id:000388,src:000000,op:arith8,pos:87,val:+15,+cov b/src/exchange/afl-tests/id:000388,src:000000,op:arith8,pos:87,val:+15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000388,src:000000,op:arith8,pos:87,val:+15,+cov
rename to src/exchange/afl-tests/id:000388,src:000000,op:arith8,pos:87,val:+15,+cov
diff --git a/src/mint/afl-tests/id:000389,src:000000,op:arith8,pos:72,val:-7,+cov b/src/exchange/afl-tests/id:000389,src:000000,op:arith8,pos:72,val:-7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000389,src:000000,op:arith8,pos:72,val:-7,+cov
rename to src/exchange/afl-tests/id:000389,src:000000,op:arith8,pos:72,val:-7,+cov
diff --git a/src/mint/afl-tests/id:000389,src:000000,op:arith8,pos:87,val:-26,+cov b/src/exchange/afl-tests/id:000389,src:000000,op:arith8,pos:87,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000389,src:000000,op:arith8,pos:87,val:-26,+cov
rename to src/exchange/afl-tests/id:000389,src:000000,op:arith8,pos:87,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000390,src:000000,op:arith8,pos:72,val:+30,+cov b/src/exchange/afl-tests/id:000390,src:000000,op:arith8,pos:72,val:+30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000390,src:000000,op:arith8,pos:72,val:+30,+cov
rename to src/exchange/afl-tests/id:000390,src:000000,op:arith8,pos:72,val:+30,+cov
diff --git a/src/mint/afl-tests/id:000390,src:000000,op:arith8,pos:88,val:+9,+cov b/src/exchange/afl-tests/id:000390,src:000000,op:arith8,pos:88,val:+9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000390,src:000000,op:arith8,pos:88,val:+9,+cov
rename to src/exchange/afl-tests/id:000390,src:000000,op:arith8,pos:88,val:+9,+cov
diff --git a/src/mint/afl-tests/id:000391,src:000000,op:arith8,pos:73,val:-13,+cov b/src/exchange/afl-tests/id:000391,src:000000,op:arith8,pos:73,val:-13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000391,src:000000,op:arith8,pos:73,val:-13,+cov
rename to src/exchange/afl-tests/id:000391,src:000000,op:arith8,pos:73,val:-13,+cov
diff --git a/src/mint/afl-tests/id:000391,src:000000,op:arith8,pos:88,val:+25 b/src/exchange/afl-tests/id:000391,src:000000,op:arith8,pos:88,val:+25
similarity index 100%
rename from src/mint/afl-tests/id:000391,src:000000,op:arith8,pos:88,val:+25
rename to src/exchange/afl-tests/id:000391,src:000000,op:arith8,pos:88,val:+25
diff --git a/src/mint/afl-tests/id:000392,src:000000,op:arith8,pos:73,val:-29,+cov b/src/exchange/afl-tests/id:000392,src:000000,op:arith8,pos:73,val:-29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000392,src:000000,op:arith8,pos:73,val:-29,+cov
rename to src/exchange/afl-tests/id:000392,src:000000,op:arith8,pos:73,val:-29,+cov
diff --git a/src/mint/afl-tests/id:000392,src:000000,op:arith8,pos:88,val:+26,+cov b/src/exchange/afl-tests/id:000392,src:000000,op:arith8,pos:88,val:+26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000392,src:000000,op:arith8,pos:88,val:+26,+cov
rename to src/exchange/afl-tests/id:000392,src:000000,op:arith8,pos:88,val:+26,+cov
diff --git a/src/mint/afl-tests/id:000393,src:000000,op:arith8,pos:73,val:-35,+cov b/src/exchange/afl-tests/id:000393,src:000000,op:arith8,pos:73,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000393,src:000000,op:arith8,pos:73,val:-35,+cov
rename to src/exchange/afl-tests/id:000393,src:000000,op:arith8,pos:73,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000393,src:000000,op:arith8,pos:90,val:-33,+cov b/src/exchange/afl-tests/id:000393,src:000000,op:arith8,pos:90,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000393,src:000000,op:arith8,pos:90,val:-33,+cov
rename to src/exchange/afl-tests/id:000393,src:000000,op:arith8,pos:90,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000394,src:000000,op:arith8,pos:75,val:-20,+cov b/src/exchange/afl-tests/id:000394,src:000000,op:arith8,pos:75,val:-20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000394,src:000000,op:arith8,pos:75,val:-20,+cov
rename to src/exchange/afl-tests/id:000394,src:000000,op:arith8,pos:75,val:-20,+cov
diff --git a/src/mint/afl-tests/id:000394,src:000000,op:arith8,pos:91,val:-14,+cov b/src/exchange/afl-tests/id:000394,src:000000,op:arith8,pos:91,val:-14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000394,src:000000,op:arith8,pos:91,val:-14,+cov
rename to src/exchange/afl-tests/id:000394,src:000000,op:arith8,pos:91,val:-14,+cov
diff --git a/src/mint/afl-tests/id:000395,src:000000,op:arith8,pos:76,val:+21,+cov b/src/exchange/afl-tests/id:000395,src:000000,op:arith8,pos:76,val:+21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000395,src:000000,op:arith8,pos:76,val:+21,+cov
rename to src/exchange/afl-tests/id:000395,src:000000,op:arith8,pos:76,val:+21,+cov
diff --git a/src/mint/afl-tests/id:000395,src:000000,op:arith8,pos:91,val:+24 b/src/exchange/afl-tests/id:000395,src:000000,op:arith8,pos:91,val:+24
similarity index 100%
rename from src/mint/afl-tests/id:000395,src:000000,op:arith8,pos:91,val:+24
rename to src/exchange/afl-tests/id:000395,src:000000,op:arith8,pos:91,val:+24
diff --git a/src/mint/afl-tests/id:000396,src:000000,op:arith8,pos:77,val:+24,+cov b/src/exchange/afl-tests/id:000396,src:000000,op:arith8,pos:77,val:+24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000396,src:000000,op:arith8,pos:77,val:+24,+cov
rename to src/exchange/afl-tests/id:000396,src:000000,op:arith8,pos:77,val:+24,+cov
diff --git a/src/mint/afl-tests/id:000396,src:000000,op:arith8,pos:92,val:+11,+cov b/src/exchange/afl-tests/id:000396,src:000000,op:arith8,pos:92,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000396,src:000000,op:arith8,pos:92,val:+11,+cov
rename to src/exchange/afl-tests/id:000396,src:000000,op:arith8,pos:92,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000397,src:000000,op:arith8,pos:80,val:-11,+cov b/src/exchange/afl-tests/id:000397,src:000000,op:arith8,pos:80,val:-11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000397,src:000000,op:arith8,pos:80,val:-11,+cov
rename to src/exchange/afl-tests/id:000397,src:000000,op:arith8,pos:80,val:-11,+cov
diff --git a/src/mint/afl-tests/id:000397,src:000000,op:arith8,pos:92,val:-23,+cov b/src/exchange/afl-tests/id:000397,src:000000,op:arith8,pos:92,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000397,src:000000,op:arith8,pos:92,val:-23,+cov
rename to src/exchange/afl-tests/id:000397,src:000000,op:arith8,pos:92,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000398,src:000000,op:arith8,pos:80,val:+18,+cov b/src/exchange/afl-tests/id:000398,src:000000,op:arith8,pos:80,val:+18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000398,src:000000,op:arith8,pos:80,val:+18,+cov
rename to src/exchange/afl-tests/id:000398,src:000000,op:arith8,pos:80,val:+18,+cov
diff --git a/src/mint/afl-tests/id:000398,src:000000,op:arith8,pos:93,val:+19,+cov b/src/exchange/afl-tests/id:000398,src:000000,op:arith8,pos:93,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000398,src:000000,op:arith8,pos:93,val:+19,+cov
rename to src/exchange/afl-tests/id:000398,src:000000,op:arith8,pos:93,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000399,src:000000,op:arith8,pos:81,val:+22,+cov b/src/exchange/afl-tests/id:000399,src:000000,op:arith8,pos:81,val:+22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000399,src:000000,op:arith8,pos:81,val:+22,+cov
rename to src/exchange/afl-tests/id:000399,src:000000,op:arith8,pos:81,val:+22,+cov
diff --git a/src/mint/afl-tests/id:000399,src:000000,op:arith8,pos:93,val:-25,+cov b/src/exchange/afl-tests/id:000399,src:000000,op:arith8,pos:93,val:-25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000399,src:000000,op:arith8,pos:93,val:-25,+cov
rename to src/exchange/afl-tests/id:000399,src:000000,op:arith8,pos:93,val:-25,+cov
diff --git a/src/mint/afl-tests/id:000400,src:000000,op:arith8,pos:81,val:-30,+cov b/src/exchange/afl-tests/id:000400,src:000000,op:arith8,pos:81,val:-30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000400,src:000000,op:arith8,pos:81,val:-30,+cov
rename to src/exchange/afl-tests/id:000400,src:000000,op:arith8,pos:81,val:-30,+cov
diff --git a/src/mint/afl-tests/id:000400,src:000000,op:arith8,pos:93,val:+35,+cov b/src/exchange/afl-tests/id:000400,src:000000,op:arith8,pos:93,val:+35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000400,src:000000,op:arith8,pos:93,val:+35,+cov
rename to src/exchange/afl-tests/id:000400,src:000000,op:arith8,pos:93,val:+35,+cov
diff --git a/src/mint/afl-tests/id:000401,src:000000,op:arith8,pos:83,val:-1 b/src/exchange/afl-tests/id:000401,src:000000,op:arith8,pos:83,val:-1
similarity index 100%
rename from src/mint/afl-tests/id:000401,src:000000,op:arith8,pos:83,val:-1
rename to src/exchange/afl-tests/id:000401,src:000000,op:arith8,pos:83,val:-1
diff --git a/src/mint/afl-tests/id:000401,src:000000,op:arith8,pos:96,val:-5,+cov b/src/exchange/afl-tests/id:000401,src:000000,op:arith8,pos:96,val:-5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000401,src:000000,op:arith8,pos:96,val:-5,+cov
rename to src/exchange/afl-tests/id:000401,src:000000,op:arith8,pos:96,val:-5,+cov
diff --git a/src/mint/afl-tests/id:000402,src:000000,op:arith8,pos:83,val:-22,+cov b/src/exchange/afl-tests/id:000402,src:000000,op:arith8,pos:83,val:-22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000402,src:000000,op:arith8,pos:83,val:-22,+cov
rename to src/exchange/afl-tests/id:000402,src:000000,op:arith8,pos:83,val:-22,+cov
diff --git a/src/mint/afl-tests/id:000402,src:000000,op:arith8,pos:96,val:+32,+cov b/src/exchange/afl-tests/id:000402,src:000000,op:arith8,pos:96,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000402,src:000000,op:arith8,pos:96,val:+32,+cov
rename to src/exchange/afl-tests/id:000402,src:000000,op:arith8,pos:96,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000403,src:000000,op:arith8,pos:83,val:+35,+cov b/src/exchange/afl-tests/id:000403,src:000000,op:arith8,pos:83,val:+35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000403,src:000000,op:arith8,pos:83,val:+35,+cov
rename to src/exchange/afl-tests/id:000403,src:000000,op:arith8,pos:83,val:+35,+cov
diff --git a/src/mint/afl-tests/id:000403,src:000000,op:arith8,pos:96,val:-34,+cov b/src/exchange/afl-tests/id:000403,src:000000,op:arith8,pos:96,val:-34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000403,src:000000,op:arith8,pos:96,val:-34,+cov
rename to src/exchange/afl-tests/id:000403,src:000000,op:arith8,pos:96,val:-34,+cov
diff --git a/src/mint/afl-tests/id:000404,src:000000,op:arith8,pos:84,val:+7,+cov b/src/exchange/afl-tests/id:000404,src:000000,op:arith8,pos:84,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000404,src:000000,op:arith8,pos:84,val:+7,+cov
rename to src/exchange/afl-tests/id:000404,src:000000,op:arith8,pos:84,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000404,src:000000,op:arith8,pos:98,val:-34,+cov b/src/exchange/afl-tests/id:000404,src:000000,op:arith8,pos:98,val:-34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000404,src:000000,op:arith8,pos:98,val:-34,+cov
rename to src/exchange/afl-tests/id:000404,src:000000,op:arith8,pos:98,val:-34,+cov
diff --git a/src/mint/afl-tests/id:000405,src:000000,op:arith8,pos:84,val:+31,+cov b/src/exchange/afl-tests/id:000405,src:000000,op:arith8,pos:84,val:+31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000405,src:000000,op:arith8,pos:84,val:+31,+cov
rename to src/exchange/afl-tests/id:000405,src:000000,op:arith8,pos:84,val:+31,+cov
diff --git a/src/mint/afl-tests/id:000405,src:000000,op:arith8,pos:98,val:-35 b/src/exchange/afl-tests/id:000405,src:000000,op:arith8,pos:98,val:-35
similarity index 100%
rename from src/mint/afl-tests/id:000405,src:000000,op:arith8,pos:98,val:-35
rename to src/exchange/afl-tests/id:000405,src:000000,op:arith8,pos:98,val:-35
diff --git a/src/mint/afl-tests/id:000406,src:000000,op:arith8,pos:113,val:-19 b/src/exchange/afl-tests/id:000406,src:000000,op:arith8,pos:113,val:-19
similarity index 100%
rename from src/mint/afl-tests/id:000406,src:000000,op:arith8,pos:113,val:-19
rename to src/exchange/afl-tests/id:000406,src:000000,op:arith8,pos:113,val:-19
diff --git a/src/mint/afl-tests/id:000406,src:000000,op:arith8,pos:86,val:-11,+cov b/src/exchange/afl-tests/id:000406,src:000000,op:arith8,pos:86,val:-11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000406,src:000000,op:arith8,pos:86,val:-11,+cov
rename to src/exchange/afl-tests/id:000406,src:000000,op:arith8,pos:86,val:-11,+cov
diff --git a/src/mint/afl-tests/id:000407,src:000000,op:arith8,pos:113,val:-22 b/src/exchange/afl-tests/id:000407,src:000000,op:arith8,pos:113,val:-22
similarity index 100%
rename from src/mint/afl-tests/id:000407,src:000000,op:arith8,pos:113,val:-22
rename to src/exchange/afl-tests/id:000407,src:000000,op:arith8,pos:113,val:-22
diff --git a/src/mint/afl-tests/id:000407,src:000000,op:arith8,pos:86,val:+22,+cov b/src/exchange/afl-tests/id:000407,src:000000,op:arith8,pos:86,val:+22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000407,src:000000,op:arith8,pos:86,val:+22,+cov
rename to src/exchange/afl-tests/id:000407,src:000000,op:arith8,pos:86,val:+22,+cov
diff --git a/src/mint/afl-tests/id:000408,src:000000,op:arith8,pos:121,val:-13,+cov b/src/exchange/afl-tests/id:000408,src:000000,op:arith8,pos:121,val:-13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000408,src:000000,op:arith8,pos:121,val:-13,+cov
rename to src/exchange/afl-tests/id:000408,src:000000,op:arith8,pos:121,val:-13,+cov
diff --git a/src/mint/afl-tests/id:000408,src:000000,op:arith8,pos:86,val:-24 b/src/exchange/afl-tests/id:000408,src:000000,op:arith8,pos:86,val:-24
similarity index 100%
rename from src/mint/afl-tests/id:000408,src:000000,op:arith8,pos:86,val:-24
rename to src/exchange/afl-tests/id:000408,src:000000,op:arith8,pos:86,val:-24
diff --git a/src/mint/afl-tests/id:000409,src:000000,op:arith8,pos:135,val:+23,+cov b/src/exchange/afl-tests/id:000409,src:000000,op:arith8,pos:135,val:+23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000409,src:000000,op:arith8,pos:135,val:+23,+cov
rename to src/exchange/afl-tests/id:000409,src:000000,op:arith8,pos:135,val:+23,+cov
diff --git a/src/mint/afl-tests/id:000409,src:000000,op:arith8,pos:87,val:-2,+cov b/src/exchange/afl-tests/id:000409,src:000000,op:arith8,pos:87,val:-2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000409,src:000000,op:arith8,pos:87,val:-2,+cov
rename to src/exchange/afl-tests/id:000409,src:000000,op:arith8,pos:87,val:-2,+cov
diff --git a/src/mint/afl-tests/id:000410,src:000000,op:arith8,pos:136,val:-9,+cov b/src/exchange/afl-tests/id:000410,src:000000,op:arith8,pos:136,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000410,src:000000,op:arith8,pos:136,val:-9,+cov
rename to src/exchange/afl-tests/id:000410,src:000000,op:arith8,pos:136,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000410,src:000000,op:arith8,pos:87,val:+9,+cov b/src/exchange/afl-tests/id:000410,src:000000,op:arith8,pos:87,val:+9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000410,src:000000,op:arith8,pos:87,val:+9,+cov
rename to src/exchange/afl-tests/id:000410,src:000000,op:arith8,pos:87,val:+9,+cov
diff --git a/src/mint/afl-tests/id:000411,src:000000,op:arith8,pos:136,val:-21,+cov b/src/exchange/afl-tests/id:000411,src:000000,op:arith8,pos:136,val:-21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000411,src:000000,op:arith8,pos:136,val:-21,+cov
rename to src/exchange/afl-tests/id:000411,src:000000,op:arith8,pos:136,val:-21,+cov
diff --git a/src/mint/afl-tests/id:000411,src:000000,op:arith8,pos:87,val:-15,+cov b/src/exchange/afl-tests/id:000411,src:000000,op:arith8,pos:87,val:-15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000411,src:000000,op:arith8,pos:87,val:-15,+cov
rename to src/exchange/afl-tests/id:000411,src:000000,op:arith8,pos:87,val:-15,+cov
diff --git a/src/mint/afl-tests/id:000412,src:000000,op:arith8,pos:137,val:+8,+cov b/src/exchange/afl-tests/id:000412,src:000000,op:arith8,pos:137,val:+8,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000412,src:000000,op:arith8,pos:137,val:+8,+cov
rename to src/exchange/afl-tests/id:000412,src:000000,op:arith8,pos:137,val:+8,+cov
diff --git a/src/mint/afl-tests/id:000412,src:000000,op:arith8,pos:87,val:-24,+cov b/src/exchange/afl-tests/id:000412,src:000000,op:arith8,pos:87,val:-24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000412,src:000000,op:arith8,pos:87,val:-24,+cov
rename to src/exchange/afl-tests/id:000412,src:000000,op:arith8,pos:87,val:-24,+cov
diff --git a/src/mint/afl-tests/id:000413,src:000000,op:arith8,pos:137,val:-11 b/src/exchange/afl-tests/id:000413,src:000000,op:arith8,pos:137,val:-11
similarity index 100%
rename from src/mint/afl-tests/id:000413,src:000000,op:arith8,pos:137,val:-11
rename to src/exchange/afl-tests/id:000413,src:000000,op:arith8,pos:137,val:-11
diff --git a/src/mint/afl-tests/id:000413,src:000000,op:arith8,pos:88,val:+30,+cov b/src/exchange/afl-tests/id:000413,src:000000,op:arith8,pos:88,val:+30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000413,src:000000,op:arith8,pos:88,val:+30,+cov
rename to src/exchange/afl-tests/id:000413,src:000000,op:arith8,pos:88,val:+30,+cov
diff --git a/src/mint/afl-tests/id:000414,src:000000,op:arith8,pos:137,val:-19,+cov b/src/exchange/afl-tests/id:000414,src:000000,op:arith8,pos:137,val:-19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000414,src:000000,op:arith8,pos:137,val:-19,+cov
rename to src/exchange/afl-tests/id:000414,src:000000,op:arith8,pos:137,val:-19,+cov
diff --git a/src/mint/afl-tests/id:000414,src:000000,op:arith8,pos:89,val:+29,+cov b/src/exchange/afl-tests/id:000414,src:000000,op:arith8,pos:89,val:+29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000414,src:000000,op:arith8,pos:89,val:+29,+cov
rename to src/exchange/afl-tests/id:000414,src:000000,op:arith8,pos:89,val:+29,+cov
diff --git a/src/mint/afl-tests/id:000415,src:000000,op:arith8,pos:138,val:+3,+cov b/src/exchange/afl-tests/id:000415,src:000000,op:arith8,pos:138,val:+3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000415,src:000000,op:arith8,pos:138,val:+3,+cov
rename to src/exchange/afl-tests/id:000415,src:000000,op:arith8,pos:138,val:+3,+cov
diff --git a/src/mint/afl-tests/id:000415,src:000000,op:arith8,pos:90,val:-21,+cov b/src/exchange/afl-tests/id:000415,src:000000,op:arith8,pos:90,val:-21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000415,src:000000,op:arith8,pos:90,val:-21,+cov
rename to src/exchange/afl-tests/id:000415,src:000000,op:arith8,pos:90,val:-21,+cov
diff --git a/src/mint/afl-tests/id:000416,src:000000,op:arith8,pos:138,val:-12,+cov b/src/exchange/afl-tests/id:000416,src:000000,op:arith8,pos:138,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000416,src:000000,op:arith8,pos:138,val:-12,+cov
rename to src/exchange/afl-tests/id:000416,src:000000,op:arith8,pos:138,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000416,src:000000,op:arith8,pos:91,val:+28,+cov b/src/exchange/afl-tests/id:000416,src:000000,op:arith8,pos:91,val:+28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000416,src:000000,op:arith8,pos:91,val:+28,+cov
rename to src/exchange/afl-tests/id:000416,src:000000,op:arith8,pos:91,val:+28,+cov
diff --git a/src/mint/afl-tests/id:000417,src:000000,op:arith8,pos:139,val:-10,+cov b/src/exchange/afl-tests/id:000417,src:000000,op:arith8,pos:139,val:-10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000417,src:000000,op:arith8,pos:139,val:-10,+cov
rename to src/exchange/afl-tests/id:000417,src:000000,op:arith8,pos:139,val:-10,+cov
diff --git a/src/mint/afl-tests/id:000417,src:000000,op:arith8,pos:91,val:+34,+cov b/src/exchange/afl-tests/id:000417,src:000000,op:arith8,pos:91,val:+34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000417,src:000000,op:arith8,pos:91,val:+34,+cov
rename to src/exchange/afl-tests/id:000417,src:000000,op:arith8,pos:91,val:+34,+cov
diff --git a/src/mint/afl-tests/id:000418,src:000000,op:arith8,pos:139,val:-26,+cov b/src/exchange/afl-tests/id:000418,src:000000,op:arith8,pos:139,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000418,src:000000,op:arith8,pos:139,val:-26,+cov
rename to src/exchange/afl-tests/id:000418,src:000000,op:arith8,pos:139,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000418,src:000000,op:arith8,pos:94,val:-23,+cov b/src/exchange/afl-tests/id:000418,src:000000,op:arith8,pos:94,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000418,src:000000,op:arith8,pos:94,val:-23,+cov
rename to src/exchange/afl-tests/id:000418,src:000000,op:arith8,pos:94,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000419,src:000000,op:arith8,pos:143,val:+21,+cov b/src/exchange/afl-tests/id:000419,src:000000,op:arith8,pos:143,val:+21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000419,src:000000,op:arith8,pos:143,val:+21,+cov
rename to src/exchange/afl-tests/id:000419,src:000000,op:arith8,pos:143,val:+21,+cov
diff --git a/src/mint/afl-tests/id:000419,src:000000,op:arith8,pos:95,val:+3,+cov b/src/exchange/afl-tests/id:000419,src:000000,op:arith8,pos:95,val:+3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000419,src:000000,op:arith8,pos:95,val:+3,+cov
rename to src/exchange/afl-tests/id:000419,src:000000,op:arith8,pos:95,val:+3,+cov
diff --git a/src/mint/afl-tests/id:000420,src:000000,op:arith8,pos:145,val:+15,+cov b/src/exchange/afl-tests/id:000420,src:000000,op:arith8,pos:145,val:+15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000420,src:000000,op:arith8,pos:145,val:+15,+cov
rename to src/exchange/afl-tests/id:000420,src:000000,op:arith8,pos:145,val:+15,+cov
diff --git a/src/mint/afl-tests/id:000420,src:000000,op:arith8,pos:95,val:-23,+cov b/src/exchange/afl-tests/id:000420,src:000000,op:arith8,pos:95,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000420,src:000000,op:arith8,pos:95,val:-23,+cov
rename to src/exchange/afl-tests/id:000420,src:000000,op:arith8,pos:95,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000421,src:000000,op:arith8,pos:146,val:-14,+cov b/src/exchange/afl-tests/id:000421,src:000000,op:arith8,pos:146,val:-14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000421,src:000000,op:arith8,pos:146,val:-14,+cov
rename to src/exchange/afl-tests/id:000421,src:000000,op:arith8,pos:146,val:-14,+cov
diff --git a/src/mint/afl-tests/id:000421,src:000000,op:arith8,pos:95,val:+31,+cov b/src/exchange/afl-tests/id:000421,src:000000,op:arith8,pos:95,val:+31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000421,src:000000,op:arith8,pos:95,val:+31,+cov
rename to src/exchange/afl-tests/id:000421,src:000000,op:arith8,pos:95,val:+31,+cov
diff --git a/src/mint/afl-tests/id:000422,src:000000,op:arith8,pos:148,val:+28,+cov b/src/exchange/afl-tests/id:000422,src:000000,op:arith8,pos:148,val:+28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000422,src:000000,op:arith8,pos:148,val:+28,+cov
rename to src/exchange/afl-tests/id:000422,src:000000,op:arith8,pos:148,val:+28,+cov
diff --git a/src/mint/afl-tests/id:000422,src:000000,op:arith8,pos:98,val:-35 b/src/exchange/afl-tests/id:000422,src:000000,op:arith8,pos:98,val:-35
similarity index 100%
rename from src/mint/afl-tests/id:000422,src:000000,op:arith8,pos:98,val:-35
rename to src/exchange/afl-tests/id:000422,src:000000,op:arith8,pos:98,val:-35
diff --git a/src/mint/afl-tests/id:000423,src:000000,op:arith8,pos:100,val:-33,+cov b/src/exchange/afl-tests/id:000423,src:000000,op:arith8,pos:100,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000423,src:000000,op:arith8,pos:100,val:-33,+cov
rename to src/exchange/afl-tests/id:000423,src:000000,op:arith8,pos:100,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000423,src:000000,op:arith8,pos:151,val:-35,+cov b/src/exchange/afl-tests/id:000423,src:000000,op:arith8,pos:151,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000423,src:000000,op:arith8,pos:151,val:-35,+cov
rename to src/exchange/afl-tests/id:000423,src:000000,op:arith8,pos:151,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000424,src:000000,op:arith8,pos:113,val:-19 b/src/exchange/afl-tests/id:000424,src:000000,op:arith8,pos:113,val:-19
similarity index 100%
rename from src/mint/afl-tests/id:000424,src:000000,op:arith8,pos:113,val:-19
rename to src/exchange/afl-tests/id:000424,src:000000,op:arith8,pos:113,val:-19
diff --git a/src/mint/afl-tests/id:000424,src:000000,op:arith8,pos:152,val:-12,+cov b/src/exchange/afl-tests/id:000424,src:000000,op:arith8,pos:152,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000424,src:000000,op:arith8,pos:152,val:-12,+cov
rename to src/exchange/afl-tests/id:000424,src:000000,op:arith8,pos:152,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000425,src:000000,op:arith8,pos:113,val:-22 b/src/exchange/afl-tests/id:000425,src:000000,op:arith8,pos:113,val:-22
similarity index 100%
rename from src/mint/afl-tests/id:000425,src:000000,op:arith8,pos:113,val:-22
rename to src/exchange/afl-tests/id:000425,src:000000,op:arith8,pos:113,val:-22
diff --git a/src/mint/afl-tests/id:000425,src:000000,op:arith8,pos:152,val:+27,+cov b/src/exchange/afl-tests/id:000425,src:000000,op:arith8,pos:152,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000425,src:000000,op:arith8,pos:152,val:+27,+cov
rename to src/exchange/afl-tests/id:000425,src:000000,op:arith8,pos:152,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000426,src:000000,op:arith8,pos:127,val:-20,+cov b/src/exchange/afl-tests/id:000426,src:000000,op:arith8,pos:127,val:-20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000426,src:000000,op:arith8,pos:127,val:-20,+cov
rename to src/exchange/afl-tests/id:000426,src:000000,op:arith8,pos:127,val:-20,+cov
diff --git a/src/mint/afl-tests/id:000426,src:000000,op:arith8,pos:152,val:+31,+cov b/src/exchange/afl-tests/id:000426,src:000000,op:arith8,pos:152,val:+31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000426,src:000000,op:arith8,pos:152,val:+31,+cov
rename to src/exchange/afl-tests/id:000426,src:000000,op:arith8,pos:152,val:+31,+cov
diff --git a/src/mint/afl-tests/id:000427,src:000000,op:arith8,pos:131,val:-20,+cov b/src/exchange/afl-tests/id:000427,src:000000,op:arith8,pos:131,val:-20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000427,src:000000,op:arith8,pos:131,val:-20,+cov
rename to src/exchange/afl-tests/id:000427,src:000000,op:arith8,pos:131,val:-20,+cov
diff --git a/src/mint/afl-tests/id:000427,src:000000,op:arith8,pos:153,val:+20,+cov b/src/exchange/afl-tests/id:000427,src:000000,op:arith8,pos:153,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000427,src:000000,op:arith8,pos:153,val:+20,+cov
rename to src/exchange/afl-tests/id:000427,src:000000,op:arith8,pos:153,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000428,src:000000,op:arith8,pos:132,val:+6,+cov b/src/exchange/afl-tests/id:000428,src:000000,op:arith8,pos:132,val:+6,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000428,src:000000,op:arith8,pos:132,val:+6,+cov
rename to src/exchange/afl-tests/id:000428,src:000000,op:arith8,pos:132,val:+6,+cov
diff --git a/src/mint/afl-tests/id:000428,src:000000,op:arith8,pos:154,val:+7,+cov b/src/exchange/afl-tests/id:000428,src:000000,op:arith8,pos:154,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000428,src:000000,op:arith8,pos:154,val:+7,+cov
rename to src/exchange/afl-tests/id:000428,src:000000,op:arith8,pos:154,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000429,src:000000,op:arith8,pos:135,val:-28,+cov b/src/exchange/afl-tests/id:000429,src:000000,op:arith8,pos:135,val:-28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000429,src:000000,op:arith8,pos:135,val:-28,+cov
rename to src/exchange/afl-tests/id:000429,src:000000,op:arith8,pos:135,val:-28,+cov
diff --git a/src/mint/afl-tests/id:000429,src:000000,op:arith8,pos:156,val:+18,+cov b/src/exchange/afl-tests/id:000429,src:000000,op:arith8,pos:156,val:+18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000429,src:000000,op:arith8,pos:156,val:+18,+cov
rename to src/exchange/afl-tests/id:000429,src:000000,op:arith8,pos:156,val:+18,+cov
diff --git a/src/mint/afl-tests/id:000430,src:000000,op:arith8,pos:135,val:-35,+cov b/src/exchange/afl-tests/id:000430,src:000000,op:arith8,pos:135,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000430,src:000000,op:arith8,pos:135,val:-35,+cov
rename to src/exchange/afl-tests/id:000430,src:000000,op:arith8,pos:135,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000430,src:000000,op:arith8,pos:156,val:+28,+cov b/src/exchange/afl-tests/id:000430,src:000000,op:arith8,pos:156,val:+28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000430,src:000000,op:arith8,pos:156,val:+28,+cov
rename to src/exchange/afl-tests/id:000430,src:000000,op:arith8,pos:156,val:+28,+cov
diff --git a/src/mint/afl-tests/id:000431,src:000000,op:arith8,pos:136,val:+3,+cov b/src/exchange/afl-tests/id:000431,src:000000,op:arith8,pos:136,val:+3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000431,src:000000,op:arith8,pos:136,val:+3,+cov
rename to src/exchange/afl-tests/id:000431,src:000000,op:arith8,pos:136,val:+3,+cov
diff --git a/src/mint/afl-tests/id:000431,src:000000,op:arith8,pos:159,val:-30,+cov b/src/exchange/afl-tests/id:000431,src:000000,op:arith8,pos:159,val:-30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000431,src:000000,op:arith8,pos:159,val:-30,+cov
rename to src/exchange/afl-tests/id:000431,src:000000,op:arith8,pos:159,val:-30,+cov
diff --git a/src/mint/afl-tests/id:000432,src:000000,op:arith8,pos:136,val:-5,+cov b/src/exchange/afl-tests/id:000432,src:000000,op:arith8,pos:136,val:-5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000432,src:000000,op:arith8,pos:136,val:-5,+cov
rename to src/exchange/afl-tests/id:000432,src:000000,op:arith8,pos:136,val:-5,+cov
diff --git a/src/mint/afl-tests/id:000432,src:000000,op:arith8,pos:160,val:-31,+cov b/src/exchange/afl-tests/id:000432,src:000000,op:arith8,pos:160,val:-31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000432,src:000000,op:arith8,pos:160,val:-31,+cov
rename to src/exchange/afl-tests/id:000432,src:000000,op:arith8,pos:160,val:-31,+cov
diff --git a/src/mint/afl-tests/id:000433,src:000000,op:arith8,pos:136,val:-9,+cov b/src/exchange/afl-tests/id:000433,src:000000,op:arith8,pos:136,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000433,src:000000,op:arith8,pos:136,val:-9,+cov
rename to src/exchange/afl-tests/id:000433,src:000000,op:arith8,pos:136,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000433,src:000000,op:arith8,pos:161,val:+5,+cov b/src/exchange/afl-tests/id:000433,src:000000,op:arith8,pos:161,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000433,src:000000,op:arith8,pos:161,val:+5,+cov
rename to src/exchange/afl-tests/id:000433,src:000000,op:arith8,pos:161,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000434,src:000000,op:arith8,pos:136,val:+20,+cov b/src/exchange/afl-tests/id:000434,src:000000,op:arith8,pos:136,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000434,src:000000,op:arith8,pos:136,val:+20,+cov
rename to src/exchange/afl-tests/id:000434,src:000000,op:arith8,pos:136,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000434,src:000000,op:arith8,pos:161,val:-11,+cov b/src/exchange/afl-tests/id:000434,src:000000,op:arith8,pos:161,val:-11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000434,src:000000,op:arith8,pos:161,val:-11,+cov
rename to src/exchange/afl-tests/id:000434,src:000000,op:arith8,pos:161,val:-11,+cov
diff --git a/src/mint/afl-tests/id:000435,src:000000,op:arith8,pos:136,val:-29,+cov b/src/exchange/afl-tests/id:000435,src:000000,op:arith8,pos:136,val:-29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000435,src:000000,op:arith8,pos:136,val:-29,+cov
rename to src/exchange/afl-tests/id:000435,src:000000,op:arith8,pos:136,val:-29,+cov
diff --git a/src/mint/afl-tests/id:000435,src:000000,op:arith8,pos:162,val:+22 b/src/exchange/afl-tests/id:000435,src:000000,op:arith8,pos:162,val:+22
similarity index 100%
rename from src/mint/afl-tests/id:000435,src:000000,op:arith8,pos:162,val:+22
rename to src/exchange/afl-tests/id:000435,src:000000,op:arith8,pos:162,val:+22
diff --git a/src/mint/afl-tests/id:000436,src:000000,op:arith8,pos:137,val:+7,+cov b/src/exchange/afl-tests/id:000436,src:000000,op:arith8,pos:137,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000436,src:000000,op:arith8,pos:137,val:+7,+cov
rename to src/exchange/afl-tests/id:000436,src:000000,op:arith8,pos:137,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000436,src:000000,op:arith8,pos:163,val:+19,+cov b/src/exchange/afl-tests/id:000436,src:000000,op:arith8,pos:163,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000436,src:000000,op:arith8,pos:163,val:+19,+cov
rename to src/exchange/afl-tests/id:000436,src:000000,op:arith8,pos:163,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000437,src:000000,op:arith8,pos:137,val:+10,+cov b/src/exchange/afl-tests/id:000437,src:000000,op:arith8,pos:137,val:+10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000437,src:000000,op:arith8,pos:137,val:+10,+cov
rename to src/exchange/afl-tests/id:000437,src:000000,op:arith8,pos:137,val:+10,+cov
diff --git a/src/mint/afl-tests/id:000437,src:000000,op:arith8,pos:164,val:+27,+cov b/src/exchange/afl-tests/id:000437,src:000000,op:arith8,pos:164,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000437,src:000000,op:arith8,pos:164,val:+27,+cov
rename to src/exchange/afl-tests/id:000437,src:000000,op:arith8,pos:164,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000438,src:000000,op:arith8,pos:138,val:+19,+cov b/src/exchange/afl-tests/id:000438,src:000000,op:arith8,pos:138,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000438,src:000000,op:arith8,pos:138,val:+19,+cov
rename to src/exchange/afl-tests/id:000438,src:000000,op:arith8,pos:138,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000438,src:000000,op:arith8,pos:166,val:+13,+cov b/src/exchange/afl-tests/id:000438,src:000000,op:arith8,pos:166,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000438,src:000000,op:arith8,pos:166,val:+13,+cov
rename to src/exchange/afl-tests/id:000438,src:000000,op:arith8,pos:166,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000439,src:000000,op:arith8,pos:139,val:+25,+cov b/src/exchange/afl-tests/id:000439,src:000000,op:arith8,pos:139,val:+25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000439,src:000000,op:arith8,pos:139,val:+25,+cov
rename to src/exchange/afl-tests/id:000439,src:000000,op:arith8,pos:139,val:+25,+cov
diff --git a/src/mint/afl-tests/id:000439,src:000000,op:arith8,pos:167,val:+33,+cov b/src/exchange/afl-tests/id:000439,src:000000,op:arith8,pos:167,val:+33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000439,src:000000,op:arith8,pos:167,val:+33,+cov
rename to src/exchange/afl-tests/id:000439,src:000000,op:arith8,pos:167,val:+33,+cov
diff --git a/src/mint/afl-tests/id:000440,src:000000,op:arith8,pos:139,val:-26,+cov b/src/exchange/afl-tests/id:000440,src:000000,op:arith8,pos:139,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000440,src:000000,op:arith8,pos:139,val:-26,+cov
rename to src/exchange/afl-tests/id:000440,src:000000,op:arith8,pos:139,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000440,src:000000,op:arith8,pos:168,val:-17,+cov b/src/exchange/afl-tests/id:000440,src:000000,op:arith8,pos:168,val:-17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000440,src:000000,op:arith8,pos:168,val:-17,+cov
rename to src/exchange/afl-tests/id:000440,src:000000,op:arith8,pos:168,val:-17,+cov
diff --git a/src/mint/afl-tests/id:000441,src:000000,op:arith8,pos:140,val:+20,+cov b/src/exchange/afl-tests/id:000441,src:000000,op:arith8,pos:140,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000441,src:000000,op:arith8,pos:140,val:+20,+cov
rename to src/exchange/afl-tests/id:000441,src:000000,op:arith8,pos:140,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000441,src:000000,op:arith8,pos:168,val:+29,+cov b/src/exchange/afl-tests/id:000441,src:000000,op:arith8,pos:168,val:+29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000441,src:000000,op:arith8,pos:168,val:+29,+cov
rename to src/exchange/afl-tests/id:000441,src:000000,op:arith8,pos:168,val:+29,+cov
diff --git a/src/mint/afl-tests/id:000442,src:000000,op:arith8,pos:141,val:+6,+cov b/src/exchange/afl-tests/id:000442,src:000000,op:arith8,pos:141,val:+6,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000442,src:000000,op:arith8,pos:141,val:+6,+cov
rename to src/exchange/afl-tests/id:000442,src:000000,op:arith8,pos:141,val:+6,+cov
diff --git a/src/mint/afl-tests/id:000442,src:000000,op:arith8,pos:168,val:+30,+cov b/src/exchange/afl-tests/id:000442,src:000000,op:arith8,pos:168,val:+30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000442,src:000000,op:arith8,pos:168,val:+30,+cov
rename to src/exchange/afl-tests/id:000442,src:000000,op:arith8,pos:168,val:+30,+cov
diff --git a/src/mint/afl-tests/id:000443,src:000000,op:arith8,pos:141,val:+10,+cov b/src/exchange/afl-tests/id:000443,src:000000,op:arith8,pos:141,val:+10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000443,src:000000,op:arith8,pos:141,val:+10,+cov
rename to src/exchange/afl-tests/id:000443,src:000000,op:arith8,pos:141,val:+10,+cov
diff --git a/src/mint/afl-tests/id:000443,src:000000,op:arith8,pos:171,val:+22,+cov b/src/exchange/afl-tests/id:000443,src:000000,op:arith8,pos:171,val:+22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000443,src:000000,op:arith8,pos:171,val:+22,+cov
rename to src/exchange/afl-tests/id:000443,src:000000,op:arith8,pos:171,val:+22,+cov
diff --git a/src/mint/afl-tests/id:000444,src:000000,op:arith8,pos:141,val:+13,+cov b/src/exchange/afl-tests/id:000444,src:000000,op:arith8,pos:141,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000444,src:000000,op:arith8,pos:141,val:+13,+cov
rename to src/exchange/afl-tests/id:000444,src:000000,op:arith8,pos:141,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000444,src:000000,op:arith8,pos:171,val:+25,+cov b/src/exchange/afl-tests/id:000444,src:000000,op:arith8,pos:171,val:+25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000444,src:000000,op:arith8,pos:171,val:+25,+cov
rename to src/exchange/afl-tests/id:000444,src:000000,op:arith8,pos:171,val:+25,+cov
diff --git a/src/mint/afl-tests/id:000445,src:000000,op:arith8,pos:141,val:+20,+cov b/src/exchange/afl-tests/id:000445,src:000000,op:arith8,pos:141,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000445,src:000000,op:arith8,pos:141,val:+20,+cov
rename to src/exchange/afl-tests/id:000445,src:000000,op:arith8,pos:141,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000445,src:000000,op:arith8,pos:172,val:-13,+cov b/src/exchange/afl-tests/id:000445,src:000000,op:arith8,pos:172,val:-13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000445,src:000000,op:arith8,pos:172,val:-13,+cov
rename to src/exchange/afl-tests/id:000445,src:000000,op:arith8,pos:172,val:-13,+cov
diff --git a/src/mint/afl-tests/id:000446,src:000000,op:arith8,pos:142,val:+6,+cov b/src/exchange/afl-tests/id:000446,src:000000,op:arith8,pos:142,val:+6,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000446,src:000000,op:arith8,pos:142,val:+6,+cov
rename to src/exchange/afl-tests/id:000446,src:000000,op:arith8,pos:142,val:+6,+cov
diff --git a/src/mint/afl-tests/id:000446,src:000000,op:arith8,pos:172,val:+19,+cov b/src/exchange/afl-tests/id:000446,src:000000,op:arith8,pos:172,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000446,src:000000,op:arith8,pos:172,val:+19,+cov
rename to src/exchange/afl-tests/id:000446,src:000000,op:arith8,pos:172,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000447,src:000000,op:arith8,pos:142,val:-20,+cov b/src/exchange/afl-tests/id:000447,src:000000,op:arith8,pos:142,val:-20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000447,src:000000,op:arith8,pos:142,val:-20,+cov
rename to src/exchange/afl-tests/id:000447,src:000000,op:arith8,pos:142,val:-20,+cov
diff --git a/src/mint/afl-tests/id:000447,src:000000,op:arith8,pos:173,val:-15,+cov b/src/exchange/afl-tests/id:000447,src:000000,op:arith8,pos:173,val:-15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000447,src:000000,op:arith8,pos:173,val:-15,+cov
rename to src/exchange/afl-tests/id:000447,src:000000,op:arith8,pos:173,val:-15,+cov
diff --git a/src/mint/afl-tests/id:000448,src:000000,op:arith8,pos:143,val:+17,+cov b/src/exchange/afl-tests/id:000448,src:000000,op:arith8,pos:143,val:+17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000448,src:000000,op:arith8,pos:143,val:+17,+cov
rename to src/exchange/afl-tests/id:000448,src:000000,op:arith8,pos:143,val:+17,+cov
diff --git a/src/mint/afl-tests/id:000448,src:000000,op:arith8,pos:174,val:+23,+cov b/src/exchange/afl-tests/id:000448,src:000000,op:arith8,pos:174,val:+23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000448,src:000000,op:arith8,pos:174,val:+23,+cov
rename to src/exchange/afl-tests/id:000448,src:000000,op:arith8,pos:174,val:+23,+cov
diff --git a/src/mint/afl-tests/id:000449,src:000000,op:arith8,pos:144,val:+28,+cov b/src/exchange/afl-tests/id:000449,src:000000,op:arith8,pos:144,val:+28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000449,src:000000,op:arith8,pos:144,val:+28,+cov
rename to src/exchange/afl-tests/id:000449,src:000000,op:arith8,pos:144,val:+28,+cov
diff --git a/src/mint/afl-tests/id:000449,src:000000,op:arith8,pos:174,val:+33,+cov b/src/exchange/afl-tests/id:000449,src:000000,op:arith8,pos:174,val:+33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000449,src:000000,op:arith8,pos:174,val:+33,+cov
rename to src/exchange/afl-tests/id:000449,src:000000,op:arith8,pos:174,val:+33,+cov
diff --git a/src/mint/afl-tests/id:000450,src:000000,op:arith8,pos:145,val:+27,+cov b/src/exchange/afl-tests/id:000450,src:000000,op:arith8,pos:145,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000450,src:000000,op:arith8,pos:145,val:+27,+cov
rename to src/exchange/afl-tests/id:000450,src:000000,op:arith8,pos:145,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000450,src:000000,op:arith8,pos:176,val:+20,+cov b/src/exchange/afl-tests/id:000450,src:000000,op:arith8,pos:176,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000450,src:000000,op:arith8,pos:176,val:+20,+cov
rename to src/exchange/afl-tests/id:000450,src:000000,op:arith8,pos:176,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000451,src:000000,op:arith8,pos:146,val:-11,+cov b/src/exchange/afl-tests/id:000451,src:000000,op:arith8,pos:146,val:-11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000451,src:000000,op:arith8,pos:146,val:-11,+cov
rename to src/exchange/afl-tests/id:000451,src:000000,op:arith8,pos:146,val:-11,+cov
diff --git a/src/mint/afl-tests/id:000451,src:000000,op:arith8,pos:177,val:+33,+cov b/src/exchange/afl-tests/id:000451,src:000000,op:arith8,pos:177,val:+33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000451,src:000000,op:arith8,pos:177,val:+33,+cov
rename to src/exchange/afl-tests/id:000451,src:000000,op:arith8,pos:177,val:+33,+cov
diff --git a/src/mint/afl-tests/id:000452,src:000000,op:arith8,pos:146,val:-13,+cov b/src/exchange/afl-tests/id:000452,src:000000,op:arith8,pos:146,val:-13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000452,src:000000,op:arith8,pos:146,val:-13,+cov
rename to src/exchange/afl-tests/id:000452,src:000000,op:arith8,pos:146,val:-13,+cov
diff --git a/src/mint/afl-tests/id:000452,src:000000,op:arith8,pos:181,val:+12,+cov b/src/exchange/afl-tests/id:000452,src:000000,op:arith8,pos:181,val:+12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000452,src:000000,op:arith8,pos:181,val:+12,+cov
rename to src/exchange/afl-tests/id:000452,src:000000,op:arith8,pos:181,val:+12,+cov
diff --git a/src/mint/afl-tests/id:000453,src:000000,op:arith8,pos:146,val:-21,+cov b/src/exchange/afl-tests/id:000453,src:000000,op:arith8,pos:146,val:-21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000453,src:000000,op:arith8,pos:146,val:-21,+cov
rename to src/exchange/afl-tests/id:000453,src:000000,op:arith8,pos:146,val:-21,+cov
diff --git a/src/mint/afl-tests/id:000453,src:000000,op:arith8,pos:181,val:+21 b/src/exchange/afl-tests/id:000453,src:000000,op:arith8,pos:181,val:+21
similarity index 100%
rename from src/mint/afl-tests/id:000453,src:000000,op:arith8,pos:181,val:+21
rename to src/exchange/afl-tests/id:000453,src:000000,op:arith8,pos:181,val:+21
diff --git a/src/mint/afl-tests/id:000454,src:000000,op:arith8,pos:147,val:-3,+cov b/src/exchange/afl-tests/id:000454,src:000000,op:arith8,pos:147,val:-3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000454,src:000000,op:arith8,pos:147,val:-3,+cov
rename to src/exchange/afl-tests/id:000454,src:000000,op:arith8,pos:147,val:-3,+cov
diff --git a/src/mint/afl-tests/id:000454,src:000000,op:arith8,pos:181,val:+25,+cov b/src/exchange/afl-tests/id:000454,src:000000,op:arith8,pos:181,val:+25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000454,src:000000,op:arith8,pos:181,val:+25,+cov
rename to src/exchange/afl-tests/id:000454,src:000000,op:arith8,pos:181,val:+25,+cov
diff --git a/src/mint/afl-tests/id:000455,src:000000,op:arith8,pos:147,val:-9,+cov b/src/exchange/afl-tests/id:000455,src:000000,op:arith8,pos:147,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000455,src:000000,op:arith8,pos:147,val:-9,+cov
rename to src/exchange/afl-tests/id:000455,src:000000,op:arith8,pos:147,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000455,src:000000,op:arith8,pos:183,val:-3 b/src/exchange/afl-tests/id:000455,src:000000,op:arith8,pos:183,val:-3
similarity index 100%
rename from src/mint/afl-tests/id:000455,src:000000,op:arith8,pos:183,val:-3
rename to src/exchange/afl-tests/id:000455,src:000000,op:arith8,pos:183,val:-3
diff --git a/src/mint/afl-tests/id:000456,src:000000,op:arith8,pos:147,val:-13,+cov b/src/exchange/afl-tests/id:000456,src:000000,op:arith8,pos:147,val:-13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000456,src:000000,op:arith8,pos:147,val:-13,+cov
rename to src/exchange/afl-tests/id:000456,src:000000,op:arith8,pos:147,val:-13,+cov
diff --git a/src/mint/afl-tests/id:000456,src:000000,op:arith8,pos:184,val:-13 b/src/exchange/afl-tests/id:000456,src:000000,op:arith8,pos:184,val:-13
similarity index 100%
rename from src/mint/afl-tests/id:000456,src:000000,op:arith8,pos:184,val:-13
rename to src/exchange/afl-tests/id:000456,src:000000,op:arith8,pos:184,val:-13
diff --git a/src/mint/afl-tests/id:000457,src:000000,op:arith8,pos:148,val:+12,+cov b/src/exchange/afl-tests/id:000457,src:000000,op:arith8,pos:148,val:+12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000457,src:000000,op:arith8,pos:148,val:+12,+cov
rename to src/exchange/afl-tests/id:000457,src:000000,op:arith8,pos:148,val:+12,+cov
diff --git a/src/mint/afl-tests/id:000457,src:000000,op:arith8,pos:184,val:-34,+cov b/src/exchange/afl-tests/id:000457,src:000000,op:arith8,pos:184,val:-34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000457,src:000000,op:arith8,pos:184,val:-34,+cov
rename to src/exchange/afl-tests/id:000457,src:000000,op:arith8,pos:184,val:-34,+cov
diff --git a/src/mint/afl-tests/id:000458,src:000000,op:arith8,pos:151,val:-7,+cov b/src/exchange/afl-tests/id:000458,src:000000,op:arith8,pos:151,val:-7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000458,src:000000,op:arith8,pos:151,val:-7,+cov
rename to src/exchange/afl-tests/id:000458,src:000000,op:arith8,pos:151,val:-7,+cov
diff --git a/src/mint/afl-tests/id:000458,src:000000,op:arith8,pos:185,val:-6,+cov b/src/exchange/afl-tests/id:000458,src:000000,op:arith8,pos:185,val:-6,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000458,src:000000,op:arith8,pos:185,val:-6,+cov
rename to src/exchange/afl-tests/id:000458,src:000000,op:arith8,pos:185,val:-6,+cov
diff --git a/src/mint/afl-tests/id:000459,src:000000,op:arith8,pos:151,val:+15,+cov b/src/exchange/afl-tests/id:000459,src:000000,op:arith8,pos:151,val:+15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000459,src:000000,op:arith8,pos:151,val:+15,+cov
rename to src/exchange/afl-tests/id:000459,src:000000,op:arith8,pos:151,val:+15,+cov
diff --git a/src/mint/afl-tests/id:000459,src:000000,op:arith8,pos:185,val:+14,+cov b/src/exchange/afl-tests/id:000459,src:000000,op:arith8,pos:185,val:+14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000459,src:000000,op:arith8,pos:185,val:+14,+cov
rename to src/exchange/afl-tests/id:000459,src:000000,op:arith8,pos:185,val:+14,+cov
diff --git a/src/mint/afl-tests/id:000460,src:000000,op:arith8,pos:152,val:-7,+cov b/src/exchange/afl-tests/id:000460,src:000000,op:arith8,pos:152,val:-7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000460,src:000000,op:arith8,pos:152,val:-7,+cov
rename to src/exchange/afl-tests/id:000460,src:000000,op:arith8,pos:152,val:-7,+cov
diff --git a/src/mint/afl-tests/id:000460,src:000000,op:arith8,pos:185,val:+29,+cov b/src/exchange/afl-tests/id:000460,src:000000,op:arith8,pos:185,val:+29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000460,src:000000,op:arith8,pos:185,val:+29,+cov
rename to src/exchange/afl-tests/id:000460,src:000000,op:arith8,pos:185,val:+29,+cov
diff --git a/src/mint/afl-tests/id:000461,src:000000,op:arith8,pos:152,val:+25,+cov b/src/exchange/afl-tests/id:000461,src:000000,op:arith8,pos:152,val:+25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000461,src:000000,op:arith8,pos:152,val:+25,+cov
rename to src/exchange/afl-tests/id:000461,src:000000,op:arith8,pos:152,val:+25,+cov
diff --git a/src/mint/afl-tests/id:000461,src:000000,op:arith8,pos:186,val:+23,+cov b/src/exchange/afl-tests/id:000461,src:000000,op:arith8,pos:186,val:+23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000461,src:000000,op:arith8,pos:186,val:+23,+cov
rename to src/exchange/afl-tests/id:000461,src:000000,op:arith8,pos:186,val:+23,+cov
diff --git a/src/mint/afl-tests/id:000462,src:000000,op:arith8,pos:152,val:-30 b/src/exchange/afl-tests/id:000462,src:000000,op:arith8,pos:152,val:-30
similarity index 100%
rename from src/mint/afl-tests/id:000462,src:000000,op:arith8,pos:152,val:-30
rename to src/exchange/afl-tests/id:000462,src:000000,op:arith8,pos:152,val:-30
diff --git a/src/mint/afl-tests/id:000462,src:000000,op:arith8,pos:191,val:-26,+cov b/src/exchange/afl-tests/id:000462,src:000000,op:arith8,pos:191,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000462,src:000000,op:arith8,pos:191,val:-26,+cov
rename to src/exchange/afl-tests/id:000462,src:000000,op:arith8,pos:191,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000463,src:000000,op:arith8,pos:153,val:+28,+cov b/src/exchange/afl-tests/id:000463,src:000000,op:arith8,pos:153,val:+28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000463,src:000000,op:arith8,pos:153,val:+28,+cov
rename to src/exchange/afl-tests/id:000463,src:000000,op:arith8,pos:153,val:+28,+cov
diff --git a/src/mint/afl-tests/id:000463,src:000000,op:arith8,pos:196,val:-18,+cov b/src/exchange/afl-tests/id:000463,src:000000,op:arith8,pos:196,val:-18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000463,src:000000,op:arith8,pos:196,val:-18,+cov
rename to src/exchange/afl-tests/id:000463,src:000000,op:arith8,pos:196,val:-18,+cov
diff --git a/src/mint/afl-tests/id:000464,src:000000,op:arith8,pos:157,val:+8,+cov b/src/exchange/afl-tests/id:000464,src:000000,op:arith8,pos:157,val:+8,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000464,src:000000,op:arith8,pos:157,val:+8,+cov
rename to src/exchange/afl-tests/id:000464,src:000000,op:arith8,pos:157,val:+8,+cov
diff --git a/src/mint/afl-tests/id:000464,src:000000,op:arith8,pos:203,val:+22,+cov b/src/exchange/afl-tests/id:000464,src:000000,op:arith8,pos:203,val:+22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000464,src:000000,op:arith8,pos:203,val:+22,+cov
rename to src/exchange/afl-tests/id:000464,src:000000,op:arith8,pos:203,val:+22,+cov
diff --git a/src/mint/afl-tests/id:000465,src:000000,op:arith8,pos:157,val:-9,+cov b/src/exchange/afl-tests/id:000465,src:000000,op:arith8,pos:157,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000465,src:000000,op:arith8,pos:157,val:-9,+cov
rename to src/exchange/afl-tests/id:000465,src:000000,op:arith8,pos:157,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000465,src:000000,op:arith8,pos:225,val:-6,+cov b/src/exchange/afl-tests/id:000465,src:000000,op:arith8,pos:225,val:-6,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000465,src:000000,op:arith8,pos:225,val:-6,+cov
rename to src/exchange/afl-tests/id:000465,src:000000,op:arith8,pos:225,val:-6,+cov
diff --git a/src/mint/afl-tests/id:000466,src:000000,op:arith8,pos:157,val:-12,+cov b/src/exchange/afl-tests/id:000466,src:000000,op:arith8,pos:157,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000466,src:000000,op:arith8,pos:157,val:-12,+cov
rename to src/exchange/afl-tests/id:000466,src:000000,op:arith8,pos:157,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000466,src:000000,op:arith8,pos:241,val:-26,+cov b/src/exchange/afl-tests/id:000466,src:000000,op:arith8,pos:241,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000466,src:000000,op:arith8,pos:241,val:-26,+cov
rename to src/exchange/afl-tests/id:000466,src:000000,op:arith8,pos:241,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000467,src:000000,op:arith8,pos:157,val:-21,+cov b/src/exchange/afl-tests/id:000467,src:000000,op:arith8,pos:157,val:-21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000467,src:000000,op:arith8,pos:157,val:-21,+cov
rename to src/exchange/afl-tests/id:000467,src:000000,op:arith8,pos:157,val:-21,+cov
diff --git a/src/mint/afl-tests/id:000467,src:000000,op:arith8,pos:268,val:-4,+cov b/src/exchange/afl-tests/id:000467,src:000000,op:arith8,pos:268,val:-4,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000467,src:000000,op:arith8,pos:268,val:-4,+cov
rename to src/exchange/afl-tests/id:000467,src:000000,op:arith8,pos:268,val:-4,+cov
diff --git a/src/mint/afl-tests/id:000468,src:000000,op:arith8,pos:158,val:-9,+cov b/src/exchange/afl-tests/id:000468,src:000000,op:arith8,pos:158,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000468,src:000000,op:arith8,pos:158,val:-9,+cov
rename to src/exchange/afl-tests/id:000468,src:000000,op:arith8,pos:158,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000468,src:000000,op:arith8,pos:268,val:+7,+cov b/src/exchange/afl-tests/id:000468,src:000000,op:arith8,pos:268,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000468,src:000000,op:arith8,pos:268,val:+7,+cov
rename to src/exchange/afl-tests/id:000468,src:000000,op:arith8,pos:268,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000469,src:000000,op:arith8,pos:158,val:+25,+cov b/src/exchange/afl-tests/id:000469,src:000000,op:arith8,pos:158,val:+25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000469,src:000000,op:arith8,pos:158,val:+25,+cov
rename to src/exchange/afl-tests/id:000469,src:000000,op:arith8,pos:158,val:+25,+cov
diff --git a/src/mint/afl-tests/id:000469,src:000000,op:arith8,pos:269,val:+11,+cov b/src/exchange/afl-tests/id:000469,src:000000,op:arith8,pos:269,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000469,src:000000,op:arith8,pos:269,val:+11,+cov
rename to src/exchange/afl-tests/id:000469,src:000000,op:arith8,pos:269,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000470,src:000000,op:arith8,pos:159,val:-7,+cov b/src/exchange/afl-tests/id:000470,src:000000,op:arith8,pos:159,val:-7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000470,src:000000,op:arith8,pos:159,val:-7,+cov
rename to src/exchange/afl-tests/id:000470,src:000000,op:arith8,pos:159,val:-7,+cov
diff --git a/src/mint/afl-tests/id:000470,src:000000,op:arith8,pos:272,val:+29,+cov b/src/exchange/afl-tests/id:000470,src:000000,op:arith8,pos:272,val:+29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000470,src:000000,op:arith8,pos:272,val:+29,+cov
rename to src/exchange/afl-tests/id:000470,src:000000,op:arith8,pos:272,val:+29,+cov
diff --git a/src/mint/afl-tests/id:000471,src:000000,op:arith8,pos:159,val:+10,+cov b/src/exchange/afl-tests/id:000471,src:000000,op:arith8,pos:159,val:+10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000471,src:000000,op:arith8,pos:159,val:+10,+cov
rename to src/exchange/afl-tests/id:000471,src:000000,op:arith8,pos:159,val:+10,+cov
diff --git a/src/mint/afl-tests/id:000471,src:000000,op:arith8,pos:273,val:+29,+cov b/src/exchange/afl-tests/id:000471,src:000000,op:arith8,pos:273,val:+29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000471,src:000000,op:arith8,pos:273,val:+29,+cov
rename to src/exchange/afl-tests/id:000471,src:000000,op:arith8,pos:273,val:+29,+cov
diff --git a/src/mint/afl-tests/id:000472,src:000000,op:arith8,pos:159,val:-11,+cov b/src/exchange/afl-tests/id:000472,src:000000,op:arith8,pos:159,val:-11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000472,src:000000,op:arith8,pos:159,val:-11,+cov
rename to src/exchange/afl-tests/id:000472,src:000000,op:arith8,pos:159,val:-11,+cov
diff --git a/src/mint/afl-tests/id:000472,src:000000,op:arith8,pos:274,val:+11,+cov b/src/exchange/afl-tests/id:000472,src:000000,op:arith8,pos:274,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000472,src:000000,op:arith8,pos:274,val:+11,+cov
rename to src/exchange/afl-tests/id:000472,src:000000,op:arith8,pos:274,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000473,src:000000,op:arith8,pos:160,val:+19,+cov b/src/exchange/afl-tests/id:000473,src:000000,op:arith8,pos:160,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000473,src:000000,op:arith8,pos:160,val:+19,+cov
rename to src/exchange/afl-tests/id:000473,src:000000,op:arith8,pos:160,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000473,src:000000,op:arith8,pos:276,val:+9,+cov b/src/exchange/afl-tests/id:000473,src:000000,op:arith8,pos:276,val:+9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000473,src:000000,op:arith8,pos:276,val:+9,+cov
rename to src/exchange/afl-tests/id:000473,src:000000,op:arith8,pos:276,val:+9,+cov
diff --git a/src/mint/afl-tests/id:000474,src:000000,op:arith8,pos:161,val:+14,+cov b/src/exchange/afl-tests/id:000474,src:000000,op:arith8,pos:161,val:+14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000474,src:000000,op:arith8,pos:161,val:+14,+cov
rename to src/exchange/afl-tests/id:000474,src:000000,op:arith8,pos:161,val:+14,+cov
diff --git a/src/mint/afl-tests/id:000474,src:000000,op:arith8,pos:276,val:+19,+cov b/src/exchange/afl-tests/id:000474,src:000000,op:arith8,pos:276,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000474,src:000000,op:arith8,pos:276,val:+19,+cov
rename to src/exchange/afl-tests/id:000474,src:000000,op:arith8,pos:276,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000475,src:000000,op:arith8,pos:162,val:+7,+cov b/src/exchange/afl-tests/id:000475,src:000000,op:arith8,pos:162,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000475,src:000000,op:arith8,pos:162,val:+7,+cov
rename to src/exchange/afl-tests/id:000475,src:000000,op:arith8,pos:162,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000475,src:000000,op:arith8,pos:277,val:+35,+cov b/src/exchange/afl-tests/id:000475,src:000000,op:arith8,pos:277,val:+35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000475,src:000000,op:arith8,pos:277,val:+35,+cov
rename to src/exchange/afl-tests/id:000475,src:000000,op:arith8,pos:277,val:+35,+cov
diff --git a/src/mint/afl-tests/id:000476,src:000000,op:arith8,pos:163,val:+26,+cov b/src/exchange/afl-tests/id:000476,src:000000,op:arith8,pos:163,val:+26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000476,src:000000,op:arith8,pos:163,val:+26,+cov
rename to src/exchange/afl-tests/id:000476,src:000000,op:arith8,pos:163,val:+26,+cov
diff --git a/src/mint/afl-tests/id:000476,src:000000,op:arith8,pos:278,val:+5,+cov b/src/exchange/afl-tests/id:000476,src:000000,op:arith8,pos:278,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000476,src:000000,op:arith8,pos:278,val:+5,+cov
rename to src/exchange/afl-tests/id:000476,src:000000,op:arith8,pos:278,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000477,src:000000,op:arith8,pos:163,val:+31,+cov b/src/exchange/afl-tests/id:000477,src:000000,op:arith8,pos:163,val:+31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000477,src:000000,op:arith8,pos:163,val:+31,+cov
rename to src/exchange/afl-tests/id:000477,src:000000,op:arith8,pos:163,val:+31,+cov
diff --git a/src/mint/afl-tests/id:000477,src:000000,op:arith8,pos:305,val:+14,+cov b/src/exchange/afl-tests/id:000477,src:000000,op:arith8,pos:305,val:+14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000477,src:000000,op:arith8,pos:305,val:+14,+cov
rename to src/exchange/afl-tests/id:000477,src:000000,op:arith8,pos:305,val:+14,+cov
diff --git a/src/mint/afl-tests/id:000478,src:000000,op:arith8,pos:164,val:+2,+cov b/src/exchange/afl-tests/id:000478,src:000000,op:arith8,pos:164,val:+2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000478,src:000000,op:arith8,pos:164,val:+2,+cov
rename to src/exchange/afl-tests/id:000478,src:000000,op:arith8,pos:164,val:+2,+cov
diff --git a/src/mint/afl-tests/id:000478,src:000000,op:arith8,pos:306,val:-20,+cov b/src/exchange/afl-tests/id:000478,src:000000,op:arith8,pos:306,val:-20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000478,src:000000,op:arith8,pos:306,val:-20,+cov
rename to src/exchange/afl-tests/id:000478,src:000000,op:arith8,pos:306,val:-20,+cov
diff --git a/src/mint/afl-tests/id:000479,src:000000,op:arith8,pos:169,val:+7,+cov b/src/exchange/afl-tests/id:000479,src:000000,op:arith8,pos:169,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000479,src:000000,op:arith8,pos:169,val:+7,+cov
rename to src/exchange/afl-tests/id:000479,src:000000,op:arith8,pos:169,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000479,src:000000,op:arith8,pos:314,val:-17,+cov b/src/exchange/afl-tests/id:000479,src:000000,op:arith8,pos:314,val:-17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000479,src:000000,op:arith8,pos:314,val:-17,+cov
rename to src/exchange/afl-tests/id:000479,src:000000,op:arith8,pos:314,val:-17,+cov
diff --git a/src/mint/afl-tests/id:000480,src:000000,op:arith8,pos:169,val:-9,+cov b/src/exchange/afl-tests/id:000480,src:000000,op:arith8,pos:169,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000480,src:000000,op:arith8,pos:169,val:-9,+cov
rename to src/exchange/afl-tests/id:000480,src:000000,op:arith8,pos:169,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000480,src:000000,op:arith8,pos:315,val:-17,+cov b/src/exchange/afl-tests/id:000480,src:000000,op:arith8,pos:315,val:-17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000480,src:000000,op:arith8,pos:315,val:-17,+cov
rename to src/exchange/afl-tests/id:000480,src:000000,op:arith8,pos:315,val:-17,+cov
diff --git a/src/mint/afl-tests/id:000481,src:000000,op:arith8,pos:169,val:+19,+cov b/src/exchange/afl-tests/id:000481,src:000000,op:arith8,pos:169,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000481,src:000000,op:arith8,pos:169,val:+19,+cov
rename to src/exchange/afl-tests/id:000481,src:000000,op:arith8,pos:169,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000481,src:000000,op:arith8,pos:315,val:-19,+cov b/src/exchange/afl-tests/id:000481,src:000000,op:arith8,pos:315,val:-19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000481,src:000000,op:arith8,pos:315,val:-19,+cov
rename to src/exchange/afl-tests/id:000481,src:000000,op:arith8,pos:315,val:-19,+cov
diff --git a/src/mint/afl-tests/id:000482,src:000000,op:arith8,pos:172,val:-3,+cov b/src/exchange/afl-tests/id:000482,src:000000,op:arith8,pos:172,val:-3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000482,src:000000,op:arith8,pos:172,val:-3,+cov
rename to src/exchange/afl-tests/id:000482,src:000000,op:arith8,pos:172,val:-3,+cov
diff --git a/src/mint/afl-tests/id:000482,src:000000,op:arith8,pos:315,val:-29,+cov b/src/exchange/afl-tests/id:000482,src:000000,op:arith8,pos:315,val:-29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000482,src:000000,op:arith8,pos:315,val:-29,+cov
rename to src/exchange/afl-tests/id:000482,src:000000,op:arith8,pos:315,val:-29,+cov
diff --git a/src/mint/afl-tests/id:000483,src:000000,op:arith8,pos:172,val:-33,+cov b/src/exchange/afl-tests/id:000483,src:000000,op:arith8,pos:172,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000483,src:000000,op:arith8,pos:172,val:-33,+cov
rename to src/exchange/afl-tests/id:000483,src:000000,op:arith8,pos:172,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000483,src:000000,op:arith8,pos:316,val:+14,+cov b/src/exchange/afl-tests/id:000483,src:000000,op:arith8,pos:316,val:+14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000483,src:000000,op:arith8,pos:316,val:+14,+cov
rename to src/exchange/afl-tests/id:000483,src:000000,op:arith8,pos:316,val:+14,+cov
diff --git a/src/mint/afl-tests/id:000484,src:000000,op:arith8,pos:175,val:+20,+cov b/src/exchange/afl-tests/id:000484,src:000000,op:arith8,pos:175,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000484,src:000000,op:arith8,pos:175,val:+20,+cov
rename to src/exchange/afl-tests/id:000484,src:000000,op:arith8,pos:175,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000484,src:000000,op:arith8,pos:316,val:+17,+cov b/src/exchange/afl-tests/id:000484,src:000000,op:arith8,pos:316,val:+17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000484,src:000000,op:arith8,pos:316,val:+17,+cov
rename to src/exchange/afl-tests/id:000484,src:000000,op:arith8,pos:316,val:+17,+cov
diff --git a/src/mint/afl-tests/id:000485,src:000000,op:arith8,pos:176,val:+7,+cov b/src/exchange/afl-tests/id:000485,src:000000,op:arith8,pos:176,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000485,src:000000,op:arith8,pos:176,val:+7,+cov
rename to src/exchange/afl-tests/id:000485,src:000000,op:arith8,pos:176,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000485,src:000000,op:arith8,pos:316,val:-23,+cov b/src/exchange/afl-tests/id:000485,src:000000,op:arith8,pos:316,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000485,src:000000,op:arith8,pos:316,val:-23,+cov
rename to src/exchange/afl-tests/id:000485,src:000000,op:arith8,pos:316,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000486,src:000000,op:arith8,pos:176,val:-28,+cov b/src/exchange/afl-tests/id:000486,src:000000,op:arith8,pos:176,val:-28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000486,src:000000,op:arith8,pos:176,val:-28,+cov
rename to src/exchange/afl-tests/id:000486,src:000000,op:arith8,pos:176,val:-28,+cov
diff --git a/src/mint/afl-tests/id:000486,src:000000,op:arith8,pos:317,val:-30,+cov b/src/exchange/afl-tests/id:000486,src:000000,op:arith8,pos:317,val:-30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000486,src:000000,op:arith8,pos:317,val:-30,+cov
rename to src/exchange/afl-tests/id:000486,src:000000,op:arith8,pos:317,val:-30,+cov
diff --git a/src/mint/afl-tests/id:000487,src:000000,op:arith8,pos:177,val:+11,+cov b/src/exchange/afl-tests/id:000487,src:000000,op:arith8,pos:177,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000487,src:000000,op:arith8,pos:177,val:+11,+cov
rename to src/exchange/afl-tests/id:000487,src:000000,op:arith8,pos:177,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000487,src:000000,op:arith8,pos:319,val:-7,+cov b/src/exchange/afl-tests/id:000487,src:000000,op:arith8,pos:319,val:-7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000487,src:000000,op:arith8,pos:319,val:-7,+cov
rename to src/exchange/afl-tests/id:000487,src:000000,op:arith8,pos:319,val:-7,+cov
diff --git a/src/mint/afl-tests/id:000488,src:000000,op:arith8,pos:177,val:+17,+cov b/src/exchange/afl-tests/id:000488,src:000000,op:arith8,pos:177,val:+17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000488,src:000000,op:arith8,pos:177,val:+17,+cov
rename to src/exchange/afl-tests/id:000488,src:000000,op:arith8,pos:177,val:+17,+cov
diff --git a/src/mint/afl-tests/id:000488,src:000000,op:arith8,pos:319,val:+9,+cov b/src/exchange/afl-tests/id:000488,src:000000,op:arith8,pos:319,val:+9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000488,src:000000,op:arith8,pos:319,val:+9,+cov
rename to src/exchange/afl-tests/id:000488,src:000000,op:arith8,pos:319,val:+9,+cov
diff --git a/src/mint/afl-tests/id:000489,src:000000,op:arith8,pos:177,val:+22,+cov b/src/exchange/afl-tests/id:000489,src:000000,op:arith8,pos:177,val:+22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000489,src:000000,op:arith8,pos:177,val:+22,+cov
rename to src/exchange/afl-tests/id:000489,src:000000,op:arith8,pos:177,val:+22,+cov
diff --git a/src/mint/afl-tests/id:000489,src:000000,op:arith8,pos:320,val:-7,+cov b/src/exchange/afl-tests/id:000489,src:000000,op:arith8,pos:320,val:-7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000489,src:000000,op:arith8,pos:320,val:-7,+cov
rename to src/exchange/afl-tests/id:000489,src:000000,op:arith8,pos:320,val:-7,+cov
diff --git a/src/mint/afl-tests/id:000490,src:000000,op:arith8,pos:178,val:-5,+cov b/src/exchange/afl-tests/id:000490,src:000000,op:arith8,pos:178,val:-5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000490,src:000000,op:arith8,pos:178,val:-5,+cov
rename to src/exchange/afl-tests/id:000490,src:000000,op:arith8,pos:178,val:-5,+cov
diff --git a/src/mint/afl-tests/id:000490,src:000000,op:arith8,pos:320,val:-25,+cov b/src/exchange/afl-tests/id:000490,src:000000,op:arith8,pos:320,val:-25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000490,src:000000,op:arith8,pos:320,val:-25,+cov
rename to src/exchange/afl-tests/id:000490,src:000000,op:arith8,pos:320,val:-25,+cov
diff --git a/src/mint/afl-tests/id:000491,src:000000,op:arith8,pos:178,val:+23,+cov b/src/exchange/afl-tests/id:000491,src:000000,op:arith8,pos:178,val:+23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000491,src:000000,op:arith8,pos:178,val:+23,+cov
rename to src/exchange/afl-tests/id:000491,src:000000,op:arith8,pos:178,val:+23,+cov
diff --git a/src/mint/afl-tests/id:000491,src:000000,op:arith8,pos:321,val:+11,+cov b/src/exchange/afl-tests/id:000491,src:000000,op:arith8,pos:321,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000491,src:000000,op:arith8,pos:321,val:+11,+cov
rename to src/exchange/afl-tests/id:000491,src:000000,op:arith8,pos:321,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000492,src:000000,op:arith8,pos:181,val:-12,+cov b/src/exchange/afl-tests/id:000492,src:000000,op:arith8,pos:181,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000492,src:000000,op:arith8,pos:181,val:-12,+cov
rename to src/exchange/afl-tests/id:000492,src:000000,op:arith8,pos:181,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000492,src:000000,op:arith8,pos:321,val:-24,+cov b/src/exchange/afl-tests/id:000492,src:000000,op:arith8,pos:321,val:-24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000492,src:000000,op:arith8,pos:321,val:-24,+cov
rename to src/exchange/afl-tests/id:000492,src:000000,op:arith8,pos:321,val:-24,+cov
diff --git a/src/mint/afl-tests/id:000493,src:000000,op:arith8,pos:182,val:-15,+cov b/src/exchange/afl-tests/id:000493,src:000000,op:arith8,pos:182,val:-15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000493,src:000000,op:arith8,pos:182,val:-15,+cov
rename to src/exchange/afl-tests/id:000493,src:000000,op:arith8,pos:182,val:-15,+cov
diff --git a/src/mint/afl-tests/id:000493,src:000000,op:arith8,pos:322,val:-21,+cov b/src/exchange/afl-tests/id:000493,src:000000,op:arith8,pos:322,val:-21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000493,src:000000,op:arith8,pos:322,val:-21,+cov
rename to src/exchange/afl-tests/id:000493,src:000000,op:arith8,pos:322,val:-21,+cov
diff --git a/src/mint/afl-tests/id:000494,src:000000,op:arith8,pos:182,val:+22,+cov b/src/exchange/afl-tests/id:000494,src:000000,op:arith8,pos:182,val:+22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000494,src:000000,op:arith8,pos:182,val:+22,+cov
rename to src/exchange/afl-tests/id:000494,src:000000,op:arith8,pos:182,val:+22,+cov
diff --git a/src/mint/afl-tests/id:000494,src:000000,op:arith8,pos:326,val:-20,+cov b/src/exchange/afl-tests/id:000494,src:000000,op:arith8,pos:326,val:-20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000494,src:000000,op:arith8,pos:326,val:-20,+cov
rename to src/exchange/afl-tests/id:000494,src:000000,op:arith8,pos:326,val:-20,+cov
diff --git a/src/mint/afl-tests/id:000495,src:000000,op:arith8,pos:183,val:-11 b/src/exchange/afl-tests/id:000495,src:000000,op:arith8,pos:183,val:-11
similarity index 100%
rename from src/mint/afl-tests/id:000495,src:000000,op:arith8,pos:183,val:-11
rename to src/exchange/afl-tests/id:000495,src:000000,op:arith8,pos:183,val:-11
diff --git a/src/mint/afl-tests/id:000495,src:000000,op:arith8,pos:328,val:+27,+cov b/src/exchange/afl-tests/id:000495,src:000000,op:arith8,pos:328,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000495,src:000000,op:arith8,pos:328,val:+27,+cov
rename to src/exchange/afl-tests/id:000495,src:000000,op:arith8,pos:328,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000496,src:000000,op:arith8,pos:183,val:+15,+cov b/src/exchange/afl-tests/id:000496,src:000000,op:arith8,pos:183,val:+15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000496,src:000000,op:arith8,pos:183,val:+15,+cov
rename to src/exchange/afl-tests/id:000496,src:000000,op:arith8,pos:183,val:+15,+cov
diff --git a/src/mint/afl-tests/id:000496,src:000000,op:arith8,pos:328,val:-27,+cov b/src/exchange/afl-tests/id:000496,src:000000,op:arith8,pos:328,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000496,src:000000,op:arith8,pos:328,val:-27,+cov
rename to src/exchange/afl-tests/id:000496,src:000000,op:arith8,pos:328,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000497,src:000000,op:arith8,pos:184,val:-14,+cov b/src/exchange/afl-tests/id:000497,src:000000,op:arith8,pos:184,val:-14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000497,src:000000,op:arith8,pos:184,val:-14,+cov
rename to src/exchange/afl-tests/id:000497,src:000000,op:arith8,pos:184,val:-14,+cov
diff --git a/src/mint/afl-tests/id:000497,src:000000,op:arith8,pos:329,val:+5,+cov b/src/exchange/afl-tests/id:000497,src:000000,op:arith8,pos:329,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000497,src:000000,op:arith8,pos:329,val:+5,+cov
rename to src/exchange/afl-tests/id:000497,src:000000,op:arith8,pos:329,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000498,src:000000,op:arith8,pos:184,val:+33,+cov b/src/exchange/afl-tests/id:000498,src:000000,op:arith8,pos:184,val:+33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000498,src:000000,op:arith8,pos:184,val:+33,+cov
rename to src/exchange/afl-tests/id:000498,src:000000,op:arith8,pos:184,val:+33,+cov
diff --git a/src/mint/afl-tests/id:000498,src:000000,op:arith8,pos:329,val:-24,+cov b/src/exchange/afl-tests/id:000498,src:000000,op:arith8,pos:329,val:-24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000498,src:000000,op:arith8,pos:329,val:-24,+cov
rename to src/exchange/afl-tests/id:000498,src:000000,op:arith8,pos:329,val:-24,+cov
diff --git a/src/mint/afl-tests/id:000499,src:000000,op:arith8,pos:184,val:-35,+cov b/src/exchange/afl-tests/id:000499,src:000000,op:arith8,pos:184,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000499,src:000000,op:arith8,pos:184,val:-35,+cov
rename to src/exchange/afl-tests/id:000499,src:000000,op:arith8,pos:184,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000499,src:000000,op:arith8,pos:330,val:-3,+cov b/src/exchange/afl-tests/id:000499,src:000000,op:arith8,pos:330,val:-3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000499,src:000000,op:arith8,pos:330,val:-3,+cov
rename to src/exchange/afl-tests/id:000499,src:000000,op:arith8,pos:330,val:-3,+cov
diff --git a/src/mint/afl-tests/id:000500,src:000000,op:arith8,pos:185,val:+3,+cov b/src/exchange/afl-tests/id:000500,src:000000,op:arith8,pos:185,val:+3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000500,src:000000,op:arith8,pos:185,val:+3,+cov
rename to src/exchange/afl-tests/id:000500,src:000000,op:arith8,pos:185,val:+3,+cov
diff --git a/src/mint/afl-tests/id:000500,src:000000,op:arith8,pos:331,val:-14,+cov b/src/exchange/afl-tests/id:000500,src:000000,op:arith8,pos:331,val:-14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000500,src:000000,op:arith8,pos:331,val:-14,+cov
rename to src/exchange/afl-tests/id:000500,src:000000,op:arith8,pos:331,val:-14,+cov
diff --git a/src/mint/afl-tests/id:000501,src:000000,op:arith8,pos:185,val:+7,+cov b/src/exchange/afl-tests/id:000501,src:000000,op:arith8,pos:185,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000501,src:000000,op:arith8,pos:185,val:+7,+cov
rename to src/exchange/afl-tests/id:000501,src:000000,op:arith8,pos:185,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000501,src:000000,op:arith8,pos:332,val:-15,+cov b/src/exchange/afl-tests/id:000501,src:000000,op:arith8,pos:332,val:-15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000501,src:000000,op:arith8,pos:332,val:-15,+cov
rename to src/exchange/afl-tests/id:000501,src:000000,op:arith8,pos:332,val:-15,+cov
diff --git a/src/mint/afl-tests/id:000502,src:000000,op:arith16,pos:33,val:-12,+cov b/src/exchange/afl-tests/id:000502,src:000000,op:arith16,pos:33,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000502,src:000000,op:arith16,pos:33,val:-12,+cov
rename to src/exchange/afl-tests/id:000502,src:000000,op:arith16,pos:33,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000502,src:000000,op:arith8,pos:192,val:+9,+cov b/src/exchange/afl-tests/id:000502,src:000000,op:arith8,pos:192,val:+9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000502,src:000000,op:arith8,pos:192,val:+9,+cov
rename to src/exchange/afl-tests/id:000502,src:000000,op:arith8,pos:192,val:+9,+cov
diff --git a/src/mint/afl-tests/id:000503,src:000000,op:arith16,pos:65,val:be:-27,+cov b/src/exchange/afl-tests/id:000503,src:000000,op:arith16,pos:65,val:be:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000503,src:000000,op:arith16,pos:65,val:be:-27,+cov
rename to src/exchange/afl-tests/id:000503,src:000000,op:arith16,pos:65,val:be:-27,+cov
diff --git a/src/mint/afl-tests/id:000503,src:000000,op:arith8,pos:237,val:-26,+cov b/src/exchange/afl-tests/id:000503,src:000000,op:arith8,pos:237,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000503,src:000000,op:arith8,pos:237,val:-26,+cov
rename to src/exchange/afl-tests/id:000503,src:000000,op:arith8,pos:237,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000504,src:000000,op:arith8,pos:238,val:+5,+cov b/src/exchange/afl-tests/id:000504,src:000000,op:arith8,pos:238,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000504,src:000000,op:arith8,pos:238,val:+5,+cov
rename to src/exchange/afl-tests/id:000504,src:000000,op:arith8,pos:238,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000504,src:000000,op:int8,pos:6,val:+0 b/src/exchange/afl-tests/id:000504,src:000000,op:int8,pos:6,val:+0
similarity index 100%
rename from src/mint/afl-tests/id:000504,src:000000,op:int8,pos:6,val:+0
rename to src/exchange/afl-tests/id:000504,src:000000,op:int8,pos:6,val:+0
diff --git a/src/mint/afl-tests/id:000505,src:000000,op:arith8,pos:241,val:+7,+cov b/src/exchange/afl-tests/id:000505,src:000000,op:arith8,pos:241,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000505,src:000000,op:arith8,pos:241,val:+7,+cov
rename to src/exchange/afl-tests/id:000505,src:000000,op:arith8,pos:241,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000505,src:000000,op:int8,pos:7,val:+0 b/src/exchange/afl-tests/id:000505,src:000000,op:int8,pos:7,val:+0
similarity index 100%
rename from src/mint/afl-tests/id:000505,src:000000,op:int8,pos:7,val:+0
rename to src/exchange/afl-tests/id:000505,src:000000,op:int8,pos:7,val:+0
diff --git a/src/mint/afl-tests/id:000506,src:000000,op:arith8,pos:268,val:-4,+cov b/src/exchange/afl-tests/id:000506,src:000000,op:arith8,pos:268,val:-4,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000506,src:000000,op:arith8,pos:268,val:-4,+cov
rename to src/exchange/afl-tests/id:000506,src:000000,op:arith8,pos:268,val:-4,+cov
diff --git a/src/mint/afl-tests/id:000506,src:000000,op:int8,pos:9,val:+0 b/src/exchange/afl-tests/id:000506,src:000000,op:int8,pos:9,val:+0
similarity index 100%
rename from src/mint/afl-tests/id:000506,src:000000,op:int8,pos:9,val:+0
rename to src/exchange/afl-tests/id:000506,src:000000,op:int8,pos:9,val:+0
diff --git a/src/mint/afl-tests/id:000507,src:000000,op:arith8,pos:269,val:+19,+cov b/src/exchange/afl-tests/id:000507,src:000000,op:arith8,pos:269,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000507,src:000000,op:arith8,pos:269,val:+19,+cov
rename to src/exchange/afl-tests/id:000507,src:000000,op:arith8,pos:269,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000507,src:000000,op:int8,pos:26,val:+32,+cov b/src/exchange/afl-tests/id:000507,src:000000,op:int8,pos:26,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000507,src:000000,op:int8,pos:26,val:+32,+cov
rename to src/exchange/afl-tests/id:000507,src:000000,op:int8,pos:26,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000508,src:000000,op:arith8,pos:271,val:-12,+cov b/src/exchange/afl-tests/id:000508,src:000000,op:arith8,pos:271,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000508,src:000000,op:arith8,pos:271,val:-12,+cov
rename to src/exchange/afl-tests/id:000508,src:000000,op:arith8,pos:271,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000508,src:000000,op:int8,pos:27,val:+127,+cov b/src/exchange/afl-tests/id:000508,src:000000,op:int8,pos:27,val:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000508,src:000000,op:int8,pos:27,val:+127,+cov
rename to src/exchange/afl-tests/id:000508,src:000000,op:int8,pos:27,val:+127,+cov
diff --git a/src/mint/afl-tests/id:000509,src:000000,op:arith8,pos:272,val:+7,+cov b/src/exchange/afl-tests/id:000509,src:000000,op:arith8,pos:272,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000509,src:000000,op:arith8,pos:272,val:+7,+cov
rename to src/exchange/afl-tests/id:000509,src:000000,op:arith8,pos:272,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000509,src:000000,op:int8,pos:34,val:+0,+cov b/src/exchange/afl-tests/id:000509,src:000000,op:int8,pos:34,val:+0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000509,src:000000,op:int8,pos:34,val:+0,+cov
rename to src/exchange/afl-tests/id:000509,src:000000,op:int8,pos:34,val:+0,+cov
diff --git a/src/mint/afl-tests/id:000510,src:000000,op:arith8,pos:274,val:+11,+cov b/src/exchange/afl-tests/id:000510,src:000000,op:arith8,pos:274,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000510,src:000000,op:arith8,pos:274,val:+11,+cov
rename to src/exchange/afl-tests/id:000510,src:000000,op:arith8,pos:274,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000510,src:000000,op:int8,pos:40,val:+0,+cov b/src/exchange/afl-tests/id:000510,src:000000,op:int8,pos:40,val:+0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000510,src:000000,op:int8,pos:40,val:+0,+cov
rename to src/exchange/afl-tests/id:000510,src:000000,op:int8,pos:40,val:+0,+cov
diff --git a/src/mint/afl-tests/id:000511,src:000000,op:arith8,pos:274,val:+25,+cov b/src/exchange/afl-tests/id:000511,src:000000,op:arith8,pos:274,val:+25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000511,src:000000,op:arith8,pos:274,val:+25,+cov
rename to src/exchange/afl-tests/id:000511,src:000000,op:arith8,pos:274,val:+25,+cov
diff --git a/src/mint/afl-tests/id:000511,src:000000,op:int8,pos:40,val:+32 b/src/exchange/afl-tests/id:000511,src:000000,op:int8,pos:40,val:+32
similarity index 100%
rename from src/mint/afl-tests/id:000511,src:000000,op:int8,pos:40,val:+32
rename to src/exchange/afl-tests/id:000511,src:000000,op:int8,pos:40,val:+32
diff --git a/src/mint/afl-tests/id:000512,src:000000,op:arith8,pos:275,val:-11,+cov b/src/exchange/afl-tests/id:000512,src:000000,op:arith8,pos:275,val:-11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000512,src:000000,op:arith8,pos:275,val:-11,+cov
rename to src/exchange/afl-tests/id:000512,src:000000,op:arith8,pos:275,val:-11,+cov
diff --git a/src/mint/afl-tests/id:000512,src:000000,op:int8,pos:46,val:+1,+cov b/src/exchange/afl-tests/id:000512,src:000000,op:int8,pos:46,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000512,src:000000,op:int8,pos:46,val:+1,+cov
rename to src/exchange/afl-tests/id:000512,src:000000,op:int8,pos:46,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000513,src:000000,op:arith8,pos:275,val:-12,+cov b/src/exchange/afl-tests/id:000513,src:000000,op:arith8,pos:275,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000513,src:000000,op:arith8,pos:275,val:-12,+cov
rename to src/exchange/afl-tests/id:000513,src:000000,op:arith8,pos:275,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000513,src:000000,op:int8,pos:51,val:+1 b/src/exchange/afl-tests/id:000513,src:000000,op:int8,pos:51,val:+1
similarity index 100%
rename from src/mint/afl-tests/id:000513,src:000000,op:int8,pos:51,val:+1
rename to src/exchange/afl-tests/id:000513,src:000000,op:int8,pos:51,val:+1
diff --git a/src/mint/afl-tests/id:000514,src:000000,op:arith8,pos:275,val:+27,+cov b/src/exchange/afl-tests/id:000514,src:000000,op:arith8,pos:275,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000514,src:000000,op:arith8,pos:275,val:+27,+cov
rename to src/exchange/afl-tests/id:000514,src:000000,op:arith8,pos:275,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000514,src:000000,op:int8,pos:52,val:-128,+cov b/src/exchange/afl-tests/id:000514,src:000000,op:int8,pos:52,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000514,src:000000,op:int8,pos:52,val:-128,+cov
rename to src/exchange/afl-tests/id:000514,src:000000,op:int8,pos:52,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000515,src:000000,op:arith8,pos:277,val:-10,+cov b/src/exchange/afl-tests/id:000515,src:000000,op:arith8,pos:277,val:-10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000515,src:000000,op:arith8,pos:277,val:-10,+cov
rename to src/exchange/afl-tests/id:000515,src:000000,op:arith8,pos:277,val:-10,+cov
diff --git a/src/mint/afl-tests/id:000515,src:000000,op:int8,pos:53,val:-1,+cov b/src/exchange/afl-tests/id:000515,src:000000,op:int8,pos:53,val:-1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000515,src:000000,op:int8,pos:53,val:-1,+cov
rename to src/exchange/afl-tests/id:000515,src:000000,op:int8,pos:53,val:-1,+cov
diff --git a/src/mint/afl-tests/id:000516,src:000000,op:arith8,pos:277,val:+35,+cov b/src/exchange/afl-tests/id:000516,src:000000,op:arith8,pos:277,val:+35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000516,src:000000,op:arith8,pos:277,val:+35,+cov
rename to src/exchange/afl-tests/id:000516,src:000000,op:arith8,pos:277,val:+35,+cov
diff --git a/src/mint/afl-tests/id:000516,src:000000,op:int8,pos:69,val:+32,+cov b/src/exchange/afl-tests/id:000516,src:000000,op:int8,pos:69,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000516,src:000000,op:int8,pos:69,val:+32,+cov
rename to src/exchange/afl-tests/id:000516,src:000000,op:int8,pos:69,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000517,src:000000,op:arith8,pos:279,val:+28,+cov b/src/exchange/afl-tests/id:000517,src:000000,op:arith8,pos:279,val:+28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000517,src:000000,op:arith8,pos:279,val:+28,+cov
rename to src/exchange/afl-tests/id:000517,src:000000,op:arith8,pos:279,val:+28,+cov
diff --git a/src/mint/afl-tests/id:000517,src:000000,op:int8,pos:70,val:+32,+cov b/src/exchange/afl-tests/id:000517,src:000000,op:int8,pos:70,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000517,src:000000,op:int8,pos:70,val:+32,+cov
rename to src/exchange/afl-tests/id:000517,src:000000,op:int8,pos:70,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000518,src:000000,op:arith8,pos:290,val:-28,+cov b/src/exchange/afl-tests/id:000518,src:000000,op:arith8,pos:290,val:-28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000518,src:000000,op:arith8,pos:290,val:-28,+cov
rename to src/exchange/afl-tests/id:000518,src:000000,op:arith8,pos:290,val:-28,+cov
diff --git a/src/mint/afl-tests/id:000518,src:000000,op:int8,pos:71,val:+64,+cov b/src/exchange/afl-tests/id:000518,src:000000,op:int8,pos:71,val:+64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000518,src:000000,op:int8,pos:71,val:+64,+cov
rename to src/exchange/afl-tests/id:000518,src:000000,op:int8,pos:71,val:+64,+cov
diff --git a/src/mint/afl-tests/id:000519,src:000000,op:arith8,pos:305,val:-3,+cov b/src/exchange/afl-tests/id:000519,src:000000,op:arith8,pos:305,val:-3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000519,src:000000,op:arith8,pos:305,val:-3,+cov
rename to src/exchange/afl-tests/id:000519,src:000000,op:arith8,pos:305,val:-3,+cov
diff --git a/src/mint/afl-tests/id:000519,src:000000,op:int8,pos:74,val:-1,+cov b/src/exchange/afl-tests/id:000519,src:000000,op:int8,pos:74,val:-1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000519,src:000000,op:int8,pos:74,val:-1,+cov
rename to src/exchange/afl-tests/id:000519,src:000000,op:int8,pos:74,val:-1,+cov
diff --git a/src/mint/afl-tests/id:000520,src:000000,op:arith8,pos:306,val:+7,+cov b/src/exchange/afl-tests/id:000520,src:000000,op:arith8,pos:306,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000520,src:000000,op:arith8,pos:306,val:+7,+cov
rename to src/exchange/afl-tests/id:000520,src:000000,op:arith8,pos:306,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000520,src:000000,op:int8,pos:115,val:+0,+cov b/src/exchange/afl-tests/id:000520,src:000000,op:int8,pos:115,val:+0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000520,src:000000,op:int8,pos:115,val:+0,+cov
rename to src/exchange/afl-tests/id:000520,src:000000,op:int8,pos:115,val:+0,+cov
diff --git a/src/mint/afl-tests/id:000521,src:000000,op:arith8,pos:306,val:-12,+cov b/src/exchange/afl-tests/id:000521,src:000000,op:arith8,pos:306,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000521,src:000000,op:arith8,pos:306,val:-12,+cov
rename to src/exchange/afl-tests/id:000521,src:000000,op:arith8,pos:306,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000521,src:000000,op:int8,pos:188,val:+1,+cov b/src/exchange/afl-tests/id:000521,src:000000,op:int8,pos:188,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000521,src:000000,op:int8,pos:188,val:+1,+cov
rename to src/exchange/afl-tests/id:000521,src:000000,op:int8,pos:188,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000522,src:000000,op:arith8,pos:306,val:+20,+cov b/src/exchange/afl-tests/id:000522,src:000000,op:arith8,pos:306,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000522,src:000000,op:arith8,pos:306,val:+20,+cov
rename to src/exchange/afl-tests/id:000522,src:000000,op:arith8,pos:306,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000522,src:000000,op:int8,pos:276,val:+100,+cov b/src/exchange/afl-tests/id:000522,src:000000,op:int8,pos:276,val:+100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000522,src:000000,op:int8,pos:276,val:+100,+cov
rename to src/exchange/afl-tests/id:000522,src:000000,op:int8,pos:276,val:+100,+cov
diff --git a/src/mint/afl-tests/id:000523,src:000000,op:arith8,pos:307,val:+13,+cov b/src/exchange/afl-tests/id:000523,src:000000,op:arith8,pos:307,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000523,src:000000,op:arith8,pos:307,val:+13,+cov
rename to src/exchange/afl-tests/id:000523,src:000000,op:arith8,pos:307,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000523,src:000000,op:int8,pos:307,val:+32,+cov b/src/exchange/afl-tests/id:000523,src:000000,op:int8,pos:307,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000523,src:000000,op:int8,pos:307,val:+32,+cov
rename to src/exchange/afl-tests/id:000523,src:000000,op:int8,pos:307,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000524,src:000000,op:arith8,pos:308,val:+19,+cov b/src/exchange/afl-tests/id:000524,src:000000,op:arith8,pos:308,val:+19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000524,src:000000,op:arith8,pos:308,val:+19,+cov
rename to src/exchange/afl-tests/id:000524,src:000000,op:arith8,pos:308,val:+19,+cov
diff --git a/src/mint/afl-tests/id:000524,src:000000,op:int8,pos:313,val:+64,+cov b/src/exchange/afl-tests/id:000524,src:000000,op:int8,pos:313,val:+64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000524,src:000000,op:int8,pos:313,val:+64,+cov
rename to src/exchange/afl-tests/id:000524,src:000000,op:int8,pos:313,val:+64,+cov
diff --git a/src/mint/afl-tests/id:000525,src:000000,op:arith8,pos:308,val:-27,+cov b/src/exchange/afl-tests/id:000525,src:000000,op:arith8,pos:308,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000525,src:000000,op:arith8,pos:308,val:-27,+cov
rename to src/exchange/afl-tests/id:000525,src:000000,op:arith8,pos:308,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000525,src:000000,op:int8,pos:314,val:-1,+cov b/src/exchange/afl-tests/id:000525,src:000000,op:int8,pos:314,val:-1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000525,src:000000,op:int8,pos:314,val:-1,+cov
rename to src/exchange/afl-tests/id:000525,src:000000,op:int8,pos:314,val:-1,+cov
diff --git a/src/mint/afl-tests/id:000526,src:000000,op:arith8,pos:312,val:+3,+cov b/src/exchange/afl-tests/id:000526,src:000000,op:arith8,pos:312,val:+3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000526,src:000000,op:arith8,pos:312,val:+3,+cov
rename to src/exchange/afl-tests/id:000526,src:000000,op:arith8,pos:312,val:+3,+cov
diff --git a/src/mint/afl-tests/id:000526,src:000000,op:int8,pos:322,val:+32,+cov b/src/exchange/afl-tests/id:000526,src:000000,op:int8,pos:322,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000526,src:000000,op:int8,pos:322,val:+32,+cov
rename to src/exchange/afl-tests/id:000526,src:000000,op:int8,pos:322,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000527,src:000000,op:arith8,pos:312,val:+5,+cov b/src/exchange/afl-tests/id:000527,src:000000,op:arith8,pos:312,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000527,src:000000,op:arith8,pos:312,val:+5,+cov
rename to src/exchange/afl-tests/id:000527,src:000000,op:arith8,pos:312,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000527,src:000000,op:int16,pos:25,val:be:+100,+cov b/src/exchange/afl-tests/id:000527,src:000000,op:int16,pos:25,val:be:+100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000527,src:000000,op:int16,pos:25,val:be:+100,+cov
rename to src/exchange/afl-tests/id:000527,src:000000,op:int16,pos:25,val:be:+100,+cov
diff --git a/src/mint/afl-tests/id:000528,src:000000,op:arith8,pos:312,val:-11,+cov b/src/exchange/afl-tests/id:000528,src:000000,op:arith8,pos:312,val:-11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000528,src:000000,op:arith8,pos:312,val:-11,+cov
rename to src/exchange/afl-tests/id:000528,src:000000,op:arith8,pos:312,val:-11,+cov
diff --git a/src/mint/afl-tests/id:000528,src:000000,op:int16,pos:29,val:-1,+cov b/src/exchange/afl-tests/id:000528,src:000000,op:int16,pos:29,val:-1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000528,src:000000,op:int16,pos:29,val:-1,+cov
rename to src/exchange/afl-tests/id:000528,src:000000,op:int16,pos:29,val:-1,+cov
diff --git a/src/mint/afl-tests/id:000529,src:000000,op:arith8,pos:313,val:-33,+cov b/src/exchange/afl-tests/id:000529,src:000000,op:arith8,pos:313,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000529,src:000000,op:arith8,pos:313,val:-33,+cov
rename to src/exchange/afl-tests/id:000529,src:000000,op:arith8,pos:313,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000529,src:000000,op:int16,pos:32,val:+32767,+cov b/src/exchange/afl-tests/id:000529,src:000000,op:int16,pos:32,val:+32767,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000529,src:000000,op:int16,pos:32,val:+32767,+cov
rename to src/exchange/afl-tests/id:000529,src:000000,op:int16,pos:32,val:+32767,+cov
diff --git a/src/mint/afl-tests/id:000530,src:000000,op:arith8,pos:314,val:-3,+cov b/src/exchange/afl-tests/id:000530,src:000000,op:arith8,pos:314,val:-3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000530,src:000000,op:arith8,pos:314,val:-3,+cov
rename to src/exchange/afl-tests/id:000530,src:000000,op:arith8,pos:314,val:-3,+cov
diff --git a/src/mint/afl-tests/id:000530,src:000000,op:int16,pos:41,val:-128,+cov b/src/exchange/afl-tests/id:000530,src:000000,op:int16,pos:41,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000530,src:000000,op:int16,pos:41,val:-128,+cov
rename to src/exchange/afl-tests/id:000530,src:000000,op:int16,pos:41,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000531,src:000000,op:arith8,pos:314,val:-25,+cov b/src/exchange/afl-tests/id:000531,src:000000,op:arith8,pos:314,val:-25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000531,src:000000,op:arith8,pos:314,val:-25,+cov
rename to src/exchange/afl-tests/id:000531,src:000000,op:arith8,pos:314,val:-25,+cov
diff --git a/src/mint/afl-tests/id:000531,src:000000,op:int16,pos:41,val:+32,+cov b/src/exchange/afl-tests/id:000531,src:000000,op:int16,pos:41,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000531,src:000000,op:int16,pos:41,val:+32,+cov
rename to src/exchange/afl-tests/id:000531,src:000000,op:int16,pos:41,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000532,src:000000,op:arith8,pos:316,val:+20,+cov b/src/exchange/afl-tests/id:000532,src:000000,op:arith8,pos:316,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000532,src:000000,op:arith8,pos:316,val:+20,+cov
rename to src/exchange/afl-tests/id:000532,src:000000,op:arith8,pos:316,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000532,src:000000,op:int16,pos:42,val:+64,+cov b/src/exchange/afl-tests/id:000532,src:000000,op:int16,pos:42,val:+64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000532,src:000000,op:int16,pos:42,val:+64,+cov
rename to src/exchange/afl-tests/id:000532,src:000000,op:int16,pos:42,val:+64,+cov
diff --git a/src/mint/afl-tests/id:000533,src:000000,op:arith8,pos:316,val:-23,+cov b/src/exchange/afl-tests/id:000533,src:000000,op:arith8,pos:316,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000533,src:000000,op:arith8,pos:316,val:-23,+cov
rename to src/exchange/afl-tests/id:000533,src:000000,op:arith8,pos:316,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000533,src:000000,op:int16,pos:47,val:+128,+cov b/src/exchange/afl-tests/id:000533,src:000000,op:int16,pos:47,val:+128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000533,src:000000,op:int16,pos:47,val:+128,+cov
rename to src/exchange/afl-tests/id:000533,src:000000,op:int16,pos:47,val:+128,+cov
diff --git a/src/mint/afl-tests/id:000534,src:000000,op:arith8,pos:316,val:-28,+cov b/src/exchange/afl-tests/id:000534,src:000000,op:arith8,pos:316,val:-28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000534,src:000000,op:arith8,pos:316,val:-28,+cov
rename to src/exchange/afl-tests/id:000534,src:000000,op:arith8,pos:316,val:-28,+cov
diff --git a/src/mint/afl-tests/id:000534,src:000000,op:int16,pos:48,val:be:+1000,+cov b/src/exchange/afl-tests/id:000534,src:000000,op:int16,pos:48,val:be:+1000,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000534,src:000000,op:int16,pos:48,val:be:+1000,+cov
rename to src/exchange/afl-tests/id:000534,src:000000,op:int16,pos:48,val:be:+1000,+cov
diff --git a/src/mint/afl-tests/id:000535,src:000000,op:arith8,pos:317,val:-31,+cov b/src/exchange/afl-tests/id:000535,src:000000,op:arith8,pos:317,val:-31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000535,src:000000,op:arith8,pos:317,val:-31,+cov
rename to src/exchange/afl-tests/id:000535,src:000000,op:arith8,pos:317,val:-31,+cov
diff --git a/src/mint/afl-tests/id:000535,src:000000,op:int16,pos:50,val:+16,+cov b/src/exchange/afl-tests/id:000535,src:000000,op:int16,pos:50,val:+16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000535,src:000000,op:int16,pos:50,val:+16,+cov
rename to src/exchange/afl-tests/id:000535,src:000000,op:int16,pos:50,val:+16,+cov
diff --git a/src/mint/afl-tests/id:000536,src:000000,op:arith8,pos:318,val:+23,+cov b/src/exchange/afl-tests/id:000536,src:000000,op:arith8,pos:318,val:+23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000536,src:000000,op:arith8,pos:318,val:+23,+cov
rename to src/exchange/afl-tests/id:000536,src:000000,op:arith8,pos:318,val:+23,+cov
diff --git a/src/mint/afl-tests/id:000536,src:000000,op:int16,pos:50,val:be:+1024,+cov b/src/exchange/afl-tests/id:000536,src:000000,op:int16,pos:50,val:be:+1024,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000536,src:000000,op:int16,pos:50,val:be:+1024,+cov
rename to src/exchange/afl-tests/id:000536,src:000000,op:int16,pos:50,val:be:+1024,+cov
diff --git a/src/mint/afl-tests/id:000537,src:000000,op:arith8,pos:319,val:-12,+cov b/src/exchange/afl-tests/id:000537,src:000000,op:arith8,pos:319,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000537,src:000000,op:arith8,pos:319,val:-12,+cov
rename to src/exchange/afl-tests/id:000537,src:000000,op:arith8,pos:319,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000537,src:000000,op:int16,pos:52,val:-129,+cov b/src/exchange/afl-tests/id:000537,src:000000,op:int16,pos:52,val:-129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000537,src:000000,op:int16,pos:52,val:-129,+cov
rename to src/exchange/afl-tests/id:000537,src:000000,op:int16,pos:52,val:-129,+cov
diff --git a/src/mint/afl-tests/id:000538,src:000000,op:arith8,pos:320,val:+17,+cov b/src/exchange/afl-tests/id:000538,src:000000,op:arith8,pos:320,val:+17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000538,src:000000,op:arith8,pos:320,val:+17,+cov
rename to src/exchange/afl-tests/id:000538,src:000000,op:arith8,pos:320,val:+17,+cov
diff --git a/src/mint/afl-tests/id:000538,src:000000,op:int16,pos:52,val:+128,+cov b/src/exchange/afl-tests/id:000538,src:000000,op:int16,pos:52,val:+128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000538,src:000000,op:int16,pos:52,val:+128,+cov
rename to src/exchange/afl-tests/id:000538,src:000000,op:int16,pos:52,val:+128,+cov
diff --git a/src/mint/afl-tests/id:000539,src:000000,op:arith8,pos:320,val:-31,+cov b/src/exchange/afl-tests/id:000539,src:000000,op:arith8,pos:320,val:-31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000539,src:000000,op:arith8,pos:320,val:-31,+cov
rename to src/exchange/afl-tests/id:000539,src:000000,op:arith8,pos:320,val:-31,+cov
diff --git a/src/mint/afl-tests/id:000539,src:000000,op:int16,pos:52,val:be:+255,+cov b/src/exchange/afl-tests/id:000539,src:000000,op:int16,pos:52,val:be:+255,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000539,src:000000,op:int16,pos:52,val:be:+255,+cov
rename to src/exchange/afl-tests/id:000539,src:000000,op:int16,pos:52,val:be:+255,+cov
diff --git a/src/mint/afl-tests/id:000540,src:000000,op:arith8,pos:321,val:-34,+cov b/src/exchange/afl-tests/id:000540,src:000000,op:arith8,pos:321,val:-34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000540,src:000000,op:arith8,pos:321,val:-34,+cov
rename to src/exchange/afl-tests/id:000540,src:000000,op:arith8,pos:321,val:-34,+cov
diff --git a/src/mint/afl-tests/id:000540,src:000000,op:int16,pos:53,val:+0,+cov b/src/exchange/afl-tests/id:000540,src:000000,op:int16,pos:53,val:+0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000540,src:000000,op:int16,pos:53,val:+0,+cov
rename to src/exchange/afl-tests/id:000540,src:000000,op:int16,pos:53,val:+0,+cov
diff --git a/src/mint/afl-tests/id:000541,src:000000,op:arith8,pos:322,val:+3,+cov b/src/exchange/afl-tests/id:000541,src:000000,op:arith8,pos:322,val:+3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000541,src:000000,op:arith8,pos:322,val:+3,+cov
rename to src/exchange/afl-tests/id:000541,src:000000,op:arith8,pos:322,val:+3,+cov
diff --git a/src/mint/afl-tests/id:000541,src:000000,op:int16,pos:54,val:+1,+cov b/src/exchange/afl-tests/id:000541,src:000000,op:int16,pos:54,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000541,src:000000,op:int16,pos:54,val:+1,+cov
rename to src/exchange/afl-tests/id:000541,src:000000,op:int16,pos:54,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000542,src:000000,op:arith8,pos:322,val:+7,+cov b/src/exchange/afl-tests/id:000542,src:000000,op:arith8,pos:322,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000542,src:000000,op:arith8,pos:322,val:+7,+cov
rename to src/exchange/afl-tests/id:000542,src:000000,op:arith8,pos:322,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000542,src:000000,op:int16,pos:69,val:-129,+cov b/src/exchange/afl-tests/id:000542,src:000000,op:int16,pos:69,val:-129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000542,src:000000,op:int16,pos:69,val:-129,+cov
rename to src/exchange/afl-tests/id:000542,src:000000,op:int16,pos:69,val:-129,+cov
diff --git a/src/mint/afl-tests/id:000543,src:000000,op:arith8,pos:326,val:-9,+cov b/src/exchange/afl-tests/id:000543,src:000000,op:arith8,pos:326,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000543,src:000000,op:arith8,pos:326,val:-9,+cov
rename to src/exchange/afl-tests/id:000543,src:000000,op:arith8,pos:326,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000543,src:000000,op:int16,pos:74,val:be:-128,+cov b/src/exchange/afl-tests/id:000543,src:000000,op:int16,pos:74,val:be:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000543,src:000000,op:int16,pos:74,val:be:-128,+cov
rename to src/exchange/afl-tests/id:000543,src:000000,op:int16,pos:74,val:be:-128,+cov
diff --git a/src/mint/afl-tests/id:000544,src:000000,op:arith8,pos:326,val:-31,+cov b/src/exchange/afl-tests/id:000544,src:000000,op:arith8,pos:326,val:-31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000544,src:000000,op:arith8,pos:326,val:-31,+cov
rename to src/exchange/afl-tests/id:000544,src:000000,op:arith8,pos:326,val:-31,+cov
diff --git a/src/mint/afl-tests/id:000544,src:000000,op:int16,pos:78,val:be:+127,+cov b/src/exchange/afl-tests/id:000544,src:000000,op:int16,pos:78,val:be:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000544,src:000000,op:int16,pos:78,val:be:+127,+cov
rename to src/exchange/afl-tests/id:000544,src:000000,op:int16,pos:78,val:be:+127,+cov
diff --git a/src/mint/afl-tests/id:000545,src:000000,op:arith8,pos:326,val:-35,+cov b/src/exchange/afl-tests/id:000545,src:000000,op:arith8,pos:326,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000545,src:000000,op:arith8,pos:326,val:-35,+cov
rename to src/exchange/afl-tests/id:000545,src:000000,op:arith8,pos:326,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000545,src:000000,op:int16,pos:81,val:+32767,+cov b/src/exchange/afl-tests/id:000545,src:000000,op:int16,pos:81,val:+32767,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000545,src:000000,op:int16,pos:81,val:+32767,+cov
rename to src/exchange/afl-tests/id:000545,src:000000,op:int16,pos:81,val:+32767,+cov
diff --git a/src/mint/afl-tests/id:000546,src:000000,op:arith8,pos:327,val:+5 b/src/exchange/afl-tests/id:000546,src:000000,op:arith8,pos:327,val:+5
similarity index 100%
rename from src/mint/afl-tests/id:000546,src:000000,op:arith8,pos:327,val:+5
rename to src/exchange/afl-tests/id:000546,src:000000,op:arith8,pos:327,val:+5
diff --git a/src/mint/afl-tests/id:000546,src:000000,op:int16,pos:83,val:+127,+cov b/src/exchange/afl-tests/id:000546,src:000000,op:int16,pos:83,val:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000546,src:000000,op:int16,pos:83,val:+127,+cov
rename to src/exchange/afl-tests/id:000546,src:000000,op:int16,pos:83,val:+127,+cov
diff --git a/src/mint/afl-tests/id:000547,src:000000,op:arith8,pos:327,val:+7,+cov b/src/exchange/afl-tests/id:000547,src:000000,op:arith8,pos:327,val:+7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000547,src:000000,op:arith8,pos:327,val:+7,+cov
rename to src/exchange/afl-tests/id:000547,src:000000,op:arith8,pos:327,val:+7,+cov
diff --git a/src/mint/afl-tests/id:000547,src:000000,op:int16,pos:86,val:+4096,+cov b/src/exchange/afl-tests/id:000547,src:000000,op:int16,pos:86,val:+4096,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000547,src:000000,op:int16,pos:86,val:+4096,+cov
rename to src/exchange/afl-tests/id:000547,src:000000,op:int16,pos:86,val:+4096,+cov
diff --git a/src/mint/afl-tests/id:000548,src:000000,op:arith8,pos:327,val:+11,+cov b/src/exchange/afl-tests/id:000548,src:000000,op:arith8,pos:327,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000548,src:000000,op:arith8,pos:327,val:+11,+cov
rename to src/exchange/afl-tests/id:000548,src:000000,op:arith8,pos:327,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000548,src:000000,op:int16,pos:87,val:+16,+cov b/src/exchange/afl-tests/id:000548,src:000000,op:int16,pos:87,val:+16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000548,src:000000,op:int16,pos:87,val:+16,+cov
rename to src/exchange/afl-tests/id:000548,src:000000,op:int16,pos:87,val:+16,+cov
diff --git a/src/mint/afl-tests/id:000549,src:000000,op:arith8,pos:327,val:-24,+cov b/src/exchange/afl-tests/id:000549,src:000000,op:arith8,pos:327,val:-24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000549,src:000000,op:arith8,pos:327,val:-24,+cov
rename to src/exchange/afl-tests/id:000549,src:000000,op:arith8,pos:327,val:-24,+cov
diff --git a/src/mint/afl-tests/id:000549,src:000000,op:int16,pos:87,val:-32768,+cov b/src/exchange/afl-tests/id:000549,src:000000,op:int16,pos:87,val:-32768,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000549,src:000000,op:int16,pos:87,val:-32768,+cov
rename to src/exchange/afl-tests/id:000549,src:000000,op:int16,pos:87,val:-32768,+cov
diff --git a/src/mint/afl-tests/id:000550,src:000000,op:arith8,pos:328,val:+14,+cov b/src/exchange/afl-tests/id:000550,src:000000,op:arith8,pos:328,val:+14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000550,src:000000,op:arith8,pos:328,val:+14,+cov
rename to src/exchange/afl-tests/id:000550,src:000000,op:arith8,pos:328,val:+14,+cov
diff --git a/src/mint/afl-tests/id:000550,src:000000,op:int16,pos:90,val:+256,+cov b/src/exchange/afl-tests/id:000550,src:000000,op:int16,pos:90,val:+256,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000550,src:000000,op:int16,pos:90,val:+256,+cov
rename to src/exchange/afl-tests/id:000550,src:000000,op:int16,pos:90,val:+256,+cov
diff --git a/src/mint/afl-tests/id:000551,src:000000,op:arith8,pos:329,val:+1,+cov b/src/exchange/afl-tests/id:000551,src:000000,op:arith8,pos:329,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000551,src:000000,op:arith8,pos:329,val:+1,+cov
rename to src/exchange/afl-tests/id:000551,src:000000,op:arith8,pos:329,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000551,src:000000,op:int16,pos:91,val:+32,+cov b/src/exchange/afl-tests/id:000551,src:000000,op:int16,pos:91,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000551,src:000000,op:int16,pos:91,val:+32,+cov
rename to src/exchange/afl-tests/id:000551,src:000000,op:int16,pos:91,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000552,src:000000,op:arith8,pos:330,val:+9,+cov b/src/exchange/afl-tests/id:000552,src:000000,op:arith8,pos:330,val:+9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000552,src:000000,op:arith8,pos:330,val:+9,+cov
rename to src/exchange/afl-tests/id:000552,src:000000,op:arith8,pos:330,val:+9,+cov
diff --git a/src/mint/afl-tests/id:000552,src:000000,op:int16,pos:91,val:-129,+cov b/src/exchange/afl-tests/id:000552,src:000000,op:int16,pos:91,val:-129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000552,src:000000,op:int16,pos:91,val:-129,+cov
rename to src/exchange/afl-tests/id:000552,src:000000,op:int16,pos:91,val:-129,+cov
diff --git a/src/mint/afl-tests/id:000553,src:000000,op:arith8,pos:330,val:-24,+cov b/src/exchange/afl-tests/id:000553,src:000000,op:arith8,pos:330,val:-24,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000553,src:000000,op:arith8,pos:330,val:-24,+cov
rename to src/exchange/afl-tests/id:000553,src:000000,op:arith8,pos:330,val:-24,+cov
diff --git a/src/mint/afl-tests/id:000553,src:000000,op:int16,pos:93,val:+0,+cov b/src/exchange/afl-tests/id:000553,src:000000,op:int16,pos:93,val:+0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000553,src:000000,op:int16,pos:93,val:+0,+cov
rename to src/exchange/afl-tests/id:000553,src:000000,op:int16,pos:93,val:+0,+cov
diff --git a/src/mint/afl-tests/id:000554,src:000000,op:int16,pos:94,val:be:+64,+cov b/src/exchange/afl-tests/id:000554,src:000000,op:int16,pos:94,val:be:+64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000554,src:000000,op:int16,pos:94,val:be:+64,+cov
rename to src/exchange/afl-tests/id:000554,src:000000,op:int16,pos:94,val:be:+64,+cov
diff --git a/src/mint/afl-tests/id:000554,src:000000,op:int8,pos:6,val:+0 b/src/exchange/afl-tests/id:000554,src:000000,op:int8,pos:6,val:+0
similarity index 100%
rename from src/mint/afl-tests/id:000554,src:000000,op:int8,pos:6,val:+0
rename to src/exchange/afl-tests/id:000554,src:000000,op:int8,pos:6,val:+0
diff --git a/src/mint/afl-tests/id:000555,src:000000,op:int16,pos:94,val:be:+100,+cov b/src/exchange/afl-tests/id:000555,src:000000,op:int16,pos:94,val:be:+100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000555,src:000000,op:int16,pos:94,val:be:+100,+cov
rename to src/exchange/afl-tests/id:000555,src:000000,op:int16,pos:94,val:be:+100,+cov
diff --git a/src/mint/afl-tests/id:000555,src:000000,op:int8,pos:7,val:+0 b/src/exchange/afl-tests/id:000555,src:000000,op:int8,pos:7,val:+0
similarity index 100%
rename from src/mint/afl-tests/id:000555,src:000000,op:int8,pos:7,val:+0
rename to src/exchange/afl-tests/id:000555,src:000000,op:int8,pos:7,val:+0
diff --git a/src/mint/afl-tests/id:000556,src:000000,op:int16,pos:232,val:+1,+cov b/src/exchange/afl-tests/id:000556,src:000000,op:int16,pos:232,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000556,src:000000,op:int16,pos:232,val:+1,+cov
rename to src/exchange/afl-tests/id:000556,src:000000,op:int16,pos:232,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000556,src:000000,op:int8,pos:9,val:+0 b/src/exchange/afl-tests/id:000556,src:000000,op:int8,pos:9,val:+0
similarity index 100%
rename from src/mint/afl-tests/id:000556,src:000000,op:int8,pos:9,val:+0
rename to src/exchange/afl-tests/id:000556,src:000000,op:int8,pos:9,val:+0
diff --git a/src/mint/afl-tests/id:000557,src:000000,op:int16,pos:254,val:+256,+cov b/src/exchange/afl-tests/id:000557,src:000000,op:int16,pos:254,val:+256,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000557,src:000000,op:int16,pos:254,val:+256,+cov
rename to src/exchange/afl-tests/id:000557,src:000000,op:int16,pos:254,val:+256,+cov
diff --git a/src/mint/afl-tests/id:000557,src:000000,op:int8,pos:34,val:+0,+cov b/src/exchange/afl-tests/id:000557,src:000000,op:int8,pos:34,val:+0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000557,src:000000,op:int8,pos:34,val:+0,+cov
rename to src/exchange/afl-tests/id:000557,src:000000,op:int8,pos:34,val:+0,+cov
diff --git a/src/mint/afl-tests/id:000558,src:000000,op:int16,pos:262,val:+1000,+cov b/src/exchange/afl-tests/id:000558,src:000000,op:int16,pos:262,val:+1000,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000558,src:000000,op:int16,pos:262,val:+1000,+cov
rename to src/exchange/afl-tests/id:000558,src:000000,op:int16,pos:262,val:+1000,+cov
diff --git a/src/mint/afl-tests/id:000558,src:000000,op:int8,pos:40,val:+0,+cov b/src/exchange/afl-tests/id:000558,src:000000,op:int8,pos:40,val:+0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000558,src:000000,op:int8,pos:40,val:+0,+cov
rename to src/exchange/afl-tests/id:000558,src:000000,op:int8,pos:40,val:+0,+cov
diff --git a/src/mint/afl-tests/id:000559,src:000000,op:int16,pos:303,val:+128,+cov b/src/exchange/afl-tests/id:000559,src:000000,op:int16,pos:303,val:+128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000559,src:000000,op:int16,pos:303,val:+128,+cov
rename to src/exchange/afl-tests/id:000559,src:000000,op:int16,pos:303,val:+128,+cov
diff --git a/src/mint/afl-tests/id:000559,src:000000,op:int8,pos:40,val:+32 b/src/exchange/afl-tests/id:000559,src:000000,op:int8,pos:40,val:+32
similarity index 100%
rename from src/mint/afl-tests/id:000559,src:000000,op:int8,pos:40,val:+32
rename to src/exchange/afl-tests/id:000559,src:000000,op:int8,pos:40,val:+32
diff --git a/src/mint/afl-tests/id:000560,src:000000,op:int32,pos:3,val:be:+1000 b/src/exchange/afl-tests/id:000560,src:000000,op:int32,pos:3,val:be:+1000
similarity index 100%
rename from src/mint/afl-tests/id:000560,src:000000,op:int32,pos:3,val:be:+1000
rename to src/exchange/afl-tests/id:000560,src:000000,op:int32,pos:3,val:be:+1000
diff --git a/src/mint/afl-tests/id:000560,src:000000,op:int8,pos:44,val:-1,+cov b/src/exchange/afl-tests/id:000560,src:000000,op:int8,pos:44,val:-1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000560,src:000000,op:int8,pos:44,val:-1,+cov
rename to src/exchange/afl-tests/id:000560,src:000000,op:int8,pos:44,val:-1,+cov
diff --git a/src/mint/afl-tests/id:000561,src:000000,op:int32,pos:28,val:+32768,+cov b/src/exchange/afl-tests/id:000561,src:000000,op:int32,pos:28,val:+32768,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000561,src:000000,op:int32,pos:28,val:+32768,+cov
rename to src/exchange/afl-tests/id:000561,src:000000,op:int32,pos:28,val:+32768,+cov
diff --git a/src/mint/afl-tests/id:000561,src:000000,op:int8,pos:51,val:-1,+cov b/src/exchange/afl-tests/id:000561,src:000000,op:int8,pos:51,val:-1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000561,src:000000,op:int8,pos:51,val:-1,+cov
rename to src/exchange/afl-tests/id:000561,src:000000,op:int8,pos:51,val:-1,+cov
diff --git a/src/mint/afl-tests/id:000562,src:000000,op:int32,pos:29,val:-128,+cov b/src/exchange/afl-tests/id:000562,src:000000,op:int32,pos:29,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000562,src:000000,op:int32,pos:29,val:-128,+cov
rename to src/exchange/afl-tests/id:000562,src:000000,op:int32,pos:29,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000562,src:000000,op:int8,pos:62,val:-128,+cov b/src/exchange/afl-tests/id:000562,src:000000,op:int8,pos:62,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000562,src:000000,op:int8,pos:62,val:-128,+cov
rename to src/exchange/afl-tests/id:000562,src:000000,op:int8,pos:62,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000563,src:000000,op:int32,pos:33,val:-128,+cov b/src/exchange/afl-tests/id:000563,src:000000,op:int32,pos:33,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000563,src:000000,op:int32,pos:33,val:-128,+cov
rename to src/exchange/afl-tests/id:000563,src:000000,op:int32,pos:33,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000563,src:000000,op:int8,pos:135,val:+127,+cov b/src/exchange/afl-tests/id:000563,src:000000,op:int8,pos:135,val:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000563,src:000000,op:int8,pos:135,val:+127,+cov
rename to src/exchange/afl-tests/id:000563,src:000000,op:int8,pos:135,val:+127,+cov
diff --git a/src/mint/afl-tests/id:000564,src:000000,op:int32,pos:33,val:+1024,+cov b/src/exchange/afl-tests/id:000564,src:000000,op:int32,pos:33,val:+1024,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000564,src:000000,op:int32,pos:33,val:+1024,+cov
rename to src/exchange/afl-tests/id:000564,src:000000,op:int32,pos:33,val:+1024,+cov
diff --git a/src/mint/afl-tests/id:000564,src:000000,op:int8,pos:140,val:+100,+cov b/src/exchange/afl-tests/id:000564,src:000000,op:int8,pos:140,val:+100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000564,src:000000,op:int8,pos:140,val:+100,+cov
rename to src/exchange/afl-tests/id:000564,src:000000,op:int8,pos:140,val:+100,+cov
diff --git a/src/mint/afl-tests/id:000565,src:000000,op:int32,pos:33,val:be:-32769,+cov b/src/exchange/afl-tests/id:000565,src:000000,op:int32,pos:33,val:be:-32769,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000565,src:000000,op:int32,pos:33,val:be:-32769,+cov
rename to src/exchange/afl-tests/id:000565,src:000000,op:int32,pos:33,val:be:-32769,+cov
diff --git a/src/mint/afl-tests/id:000565,src:000000,op:int8,pos:178,val:+100,+cov b/src/exchange/afl-tests/id:000565,src:000000,op:int8,pos:178,val:+100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000565,src:000000,op:int8,pos:178,val:+100,+cov
rename to src/exchange/afl-tests/id:000565,src:000000,op:int8,pos:178,val:+100,+cov
diff --git a/src/mint/afl-tests/id:000566,src:000000,op:int16,pos:27,val:-128,+cov b/src/exchange/afl-tests/id:000566,src:000000,op:int16,pos:27,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000566,src:000000,op:int16,pos:27,val:-128,+cov
rename to src/exchange/afl-tests/id:000566,src:000000,op:int16,pos:27,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000566,src:000000,op:int32,pos:39,val:be:+255,+cov b/src/exchange/afl-tests/id:000566,src:000000,op:int32,pos:39,val:be:+255,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000566,src:000000,op:int32,pos:39,val:be:+255,+cov
rename to src/exchange/afl-tests/id:000566,src:000000,op:int32,pos:39,val:be:+255,+cov
diff --git a/src/mint/afl-tests/id:000567,src:000000,op:int16,pos:28,val:be:+32,+cov b/src/exchange/afl-tests/id:000567,src:000000,op:int16,pos:28,val:be:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000567,src:000000,op:int16,pos:28,val:be:+32,+cov
rename to src/exchange/afl-tests/id:000567,src:000000,op:int16,pos:28,val:be:+32,+cov
diff --git a/src/mint/afl-tests/id:000567,src:000000,op:int32,pos:40,val:+32767,+cov b/src/exchange/afl-tests/id:000567,src:000000,op:int32,pos:40,val:+32767,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000567,src:000000,op:int32,pos:40,val:+32767,+cov
rename to src/exchange/afl-tests/id:000567,src:000000,op:int32,pos:40,val:+32767,+cov
diff --git a/src/mint/afl-tests/id:000568,src:000000,op:int16,pos:28,val:be:+127,+cov b/src/exchange/afl-tests/id:000568,src:000000,op:int16,pos:28,val:be:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000568,src:000000,op:int16,pos:28,val:be:+127,+cov
rename to src/exchange/afl-tests/id:000568,src:000000,op:int16,pos:28,val:be:+127,+cov
diff --git a/src/mint/afl-tests/id:000568,src:000000,op:int32,pos:41,val:+16,+cov b/src/exchange/afl-tests/id:000568,src:000000,op:int32,pos:41,val:+16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000568,src:000000,op:int32,pos:41,val:+16,+cov
rename to src/exchange/afl-tests/id:000568,src:000000,op:int32,pos:41,val:+16,+cov
diff --git a/src/mint/afl-tests/id:000569,src:000000,op:int16,pos:33,val:be:+512,+cov b/src/exchange/afl-tests/id:000569,src:000000,op:int16,pos:33,val:be:+512,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000569,src:000000,op:int16,pos:33,val:be:+512,+cov
rename to src/exchange/afl-tests/id:000569,src:000000,op:int16,pos:33,val:be:+512,+cov
diff --git a/src/mint/afl-tests/id:000569,src:000000,op:int32,pos:41,val:+1024,+cov b/src/exchange/afl-tests/id:000569,src:000000,op:int32,pos:41,val:+1024,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000569,src:000000,op:int32,pos:41,val:+1024,+cov
rename to src/exchange/afl-tests/id:000569,src:000000,op:int32,pos:41,val:+1024,+cov
diff --git a/src/mint/afl-tests/id:000570,src:000000,op:int16,pos:34,val:+1000,+cov b/src/exchange/afl-tests/id:000570,src:000000,op:int16,pos:34,val:+1000,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000570,src:000000,op:int16,pos:34,val:+1000,+cov
rename to src/exchange/afl-tests/id:000570,src:000000,op:int16,pos:34,val:+1000,+cov
diff --git a/src/mint/afl-tests/id:000570,src:000000,op:int32,pos:44,val:-32769,+cov b/src/exchange/afl-tests/id:000570,src:000000,op:int32,pos:44,val:-32769,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000570,src:000000,op:int32,pos:44,val:-32769,+cov
rename to src/exchange/afl-tests/id:000570,src:000000,op:int32,pos:44,val:-32769,+cov
diff --git a/src/mint/afl-tests/id:000571,src:000000,op:int16,pos:44,val:+512,+cov b/src/exchange/afl-tests/id:000571,src:000000,op:int16,pos:44,val:+512,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000571,src:000000,op:int16,pos:44,val:+512,+cov
rename to src/exchange/afl-tests/id:000571,src:000000,op:int16,pos:44,val:+512,+cov
diff --git a/src/mint/afl-tests/id:000571,src:000000,op:int32,pos:45,val:be:+1024,+cov b/src/exchange/afl-tests/id:000571,src:000000,op:int32,pos:45,val:be:+1024,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000571,src:000000,op:int32,pos:45,val:be:+1024,+cov
rename to src/exchange/afl-tests/id:000571,src:000000,op:int32,pos:45,val:be:+1024,+cov
diff --git a/src/mint/afl-tests/id:000572,src:000000,op:int16,pos:46,val:+100,+cov b/src/exchange/afl-tests/id:000572,src:000000,op:int16,pos:46,val:+100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000572,src:000000,op:int16,pos:46,val:+100,+cov
rename to src/exchange/afl-tests/id:000572,src:000000,op:int16,pos:46,val:+100,+cov
diff --git a/src/mint/afl-tests/id:000572,src:000000,op:int32,pos:48,val:+256,+cov b/src/exchange/afl-tests/id:000572,src:000000,op:int32,pos:48,val:+256,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000572,src:000000,op:int32,pos:48,val:+256,+cov
rename to src/exchange/afl-tests/id:000572,src:000000,op:int32,pos:48,val:+256,+cov
diff --git a/src/mint/afl-tests/id:000573,src:000000,op:int16,pos:46,val:be:+512,+cov b/src/exchange/afl-tests/id:000573,src:000000,op:int16,pos:46,val:be:+512,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000573,src:000000,op:int16,pos:46,val:be:+512,+cov
rename to src/exchange/afl-tests/id:000573,src:000000,op:int16,pos:46,val:be:+512,+cov
diff --git a/src/mint/afl-tests/id:000573,src:000000,op:int32,pos:53,val:+32768,+cov b/src/exchange/afl-tests/id:000573,src:000000,op:int32,pos:53,val:+32768,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000573,src:000000,op:int32,pos:53,val:+32768,+cov
rename to src/exchange/afl-tests/id:000573,src:000000,op:int32,pos:53,val:+32768,+cov
diff --git a/src/mint/afl-tests/id:000574,src:000000,op:int16,pos:52,val:-128,+cov b/src/exchange/afl-tests/id:000574,src:000000,op:int16,pos:52,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000574,src:000000,op:int16,pos:52,val:-128,+cov
rename to src/exchange/afl-tests/id:000574,src:000000,op:int16,pos:52,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000574,src:000000,op:int32,pos:54,val:be:-32768,+cov b/src/exchange/afl-tests/id:000574,src:000000,op:int32,pos:54,val:be:-32768,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000574,src:000000,op:int32,pos:54,val:be:-32768,+cov
rename to src/exchange/afl-tests/id:000574,src:000000,op:int32,pos:54,val:be:-32768,+cov
diff --git a/src/mint/afl-tests/id:000575,src:000000,op:int16,pos:54,val:-128,+cov b/src/exchange/afl-tests/id:000575,src:000000,op:int16,pos:54,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000575,src:000000,op:int16,pos:54,val:-128,+cov
rename to src/exchange/afl-tests/id:000575,src:000000,op:int16,pos:54,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000575,src:000000,op:int32,pos:54,val:-32769,+cov b/src/exchange/afl-tests/id:000575,src:000000,op:int32,pos:54,val:-32769,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000575,src:000000,op:int32,pos:54,val:-32769,+cov
rename to src/exchange/afl-tests/id:000575,src:000000,op:int32,pos:54,val:-32769,+cov
diff --git a/src/mint/afl-tests/id:000576,src:000000,op:int16,pos:54,val:+100,+cov b/src/exchange/afl-tests/id:000576,src:000000,op:int16,pos:54,val:+100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000576,src:000000,op:int16,pos:54,val:+100,+cov
rename to src/exchange/afl-tests/id:000576,src:000000,op:int16,pos:54,val:+100,+cov
diff --git a/src/mint/afl-tests/id:000576,src:000000,op:int32,pos:54,val:+2147483647,+cov b/src/exchange/afl-tests/id:000576,src:000000,op:int32,pos:54,val:+2147483647,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000576,src:000000,op:int32,pos:54,val:+2147483647,+cov
rename to src/exchange/afl-tests/id:000576,src:000000,op:int32,pos:54,val:+2147483647,+cov
diff --git a/src/mint/afl-tests/id:000577,src:000000,op:int16,pos:54,val:+255,+cov b/src/exchange/afl-tests/id:000577,src:000000,op:int16,pos:54,val:+255,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000577,src:000000,op:int16,pos:54,val:+255,+cov
rename to src/exchange/afl-tests/id:000577,src:000000,op:int16,pos:54,val:+255,+cov
diff --git a/src/mint/afl-tests/id:000577,src:000000,op:int32,pos:63,val:-1,+cov b/src/exchange/afl-tests/id:000577,src:000000,op:int32,pos:63,val:-1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000577,src:000000,op:int32,pos:63,val:-1,+cov
rename to src/exchange/afl-tests/id:000577,src:000000,op:int32,pos:63,val:-1,+cov
diff --git a/src/mint/afl-tests/id:000578,src:000000,op:int16,pos:62,val:+255,+cov b/src/exchange/afl-tests/id:000578,src:000000,op:int16,pos:62,val:+255,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000578,src:000000,op:int16,pos:62,val:+255,+cov
rename to src/exchange/afl-tests/id:000578,src:000000,op:int16,pos:62,val:+255,+cov
diff --git a/src/mint/afl-tests/id:000578,src:000000,op:int32,pos:64,val:-128,+cov b/src/exchange/afl-tests/id:000578,src:000000,op:int32,pos:64,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000578,src:000000,op:int32,pos:64,val:-128,+cov
rename to src/exchange/afl-tests/id:000578,src:000000,op:int32,pos:64,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000579,src:000000,op:int16,pos:63,val:+32,+cov b/src/exchange/afl-tests/id:000579,src:000000,op:int16,pos:63,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000579,src:000000,op:int16,pos:63,val:+32,+cov
rename to src/exchange/afl-tests/id:000579,src:000000,op:int16,pos:63,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000579,src:000000,op:int32,pos:69,val:+128,+cov b/src/exchange/afl-tests/id:000579,src:000000,op:int32,pos:69,val:+128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000579,src:000000,op:int32,pos:69,val:+128,+cov
rename to src/exchange/afl-tests/id:000579,src:000000,op:int32,pos:69,val:+128,+cov
diff --git a/src/mint/afl-tests/id:000580,src:000000,op:int16,pos:65,val:be:+100,+cov b/src/exchange/afl-tests/id:000580,src:000000,op:int16,pos:65,val:be:+100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000580,src:000000,op:int16,pos:65,val:be:+100,+cov
rename to src/exchange/afl-tests/id:000580,src:000000,op:int16,pos:65,val:be:+100,+cov
diff --git a/src/mint/afl-tests/id:000580,src:000000,op:int32,pos:80,val:+1024,+cov b/src/exchange/afl-tests/id:000580,src:000000,op:int32,pos:80,val:+1024,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000580,src:000000,op:int32,pos:80,val:+1024,+cov
rename to src/exchange/afl-tests/id:000580,src:000000,op:int32,pos:80,val:+1024,+cov
diff --git a/src/mint/afl-tests/id:000581,src:000000,op:int16,pos:66,val:+0,+cov b/src/exchange/afl-tests/id:000581,src:000000,op:int16,pos:66,val:+0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000581,src:000000,op:int16,pos:66,val:+0,+cov
rename to src/exchange/afl-tests/id:000581,src:000000,op:int16,pos:66,val:+0,+cov
diff --git a/src/mint/afl-tests/id:000581,src:000000,op:int32,pos:80,val:+65535,+cov b/src/exchange/afl-tests/id:000581,src:000000,op:int32,pos:80,val:+65535,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000581,src:000000,op:int32,pos:80,val:+65535,+cov
rename to src/exchange/afl-tests/id:000581,src:000000,op:int32,pos:80,val:+65535,+cov
diff --git a/src/mint/afl-tests/id:000582,src:000000,op:int16,pos:80,val:+1000,+cov b/src/exchange/afl-tests/id:000582,src:000000,op:int16,pos:80,val:+1000,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000582,src:000000,op:int16,pos:80,val:+1000,+cov
rename to src/exchange/afl-tests/id:000582,src:000000,op:int16,pos:80,val:+1000,+cov
diff --git a/src/mint/afl-tests/id:000582,src:000000,op:int32,pos:82,val:be:+16,+cov b/src/exchange/afl-tests/id:000582,src:000000,op:int32,pos:82,val:be:+16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000582,src:000000,op:int32,pos:82,val:be:+16,+cov
rename to src/exchange/afl-tests/id:000582,src:000000,op:int32,pos:82,val:be:+16,+cov
diff --git a/src/mint/afl-tests/id:000583,src:000000,op:int16,pos:82,val:+256,+cov b/src/exchange/afl-tests/id:000583,src:000000,op:int16,pos:82,val:+256,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000583,src:000000,op:int16,pos:82,val:+256,+cov
rename to src/exchange/afl-tests/id:000583,src:000000,op:int16,pos:82,val:+256,+cov
diff --git a/src/mint/afl-tests/id:000583,src:000000,op:int32,pos:83,val:+100,+cov b/src/exchange/afl-tests/id:000583,src:000000,op:int32,pos:83,val:+100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000583,src:000000,op:int32,pos:83,val:+100,+cov
rename to src/exchange/afl-tests/id:000583,src:000000,op:int32,pos:83,val:+100,+cov
diff --git a/src/mint/afl-tests/id:000584,src:000000,op:int16,pos:83,val:be:+1024,+cov b/src/exchange/afl-tests/id:000584,src:000000,op:int16,pos:83,val:be:+1024,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000584,src:000000,op:int16,pos:83,val:be:+1024,+cov
rename to src/exchange/afl-tests/id:000584,src:000000,op:int16,pos:83,val:be:+1024,+cov
diff --git a/src/mint/afl-tests/id:000584,src:000000,op:int32,pos:84,val:+32,+cov b/src/exchange/afl-tests/id:000584,src:000000,op:int32,pos:84,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000584,src:000000,op:int32,pos:84,val:+32,+cov
rename to src/exchange/afl-tests/id:000584,src:000000,op:int32,pos:84,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000585,src:000000,op:int16,pos:87,val:-128,+cov b/src/exchange/afl-tests/id:000585,src:000000,op:int16,pos:87,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000585,src:000000,op:int16,pos:87,val:-128,+cov
rename to src/exchange/afl-tests/id:000585,src:000000,op:int16,pos:87,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000585,src:000000,op:int32,pos:84,val:+128,+cov b/src/exchange/afl-tests/id:000585,src:000000,op:int32,pos:84,val:+128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000585,src:000000,op:int32,pos:84,val:+128,+cov
rename to src/exchange/afl-tests/id:000585,src:000000,op:int32,pos:84,val:+128,+cov
diff --git a/src/mint/afl-tests/id:000586,src:000000,op:int16,pos:87,val:-32768,+cov b/src/exchange/afl-tests/id:000586,src:000000,op:int16,pos:87,val:-32768,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000586,src:000000,op:int16,pos:87,val:-32768,+cov
rename to src/exchange/afl-tests/id:000586,src:000000,op:int16,pos:87,val:-32768,+cov
diff --git a/src/mint/afl-tests/id:000586,src:000000,op:int32,pos:87,val:be:-32768,+cov b/src/exchange/afl-tests/id:000586,src:000000,op:int32,pos:87,val:be:-32768,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000586,src:000000,op:int32,pos:87,val:be:-32768,+cov
rename to src/exchange/afl-tests/id:000586,src:000000,op:int32,pos:87,val:be:-32768,+cov
diff --git a/src/mint/afl-tests/id:000587,src:000000,op:int16,pos:94,val:-129,+cov b/src/exchange/afl-tests/id:000587,src:000000,op:int16,pos:94,val:-129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000587,src:000000,op:int16,pos:94,val:-129,+cov
rename to src/exchange/afl-tests/id:000587,src:000000,op:int16,pos:94,val:-129,+cov
diff --git a/src/mint/afl-tests/id:000587,src:000000,op:int32,pos:88,val:be:-32769,+cov b/src/exchange/afl-tests/id:000587,src:000000,op:int32,pos:88,val:be:-32769,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000587,src:000000,op:int32,pos:88,val:be:-32769,+cov
rename to src/exchange/afl-tests/id:000587,src:000000,op:int32,pos:88,val:be:-32769,+cov
diff --git a/src/mint/afl-tests/id:000588,src:000000,op:int16,pos:193,val:+16 b/src/exchange/afl-tests/id:000588,src:000000,op:int16,pos:193,val:+16
similarity index 100%
rename from src/mint/afl-tests/id:000588,src:000000,op:int16,pos:193,val:+16
rename to src/exchange/afl-tests/id:000588,src:000000,op:int16,pos:193,val:+16
diff --git a/src/mint/afl-tests/id:000588,src:000000,op:int32,pos:89,val:-128,+cov b/src/exchange/afl-tests/id:000588,src:000000,op:int32,pos:89,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000588,src:000000,op:int32,pos:89,val:-128,+cov
rename to src/exchange/afl-tests/id:000588,src:000000,op:int32,pos:89,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000589,src:000000,op:int32,pos:0,val:be:+32767 b/src/exchange/afl-tests/id:000589,src:000000,op:int32,pos:0,val:be:+32767
similarity index 100%
rename from src/mint/afl-tests/id:000589,src:000000,op:int32,pos:0,val:be:+32767
rename to src/exchange/afl-tests/id:000589,src:000000,op:int32,pos:0,val:be:+32767
diff --git a/src/mint/afl-tests/id:000589,src:000000,op:int32,pos:92,val:+32767,+cov b/src/exchange/afl-tests/id:000589,src:000000,op:int32,pos:92,val:+32767,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000589,src:000000,op:int32,pos:92,val:+32767,+cov
rename to src/exchange/afl-tests/id:000589,src:000000,op:int32,pos:92,val:+32767,+cov
diff --git a/src/mint/afl-tests/id:000590,src:000000,op:int32,pos:164,val:+256,+cov b/src/exchange/afl-tests/id:000590,src:000000,op:int32,pos:164,val:+256,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000590,src:000000,op:int32,pos:164,val:+256,+cov
rename to src/exchange/afl-tests/id:000590,src:000000,op:int32,pos:164,val:+256,+cov
diff --git a/src/mint/afl-tests/id:000590,src:000000,op:int32,pos:2,val:+65535 b/src/exchange/afl-tests/id:000590,src:000000,op:int32,pos:2,val:+65535
similarity index 100%
rename from src/mint/afl-tests/id:000590,src:000000,op:int32,pos:2,val:+65535
rename to src/exchange/afl-tests/id:000590,src:000000,op:int32,pos:2,val:+65535
diff --git a/src/mint/afl-tests/id:000591,src:000000,op:int32,pos:178,val:be:-32769,+cov b/src/exchange/afl-tests/id:000591,src:000000,op:int32,pos:178,val:be:-32769,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000591,src:000000,op:int32,pos:178,val:be:-32769,+cov
rename to src/exchange/afl-tests/id:000591,src:000000,op:int32,pos:178,val:be:-32769,+cov
diff --git a/src/mint/afl-tests/id:000591,src:000000,op:int32,pos:7,val:-2147483648,+cov b/src/exchange/afl-tests/id:000591,src:000000,op:int32,pos:7,val:-2147483648,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000591,src:000000,op:int32,pos:7,val:-2147483648,+cov
rename to src/exchange/afl-tests/id:000591,src:000000,op:int32,pos:7,val:-2147483648,+cov
diff --git a/src/mint/afl-tests/id:000592,src:000000,op:int32,pos:232,val:be:+65535,+cov b/src/exchange/afl-tests/id:000592,src:000000,op:int32,pos:232,val:be:+65535,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000592,src:000000,op:int32,pos:232,val:be:+65535,+cov
rename to src/exchange/afl-tests/id:000592,src:000000,op:int32,pos:232,val:be:+65535,+cov
diff --git a/src/mint/afl-tests/id:000592,src:000000,op:int32,pos:24,val:be:+32,+cov b/src/exchange/afl-tests/id:000592,src:000000,op:int32,pos:24,val:be:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000592,src:000000,op:int32,pos:24,val:be:+32,+cov
rename to src/exchange/afl-tests/id:000592,src:000000,op:int32,pos:24,val:be:+32,+cov
diff --git a/src/mint/afl-tests/id:000593,src:000000,op:int32,pos:26,val:+255,+cov b/src/exchange/afl-tests/id:000593,src:000000,op:int32,pos:26,val:+255,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000593,src:000000,op:int32,pos:26,val:+255,+cov
rename to src/exchange/afl-tests/id:000593,src:000000,op:int32,pos:26,val:+255,+cov
diff --git a/src/mint/afl-tests/id:000593,src:000000,op:int32,pos:313,val:+1,+cov b/src/exchange/afl-tests/id:000593,src:000000,op:int32,pos:313,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000593,src:000000,op:int32,pos:313,val:+1,+cov
rename to src/exchange/afl-tests/id:000593,src:000000,op:int32,pos:313,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000594,src:000000,op:int32,pos:27,val:be:+1,+cov b/src/exchange/afl-tests/id:000594,src:000000,op:int32,pos:27,val:be:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000594,src:000000,op:int32,pos:27,val:be:+1,+cov
rename to src/exchange/afl-tests/id:000594,src:000000,op:int32,pos:27,val:be:+1,+cov
diff --git a/src/mint/afl-tests/id:000594,src:000000,op:int32,pos:333,val:be:+255,+cov b/src/exchange/afl-tests/id:000594,src:000000,op:int32,pos:333,val:be:+255,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000594,src:000000,op:int32,pos:333,val:be:+255,+cov
rename to src/exchange/afl-tests/id:000594,src:000000,op:int32,pos:333,val:be:+255,+cov
diff --git a/src/mint/afl-tests/id:000595,src:000000,op:ext_AO,pos:26,+cov b/src/exchange/afl-tests/id:000595,src:000000,op:ext_AO,pos:26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000595,src:000000,op:ext_AO,pos:26,+cov
rename to src/exchange/afl-tests/id:000595,src:000000,op:ext_AO,pos:26,+cov
diff --git a/src/mint/afl-tests/id:000595,src:000000,op:int32,pos:29,val:+1000,+cov b/src/exchange/afl-tests/id:000595,src:000000,op:int32,pos:29,val:+1000,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000595,src:000000,op:int32,pos:29,val:+1000,+cov
rename to src/exchange/afl-tests/id:000595,src:000000,op:int32,pos:29,val:+1000,+cov
diff --git a/src/mint/afl-tests/id:000596,src:000000,op:ext_AO,pos:43,+cov b/src/exchange/afl-tests/id:000596,src:000000,op:ext_AO,pos:43,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000596,src:000000,op:ext_AO,pos:43,+cov
rename to src/exchange/afl-tests/id:000596,src:000000,op:ext_AO,pos:43,+cov
diff --git a/src/mint/afl-tests/id:000596,src:000000,op:int32,pos:30,val:be:+32 b/src/exchange/afl-tests/id:000596,src:000000,op:int32,pos:30,val:be:+32
similarity index 100%
rename from src/mint/afl-tests/id:000596,src:000000,op:int32,pos:30,val:be:+32
rename to src/exchange/afl-tests/id:000596,src:000000,op:int32,pos:30,val:be:+32
diff --git a/src/mint/afl-tests/id:000597,src:000000,op:ext_AO,pos:49,+cov b/src/exchange/afl-tests/id:000597,src:000000,op:ext_AO,pos:49,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000597,src:000000,op:ext_AO,pos:49,+cov
rename to src/exchange/afl-tests/id:000597,src:000000,op:ext_AO,pos:49,+cov
diff --git a/src/mint/afl-tests/id:000597,src:000000,op:int32,pos:30,val:be:+512,+cov b/src/exchange/afl-tests/id:000597,src:000000,op:int32,pos:30,val:be:+512,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000597,src:000000,op:int32,pos:30,val:be:+512,+cov
rename to src/exchange/afl-tests/id:000597,src:000000,op:int32,pos:30,val:be:+512,+cov
diff --git a/src/mint/afl-tests/id:000598,src:000000,op:ext_AO,pos:52,+cov b/src/exchange/afl-tests/id:000598,src:000000,op:ext_AO,pos:52,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000598,src:000000,op:ext_AO,pos:52,+cov
rename to src/exchange/afl-tests/id:000598,src:000000,op:ext_AO,pos:52,+cov
diff --git a/src/mint/afl-tests/id:000598,src:000000,op:int32,pos:39,val:be:+1,+cov b/src/exchange/afl-tests/id:000598,src:000000,op:int32,pos:39,val:be:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000598,src:000000,op:int32,pos:39,val:be:+1,+cov
rename to src/exchange/afl-tests/id:000598,src:000000,op:int32,pos:39,val:be:+1,+cov
diff --git a/src/mint/afl-tests/id:000599,src:000000,op:ext_AO,pos:56,+cov b/src/exchange/afl-tests/id:000599,src:000000,op:ext_AO,pos:56,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000599,src:000000,op:ext_AO,pos:56,+cov
rename to src/exchange/afl-tests/id:000599,src:000000,op:ext_AO,pos:56,+cov
diff --git a/src/mint/afl-tests/id:000599,src:000000,op:int32,pos:40,val:+1024,+cov b/src/exchange/afl-tests/id:000599,src:000000,op:int32,pos:40,val:+1024,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000599,src:000000,op:int32,pos:40,val:+1024,+cov
rename to src/exchange/afl-tests/id:000599,src:000000,op:int32,pos:40,val:+1024,+cov
diff --git a/src/mint/afl-tests/id:000600,src:000000,op:ext_AO,pos:64,+cov b/src/exchange/afl-tests/id:000600,src:000000,op:ext_AO,pos:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000600,src:000000,op:ext_AO,pos:64,+cov
rename to src/exchange/afl-tests/id:000600,src:000000,op:ext_AO,pos:64,+cov
diff --git a/src/mint/afl-tests/id:000600,src:000000,op:int32,pos:42,val:be:+16,+cov b/src/exchange/afl-tests/id:000600,src:000000,op:int32,pos:42,val:be:+16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000600,src:000000,op:int32,pos:42,val:be:+16,+cov
rename to src/exchange/afl-tests/id:000600,src:000000,op:int32,pos:42,val:be:+16,+cov
diff --git a/src/mint/afl-tests/id:000601,src:000000,op:ext_AO,pos:65,+cov b/src/exchange/afl-tests/id:000601,src:000000,op:ext_AO,pos:65,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000601,src:000000,op:ext_AO,pos:65,+cov
rename to src/exchange/afl-tests/id:000601,src:000000,op:ext_AO,pos:65,+cov
diff --git a/src/mint/afl-tests/id:000601,src:000000,op:int32,pos:48,val:+100663045,+cov b/src/exchange/afl-tests/id:000601,src:000000,op:int32,pos:48,val:+100663045,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000601,src:000000,op:int32,pos:48,val:+100663045,+cov
rename to src/exchange/afl-tests/id:000601,src:000000,op:int32,pos:48,val:+100663045,+cov
diff --git a/src/mint/afl-tests/id:000602,src:000000,op:ext_AO,pos:65,+cov b/src/exchange/afl-tests/id:000602,src:000000,op:ext_AO,pos:65,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000602,src:000000,op:ext_AO,pos:65,+cov
rename to src/exchange/afl-tests/id:000602,src:000000,op:ext_AO,pos:65,+cov
diff --git a/src/mint/afl-tests/id:000602,src:000000,op:int32,pos:49,val:be:+4096,+cov b/src/exchange/afl-tests/id:000602,src:000000,op:int32,pos:49,val:be:+4096,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000602,src:000000,op:int32,pos:49,val:be:+4096,+cov
rename to src/exchange/afl-tests/id:000602,src:000000,op:int32,pos:49,val:be:+4096,+cov
diff --git a/src/mint/afl-tests/id:000603,src:000000,op:ext_AO,pos:69,+cov b/src/exchange/afl-tests/id:000603,src:000000,op:ext_AO,pos:69,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000603,src:000000,op:ext_AO,pos:69,+cov
rename to src/exchange/afl-tests/id:000603,src:000000,op:ext_AO,pos:69,+cov
diff --git a/src/mint/afl-tests/id:000603,src:000000,op:int32,pos:51,val:+128,+cov b/src/exchange/afl-tests/id:000603,src:000000,op:int32,pos:51,val:+128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000603,src:000000,op:int32,pos:51,val:+128,+cov
rename to src/exchange/afl-tests/id:000603,src:000000,op:int32,pos:51,val:+128,+cov
diff --git a/src/mint/afl-tests/id:000604,src:000000,op:ext_AO,pos:69,+cov b/src/exchange/afl-tests/id:000604,src:000000,op:ext_AO,pos:69,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000604,src:000000,op:ext_AO,pos:69,+cov
rename to src/exchange/afl-tests/id:000604,src:000000,op:ext_AO,pos:69,+cov
diff --git a/src/mint/afl-tests/id:000604,src:000000,op:int32,pos:53,val:-128,+cov b/src/exchange/afl-tests/id:000604,src:000000,op:int32,pos:53,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000604,src:000000,op:int32,pos:53,val:-128,+cov
rename to src/exchange/afl-tests/id:000604,src:000000,op:int32,pos:53,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000605,src:000000,op:ext_AO,pos:72,+cov b/src/exchange/afl-tests/id:000605,src:000000,op:ext_AO,pos:72,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000605,src:000000,op:ext_AO,pos:72,+cov
rename to src/exchange/afl-tests/id:000605,src:000000,op:ext_AO,pos:72,+cov
diff --git a/src/mint/afl-tests/id:000605,src:000000,op:int32,pos:53,val:+128,+cov b/src/exchange/afl-tests/id:000605,src:000000,op:int32,pos:53,val:+128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000605,src:000000,op:int32,pos:53,val:+128,+cov
rename to src/exchange/afl-tests/id:000605,src:000000,op:int32,pos:53,val:+128,+cov
diff --git a/src/mint/afl-tests/id:000606,src:000000,op:ext_AO,pos:72,+cov b/src/exchange/afl-tests/id:000606,src:000000,op:ext_AO,pos:72,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000606,src:000000,op:ext_AO,pos:72,+cov
rename to src/exchange/afl-tests/id:000606,src:000000,op:ext_AO,pos:72,+cov
diff --git a/src/mint/afl-tests/id:000606,src:000000,op:int32,pos:53,val:+1024,+cov b/src/exchange/afl-tests/id:000606,src:000000,op:int32,pos:53,val:+1024,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000606,src:000000,op:int32,pos:53,val:+1024,+cov
rename to src/exchange/afl-tests/id:000606,src:000000,op:int32,pos:53,val:+1024,+cov
diff --git a/src/mint/afl-tests/id:000607,src:000000,op:ext_AO,pos:76,+cov b/src/exchange/afl-tests/id:000607,src:000000,op:ext_AO,pos:76,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000607,src:000000,op:ext_AO,pos:76,+cov
rename to src/exchange/afl-tests/id:000607,src:000000,op:ext_AO,pos:76,+cov
diff --git a/src/mint/afl-tests/id:000607,src:000000,op:int32,pos:64,val:+256,+cov b/src/exchange/afl-tests/id:000607,src:000000,op:int32,pos:64,val:+256,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000607,src:000000,op:int32,pos:64,val:+256,+cov
rename to src/exchange/afl-tests/id:000607,src:000000,op:int32,pos:64,val:+256,+cov
diff --git a/src/mint/afl-tests/id:000608,src:000000,op:ext_AO,pos:81,+cov b/src/exchange/afl-tests/id:000608,src:000000,op:ext_AO,pos:81,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000608,src:000000,op:ext_AO,pos:81,+cov
rename to src/exchange/afl-tests/id:000608,src:000000,op:ext_AO,pos:81,+cov
diff --git a/src/mint/afl-tests/id:000608,src:000000,op:int32,pos:65,val:+1,+cov b/src/exchange/afl-tests/id:000608,src:000000,op:int32,pos:65,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000608,src:000000,op:int32,pos:65,val:+1,+cov
rename to src/exchange/afl-tests/id:000608,src:000000,op:int32,pos:65,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000609,src:000000,op:ext_AO,pos:90,+cov b/src/exchange/afl-tests/id:000609,src:000000,op:ext_AO,pos:90,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000609,src:000000,op:ext_AO,pos:90,+cov
rename to src/exchange/afl-tests/id:000609,src:000000,op:ext_AO,pos:90,+cov
diff --git a/src/mint/afl-tests/id:000609,src:000000,op:int32,pos:65,val:be:+64,+cov b/src/exchange/afl-tests/id:000609,src:000000,op:int32,pos:65,val:be:+64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000609,src:000000,op:int32,pos:65,val:be:+64,+cov
rename to src/exchange/afl-tests/id:000609,src:000000,op:int32,pos:65,val:be:+64,+cov
diff --git a/src/mint/afl-tests/id:000610,src:000000,op:ext_AO,pos:111,+cov b/src/exchange/afl-tests/id:000610,src:000000,op:ext_AO,pos:111,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000610,src:000000,op:ext_AO,pos:111,+cov
rename to src/exchange/afl-tests/id:000610,src:000000,op:ext_AO,pos:111,+cov
diff --git a/src/mint/afl-tests/id:000610,src:000000,op:int32,pos:66,val:+16,+cov b/src/exchange/afl-tests/id:000610,src:000000,op:int32,pos:66,val:+16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000610,src:000000,op:int32,pos:66,val:+16,+cov
rename to src/exchange/afl-tests/id:000610,src:000000,op:int32,pos:66,val:+16,+cov
diff --git a/src/mint/afl-tests/id:000611,src:000000,op:ext_AO,pos:135,+cov b/src/exchange/afl-tests/id:000611,src:000000,op:ext_AO,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000611,src:000000,op:ext_AO,pos:135,+cov
rename to src/exchange/afl-tests/id:000611,src:000000,op:ext_AO,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000611,src:000000,op:int32,pos:73,val:+100663045,+cov b/src/exchange/afl-tests/id:000611,src:000000,op:int32,pos:73,val:+100663045,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000611,src:000000,op:int32,pos:73,val:+100663045,+cov
rename to src/exchange/afl-tests/id:000611,src:000000,op:int32,pos:73,val:+100663045,+cov
diff --git a/src/mint/afl-tests/id:000612,src:000000,op:ext_AO,pos:135,+cov b/src/exchange/afl-tests/id:000612,src:000000,op:ext_AO,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000612,src:000000,op:ext_AO,pos:135,+cov
rename to src/exchange/afl-tests/id:000612,src:000000,op:ext_AO,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000612,src:000000,op:int32,pos:81,val:+0,+cov b/src/exchange/afl-tests/id:000612,src:000000,op:int32,pos:81,val:+0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000612,src:000000,op:int32,pos:81,val:+0,+cov
rename to src/exchange/afl-tests/id:000612,src:000000,op:int32,pos:81,val:+0,+cov
diff --git a/src/mint/afl-tests/id:000613,src:000000,op:ext_AO,pos:135,+cov b/src/exchange/afl-tests/id:000613,src:000000,op:ext_AO,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000613,src:000000,op:ext_AO,pos:135,+cov
rename to src/exchange/afl-tests/id:000613,src:000000,op:ext_AO,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000613,src:000000,op:int32,pos:82,val:+32767,+cov b/src/exchange/afl-tests/id:000613,src:000000,op:int32,pos:82,val:+32767,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000613,src:000000,op:int32,pos:82,val:+32767,+cov
rename to src/exchange/afl-tests/id:000613,src:000000,op:int32,pos:82,val:+32767,+cov
diff --git a/src/mint/afl-tests/id:000614,src:000000,op:ext_AO,pos:135,+cov b/src/exchange/afl-tests/id:000614,src:000000,op:ext_AO,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000614,src:000000,op:ext_AO,pos:135,+cov
rename to src/exchange/afl-tests/id:000614,src:000000,op:ext_AO,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000614,src:000000,op:int32,pos:83,val:be:+1000,+cov b/src/exchange/afl-tests/id:000614,src:000000,op:int32,pos:83,val:be:+1000,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000614,src:000000,op:int32,pos:83,val:be:+1000,+cov
rename to src/exchange/afl-tests/id:000614,src:000000,op:int32,pos:83,val:be:+1000,+cov
diff --git a/src/mint/afl-tests/id:000615,src:000000,op:ext_AO,pos:135,+cov b/src/exchange/afl-tests/id:000615,src:000000,op:ext_AO,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000615,src:000000,op:ext_AO,pos:135,+cov
rename to src/exchange/afl-tests/id:000615,src:000000,op:ext_AO,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000615,src:000000,op:int32,pos:84,val:-129,+cov b/src/exchange/afl-tests/id:000615,src:000000,op:int32,pos:84,val:-129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000615,src:000000,op:int32,pos:84,val:-129,+cov
rename to src/exchange/afl-tests/id:000615,src:000000,op:int32,pos:84,val:-129,+cov
diff --git a/src/mint/afl-tests/id:000616,src:000000,op:ext_AO,pos:136,+cov b/src/exchange/afl-tests/id:000616,src:000000,op:ext_AO,pos:136,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000616,src:000000,op:ext_AO,pos:136,+cov
rename to src/exchange/afl-tests/id:000616,src:000000,op:ext_AO,pos:136,+cov
diff --git a/src/mint/afl-tests/id:000616,src:000000,op:int32,pos:84,val:+65536,+cov b/src/exchange/afl-tests/id:000616,src:000000,op:int32,pos:84,val:+65536,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000616,src:000000,op:int32,pos:84,val:+65536,+cov
rename to src/exchange/afl-tests/id:000616,src:000000,op:int32,pos:84,val:+65536,+cov
diff --git a/src/mint/afl-tests/id:000617,src:000000,op:ext_AO,pos:136,+cov b/src/exchange/afl-tests/id:000617,src:000000,op:ext_AO,pos:136,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000617,src:000000,op:ext_AO,pos:136,+cov
rename to src/exchange/afl-tests/id:000617,src:000000,op:ext_AO,pos:136,+cov
diff --git a/src/mint/afl-tests/id:000617,src:000000,op:int32,pos:85,val:be:+255,+cov b/src/exchange/afl-tests/id:000617,src:000000,op:int32,pos:85,val:be:+255,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000617,src:000000,op:int32,pos:85,val:be:+255,+cov
rename to src/exchange/afl-tests/id:000617,src:000000,op:int32,pos:85,val:be:+255,+cov
diff --git a/src/mint/afl-tests/id:000618,src:000000,op:ext_AO,pos:137,+cov b/src/exchange/afl-tests/id:000618,src:000000,op:ext_AO,pos:137,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000618,src:000000,op:ext_AO,pos:137,+cov
rename to src/exchange/afl-tests/id:000618,src:000000,op:ext_AO,pos:137,+cov
diff --git a/src/mint/afl-tests/id:000618,src:000000,op:int32,pos:85,val:-32769,+cov b/src/exchange/afl-tests/id:000618,src:000000,op:int32,pos:85,val:-32769,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000618,src:000000,op:int32,pos:85,val:-32769,+cov
rename to src/exchange/afl-tests/id:000618,src:000000,op:int32,pos:85,val:-32769,+cov
diff --git a/src/mint/afl-tests/id:000619,src:000000,op:ext_AO,pos:137,+cov b/src/exchange/afl-tests/id:000619,src:000000,op:ext_AO,pos:137,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000619,src:000000,op:ext_AO,pos:137,+cov
rename to src/exchange/afl-tests/id:000619,src:000000,op:ext_AO,pos:137,+cov
diff --git a/src/mint/afl-tests/id:000619,src:000000,op:int32,pos:88,val:be:-32768,+cov b/src/exchange/afl-tests/id:000619,src:000000,op:int32,pos:88,val:be:-32768,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000619,src:000000,op:int32,pos:88,val:be:-32768,+cov
rename to src/exchange/afl-tests/id:000619,src:000000,op:int32,pos:88,val:be:-32768,+cov
diff --git a/src/mint/afl-tests/id:000620,src:000000,op:ext_AO,pos:138,+cov b/src/exchange/afl-tests/id:000620,src:000000,op:ext_AO,pos:138,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000620,src:000000,op:ext_AO,pos:138,+cov
rename to src/exchange/afl-tests/id:000620,src:000000,op:ext_AO,pos:138,+cov
diff --git a/src/mint/afl-tests/id:000620,src:000000,op:int32,pos:91,val:+127,+cov b/src/exchange/afl-tests/id:000620,src:000000,op:int32,pos:91,val:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000620,src:000000,op:int32,pos:91,val:+127,+cov
rename to src/exchange/afl-tests/id:000620,src:000000,op:int32,pos:91,val:+127,+cov
diff --git a/src/mint/afl-tests/id:000621,src:000000,op:ext_AO,pos:142,+cov b/src/exchange/afl-tests/id:000621,src:000000,op:ext_AO,pos:142,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000621,src:000000,op:ext_AO,pos:142,+cov
rename to src/exchange/afl-tests/id:000621,src:000000,op:ext_AO,pos:142,+cov
diff --git a/src/mint/afl-tests/id:000621,src:000000,op:int32,pos:92,val:-32768,+cov b/src/exchange/afl-tests/id:000621,src:000000,op:int32,pos:92,val:-32768,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000621,src:000000,op:int32,pos:92,val:-32768,+cov
rename to src/exchange/afl-tests/id:000621,src:000000,op:int32,pos:92,val:-32768,+cov
diff --git a/src/mint/afl-tests/id:000622,src:000000,op:ext_AO,pos:143,+cov b/src/exchange/afl-tests/id:000622,src:000000,op:ext_AO,pos:143,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000622,src:000000,op:ext_AO,pos:143,+cov
rename to src/exchange/afl-tests/id:000622,src:000000,op:ext_AO,pos:143,+cov
diff --git a/src/mint/afl-tests/id:000622,src:000000,op:int32,pos:98,val:-129,+cov b/src/exchange/afl-tests/id:000622,src:000000,op:int32,pos:98,val:-129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000622,src:000000,op:int32,pos:98,val:-129,+cov
rename to src/exchange/afl-tests/id:000622,src:000000,op:int32,pos:98,val:-129,+cov
diff --git a/src/mint/afl-tests/id:000623,src:000000,op:ext_AO,pos:144,+cov b/src/exchange/afl-tests/id:000623,src:000000,op:ext_AO,pos:144,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000623,src:000000,op:ext_AO,pos:144,+cov
rename to src/exchange/afl-tests/id:000623,src:000000,op:ext_AO,pos:144,+cov
diff --git a/src/mint/afl-tests/id:000623,src:000000,op:int32,pos:128,val:-32769,+cov b/src/exchange/afl-tests/id:000623,src:000000,op:int32,pos:128,val:-32769,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000623,src:000000,op:int32,pos:128,val:-32769,+cov
rename to src/exchange/afl-tests/id:000623,src:000000,op:int32,pos:128,val:-32769,+cov
diff --git a/src/mint/afl-tests/id:000624,src:000000,op:ext_AO,pos:144,+cov b/src/exchange/afl-tests/id:000624,src:000000,op:ext_AO,pos:144,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000624,src:000000,op:ext_AO,pos:144,+cov
rename to src/exchange/afl-tests/id:000624,src:000000,op:ext_AO,pos:144,+cov
diff --git a/src/mint/afl-tests/id:000624,src:000000,op:int32,pos:160,val:be:+512,+cov b/src/exchange/afl-tests/id:000624,src:000000,op:int32,pos:160,val:be:+512,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000624,src:000000,op:int32,pos:160,val:be:+512,+cov
rename to src/exchange/afl-tests/id:000624,src:000000,op:int32,pos:160,val:be:+512,+cov
diff --git a/src/mint/afl-tests/id:000625,src:000000,op:ext_AO,pos:145,+cov b/src/exchange/afl-tests/id:000625,src:000000,op:ext_AO,pos:145,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000625,src:000000,op:ext_AO,pos:145,+cov
rename to src/exchange/afl-tests/id:000625,src:000000,op:ext_AO,pos:145,+cov
diff --git a/src/mint/afl-tests/id:000625,src:000000,op:int32,pos:203,val:be:+1,+cov b/src/exchange/afl-tests/id:000625,src:000000,op:int32,pos:203,val:be:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000625,src:000000,op:int32,pos:203,val:be:+1,+cov
rename to src/exchange/afl-tests/id:000625,src:000000,op:int32,pos:203,val:be:+1,+cov
diff --git a/src/mint/afl-tests/id:000626,src:000000,op:ext_AO,pos:146,+cov b/src/exchange/afl-tests/id:000626,src:000000,op:ext_AO,pos:146,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000626,src:000000,op:ext_AO,pos:146,+cov
rename to src/exchange/afl-tests/id:000626,src:000000,op:ext_AO,pos:146,+cov
diff --git a/src/mint/afl-tests/id:000626,src:000000,op:int32,pos:263,val:+0,+cov b/src/exchange/afl-tests/id:000626,src:000000,op:int32,pos:263,val:+0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000626,src:000000,op:int32,pos:263,val:+0,+cov
rename to src/exchange/afl-tests/id:000626,src:000000,op:int32,pos:263,val:+0,+cov
diff --git a/src/mint/afl-tests/id:000627,src:000000,op:ext_AO,pos:146,+cov b/src/exchange/afl-tests/id:000627,src:000000,op:ext_AO,pos:146,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000627,src:000000,op:ext_AO,pos:146,+cov
rename to src/exchange/afl-tests/id:000627,src:000000,op:ext_AO,pos:146,+cov
diff --git a/src/mint/afl-tests/id:000627,src:000000,op:int32,pos:264,val:be:-32769,+cov b/src/exchange/afl-tests/id:000627,src:000000,op:int32,pos:264,val:be:-32769,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000627,src:000000,op:int32,pos:264,val:be:-32769,+cov
rename to src/exchange/afl-tests/id:000627,src:000000,op:int32,pos:264,val:be:-32769,+cov
diff --git a/src/mint/afl-tests/id:000628,src:000000,op:ext_AO,pos:147,+cov b/src/exchange/afl-tests/id:000628,src:000000,op:ext_AO,pos:147,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000628,src:000000,op:ext_AO,pos:147,+cov
rename to src/exchange/afl-tests/id:000628,src:000000,op:ext_AO,pos:147,+cov
diff --git a/src/mint/afl-tests/id:000628,src:000000,op:int32,pos:285,val:+100663045,+cov b/src/exchange/afl-tests/id:000628,src:000000,op:int32,pos:285,val:+100663045,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000628,src:000000,op:int32,pos:285,val:+100663045,+cov
rename to src/exchange/afl-tests/id:000628,src:000000,op:int32,pos:285,val:+100663045,+cov
diff --git a/src/mint/afl-tests/id:000629,src:000000,op:ext_AO,pos:147,+cov b/src/exchange/afl-tests/id:000629,src:000000,op:ext_AO,pos:147,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000629,src:000000,op:ext_AO,pos:147,+cov
rename to src/exchange/afl-tests/id:000629,src:000000,op:ext_AO,pos:147,+cov
diff --git a/src/mint/afl-tests/id:000629,src:000000,op:ext_AO,pos:34,+cov b/src/exchange/afl-tests/id:000629,src:000000,op:ext_AO,pos:34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000629,src:000000,op:ext_AO,pos:34,+cov
rename to src/exchange/afl-tests/id:000629,src:000000,op:ext_AO,pos:34,+cov
diff --git a/src/mint/afl-tests/id:000630,src:000000,op:ext_AO,pos:148,+cov b/src/exchange/afl-tests/id:000630,src:000000,op:ext_AO,pos:148,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000630,src:000000,op:ext_AO,pos:148,+cov
rename to src/exchange/afl-tests/id:000630,src:000000,op:ext_AO,pos:148,+cov
diff --git a/src/mint/afl-tests/id:000630,src:000000,op:ext_AO,pos:34,+cov b/src/exchange/afl-tests/id:000630,src:000000,op:ext_AO,pos:34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000630,src:000000,op:ext_AO,pos:34,+cov
rename to src/exchange/afl-tests/id:000630,src:000000,op:ext_AO,pos:34,+cov
diff --git a/src/mint/afl-tests/id:000631,src:000000,op:ext_AO,pos:148 b/src/exchange/afl-tests/id:000631,src:000000,op:ext_AO,pos:148
similarity index 100%
rename from src/mint/afl-tests/id:000631,src:000000,op:ext_AO,pos:148
rename to src/exchange/afl-tests/id:000631,src:000000,op:ext_AO,pos:148
diff --git a/src/mint/afl-tests/id:000631,src:000000,op:ext_AO,pos:37,+cov b/src/exchange/afl-tests/id:000631,src:000000,op:ext_AO,pos:37,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000631,src:000000,op:ext_AO,pos:37,+cov
rename to src/exchange/afl-tests/id:000631,src:000000,op:ext_AO,pos:37,+cov
diff --git a/src/mint/afl-tests/id:000632,src:000000,op:ext_AO,pos:149,+cov b/src/exchange/afl-tests/id:000632,src:000000,op:ext_AO,pos:149,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000632,src:000000,op:ext_AO,pos:149,+cov
rename to src/exchange/afl-tests/id:000632,src:000000,op:ext_AO,pos:149,+cov
diff --git a/src/mint/afl-tests/id:000632,src:000000,op:ext_AO,pos:39,+cov b/src/exchange/afl-tests/id:000632,src:000000,op:ext_AO,pos:39,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000632,src:000000,op:ext_AO,pos:39,+cov
rename to src/exchange/afl-tests/id:000632,src:000000,op:ext_AO,pos:39,+cov
diff --git a/src/mint/afl-tests/id:000633,src:000000,op:ext_AO,pos:152,+cov b/src/exchange/afl-tests/id:000633,src:000000,op:ext_AO,pos:152,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000633,src:000000,op:ext_AO,pos:152,+cov
rename to src/exchange/afl-tests/id:000633,src:000000,op:ext_AO,pos:152,+cov
diff --git a/src/mint/afl-tests/id:000633,src:000000,op:ext_AO,pos:49,+cov b/src/exchange/afl-tests/id:000633,src:000000,op:ext_AO,pos:49,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000633,src:000000,op:ext_AO,pos:49,+cov
rename to src/exchange/afl-tests/id:000633,src:000000,op:ext_AO,pos:49,+cov
diff --git a/src/mint/afl-tests/id:000634,src:000000,op:ext_AO,pos:154 b/src/exchange/afl-tests/id:000634,src:000000,op:ext_AO,pos:154
similarity index 100%
rename from src/mint/afl-tests/id:000634,src:000000,op:ext_AO,pos:154
rename to src/exchange/afl-tests/id:000634,src:000000,op:ext_AO,pos:154
diff --git a/src/mint/afl-tests/id:000634,src:000000,op:ext_AO,pos:51,+cov b/src/exchange/afl-tests/id:000634,src:000000,op:ext_AO,pos:51,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000634,src:000000,op:ext_AO,pos:51,+cov
rename to src/exchange/afl-tests/id:000634,src:000000,op:ext_AO,pos:51,+cov
diff --git a/src/mint/afl-tests/id:000635,src:000000,op:ext_AO,pos:155,+cov b/src/exchange/afl-tests/id:000635,src:000000,op:ext_AO,pos:155,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000635,src:000000,op:ext_AO,pos:155,+cov
rename to src/exchange/afl-tests/id:000635,src:000000,op:ext_AO,pos:155,+cov
diff --git a/src/mint/afl-tests/id:000635,src:000000,op:ext_AO,pos:52,+cov b/src/exchange/afl-tests/id:000635,src:000000,op:ext_AO,pos:52,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000635,src:000000,op:ext_AO,pos:52,+cov
rename to src/exchange/afl-tests/id:000635,src:000000,op:ext_AO,pos:52,+cov
diff --git a/src/mint/afl-tests/id:000636,src:000000,op:ext_AO,pos:156,+cov b/src/exchange/afl-tests/id:000636,src:000000,op:ext_AO,pos:156,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000636,src:000000,op:ext_AO,pos:156,+cov
rename to src/exchange/afl-tests/id:000636,src:000000,op:ext_AO,pos:156,+cov
diff --git a/src/mint/afl-tests/id:000636,src:000000,op:ext_AO,pos:52,+cov b/src/exchange/afl-tests/id:000636,src:000000,op:ext_AO,pos:52,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000636,src:000000,op:ext_AO,pos:52,+cov
rename to src/exchange/afl-tests/id:000636,src:000000,op:ext_AO,pos:52,+cov
diff --git a/src/mint/afl-tests/id:000637,src:000000,op:ext_AO,pos:157 b/src/exchange/afl-tests/id:000637,src:000000,op:ext_AO,pos:157
similarity index 100%
rename from src/mint/afl-tests/id:000637,src:000000,op:ext_AO,pos:157
rename to src/exchange/afl-tests/id:000637,src:000000,op:ext_AO,pos:157
diff --git a/src/mint/afl-tests/id:000637,src:000000,op:ext_AO,pos:58,+cov b/src/exchange/afl-tests/id:000637,src:000000,op:ext_AO,pos:58,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000637,src:000000,op:ext_AO,pos:58,+cov
rename to src/exchange/afl-tests/id:000637,src:000000,op:ext_AO,pos:58,+cov
diff --git a/src/mint/afl-tests/id:000638,src:000000,op:ext_AO,pos:159,+cov b/src/exchange/afl-tests/id:000638,src:000000,op:ext_AO,pos:159,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000638,src:000000,op:ext_AO,pos:159,+cov
rename to src/exchange/afl-tests/id:000638,src:000000,op:ext_AO,pos:159,+cov
diff --git a/src/mint/afl-tests/id:000638,src:000000,op:ext_AO,pos:64,+cov b/src/exchange/afl-tests/id:000638,src:000000,op:ext_AO,pos:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000638,src:000000,op:ext_AO,pos:64,+cov
rename to src/exchange/afl-tests/id:000638,src:000000,op:ext_AO,pos:64,+cov
diff --git a/src/mint/afl-tests/id:000639,src:000000,op:ext_AO,pos:161,+cov b/src/exchange/afl-tests/id:000639,src:000000,op:ext_AO,pos:161,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000639,src:000000,op:ext_AO,pos:161,+cov
rename to src/exchange/afl-tests/id:000639,src:000000,op:ext_AO,pos:161,+cov
diff --git a/src/mint/afl-tests/id:000639,src:000000,op:ext_AO,pos:86,+cov b/src/exchange/afl-tests/id:000639,src:000000,op:ext_AO,pos:86,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000639,src:000000,op:ext_AO,pos:86,+cov
rename to src/exchange/afl-tests/id:000639,src:000000,op:ext_AO,pos:86,+cov
diff --git a/src/mint/afl-tests/id:000640,src:000000,op:ext_AO,pos:166,+cov b/src/exchange/afl-tests/id:000640,src:000000,op:ext_AO,pos:166,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000640,src:000000,op:ext_AO,pos:166,+cov
rename to src/exchange/afl-tests/id:000640,src:000000,op:ext_AO,pos:166,+cov
diff --git a/src/mint/afl-tests/id:000640,src:000000,op:ext_AO,pos:88,+cov b/src/exchange/afl-tests/id:000640,src:000000,op:ext_AO,pos:88,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000640,src:000000,op:ext_AO,pos:88,+cov
rename to src/exchange/afl-tests/id:000640,src:000000,op:ext_AO,pos:88,+cov
diff --git a/src/mint/afl-tests/id:000641,src:000000,op:ext_AO,pos:168,+cov b/src/exchange/afl-tests/id:000641,src:000000,op:ext_AO,pos:168,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000641,src:000000,op:ext_AO,pos:168,+cov
rename to src/exchange/afl-tests/id:000641,src:000000,op:ext_AO,pos:168,+cov
diff --git a/src/mint/afl-tests/id:000641,src:000000,op:ext_AO,pos:93,+cov b/src/exchange/afl-tests/id:000641,src:000000,op:ext_AO,pos:93,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000641,src:000000,op:ext_AO,pos:93,+cov
rename to src/exchange/afl-tests/id:000641,src:000000,op:ext_AO,pos:93,+cov
diff --git a/src/mint/afl-tests/id:000642,src:000000,op:ext_AO,pos:135,+cov b/src/exchange/afl-tests/id:000642,src:000000,op:ext_AO,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000642,src:000000,op:ext_AO,pos:135,+cov
rename to src/exchange/afl-tests/id:000642,src:000000,op:ext_AO,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000642,src:000000,op:ext_AO,pos:169,+cov b/src/exchange/afl-tests/id:000642,src:000000,op:ext_AO,pos:169,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000642,src:000000,op:ext_AO,pos:169,+cov
rename to src/exchange/afl-tests/id:000642,src:000000,op:ext_AO,pos:169,+cov
diff --git a/src/mint/afl-tests/id:000643,src:000000,op:ext_AO,pos:136,+cov b/src/exchange/afl-tests/id:000643,src:000000,op:ext_AO,pos:136,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000643,src:000000,op:ext_AO,pos:136,+cov
rename to src/exchange/afl-tests/id:000643,src:000000,op:ext_AO,pos:136,+cov
diff --git a/src/mint/afl-tests/id:000643,src:000000,op:ext_AO,pos:173,+cov b/src/exchange/afl-tests/id:000643,src:000000,op:ext_AO,pos:173,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000643,src:000000,op:ext_AO,pos:173,+cov
rename to src/exchange/afl-tests/id:000643,src:000000,op:ext_AO,pos:173,+cov
diff --git a/src/mint/afl-tests/id:000644,src:000000,op:ext_AO,pos:138,+cov b/src/exchange/afl-tests/id:000644,src:000000,op:ext_AO,pos:138,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000644,src:000000,op:ext_AO,pos:138,+cov
rename to src/exchange/afl-tests/id:000644,src:000000,op:ext_AO,pos:138,+cov
diff --git a/src/mint/afl-tests/id:000644,src:000000,op:ext_AO,pos:174,+cov b/src/exchange/afl-tests/id:000644,src:000000,op:ext_AO,pos:174,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000644,src:000000,op:ext_AO,pos:174,+cov
rename to src/exchange/afl-tests/id:000644,src:000000,op:ext_AO,pos:174,+cov
diff --git a/src/mint/afl-tests/id:000645,src:000000,op:ext_AO,pos:140,+cov b/src/exchange/afl-tests/id:000645,src:000000,op:ext_AO,pos:140,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000645,src:000000,op:ext_AO,pos:140,+cov
rename to src/exchange/afl-tests/id:000645,src:000000,op:ext_AO,pos:140,+cov
diff --git a/src/mint/afl-tests/id:000645,src:000000,op:ext_AO,pos:174,+cov b/src/exchange/afl-tests/id:000645,src:000000,op:ext_AO,pos:174,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000645,src:000000,op:ext_AO,pos:174,+cov
rename to src/exchange/afl-tests/id:000645,src:000000,op:ext_AO,pos:174,+cov
diff --git a/src/mint/afl-tests/id:000646,src:000000,op:ext_AO,pos:143,+cov b/src/exchange/afl-tests/id:000646,src:000000,op:ext_AO,pos:143,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000646,src:000000,op:ext_AO,pos:143,+cov
rename to src/exchange/afl-tests/id:000646,src:000000,op:ext_AO,pos:143,+cov
diff --git a/src/mint/afl-tests/id:000646,src:000000,op:ext_AO,pos:184,+cov b/src/exchange/afl-tests/id:000646,src:000000,op:ext_AO,pos:184,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000646,src:000000,op:ext_AO,pos:184,+cov
rename to src/exchange/afl-tests/id:000646,src:000000,op:ext_AO,pos:184,+cov
diff --git a/src/mint/afl-tests/id:000647,src:000000,op:ext_AO,pos:144,+cov b/src/exchange/afl-tests/id:000647,src:000000,op:ext_AO,pos:144,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000647,src:000000,op:ext_AO,pos:144,+cov
rename to src/exchange/afl-tests/id:000647,src:000000,op:ext_AO,pos:144,+cov
diff --git a/src/mint/afl-tests/id:000647,src:000000,op:ext_AO,pos:191,+cov b/src/exchange/afl-tests/id:000647,src:000000,op:ext_AO,pos:191,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000647,src:000000,op:ext_AO,pos:191,+cov
rename to src/exchange/afl-tests/id:000647,src:000000,op:ext_AO,pos:191,+cov
diff --git a/src/mint/afl-tests/id:000648,src:000000,op:ext_AO,pos:155,+cov b/src/exchange/afl-tests/id:000648,src:000000,op:ext_AO,pos:155,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000648,src:000000,op:ext_AO,pos:155,+cov
rename to src/exchange/afl-tests/id:000648,src:000000,op:ext_AO,pos:155,+cov
diff --git a/src/mint/afl-tests/id:000648,src:000000,op:ext_AO,pos:216,+cov b/src/exchange/afl-tests/id:000648,src:000000,op:ext_AO,pos:216,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000648,src:000000,op:ext_AO,pos:216,+cov
rename to src/exchange/afl-tests/id:000648,src:000000,op:ext_AO,pos:216,+cov
diff --git a/src/mint/afl-tests/id:000649,src:000000,op:ext_AO,pos:166,+cov b/src/exchange/afl-tests/id:000649,src:000000,op:ext_AO,pos:166,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000649,src:000000,op:ext_AO,pos:166,+cov
rename to src/exchange/afl-tests/id:000649,src:000000,op:ext_AO,pos:166,+cov
diff --git a/src/mint/afl-tests/id:000649,src:000000,op:ext_AO,pos:236,+cov b/src/exchange/afl-tests/id:000649,src:000000,op:ext_AO,pos:236,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000649,src:000000,op:ext_AO,pos:236,+cov
rename to src/exchange/afl-tests/id:000649,src:000000,op:ext_AO,pos:236,+cov
diff --git a/src/mint/afl-tests/id:000650,src:000000,op:ext_AO,pos:166,+cov b/src/exchange/afl-tests/id:000650,src:000000,op:ext_AO,pos:166,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000650,src:000000,op:ext_AO,pos:166,+cov
rename to src/exchange/afl-tests/id:000650,src:000000,op:ext_AO,pos:166,+cov
diff --git a/src/mint/afl-tests/id:000650,src:000000,op:ext_AO,pos:270,+cov b/src/exchange/afl-tests/id:000650,src:000000,op:ext_AO,pos:270,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000650,src:000000,op:ext_AO,pos:270,+cov
rename to src/exchange/afl-tests/id:000650,src:000000,op:ext_AO,pos:270,+cov
diff --git a/src/mint/afl-tests/id:000651,src:000000,op:ext_AO,pos:173,+cov b/src/exchange/afl-tests/id:000651,src:000000,op:ext_AO,pos:173,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000651,src:000000,op:ext_AO,pos:173,+cov
rename to src/exchange/afl-tests/id:000651,src:000000,op:ext_AO,pos:173,+cov
diff --git a/src/mint/afl-tests/id:000651,src:000000,op:ext_AO,pos:270,+cov b/src/exchange/afl-tests/id:000651,src:000000,op:ext_AO,pos:270,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000651,src:000000,op:ext_AO,pos:270,+cov
rename to src/exchange/afl-tests/id:000651,src:000000,op:ext_AO,pos:270,+cov
diff --git a/src/mint/afl-tests/id:000652,src:000000,op:ext_AO,pos:175,+cov b/src/exchange/afl-tests/id:000652,src:000000,op:ext_AO,pos:175,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000652,src:000000,op:ext_AO,pos:175,+cov
rename to src/exchange/afl-tests/id:000652,src:000000,op:ext_AO,pos:175,+cov
diff --git a/src/mint/afl-tests/id:000652,src:000000,op:ext_AO,pos:272,+cov b/src/exchange/afl-tests/id:000652,src:000000,op:ext_AO,pos:272,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000652,src:000000,op:ext_AO,pos:272,+cov
rename to src/exchange/afl-tests/id:000652,src:000000,op:ext_AO,pos:272,+cov
diff --git a/src/mint/afl-tests/id:000653,src:000000,op:ext_AO,pos:176,+cov b/src/exchange/afl-tests/id:000653,src:000000,op:ext_AO,pos:176,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000653,src:000000,op:ext_AO,pos:176,+cov
rename to src/exchange/afl-tests/id:000653,src:000000,op:ext_AO,pos:176,+cov
diff --git a/src/mint/afl-tests/id:000653,src:000000,op:ext_AO,pos:283,+cov b/src/exchange/afl-tests/id:000653,src:000000,op:ext_AO,pos:283,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000653,src:000000,op:ext_AO,pos:283,+cov
rename to src/exchange/afl-tests/id:000653,src:000000,op:ext_AO,pos:283,+cov
diff --git a/src/mint/afl-tests/id:000654,src:000000,op:ext_AO,pos:177,+cov b/src/exchange/afl-tests/id:000654,src:000000,op:ext_AO,pos:177,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000654,src:000000,op:ext_AO,pos:177,+cov
rename to src/exchange/afl-tests/id:000654,src:000000,op:ext_AO,pos:177,+cov
diff --git a/src/mint/afl-tests/id:000654,src:000000,op:ext_AO,pos:305,+cov b/src/exchange/afl-tests/id:000654,src:000000,op:ext_AO,pos:305,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000654,src:000000,op:ext_AO,pos:305,+cov
rename to src/exchange/afl-tests/id:000654,src:000000,op:ext_AO,pos:305,+cov
diff --git a/src/mint/afl-tests/id:000655,src:000000,op:ext_AO,pos:177,+cov b/src/exchange/afl-tests/id:000655,src:000000,op:ext_AO,pos:177,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000655,src:000000,op:ext_AO,pos:177,+cov
rename to src/exchange/afl-tests/id:000655,src:000000,op:ext_AO,pos:177,+cov
diff --git a/src/mint/afl-tests/id:000655,src:000000,op:ext_AO,pos:305,+cov b/src/exchange/afl-tests/id:000655,src:000000,op:ext_AO,pos:305,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000655,src:000000,op:ext_AO,pos:305,+cov
rename to src/exchange/afl-tests/id:000655,src:000000,op:ext_AO,pos:305,+cov
diff --git a/src/mint/afl-tests/id:000656,src:000000,op:ext_AO,pos:177,+cov b/src/exchange/afl-tests/id:000656,src:000000,op:ext_AO,pos:177,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000656,src:000000,op:ext_AO,pos:177,+cov
rename to src/exchange/afl-tests/id:000656,src:000000,op:ext_AO,pos:177,+cov
diff --git a/src/mint/afl-tests/id:000656,src:000000,op:ext_AO,pos:313,+cov b/src/exchange/afl-tests/id:000656,src:000000,op:ext_AO,pos:313,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000656,src:000000,op:ext_AO,pos:313,+cov
rename to src/exchange/afl-tests/id:000656,src:000000,op:ext_AO,pos:313,+cov
diff --git a/src/mint/afl-tests/id:000657,src:000000,op:ext_AO,pos:180,+cov b/src/exchange/afl-tests/id:000657,src:000000,op:ext_AO,pos:180,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000657,src:000000,op:ext_AO,pos:180,+cov
rename to src/exchange/afl-tests/id:000657,src:000000,op:ext_AO,pos:180,+cov
diff --git a/src/mint/afl-tests/id:000657,src:000000,op:ext_AO,pos:315,+cov b/src/exchange/afl-tests/id:000657,src:000000,op:ext_AO,pos:315,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000657,src:000000,op:ext_AO,pos:315,+cov
rename to src/exchange/afl-tests/id:000657,src:000000,op:ext_AO,pos:315,+cov
diff --git a/src/mint/afl-tests/id:000658,src:000000,op:ext_AO,pos:182,+cov b/src/exchange/afl-tests/id:000658,src:000000,op:ext_AO,pos:182,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000658,src:000000,op:ext_AO,pos:182,+cov
rename to src/exchange/afl-tests/id:000658,src:000000,op:ext_AO,pos:182,+cov
diff --git a/src/mint/afl-tests/id:000658,src:000000,op:ext_AO,pos:326 b/src/exchange/afl-tests/id:000658,src:000000,op:ext_AO,pos:326
similarity index 100%
rename from src/mint/afl-tests/id:000658,src:000000,op:ext_AO,pos:326
rename to src/exchange/afl-tests/id:000658,src:000000,op:ext_AO,pos:326
diff --git a/src/mint/afl-tests/id:000659,src:000000,op:ext_AO,pos:269,+cov b/src/exchange/afl-tests/id:000659,src:000000,op:ext_AO,pos:269,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000659,src:000000,op:ext_AO,pos:269,+cov
rename to src/exchange/afl-tests/id:000659,src:000000,op:ext_AO,pos:269,+cov
diff --git a/src/mint/afl-tests/id:000659,src:000000,op:havoc,rep:4 b/src/exchange/afl-tests/id:000659,src:000000,op:havoc,rep:4
similarity index 100%
rename from src/mint/afl-tests/id:000659,src:000000,op:havoc,rep:4
rename to src/exchange/afl-tests/id:000659,src:000000,op:havoc,rep:4
diff --git a/src/mint/afl-tests/id:000660,src:000000,op:ext_AO,pos:270,+cov b/src/exchange/afl-tests/id:000660,src:000000,op:ext_AO,pos:270,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000660,src:000000,op:ext_AO,pos:270,+cov
rename to src/exchange/afl-tests/id:000660,src:000000,op:ext_AO,pos:270,+cov
diff --git a/src/mint/afl-tests/id:000660,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000660,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000660,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000660,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000661,src:000000,op:ext_AO,pos:271,+cov b/src/exchange/afl-tests/id:000661,src:000000,op:ext_AO,pos:271,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000661,src:000000,op:ext_AO,pos:271,+cov
rename to src/exchange/afl-tests/id:000661,src:000000,op:ext_AO,pos:271,+cov
diff --git a/src/mint/afl-tests/id:000661,src:000000,op:havoc,rep:4 b/src/exchange/afl-tests/id:000661,src:000000,op:havoc,rep:4
similarity index 100%
rename from src/mint/afl-tests/id:000661,src:000000,op:havoc,rep:4
rename to src/exchange/afl-tests/id:000661,src:000000,op:havoc,rep:4
diff --git a/src/mint/afl-tests/id:000662,src:000000,op:ext_AO,pos:274,+cov b/src/exchange/afl-tests/id:000662,src:000000,op:ext_AO,pos:274,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000662,src:000000,op:ext_AO,pos:274,+cov
rename to src/exchange/afl-tests/id:000662,src:000000,op:ext_AO,pos:274,+cov
diff --git a/src/mint/afl-tests/id:000662,src:000000,op:havoc,rep:128 b/src/exchange/afl-tests/id:000662,src:000000,op:havoc,rep:128
similarity index 100%
rename from src/mint/afl-tests/id:000662,src:000000,op:havoc,rep:128
rename to src/exchange/afl-tests/id:000662,src:000000,op:havoc,rep:128
diff --git a/src/mint/afl-tests/id:000663,src:000000,op:ext_AO,pos:275,+cov b/src/exchange/afl-tests/id:000663,src:000000,op:ext_AO,pos:275,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000663,src:000000,op:ext_AO,pos:275,+cov
rename to src/exchange/afl-tests/id:000663,src:000000,op:ext_AO,pos:275,+cov
diff --git a/src/mint/afl-tests/id:000663,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000663,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000663,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000663,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000664,src:000000,op:ext_AO,pos:305,+cov b/src/exchange/afl-tests/id:000664,src:000000,op:ext_AO,pos:305,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000664,src:000000,op:ext_AO,pos:305,+cov
rename to src/exchange/afl-tests/id:000664,src:000000,op:ext_AO,pos:305,+cov
diff --git a/src/mint/afl-tests/id:000664,src:000000,op:havoc,rep:128 b/src/exchange/afl-tests/id:000664,src:000000,op:havoc,rep:128
similarity index 100%
rename from src/mint/afl-tests/id:000664,src:000000,op:havoc,rep:128
rename to src/exchange/afl-tests/id:000664,src:000000,op:havoc,rep:128
diff --git a/src/mint/afl-tests/id:000665,src:000000,op:ext_AO,pos:312,+cov b/src/exchange/afl-tests/id:000665,src:000000,op:ext_AO,pos:312,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000665,src:000000,op:ext_AO,pos:312,+cov
rename to src/exchange/afl-tests/id:000665,src:000000,op:ext_AO,pos:312,+cov
diff --git a/src/mint/afl-tests/id:000665,src:000000,op:havoc,rep:16,+cov b/src/exchange/afl-tests/id:000665,src:000000,op:havoc,rep:16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000665,src:000000,op:havoc,rep:16,+cov
rename to src/exchange/afl-tests/id:000665,src:000000,op:havoc,rep:16,+cov
diff --git a/src/mint/afl-tests/id:000666,src:000000,op:ext_AO,pos:314,+cov b/src/exchange/afl-tests/id:000666,src:000000,op:ext_AO,pos:314,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000666,src:000000,op:ext_AO,pos:314,+cov
rename to src/exchange/afl-tests/id:000666,src:000000,op:ext_AO,pos:314,+cov
diff --git a/src/mint/afl-tests/id:000666,src:000000,op:havoc,rep:64 b/src/exchange/afl-tests/id:000666,src:000000,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000666,src:000000,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000666,src:000000,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000667,src:000000,op:ext_AO,pos:319,+cov b/src/exchange/afl-tests/id:000667,src:000000,op:ext_AO,pos:319,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000667,src:000000,op:ext_AO,pos:319,+cov
rename to src/exchange/afl-tests/id:000667,src:000000,op:ext_AO,pos:319,+cov
diff --git a/src/mint/afl-tests/id:000667,src:000000,op:havoc,rep:16 b/src/exchange/afl-tests/id:000667,src:000000,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000667,src:000000,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000667,src:000000,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000668,src:000000,op:ext_AO,pos:328,+cov b/src/exchange/afl-tests/id:000668,src:000000,op:ext_AO,pos:328,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000668,src:000000,op:ext_AO,pos:328,+cov
rename to src/exchange/afl-tests/id:000668,src:000000,op:ext_AO,pos:328,+cov
diff --git a/src/mint/afl-tests/id:000668,src:000000,op:havoc,rep:128 b/src/exchange/afl-tests/id:000668,src:000000,op:havoc,rep:128
similarity index 100%
rename from src/mint/afl-tests/id:000668,src:000000,op:havoc,rep:128
rename to src/exchange/afl-tests/id:000668,src:000000,op:havoc,rep:128
diff --git a/src/mint/afl-tests/id:000669,src:000000,op:havoc,rep:16 b/src/exchange/afl-tests/id:000669,src:000000,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000669,src:000000,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000669,src:000000,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000669,src:000000,op:havoc,rep:64 b/src/exchange/afl-tests/id:000669,src:000000,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000669,src:000000,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000669,src:000000,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000670,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000670,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000670,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000670,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000671,src:000000,op:havoc,rep:16 b/src/exchange/afl-tests/id:000671,src:000000,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000671,src:000000,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000671,src:000000,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000671,src:000000,op:havoc,rep:8 b/src/exchange/afl-tests/id:000671,src:000000,op:havoc,rep:8
similarity index 100%
rename from src/mint/afl-tests/id:000671,src:000000,op:havoc,rep:8
rename to src/exchange/afl-tests/id:000671,src:000000,op:havoc,rep:8
diff --git a/src/mint/afl-tests/id:000672,src:000000,op:havoc,rep:16 b/src/exchange/afl-tests/id:000672,src:000000,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000672,src:000000,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000672,src:000000,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000672,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000672,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000672,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000672,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000673,src:000000,op:havoc,rep:128 b/src/exchange/afl-tests/id:000673,src:000000,op:havoc,rep:128
similarity index 100%
rename from src/mint/afl-tests/id:000673,src:000000,op:havoc,rep:128
rename to src/exchange/afl-tests/id:000673,src:000000,op:havoc,rep:128
diff --git a/src/mint/afl-tests/id:000673,src:000000,op:havoc,rep:16 b/src/exchange/afl-tests/id:000673,src:000000,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000673,src:000000,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000673,src:000000,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000674,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000674,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000674,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000674,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000675,src:000000,op:havoc,rep:128 b/src/exchange/afl-tests/id:000675,src:000000,op:havoc,rep:128
similarity index 100%
rename from src/mint/afl-tests/id:000675,src:000000,op:havoc,rep:128
rename to src/exchange/afl-tests/id:000675,src:000000,op:havoc,rep:128
diff --git a/src/mint/afl-tests/id:000675,src:000000,op:havoc,rep:8 b/src/exchange/afl-tests/id:000675,src:000000,op:havoc,rep:8
similarity index 100%
rename from src/mint/afl-tests/id:000675,src:000000,op:havoc,rep:8
rename to src/exchange/afl-tests/id:000675,src:000000,op:havoc,rep:8
diff --git a/src/mint/afl-tests/id:000676,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000676,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000676,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000676,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000677,src:000000,op:havoc,rep:64 b/src/exchange/afl-tests/id:000677,src:000000,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000677,src:000000,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000677,src:000000,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000677,src:000000,op:havoc,rep:8 b/src/exchange/afl-tests/id:000677,src:000000,op:havoc,rep:8
similarity index 100%
rename from src/mint/afl-tests/id:000677,src:000000,op:havoc,rep:8
rename to src/exchange/afl-tests/id:000677,src:000000,op:havoc,rep:8
diff --git a/src/mint/afl-tests/id:000678,src:000000,op:havoc,rep:16 b/src/exchange/afl-tests/id:000678,src:000000,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000678,src:000000,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000678,src:000000,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000678,src:000000,op:havoc,rep:4 b/src/exchange/afl-tests/id:000678,src:000000,op:havoc,rep:4
similarity index 100%
rename from src/mint/afl-tests/id:000678,src:000000,op:havoc,rep:4
rename to src/exchange/afl-tests/id:000678,src:000000,op:havoc,rep:4
diff --git a/src/mint/afl-tests/id:000679,src:000000,op:havoc,rep:128 b/src/exchange/afl-tests/id:000679,src:000000,op:havoc,rep:128
similarity index 100%
rename from src/mint/afl-tests/id:000679,src:000000,op:havoc,rep:128
rename to src/exchange/afl-tests/id:000679,src:000000,op:havoc,rep:128
diff --git a/src/mint/afl-tests/id:000679,src:000000,op:havoc,rep:16,+cov b/src/exchange/afl-tests/id:000679,src:000000,op:havoc,rep:16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000679,src:000000,op:havoc,rep:16,+cov
rename to src/exchange/afl-tests/id:000679,src:000000,op:havoc,rep:16,+cov
diff --git a/src/mint/afl-tests/id:000680,src:000000,op:havoc,rep:128,+cov b/src/exchange/afl-tests/id:000680,src:000000,op:havoc,rep:128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000680,src:000000,op:havoc,rep:128,+cov
rename to src/exchange/afl-tests/id:000680,src:000000,op:havoc,rep:128,+cov
diff --git a/src/mint/afl-tests/id:000680,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000680,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000680,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000680,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000681,src:000000,op:havoc,rep:16 b/src/exchange/afl-tests/id:000681,src:000000,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000681,src:000000,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000681,src:000000,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000681,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000681,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000681,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000681,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000682,src:000000,op:havoc,rep:16 b/src/exchange/afl-tests/id:000682,src:000000,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000682,src:000000,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000682,src:000000,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000682,src:000000,op:havoc,rep:64,+cov b/src/exchange/afl-tests/id:000682,src:000000,op:havoc,rep:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000682,src:000000,op:havoc,rep:64,+cov
rename to src/exchange/afl-tests/id:000682,src:000000,op:havoc,rep:64,+cov
diff --git a/src/mint/afl-tests/id:000683,src:000000,op:havoc,rep:16,+cov b/src/exchange/afl-tests/id:000683,src:000000,op:havoc,rep:16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000683,src:000000,op:havoc,rep:16,+cov
rename to src/exchange/afl-tests/id:000683,src:000000,op:havoc,rep:16,+cov
diff --git a/src/mint/afl-tests/id:000683,src:000000,op:havoc,rep:32,+cov b/src/exchange/afl-tests/id:000683,src:000000,op:havoc,rep:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000683,src:000000,op:havoc,rep:32,+cov
rename to src/exchange/afl-tests/id:000683,src:000000,op:havoc,rep:32,+cov
diff --git a/src/mint/afl-tests/id:000684,src:000000,op:havoc,rep:16,+cov b/src/exchange/afl-tests/id:000684,src:000000,op:havoc,rep:16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000684,src:000000,op:havoc,rep:16,+cov
rename to src/exchange/afl-tests/id:000684,src:000000,op:havoc,rep:16,+cov
diff --git a/src/mint/afl-tests/id:000684,src:000000,op:havoc,rep:8 b/src/exchange/afl-tests/id:000684,src:000000,op:havoc,rep:8
similarity index 100%
rename from src/mint/afl-tests/id:000684,src:000000,op:havoc,rep:8
rename to src/exchange/afl-tests/id:000684,src:000000,op:havoc,rep:8
diff --git a/src/mint/afl-tests/id:000685,src:000000,op:havoc,rep:16 b/src/exchange/afl-tests/id:000685,src:000000,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000685,src:000000,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000685,src:000000,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000685,src:000000,op:havoc,rep:16,+cov b/src/exchange/afl-tests/id:000685,src:000000,op:havoc,rep:16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000685,src:000000,op:havoc,rep:16,+cov
rename to src/exchange/afl-tests/id:000685,src:000000,op:havoc,rep:16,+cov
diff --git a/src/mint/afl-tests/id:000686,src:000000,op:havoc,rep:128,+cov b/src/exchange/afl-tests/id:000686,src:000000,op:havoc,rep:128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000686,src:000000,op:havoc,rep:128,+cov
rename to src/exchange/afl-tests/id:000686,src:000000,op:havoc,rep:128,+cov
diff --git a/src/mint/afl-tests/id:000686,src:000000,op:havoc,rep:16,+cov b/src/exchange/afl-tests/id:000686,src:000000,op:havoc,rep:16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000686,src:000000,op:havoc,rep:16,+cov
rename to src/exchange/afl-tests/id:000686,src:000000,op:havoc,rep:16,+cov
diff --git a/src/mint/afl-tests/id:000687,src:000000,op:havoc,rep:16 b/src/exchange/afl-tests/id:000687,src:000000,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000687,src:000000,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000687,src:000000,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000687,src:000000,op:havoc,rep:32,+cov b/src/exchange/afl-tests/id:000687,src:000000,op:havoc,rep:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000687,src:000000,op:havoc,rep:32,+cov
rename to src/exchange/afl-tests/id:000687,src:000000,op:havoc,rep:32,+cov
diff --git a/src/mint/afl-tests/id:000688,src:000000,op:havoc,rep:128 b/src/exchange/afl-tests/id:000688,src:000000,op:havoc,rep:128
similarity index 100%
rename from src/mint/afl-tests/id:000688,src:000000,op:havoc,rep:128
rename to src/exchange/afl-tests/id:000688,src:000000,op:havoc,rep:128
diff --git a/src/mint/afl-tests/id:000689,src:000000,op:havoc,rep:128,+cov b/src/exchange/afl-tests/id:000689,src:000000,op:havoc,rep:128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000689,src:000000,op:havoc,rep:128,+cov
rename to src/exchange/afl-tests/id:000689,src:000000,op:havoc,rep:128,+cov
diff --git a/src/mint/afl-tests/id:000689,src:000000,op:havoc,rep:64,+cov b/src/exchange/afl-tests/id:000689,src:000000,op:havoc,rep:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000689,src:000000,op:havoc,rep:64,+cov
rename to src/exchange/afl-tests/id:000689,src:000000,op:havoc,rep:64,+cov
diff --git a/src/mint/afl-tests/id:000690,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000690,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000690,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000690,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000690,src:000000,op:havoc,rep:64 b/src/exchange/afl-tests/id:000690,src:000000,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000690,src:000000,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000690,src:000000,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000691,src:000000,op:havoc,rep:64 b/src/exchange/afl-tests/id:000691,src:000000,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000691,src:000000,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000691,src:000000,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000692,src:000000,op:havoc,rep:4,+cov b/src/exchange/afl-tests/id:000692,src:000000,op:havoc,rep:4,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000692,src:000000,op:havoc,rep:4,+cov
rename to src/exchange/afl-tests/id:000692,src:000000,op:havoc,rep:4,+cov
diff --git a/src/mint/afl-tests/id:000693,src:000000,op:havoc,rep:16,+cov b/src/exchange/afl-tests/id:000693,src:000000,op:havoc,rep:16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000693,src:000000,op:havoc,rep:16,+cov
rename to src/exchange/afl-tests/id:000693,src:000000,op:havoc,rep:16,+cov
diff --git a/src/mint/afl-tests/id:000693,src:000000,op:havoc,rep:4,+cov b/src/exchange/afl-tests/id:000693,src:000000,op:havoc,rep:4,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000693,src:000000,op:havoc,rep:4,+cov
rename to src/exchange/afl-tests/id:000693,src:000000,op:havoc,rep:4,+cov
diff --git a/src/mint/afl-tests/id:000694,src:000000,op:havoc,rep:2,+cov b/src/exchange/afl-tests/id:000694,src:000000,op:havoc,rep:2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000694,src:000000,op:havoc,rep:2,+cov
rename to src/exchange/afl-tests/id:000694,src:000000,op:havoc,rep:2,+cov
diff --git a/src/mint/afl-tests/id:000694,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000694,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000694,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000694,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000695,src:000000,op:havoc,rep:128,+cov b/src/exchange/afl-tests/id:000695,src:000000,op:havoc,rep:128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000695,src:000000,op:havoc,rep:128,+cov
rename to src/exchange/afl-tests/id:000695,src:000000,op:havoc,rep:128,+cov
diff --git a/src/mint/afl-tests/id:000695,src:000000,op:havoc,rep:64 b/src/exchange/afl-tests/id:000695,src:000000,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000695,src:000000,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000695,src:000000,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000696,src:000000,op:havoc,rep:16 b/src/exchange/afl-tests/id:000696,src:000000,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000696,src:000000,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000696,src:000000,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000696,src:000000,op:havoc,rep:2,+cov b/src/exchange/afl-tests/id:000696,src:000000,op:havoc,rep:2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000696,src:000000,op:havoc,rep:2,+cov
rename to src/exchange/afl-tests/id:000696,src:000000,op:havoc,rep:2,+cov
diff --git a/src/mint/afl-tests/id:000697,src:000000,op:havoc,rep:64,+cov b/src/exchange/afl-tests/id:000697,src:000000,op:havoc,rep:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000697,src:000000,op:havoc,rep:64,+cov
rename to src/exchange/afl-tests/id:000697,src:000000,op:havoc,rep:64,+cov
diff --git a/src/mint/afl-tests/id:000697,src:000000,op:havoc,rep:8 b/src/exchange/afl-tests/id:000697,src:000000,op:havoc,rep:8
similarity index 100%
rename from src/mint/afl-tests/id:000697,src:000000,op:havoc,rep:8
rename to src/exchange/afl-tests/id:000697,src:000000,op:havoc,rep:8
diff --git a/src/mint/afl-tests/id:000698,src:000000,op:havoc,rep:128 b/src/exchange/afl-tests/id:000698,src:000000,op:havoc,rep:128
similarity index 100%
rename from src/mint/afl-tests/id:000698,src:000000,op:havoc,rep:128
rename to src/exchange/afl-tests/id:000698,src:000000,op:havoc,rep:128
diff --git a/src/mint/afl-tests/id:000699,src:000000,op:havoc,rep:2,+cov b/src/exchange/afl-tests/id:000699,src:000000,op:havoc,rep:2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000699,src:000000,op:havoc,rep:2,+cov
rename to src/exchange/afl-tests/id:000699,src:000000,op:havoc,rep:2,+cov
diff --git a/src/mint/afl-tests/id:000699,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000699,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000699,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000699,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000700,src:000000,op:havoc,rep:128,+cov b/src/exchange/afl-tests/id:000700,src:000000,op:havoc,rep:128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000700,src:000000,op:havoc,rep:128,+cov
rename to src/exchange/afl-tests/id:000700,src:000000,op:havoc,rep:128,+cov
diff --git a/src/mint/afl-tests/id:000700,src:000000,op:havoc,rep:32,+cov b/src/exchange/afl-tests/id:000700,src:000000,op:havoc,rep:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000700,src:000000,op:havoc,rep:32,+cov
rename to src/exchange/afl-tests/id:000700,src:000000,op:havoc,rep:32,+cov
diff --git a/src/mint/afl-tests/id:000701,src:000000,op:havoc,rep:16,+cov b/src/exchange/afl-tests/id:000701,src:000000,op:havoc,rep:16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000701,src:000000,op:havoc,rep:16,+cov
rename to src/exchange/afl-tests/id:000701,src:000000,op:havoc,rep:16,+cov
diff --git a/src/mint/afl-tests/id:000701,src:000000,op:havoc,rep:2 b/src/exchange/afl-tests/id:000701,src:000000,op:havoc,rep:2
similarity index 100%
rename from src/mint/afl-tests/id:000701,src:000000,op:havoc,rep:2
rename to src/exchange/afl-tests/id:000701,src:000000,op:havoc,rep:2
diff --git a/src/mint/afl-tests/id:000702,src:000000,op:havoc,rep:128 b/src/exchange/afl-tests/id:000702,src:000000,op:havoc,rep:128
similarity index 100%
rename from src/mint/afl-tests/id:000702,src:000000,op:havoc,rep:128
rename to src/exchange/afl-tests/id:000702,src:000000,op:havoc,rep:128
diff --git a/src/mint/afl-tests/id:000702,src:000000,op:havoc,rep:8 b/src/exchange/afl-tests/id:000702,src:000000,op:havoc,rep:8
similarity index 100%
rename from src/mint/afl-tests/id:000702,src:000000,op:havoc,rep:8
rename to src/exchange/afl-tests/id:000702,src:000000,op:havoc,rep:8
diff --git a/src/mint/afl-tests/id:000703,src:000000,op:havoc,rep:32,+cov b/src/exchange/afl-tests/id:000703,src:000000,op:havoc,rep:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000703,src:000000,op:havoc,rep:32,+cov
rename to src/exchange/afl-tests/id:000703,src:000000,op:havoc,rep:32,+cov
diff --git a/src/mint/afl-tests/id:000703,src:000001,op:flip1,pos:34,+cov b/src/exchange/afl-tests/id:000703,src:000001,op:flip1,pos:34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000703,src:000001,op:flip1,pos:34,+cov
rename to src/exchange/afl-tests/id:000703,src:000001,op:flip1,pos:34,+cov
diff --git a/src/mint/afl-tests/id:000704,src:000000,op:havoc,rep:64,+cov b/src/exchange/afl-tests/id:000704,src:000000,op:havoc,rep:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000704,src:000000,op:havoc,rep:64,+cov
rename to src/exchange/afl-tests/id:000704,src:000000,op:havoc,rep:64,+cov
diff --git a/src/mint/afl-tests/id:000704,src:000001,op:flip1,pos:50,+cov b/src/exchange/afl-tests/id:000704,src:000001,op:flip1,pos:50,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000704,src:000001,op:flip1,pos:50,+cov
rename to src/exchange/afl-tests/id:000704,src:000001,op:flip1,pos:50,+cov
diff --git a/src/mint/afl-tests/id:000705,src:000000,op:havoc,rep:2,+cov b/src/exchange/afl-tests/id:000705,src:000000,op:havoc,rep:2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000705,src:000000,op:havoc,rep:2,+cov
rename to src/exchange/afl-tests/id:000705,src:000000,op:havoc,rep:2,+cov
diff --git a/src/mint/afl-tests/id:000705,src:000001,op:flip1,pos:61,+cov b/src/exchange/afl-tests/id:000705,src:000001,op:flip1,pos:61,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000705,src:000001,op:flip1,pos:61,+cov
rename to src/exchange/afl-tests/id:000705,src:000001,op:flip1,pos:61,+cov
diff --git a/src/mint/afl-tests/id:000706,src:000000,op:havoc,rep:32 b/src/exchange/afl-tests/id:000706,src:000000,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000706,src:000000,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000706,src:000000,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000706,src:000001,op:flip1,pos:91 b/src/exchange/afl-tests/id:000706,src:000001,op:flip1,pos:91
similarity index 100%
rename from src/mint/afl-tests/id:000706,src:000001,op:flip1,pos:91
rename to src/exchange/afl-tests/id:000706,src:000001,op:flip1,pos:91
diff --git a/src/mint/afl-tests/id:000707,src:000000,op:havoc,rep:128,+cov b/src/exchange/afl-tests/id:000707,src:000000,op:havoc,rep:128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000707,src:000000,op:havoc,rep:128,+cov
rename to src/exchange/afl-tests/id:000707,src:000000,op:havoc,rep:128,+cov
diff --git a/src/mint/afl-tests/id:000707,src:000001,op:flip1,pos:103,+cov b/src/exchange/afl-tests/id:000707,src:000001,op:flip1,pos:103,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000707,src:000001,op:flip1,pos:103,+cov
rename to src/exchange/afl-tests/id:000707,src:000001,op:flip1,pos:103,+cov
diff --git a/src/mint/afl-tests/id:000708,src:000000,op:havoc,rep:2 b/src/exchange/afl-tests/id:000708,src:000000,op:havoc,rep:2
similarity index 100%
rename from src/mint/afl-tests/id:000708,src:000000,op:havoc,rep:2
rename to src/exchange/afl-tests/id:000708,src:000000,op:havoc,rep:2
diff --git a/src/mint/afl-tests/id:000708,src:000001,op:flip1,pos:120,+cov b/src/exchange/afl-tests/id:000708,src:000001,op:flip1,pos:120,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000708,src:000001,op:flip1,pos:120,+cov
rename to src/exchange/afl-tests/id:000708,src:000001,op:flip1,pos:120,+cov
diff --git a/src/mint/afl-tests/id:000709,src:000000,op:havoc,rep:64 b/src/exchange/afl-tests/id:000709,src:000000,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000709,src:000000,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000709,src:000000,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000709,src:000001,op:flip1,pos:129,+cov b/src/exchange/afl-tests/id:000709,src:000001,op:flip1,pos:129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000709,src:000001,op:flip1,pos:129,+cov
rename to src/exchange/afl-tests/id:000709,src:000001,op:flip1,pos:129,+cov
diff --git a/src/mint/afl-tests/id:000710,src:000000,op:havoc,rep:8,+cov b/src/exchange/afl-tests/id:000710,src:000000,op:havoc,rep:8,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000710,src:000000,op:havoc,rep:8,+cov
rename to src/exchange/afl-tests/id:000710,src:000000,op:havoc,rep:8,+cov
diff --git a/src/mint/afl-tests/id:000710,src:000001,op:flip1,pos:129,+cov b/src/exchange/afl-tests/id:000710,src:000001,op:flip1,pos:129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000710,src:000001,op:flip1,pos:129,+cov
rename to src/exchange/afl-tests/id:000710,src:000001,op:flip1,pos:129,+cov
diff --git a/src/mint/afl-tests/id:000711,src:000000,op:havoc,rep:2,+cov b/src/exchange/afl-tests/id:000711,src:000000,op:havoc,rep:2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000711,src:000000,op:havoc,rep:2,+cov
rename to src/exchange/afl-tests/id:000711,src:000000,op:havoc,rep:2,+cov
diff --git a/src/mint/afl-tests/id:000711,src:000001,op:flip1,pos:131,+cov b/src/exchange/afl-tests/id:000711,src:000001,op:flip1,pos:131,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000711,src:000001,op:flip1,pos:131,+cov
rename to src/exchange/afl-tests/id:000711,src:000001,op:flip1,pos:131,+cov
diff --git a/src/mint/afl-tests/id:000712,src:000000,op:havoc,rep:2,+cov b/src/exchange/afl-tests/id:000712,src:000000,op:havoc,rep:2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000712,src:000000,op:havoc,rep:2,+cov
rename to src/exchange/afl-tests/id:000712,src:000000,op:havoc,rep:2,+cov
diff --git a/src/mint/afl-tests/id:000712,src:000001,op:flip1,pos:139,+cov b/src/exchange/afl-tests/id:000712,src:000001,op:flip1,pos:139,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000712,src:000001,op:flip1,pos:139,+cov
rename to src/exchange/afl-tests/id:000712,src:000001,op:flip1,pos:139,+cov
diff --git a/src/mint/afl-tests/id:000713,src:000000,op:havoc,rep:64,+cov b/src/exchange/afl-tests/id:000713,src:000000,op:havoc,rep:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000713,src:000000,op:havoc,rep:64,+cov
rename to src/exchange/afl-tests/id:000713,src:000000,op:havoc,rep:64,+cov
diff --git a/src/mint/afl-tests/id:000713,src:000001,op:flip1,pos:197,+cov b/src/exchange/afl-tests/id:000713,src:000001,op:flip1,pos:197,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000713,src:000001,op:flip1,pos:197,+cov
rename to src/exchange/afl-tests/id:000713,src:000001,op:flip1,pos:197,+cov
diff --git a/src/mint/afl-tests/id:000714,src:000000,op:havoc,rep:8,+cov b/src/exchange/afl-tests/id:000714,src:000000,op:havoc,rep:8,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000714,src:000000,op:havoc,rep:8,+cov
rename to src/exchange/afl-tests/id:000714,src:000000,op:havoc,rep:8,+cov
diff --git a/src/mint/afl-tests/id:000714,src:000001,op:flip1,pos:243,+cov b/src/exchange/afl-tests/id:000714,src:000001,op:flip1,pos:243,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000714,src:000001,op:flip1,pos:243,+cov
rename to src/exchange/afl-tests/id:000714,src:000001,op:flip1,pos:243,+cov
diff --git a/src/mint/afl-tests/id:000715,src:000000,op:havoc,rep:8,+cov b/src/exchange/afl-tests/id:000715,src:000000,op:havoc,rep:8,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000715,src:000000,op:havoc,rep:8,+cov
rename to src/exchange/afl-tests/id:000715,src:000000,op:havoc,rep:8,+cov
diff --git a/src/mint/afl-tests/id:000715,src:000001,op:flip1,pos:365,+cov b/src/exchange/afl-tests/id:000715,src:000001,op:flip1,pos:365,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000715,src:000001,op:flip1,pos:365,+cov
rename to src/exchange/afl-tests/id:000715,src:000001,op:flip1,pos:365,+cov
diff --git a/src/mint/afl-tests/id:000716,src:000001,op:flip1,pos:2 b/src/exchange/afl-tests/id:000716,src:000001,op:flip1,pos:2
similarity index 100%
rename from src/mint/afl-tests/id:000716,src:000001,op:flip1,pos:2
rename to src/exchange/afl-tests/id:000716,src:000001,op:flip1,pos:2
diff --git a/src/mint/afl-tests/id:000716,src:000001,op:flip1,pos:456,+cov b/src/exchange/afl-tests/id:000716,src:000001,op:flip1,pos:456,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000716,src:000001,op:flip1,pos:456,+cov
rename to src/exchange/afl-tests/id:000716,src:000001,op:flip1,pos:456,+cov
diff --git a/src/mint/afl-tests/id:000717,src:000001,op:flip1,pos:50,+cov b/src/exchange/afl-tests/id:000717,src:000001,op:flip1,pos:50,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000717,src:000001,op:flip1,pos:50,+cov
rename to src/exchange/afl-tests/id:000717,src:000001,op:flip1,pos:50,+cov
diff --git a/src/mint/afl-tests/id:000717,src:000001,op:flip1,pos:596 b/src/exchange/afl-tests/id:000717,src:000001,op:flip1,pos:596
similarity index 100%
rename from src/mint/afl-tests/id:000717,src:000001,op:flip1,pos:596
rename to src/exchange/afl-tests/id:000717,src:000001,op:flip1,pos:596
diff --git a/src/mint/afl-tests/id:000718,src:000001,op:flip1,pos:55,+cov b/src/exchange/afl-tests/id:000718,src:000001,op:flip1,pos:55,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000718,src:000001,op:flip1,pos:55,+cov
rename to src/exchange/afl-tests/id:000718,src:000001,op:flip1,pos:55,+cov
diff --git a/src/mint/afl-tests/id:000718,src:000001,op:flip1,pos:614,+cov b/src/exchange/afl-tests/id:000718,src:000001,op:flip1,pos:614,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000718,src:000001,op:flip1,pos:614,+cov
rename to src/exchange/afl-tests/id:000718,src:000001,op:flip1,pos:614,+cov
diff --git a/src/mint/afl-tests/id:000719,src:000001,op:flip1,pos:629,+cov b/src/exchange/afl-tests/id:000719,src:000001,op:flip1,pos:629,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000719,src:000001,op:flip1,pos:629,+cov
rename to src/exchange/afl-tests/id:000719,src:000001,op:flip1,pos:629,+cov
diff --git a/src/mint/afl-tests/id:000719,src:000001,op:flip1,pos:95 b/src/exchange/afl-tests/id:000719,src:000001,op:flip1,pos:95
similarity index 100%
rename from src/mint/afl-tests/id:000719,src:000001,op:flip1,pos:95
rename to src/exchange/afl-tests/id:000719,src:000001,op:flip1,pos:95
diff --git a/src/mint/afl-tests/id:000720,src:000001,op:flip1,pos:102,+cov b/src/exchange/afl-tests/id:000720,src:000001,op:flip1,pos:102,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000720,src:000001,op:flip1,pos:102,+cov
rename to src/exchange/afl-tests/id:000720,src:000001,op:flip1,pos:102,+cov
diff --git a/src/mint/afl-tests/id:000720,src:000001,op:flip1,pos:635,+cov b/src/exchange/afl-tests/id:000720,src:000001,op:flip1,pos:635,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000720,src:000001,op:flip1,pos:635,+cov
rename to src/exchange/afl-tests/id:000720,src:000001,op:flip1,pos:635,+cov
diff --git a/src/mint/afl-tests/id:000721,src:000001,op:flip1,pos:107,+cov b/src/exchange/afl-tests/id:000721,src:000001,op:flip1,pos:107,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000721,src:000001,op:flip1,pos:107,+cov
rename to src/exchange/afl-tests/id:000721,src:000001,op:flip1,pos:107,+cov
diff --git a/src/mint/afl-tests/id:000721,src:000001,op:flip1,pos:683,+cov b/src/exchange/afl-tests/id:000721,src:000001,op:flip1,pos:683,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000721,src:000001,op:flip1,pos:683,+cov
rename to src/exchange/afl-tests/id:000721,src:000001,op:flip1,pos:683,+cov
diff --git a/src/mint/afl-tests/id:000722,src:000001,op:flip1,pos:118,+cov b/src/exchange/afl-tests/id:000722,src:000001,op:flip1,pos:118,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000722,src:000001,op:flip1,pos:118,+cov
rename to src/exchange/afl-tests/id:000722,src:000001,op:flip1,pos:118,+cov
diff --git a/src/mint/afl-tests/id:000722,src:000001,op:flip1,pos:730,+cov b/src/exchange/afl-tests/id:000722,src:000001,op:flip1,pos:730,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000722,src:000001,op:flip1,pos:730,+cov
rename to src/exchange/afl-tests/id:000722,src:000001,op:flip1,pos:730,+cov
diff --git a/src/mint/afl-tests/id:000723,src:000001,op:flip1,pos:124,+cov b/src/exchange/afl-tests/id:000723,src:000001,op:flip1,pos:124,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000723,src:000001,op:flip1,pos:124,+cov
rename to src/exchange/afl-tests/id:000723,src:000001,op:flip1,pos:124,+cov
diff --git a/src/mint/afl-tests/id:000723,src:000001,op:flip1,pos:786,+cov b/src/exchange/afl-tests/id:000723,src:000001,op:flip1,pos:786,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000723,src:000001,op:flip1,pos:786,+cov
rename to src/exchange/afl-tests/id:000723,src:000001,op:flip1,pos:786,+cov
diff --git a/src/mint/afl-tests/id:000724,src:000001,op:flip1,pos:133,+cov b/src/exchange/afl-tests/id:000724,src:000001,op:flip1,pos:133,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000724,src:000001,op:flip1,pos:133,+cov
rename to src/exchange/afl-tests/id:000724,src:000001,op:flip1,pos:133,+cov
diff --git a/src/mint/afl-tests/id:000724,src:000001,op:flip1,pos:796 b/src/exchange/afl-tests/id:000724,src:000001,op:flip1,pos:796
similarity index 100%
rename from src/mint/afl-tests/id:000724,src:000001,op:flip1,pos:796
rename to src/exchange/afl-tests/id:000724,src:000001,op:flip1,pos:796
diff --git a/src/mint/afl-tests/id:000725,src:000001,op:flip1,pos:133,+cov b/src/exchange/afl-tests/id:000725,src:000001,op:flip1,pos:133,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000725,src:000001,op:flip1,pos:133,+cov
rename to src/exchange/afl-tests/id:000725,src:000001,op:flip1,pos:133,+cov
diff --git a/src/mint/afl-tests/id:000725,src:000001,op:flip1,pos:915,+cov b/src/exchange/afl-tests/id:000725,src:000001,op:flip1,pos:915,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000725,src:000001,op:flip1,pos:915,+cov
rename to src/exchange/afl-tests/id:000725,src:000001,op:flip1,pos:915,+cov
diff --git a/src/mint/afl-tests/id:000726,src:000001,op:flip1,pos:1112,+cov b/src/exchange/afl-tests/id:000726,src:000001,op:flip1,pos:1112,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000726,src:000001,op:flip1,pos:1112,+cov
rename to src/exchange/afl-tests/id:000726,src:000001,op:flip1,pos:1112,+cov
diff --git a/src/mint/afl-tests/id:000726,src:000001,op:flip1,pos:135,+cov b/src/exchange/afl-tests/id:000726,src:000001,op:flip1,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000726,src:000001,op:flip1,pos:135,+cov
rename to src/exchange/afl-tests/id:000726,src:000001,op:flip1,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000727,src:000001,op:flip1,pos:1112,+cov b/src/exchange/afl-tests/id:000727,src:000001,op:flip1,pos:1112,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000727,src:000001,op:flip1,pos:1112,+cov
rename to src/exchange/afl-tests/id:000727,src:000001,op:flip1,pos:1112,+cov
diff --git a/src/mint/afl-tests/id:000727,src:000001,op:flip1,pos:457,+cov b/src/exchange/afl-tests/id:000727,src:000001,op:flip1,pos:457,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000727,src:000001,op:flip1,pos:457,+cov
rename to src/exchange/afl-tests/id:000727,src:000001,op:flip1,pos:457,+cov
diff --git a/src/mint/afl-tests/id:000728,src:000001,op:flip1,pos:1114,+cov b/src/exchange/afl-tests/id:000728,src:000001,op:flip1,pos:1114,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000728,src:000001,op:flip1,pos:1114,+cov
rename to src/exchange/afl-tests/id:000728,src:000001,op:flip1,pos:1114,+cov
diff --git a/src/mint/afl-tests/id:000728,src:000001,op:flip1,pos:469,+cov b/src/exchange/afl-tests/id:000728,src:000001,op:flip1,pos:469,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000728,src:000001,op:flip1,pos:469,+cov
rename to src/exchange/afl-tests/id:000728,src:000001,op:flip1,pos:469,+cov
diff --git a/src/mint/afl-tests/id:000729,src:000001,op:flip1,pos:1215,+cov b/src/exchange/afl-tests/id:000729,src:000001,op:flip1,pos:1215,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000729,src:000001,op:flip1,pos:1215,+cov
rename to src/exchange/afl-tests/id:000729,src:000001,op:flip1,pos:1215,+cov
diff --git a/src/mint/afl-tests/id:000729,src:000001,op:flip1,pos:508,+cov b/src/exchange/afl-tests/id:000729,src:000001,op:flip1,pos:508,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000729,src:000001,op:flip1,pos:508,+cov
rename to src/exchange/afl-tests/id:000729,src:000001,op:flip1,pos:508,+cov
diff --git a/src/mint/afl-tests/id:000730,src:000001,op:flip1,pos:1353,+cov b/src/exchange/afl-tests/id:000730,src:000001,op:flip1,pos:1353,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000730,src:000001,op:flip1,pos:1353,+cov
rename to src/exchange/afl-tests/id:000730,src:000001,op:flip1,pos:1353,+cov
diff --git a/src/mint/afl-tests/id:000730,src:000001,op:flip1,pos:600 b/src/exchange/afl-tests/id:000730,src:000001,op:flip1,pos:600
similarity index 100%
rename from src/mint/afl-tests/id:000730,src:000001,op:flip1,pos:600
rename to src/exchange/afl-tests/id:000730,src:000001,op:flip1,pos:600
diff --git a/src/mint/afl-tests/id:000731,src:000001,op:flip1,pos:1453,+cov b/src/exchange/afl-tests/id:000731,src:000001,op:flip1,pos:1453,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000731,src:000001,op:flip1,pos:1453,+cov
rename to src/exchange/afl-tests/id:000731,src:000001,op:flip1,pos:1453,+cov
diff --git a/src/mint/afl-tests/id:000731,src:000001,op:flip1,pos:618,+cov b/src/exchange/afl-tests/id:000731,src:000001,op:flip1,pos:618,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000731,src:000001,op:flip1,pos:618,+cov
rename to src/exchange/afl-tests/id:000731,src:000001,op:flip1,pos:618,+cov
diff --git a/src/mint/afl-tests/id:000732,src:000001,op:flip1,pos:1574,+cov b/src/exchange/afl-tests/id:000732,src:000001,op:flip1,pos:1574,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000732,src:000001,op:flip1,pos:1574,+cov
rename to src/exchange/afl-tests/id:000732,src:000001,op:flip1,pos:1574,+cov
diff --git a/src/mint/afl-tests/id:000732,src:000001,op:flip1,pos:633,+cov b/src/exchange/afl-tests/id:000732,src:000001,op:flip1,pos:633,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000732,src:000001,op:flip1,pos:633,+cov
rename to src/exchange/afl-tests/id:000732,src:000001,op:flip1,pos:633,+cov
diff --git a/src/mint/afl-tests/id:000733,src:000001,op:flip1,pos:1630 b/src/exchange/afl-tests/id:000733,src:000001,op:flip1,pos:1630
similarity index 100%
rename from src/mint/afl-tests/id:000733,src:000001,op:flip1,pos:1630
rename to src/exchange/afl-tests/id:000733,src:000001,op:flip1,pos:1630
diff --git a/src/mint/afl-tests/id:000733,src:000001,op:flip1,pos:687,+cov b/src/exchange/afl-tests/id:000733,src:000001,op:flip1,pos:687,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000733,src:000001,op:flip1,pos:687,+cov
rename to src/exchange/afl-tests/id:000733,src:000001,op:flip1,pos:687,+cov
diff --git a/src/mint/afl-tests/id:000734,src:000001,op:flip1,pos:722,+cov b/src/exchange/afl-tests/id:000734,src:000001,op:flip1,pos:722,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000734,src:000001,op:flip1,pos:722,+cov
rename to src/exchange/afl-tests/id:000734,src:000001,op:flip1,pos:722,+cov
diff --git a/src/mint/afl-tests/id:000734,src:000001,op:flip2,pos:453,+cov b/src/exchange/afl-tests/id:000734,src:000001,op:flip2,pos:453,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000734,src:000001,op:flip2,pos:453,+cov
rename to src/exchange/afl-tests/id:000734,src:000001,op:flip2,pos:453,+cov
diff --git a/src/mint/afl-tests/id:000735,src:000001,op:flip1,pos:734,+cov b/src/exchange/afl-tests/id:000735,src:000001,op:flip1,pos:734,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000735,src:000001,op:flip1,pos:734,+cov
rename to src/exchange/afl-tests/id:000735,src:000001,op:flip1,pos:734,+cov
diff --git a/src/mint/afl-tests/id:000735,src:000001,op:flip2,pos:484,+cov b/src/exchange/afl-tests/id:000735,src:000001,op:flip2,pos:484,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000735,src:000001,op:flip2,pos:484,+cov
rename to src/exchange/afl-tests/id:000735,src:000001,op:flip2,pos:484,+cov
diff --git a/src/mint/afl-tests/id:000736,src:000001,op:flip1,pos:800 b/src/exchange/afl-tests/id:000736,src:000001,op:flip1,pos:800
similarity index 100%
rename from src/mint/afl-tests/id:000736,src:000001,op:flip1,pos:800
rename to src/exchange/afl-tests/id:000736,src:000001,op:flip1,pos:800
diff --git a/src/mint/afl-tests/id:000736,src:000001,op:flip2,pos:696,+cov b/src/exchange/afl-tests/id:000736,src:000001,op:flip2,pos:696,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000736,src:000001,op:flip2,pos:696,+cov
rename to src/exchange/afl-tests/id:000736,src:000001,op:flip2,pos:696,+cov
diff --git a/src/mint/afl-tests/id:000737,src:000001,op:flip1,pos:888,+cov b/src/exchange/afl-tests/id:000737,src:000001,op:flip1,pos:888,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000737,src:000001,op:flip1,pos:888,+cov
rename to src/exchange/afl-tests/id:000737,src:000001,op:flip1,pos:888,+cov
diff --git a/src/mint/afl-tests/id:000737,src:000001,op:flip2,pos:843,+cov b/src/exchange/afl-tests/id:000737,src:000001,op:flip2,pos:843,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000737,src:000001,op:flip2,pos:843,+cov
rename to src/exchange/afl-tests/id:000737,src:000001,op:flip2,pos:843,+cov
diff --git a/src/mint/afl-tests/id:000738,src:000001,op:flip1,pos:893,+cov b/src/exchange/afl-tests/id:000738,src:000001,op:flip1,pos:893,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000738,src:000001,op:flip1,pos:893,+cov
rename to src/exchange/afl-tests/id:000738,src:000001,op:flip1,pos:893,+cov
diff --git a/src/mint/afl-tests/id:000738,src:000001,op:flip2,pos:845,+cov b/src/exchange/afl-tests/id:000738,src:000001,op:flip2,pos:845,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000738,src:000001,op:flip2,pos:845,+cov
rename to src/exchange/afl-tests/id:000738,src:000001,op:flip2,pos:845,+cov
diff --git a/src/mint/afl-tests/id:000739,src:000001,op:flip1,pos:1116,+cov b/src/exchange/afl-tests/id:000739,src:000001,op:flip1,pos:1116,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000739,src:000001,op:flip1,pos:1116,+cov
rename to src/exchange/afl-tests/id:000739,src:000001,op:flip1,pos:1116,+cov
diff --git a/src/mint/afl-tests/id:000739,src:000001,op:flip2,pos:917,+cov b/src/exchange/afl-tests/id:000739,src:000001,op:flip2,pos:917,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000739,src:000001,op:flip2,pos:917,+cov
rename to src/exchange/afl-tests/id:000739,src:000001,op:flip2,pos:917,+cov
diff --git a/src/mint/afl-tests/id:000740,src:000001,op:flip1,pos:1116,+cov b/src/exchange/afl-tests/id:000740,src:000001,op:flip1,pos:1116,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000740,src:000001,op:flip1,pos:1116,+cov
rename to src/exchange/afl-tests/id:000740,src:000001,op:flip1,pos:1116,+cov
diff --git a/src/mint/afl-tests/id:000740,src:000001,op:flip2,pos:995,+cov b/src/exchange/afl-tests/id:000740,src:000001,op:flip2,pos:995,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000740,src:000001,op:flip2,pos:995,+cov
rename to src/exchange/afl-tests/id:000740,src:000001,op:flip2,pos:995,+cov
diff --git a/src/mint/afl-tests/id:000741,src:000001,op:flip1,pos:1118,+cov b/src/exchange/afl-tests/id:000741,src:000001,op:flip1,pos:1118,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000741,src:000001,op:flip1,pos:1118,+cov
rename to src/exchange/afl-tests/id:000741,src:000001,op:flip1,pos:1118,+cov
diff --git a/src/mint/afl-tests/id:000741,src:000001,op:flip2,pos:1031,+cov b/src/exchange/afl-tests/id:000741,src:000001,op:flip2,pos:1031,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000741,src:000001,op:flip2,pos:1031,+cov
rename to src/exchange/afl-tests/id:000741,src:000001,op:flip2,pos:1031,+cov
diff --git a/src/mint/afl-tests/id:000742,src:000001,op:flip1,pos:1170,+cov b/src/exchange/afl-tests/id:000742,src:000001,op:flip1,pos:1170,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000742,src:000001,op:flip1,pos:1170,+cov
rename to src/exchange/afl-tests/id:000742,src:000001,op:flip1,pos:1170,+cov
diff --git a/src/mint/afl-tests/id:000742,src:000001,op:flip2,pos:1135,+cov b/src/exchange/afl-tests/id:000742,src:000001,op:flip2,pos:1135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000742,src:000001,op:flip2,pos:1135,+cov
rename to src/exchange/afl-tests/id:000742,src:000001,op:flip2,pos:1135,+cov
diff --git a/src/mint/afl-tests/id:000743,src:000001,op:flip1,pos:1205,+cov b/src/exchange/afl-tests/id:000743,src:000001,op:flip1,pos:1205,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000743,src:000001,op:flip1,pos:1205,+cov
rename to src/exchange/afl-tests/id:000743,src:000001,op:flip1,pos:1205,+cov
diff --git a/src/mint/afl-tests/id:000743,src:000001,op:flip2,pos:1286,+cov b/src/exchange/afl-tests/id:000743,src:000001,op:flip2,pos:1286,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000743,src:000001,op:flip2,pos:1286,+cov
rename to src/exchange/afl-tests/id:000743,src:000001,op:flip2,pos:1286,+cov
diff --git a/src/mint/afl-tests/id:000744,src:000001,op:flip1,pos:1301,+cov b/src/exchange/afl-tests/id:000744,src:000001,op:flip1,pos:1301,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000744,src:000001,op:flip1,pos:1301,+cov
rename to src/exchange/afl-tests/id:000744,src:000001,op:flip1,pos:1301,+cov
diff --git a/src/mint/afl-tests/id:000744,src:000001,op:flip2,pos:1655,+cov b/src/exchange/afl-tests/id:000744,src:000001,op:flip2,pos:1655,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000744,src:000001,op:flip2,pos:1655,+cov
rename to src/exchange/afl-tests/id:000744,src:000001,op:flip2,pos:1655,+cov
diff --git a/src/mint/afl-tests/id:000745,src:000001,op:flip1,pos:1369,+cov b/src/exchange/afl-tests/id:000745,src:000001,op:flip1,pos:1369,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000745,src:000001,op:flip1,pos:1369,+cov
rename to src/exchange/afl-tests/id:000745,src:000001,op:flip1,pos:1369,+cov
diff --git a/src/mint/afl-tests/id:000745,src:000001,op:flip4,pos:50,+cov b/src/exchange/afl-tests/id:000745,src:000001,op:flip4,pos:50,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000745,src:000001,op:flip4,pos:50,+cov
rename to src/exchange/afl-tests/id:000745,src:000001,op:flip4,pos:50,+cov
diff --git a/src/mint/afl-tests/id:000746,src:000001,op:flip1,pos:1378,+cov b/src/exchange/afl-tests/id:000746,src:000001,op:flip1,pos:1378,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000746,src:000001,op:flip1,pos:1378,+cov
rename to src/exchange/afl-tests/id:000746,src:000001,op:flip1,pos:1378,+cov
diff --git a/src/mint/afl-tests/id:000746,src:000001,op:flip4,pos:122,+cov b/src/exchange/afl-tests/id:000746,src:000001,op:flip4,pos:122,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000746,src:000001,op:flip4,pos:122,+cov
rename to src/exchange/afl-tests/id:000746,src:000001,op:flip4,pos:122,+cov
diff --git a/src/mint/afl-tests/id:000747,src:000001,op:flip1,pos:1474,+cov b/src/exchange/afl-tests/id:000747,src:000001,op:flip1,pos:1474,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000747,src:000001,op:flip1,pos:1474,+cov
rename to src/exchange/afl-tests/id:000747,src:000001,op:flip1,pos:1474,+cov
diff --git a/src/mint/afl-tests/id:000747,src:000001,op:flip4,pos:351,+cov b/src/exchange/afl-tests/id:000747,src:000001,op:flip4,pos:351,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000747,src:000001,op:flip4,pos:351,+cov
rename to src/exchange/afl-tests/id:000747,src:000001,op:flip4,pos:351,+cov
diff --git a/src/mint/afl-tests/id:000748,src:000001,op:flip1,pos:1510,+cov b/src/exchange/afl-tests/id:000748,src:000001,op:flip1,pos:1510,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000748,src:000001,op:flip1,pos:1510,+cov
rename to src/exchange/afl-tests/id:000748,src:000001,op:flip1,pos:1510,+cov
diff --git a/src/mint/afl-tests/id:000748,src:000001,op:flip4,pos:569,+cov b/src/exchange/afl-tests/id:000748,src:000001,op:flip4,pos:569,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000748,src:000001,op:flip4,pos:569,+cov
rename to src/exchange/afl-tests/id:000748,src:000001,op:flip4,pos:569,+cov
diff --git a/src/mint/afl-tests/id:000749,src:000001,op:flip1,pos:1634 b/src/exchange/afl-tests/id:000749,src:000001,op:flip1,pos:1634
similarity index 100%
rename from src/mint/afl-tests/id:000749,src:000001,op:flip1,pos:1634
rename to src/exchange/afl-tests/id:000749,src:000001,op:flip1,pos:1634
diff --git a/src/mint/afl-tests/id:000749,src:000001,op:flip4,pos:788,+cov b/src/exchange/afl-tests/id:000749,src:000001,op:flip4,pos:788,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000749,src:000001,op:flip4,pos:788,+cov
rename to src/exchange/afl-tests/id:000749,src:000001,op:flip4,pos:788,+cov
diff --git a/src/mint/afl-tests/id:000750,src:000001,op:flip1,pos:1657,+cov b/src/exchange/afl-tests/id:000750,src:000001,op:flip1,pos:1657,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000750,src:000001,op:flip1,pos:1657,+cov
rename to src/exchange/afl-tests/id:000750,src:000001,op:flip1,pos:1657,+cov
diff --git a/src/mint/afl-tests/id:000750,src:000001,op:flip4,pos:1198,+cov b/src/exchange/afl-tests/id:000750,src:000001,op:flip4,pos:1198,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000750,src:000001,op:flip4,pos:1198,+cov
rename to src/exchange/afl-tests/id:000750,src:000001,op:flip4,pos:1198,+cov
diff --git a/src/mint/afl-tests/id:000751,src:000001,op:flip1,pos:1712,+cov b/src/exchange/afl-tests/id:000751,src:000001,op:flip1,pos:1712,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000751,src:000001,op:flip1,pos:1712,+cov
rename to src/exchange/afl-tests/id:000751,src:000001,op:flip1,pos:1712,+cov
diff --git a/src/mint/afl-tests/id:000751,src:000001,op:flip8,pos:67,+cov b/src/exchange/afl-tests/id:000751,src:000001,op:flip8,pos:67,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000751,src:000001,op:flip8,pos:67,+cov
rename to src/exchange/afl-tests/id:000751,src:000001,op:flip8,pos:67,+cov
diff --git a/src/mint/afl-tests/id:000752,src:000001,op:flip2,pos:21,+cov b/src/exchange/afl-tests/id:000752,src:000001,op:flip2,pos:21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000752,src:000001,op:flip2,pos:21,+cov
rename to src/exchange/afl-tests/id:000752,src:000001,op:flip2,pos:21,+cov
diff --git a/src/mint/afl-tests/id:000752,src:000001,op:flip8,pos:1661,+cov b/src/exchange/afl-tests/id:000752,src:000001,op:flip8,pos:1661,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000752,src:000001,op:flip8,pos:1661,+cov
rename to src/exchange/afl-tests/id:000752,src:000001,op:flip8,pos:1661,+cov
diff --git a/src/mint/afl-tests/id:000753,src:000001,op:flip16,pos:390,+cov b/src/exchange/afl-tests/id:000753,src:000001,op:flip16,pos:390,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000753,src:000001,op:flip16,pos:390,+cov
rename to src/exchange/afl-tests/id:000753,src:000001,op:flip16,pos:390,+cov
diff --git a/src/mint/afl-tests/id:000753,src:000001,op:flip2,pos:39,+cov b/src/exchange/afl-tests/id:000753,src:000001,op:flip2,pos:39,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000753,src:000001,op:flip2,pos:39,+cov
rename to src/exchange/afl-tests/id:000753,src:000001,op:flip2,pos:39,+cov
diff --git a/src/mint/afl-tests/id:000754,src:000001,op:flip2,pos:105,+cov b/src/exchange/afl-tests/id:000754,src:000001,op:flip2,pos:105,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000754,src:000001,op:flip2,pos:105,+cov
rename to src/exchange/afl-tests/id:000754,src:000001,op:flip2,pos:105,+cov
diff --git a/src/mint/afl-tests/id:000754,src:000001,op:flip32,pos:339,+cov b/src/exchange/afl-tests/id:000754,src:000001,op:flip32,pos:339,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000754,src:000001,op:flip32,pos:339,+cov
rename to src/exchange/afl-tests/id:000754,src:000001,op:flip32,pos:339,+cov
diff --git a/src/mint/afl-tests/id:000755,src:000001,op:flip2,pos:890,+cov b/src/exchange/afl-tests/id:000755,src:000001,op:flip2,pos:890,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000755,src:000001,op:flip2,pos:890,+cov
rename to src/exchange/afl-tests/id:000755,src:000001,op:flip2,pos:890,+cov
diff --git a/src/mint/afl-tests/id:000755,src:000001,op:flip32,pos:975,+cov b/src/exchange/afl-tests/id:000755,src:000001,op:flip32,pos:975,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000755,src:000001,op:flip32,pos:975,+cov
rename to src/exchange/afl-tests/id:000755,src:000001,op:flip32,pos:975,+cov
diff --git a/src/mint/afl-tests/id:000756,src:000001,op:arith8,pos:10,val:-30,+cov b/src/exchange/afl-tests/id:000756,src:000001,op:arith8,pos:10,val:-30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000756,src:000001,op:arith8,pos:10,val:-30,+cov
rename to src/exchange/afl-tests/id:000756,src:000001,op:arith8,pos:10,val:-30,+cov
diff --git a/src/mint/afl-tests/id:000756,src:000001,op:flip2,pos:975,+cov b/src/exchange/afl-tests/id:000756,src:000001,op:flip2,pos:975,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000756,src:000001,op:flip2,pos:975,+cov
rename to src/exchange/afl-tests/id:000756,src:000001,op:flip2,pos:975,+cov
diff --git a/src/mint/afl-tests/id:000757,src:000001,op:arith8,pos:46,val:+9,+cov b/src/exchange/afl-tests/id:000757,src:000001,op:arith8,pos:46,val:+9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000757,src:000001,op:arith8,pos:46,val:+9,+cov
rename to src/exchange/afl-tests/id:000757,src:000001,op:arith8,pos:46,val:+9,+cov
diff --git a/src/mint/afl-tests/id:000757,src:000001,op:flip2,pos:1509,+cov b/src/exchange/afl-tests/id:000757,src:000001,op:flip2,pos:1509,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000757,src:000001,op:flip2,pos:1509,+cov
rename to src/exchange/afl-tests/id:000757,src:000001,op:flip2,pos:1509,+cov
diff --git a/src/mint/afl-tests/id:000758,src:000001,op:arith8,pos:72,val:+5,+cov b/src/exchange/afl-tests/id:000758,src:000001,op:arith8,pos:72,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000758,src:000001,op:arith8,pos:72,val:+5,+cov
rename to src/exchange/afl-tests/id:000758,src:000001,op:arith8,pos:72,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000758,src:000001,op:flip2,pos:1662,+cov b/src/exchange/afl-tests/id:000758,src:000001,op:flip2,pos:1662,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000758,src:000001,op:flip2,pos:1662,+cov
rename to src/exchange/afl-tests/id:000758,src:000001,op:flip2,pos:1662,+cov
diff --git a/src/mint/afl-tests/id:000759,src:000001,op:flip4,pos:32,+cov b/src/exchange/afl-tests/id:000759,src:000001,op:flip4,pos:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000759,src:000001,op:flip4,pos:32,+cov
rename to src/exchange/afl-tests/id:000759,src:000001,op:flip4,pos:32,+cov
diff --git a/src/mint/afl-tests/id:000759,src:000002,op:flip1,pos:30 b/src/exchange/afl-tests/id:000759,src:000002,op:flip1,pos:30
similarity index 100%
rename from src/mint/afl-tests/id:000759,src:000002,op:flip1,pos:30
rename to src/exchange/afl-tests/id:000759,src:000002,op:flip1,pos:30
diff --git a/src/mint/afl-tests/id:000760,src:000001,op:flip4,pos:300,+cov b/src/exchange/afl-tests/id:000760,src:000001,op:flip4,pos:300,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000760,src:000001,op:flip4,pos:300,+cov
rename to src/exchange/afl-tests/id:000760,src:000001,op:flip4,pos:300,+cov
diff --git a/src/mint/afl-tests/id:000760,src:000002,op:flip1,pos:50 b/src/exchange/afl-tests/id:000760,src:000002,op:flip1,pos:50
similarity index 100%
rename from src/mint/afl-tests/id:000760,src:000002,op:flip1,pos:50
rename to src/exchange/afl-tests/id:000760,src:000002,op:flip1,pos:50
diff --git a/src/mint/afl-tests/id:000761,src:000001,op:flip4,pos:457,+cov b/src/exchange/afl-tests/id:000761,src:000001,op:flip4,pos:457,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000761,src:000001,op:flip4,pos:457,+cov
rename to src/exchange/afl-tests/id:000761,src:000001,op:flip4,pos:457,+cov
diff --git a/src/mint/afl-tests/id:000761,src:000002,op:flip1,pos:50,+cov b/src/exchange/afl-tests/id:000761,src:000002,op:flip1,pos:50,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000761,src:000002,op:flip1,pos:50,+cov
rename to src/exchange/afl-tests/id:000761,src:000002,op:flip1,pos:50,+cov
diff --git a/src/mint/afl-tests/id:000762,src:000001,op:flip4,pos:1507,+cov b/src/exchange/afl-tests/id:000762,src:000001,op:flip4,pos:1507,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000762,src:000001,op:flip4,pos:1507,+cov
rename to src/exchange/afl-tests/id:000762,src:000001,op:flip4,pos:1507,+cov
diff --git a/src/mint/afl-tests/id:000762,src:000002,op:flip1,pos:63 b/src/exchange/afl-tests/id:000762,src:000002,op:flip1,pos:63
similarity index 100%
rename from src/mint/afl-tests/id:000762,src:000002,op:flip1,pos:63
rename to src/exchange/afl-tests/id:000762,src:000002,op:flip1,pos:63
diff --git a/src/mint/afl-tests/id:000763,src:000001,op:flip4,pos:1549,+cov b/src/exchange/afl-tests/id:000763,src:000001,op:flip4,pos:1549,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000763,src:000001,op:flip4,pos:1549,+cov
rename to src/exchange/afl-tests/id:000763,src:000001,op:flip4,pos:1549,+cov
diff --git a/src/mint/afl-tests/id:000763,src:000002,op:flip1,pos:76 b/src/exchange/afl-tests/id:000763,src:000002,op:flip1,pos:76
similarity index 100%
rename from src/mint/afl-tests/id:000763,src:000002,op:flip1,pos:76
rename to src/exchange/afl-tests/id:000763,src:000002,op:flip1,pos:76
diff --git a/src/mint/afl-tests/id:000764,src:000001,op:flip4,pos:1577,+cov b/src/exchange/afl-tests/id:000764,src:000001,op:flip4,pos:1577,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000764,src:000001,op:flip4,pos:1577,+cov
rename to src/exchange/afl-tests/id:000764,src:000001,op:flip4,pos:1577,+cov
diff --git a/src/mint/afl-tests/id:000764,src:000002,op:flip1,pos:135 b/src/exchange/afl-tests/id:000764,src:000002,op:flip1,pos:135
similarity index 100%
rename from src/mint/afl-tests/id:000764,src:000002,op:flip1,pos:135
rename to src/exchange/afl-tests/id:000764,src:000002,op:flip1,pos:135
diff --git a/src/mint/afl-tests/id:000765,src:000001,op:flip8,pos:899,+cov b/src/exchange/afl-tests/id:000765,src:000001,op:flip8,pos:899,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000765,src:000001,op:flip8,pos:899,+cov
rename to src/exchange/afl-tests/id:000765,src:000001,op:flip8,pos:899,+cov
diff --git a/src/mint/afl-tests/id:000765,src:000002,op:flip1,pos:143,+cov b/src/exchange/afl-tests/id:000765,src:000002,op:flip1,pos:143,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000765,src:000002,op:flip1,pos:143,+cov
rename to src/exchange/afl-tests/id:000765,src:000002,op:flip1,pos:143,+cov
diff --git a/src/mint/afl-tests/id:000766,src:000001,op:flip8,pos:1457,+cov b/src/exchange/afl-tests/id:000766,src:000001,op:flip8,pos:1457,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000766,src:000001,op:flip8,pos:1457,+cov
rename to src/exchange/afl-tests/id:000766,src:000001,op:flip8,pos:1457,+cov
diff --git a/src/mint/afl-tests/id:000766,src:000002,op:flip4,pos:8,+cov b/src/exchange/afl-tests/id:000766,src:000002,op:flip4,pos:8,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000766,src:000002,op:flip4,pos:8,+cov
rename to src/exchange/afl-tests/id:000766,src:000002,op:flip4,pos:8,+cov
diff --git a/src/mint/afl-tests/id:000767,src:000001,op:flip32,pos:301,+cov b/src/exchange/afl-tests/id:000767,src:000001,op:flip32,pos:301,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000767,src:000001,op:flip32,pos:301,+cov
rename to src/exchange/afl-tests/id:000767,src:000001,op:flip32,pos:301,+cov
diff --git a/src/mint/afl-tests/id:000767,src:000002,op:flip4,pos:117,+cov b/src/exchange/afl-tests/id:000767,src:000002,op:flip4,pos:117,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000767,src:000002,op:flip4,pos:117,+cov
rename to src/exchange/afl-tests/id:000767,src:000002,op:flip4,pos:117,+cov
diff --git a/src/mint/afl-tests/id:000768,src:000001,op:arith8,pos:18,val:+11,+cov b/src/exchange/afl-tests/id:000768,src:000001,op:arith8,pos:18,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000768,src:000001,op:arith8,pos:18,val:+11,+cov
rename to src/exchange/afl-tests/id:000768,src:000001,op:arith8,pos:18,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000768,src:000002,op:arith8,pos:11,val:-1,+cov b/src/exchange/afl-tests/id:000768,src:000002,op:arith8,pos:11,val:-1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000768,src:000002,op:arith8,pos:11,val:-1,+cov
rename to src/exchange/afl-tests/id:000768,src:000002,op:arith8,pos:11,val:-1,+cov
diff --git a/src/mint/afl-tests/id:000769,src:000001,op:arith8,pos:33,val:+17,+cov b/src/exchange/afl-tests/id:000769,src:000001,op:arith8,pos:33,val:+17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000769,src:000001,op:arith8,pos:33,val:+17,+cov
rename to src/exchange/afl-tests/id:000769,src:000001,op:arith8,pos:33,val:+17,+cov
diff --git a/src/mint/afl-tests/id:000769,src:000002,op:arith8,pos:20,val:+13,+cov b/src/exchange/afl-tests/id:000769,src:000002,op:arith8,pos:20,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000769,src:000002,op:arith8,pos:20,val:+13,+cov
rename to src/exchange/afl-tests/id:000769,src:000002,op:arith8,pos:20,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000770,src:000002,op:arith8,pos:34,val:-6,+cov b/src/exchange/afl-tests/id:000770,src:000002,op:arith8,pos:34,val:-6,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000770,src:000002,op:arith8,pos:34,val:-6,+cov
rename to src/exchange/afl-tests/id:000770,src:000002,op:arith8,pos:34,val:-6,+cov
diff --git a/src/mint/afl-tests/id:000770,src:000002,op:flip1,pos:30 b/src/exchange/afl-tests/id:000770,src:000002,op:flip1,pos:30
similarity index 100%
rename from src/mint/afl-tests/id:000770,src:000002,op:flip1,pos:30
rename to src/exchange/afl-tests/id:000770,src:000002,op:flip1,pos:30
diff --git a/src/mint/afl-tests/id:000771,src:000002,op:arith8,pos:105,val:+35,+cov b/src/exchange/afl-tests/id:000771,src:000002,op:arith8,pos:105,val:+35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000771,src:000002,op:arith8,pos:105,val:+35,+cov
rename to src/exchange/afl-tests/id:000771,src:000002,op:arith8,pos:105,val:+35,+cov
diff --git a/src/mint/afl-tests/id:000771,src:000002,op:flip1,pos:45,+cov b/src/exchange/afl-tests/id:000771,src:000002,op:flip1,pos:45,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000771,src:000002,op:flip1,pos:45,+cov
rename to src/exchange/afl-tests/id:000771,src:000002,op:flip1,pos:45,+cov
diff --git a/src/mint/afl-tests/id:000772,src:000002,op:arith8,pos:109,val:-35 b/src/exchange/afl-tests/id:000772,src:000002,op:arith8,pos:109,val:-35
similarity index 100%
rename from src/mint/afl-tests/id:000772,src:000002,op:arith8,pos:109,val:-35
rename to src/exchange/afl-tests/id:000772,src:000002,op:arith8,pos:109,val:-35
diff --git a/src/mint/afl-tests/id:000772,src:000002,op:flip1,pos:50 b/src/exchange/afl-tests/id:000772,src:000002,op:flip1,pos:50
similarity index 100%
rename from src/mint/afl-tests/id:000772,src:000002,op:flip1,pos:50
rename to src/exchange/afl-tests/id:000772,src:000002,op:flip1,pos:50
diff --git a/src/mint/afl-tests/id:000773,src:000002,op:arith8,pos:131,val:+5,+cov b/src/exchange/afl-tests/id:000773,src:000002,op:arith8,pos:131,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000773,src:000002,op:arith8,pos:131,val:+5,+cov
rename to src/exchange/afl-tests/id:000773,src:000002,op:arith8,pos:131,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000773,src:000002,op:flip1,pos:63 b/src/exchange/afl-tests/id:000773,src:000002,op:flip1,pos:63
similarity index 100%
rename from src/mint/afl-tests/id:000773,src:000002,op:flip1,pos:63
rename to src/exchange/afl-tests/id:000773,src:000002,op:flip1,pos:63
diff --git a/src/mint/afl-tests/id:000774,src:000002,op:arith8,pos:137,val:+9,+cov b/src/exchange/afl-tests/id:000774,src:000002,op:arith8,pos:137,val:+9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000774,src:000002,op:arith8,pos:137,val:+9,+cov
rename to src/exchange/afl-tests/id:000774,src:000002,op:arith8,pos:137,val:+9,+cov
diff --git a/src/mint/afl-tests/id:000774,src:000002,op:flip1,pos:76 b/src/exchange/afl-tests/id:000774,src:000002,op:flip1,pos:76
similarity index 100%
rename from src/mint/afl-tests/id:000774,src:000002,op:flip1,pos:76
rename to src/exchange/afl-tests/id:000774,src:000002,op:flip1,pos:76
diff --git a/src/mint/afl-tests/id:000775,src:000002,op:arith16,pos:55,val:-29,+cov b/src/exchange/afl-tests/id:000775,src:000002,op:arith16,pos:55,val:-29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000775,src:000002,op:arith16,pos:55,val:-29,+cov
rename to src/exchange/afl-tests/id:000775,src:000002,op:arith16,pos:55,val:-29,+cov
diff --git a/src/mint/afl-tests/id:000775,src:000002,op:flip1,pos:107,+cov b/src/exchange/afl-tests/id:000775,src:000002,op:flip1,pos:107,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000775,src:000002,op:flip1,pos:107,+cov
rename to src/exchange/afl-tests/id:000775,src:000002,op:flip1,pos:107,+cov
diff --git a/src/mint/afl-tests/id:000776,src:000002,op:flip1,pos:135 b/src/exchange/afl-tests/id:000776,src:000002,op:flip1,pos:135
similarity index 100%
rename from src/mint/afl-tests/id:000776,src:000002,op:flip1,pos:135
rename to src/exchange/afl-tests/id:000776,src:000002,op:flip1,pos:135
diff --git a/src/mint/afl-tests/id:000776,src:000002,op:int16,pos:27,val:+16,+cov b/src/exchange/afl-tests/id:000776,src:000002,op:int16,pos:27,val:+16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000776,src:000002,op:int16,pos:27,val:+16,+cov
rename to src/exchange/afl-tests/id:000776,src:000002,op:int16,pos:27,val:+16,+cov
diff --git a/src/mint/afl-tests/id:000777,src:000002,op:flip2,pos:56,+cov b/src/exchange/afl-tests/id:000777,src:000002,op:flip2,pos:56,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000777,src:000002,op:flip2,pos:56,+cov
rename to src/exchange/afl-tests/id:000777,src:000002,op:flip2,pos:56,+cov
diff --git a/src/mint/afl-tests/id:000777,src:000002,op:int16,pos:96,val:+32 b/src/exchange/afl-tests/id:000777,src:000002,op:int16,pos:96,val:+32
similarity index 100%
rename from src/mint/afl-tests/id:000777,src:000002,op:int16,pos:96,val:+32
rename to src/exchange/afl-tests/id:000777,src:000002,op:int16,pos:96,val:+32
diff --git a/src/mint/afl-tests/id:000778,src:000002,op:flip2,pos:113,+cov b/src/exchange/afl-tests/id:000778,src:000002,op:flip2,pos:113,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000778,src:000002,op:flip2,pos:113,+cov
rename to src/exchange/afl-tests/id:000778,src:000002,op:flip2,pos:113,+cov
diff --git a/src/mint/afl-tests/id:000778,src:000002,op:int32,pos:53,val:be:+32767,+cov b/src/exchange/afl-tests/id:000778,src:000002,op:int32,pos:53,val:be:+32767,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000778,src:000002,op:int32,pos:53,val:be:+32767,+cov
rename to src/exchange/afl-tests/id:000778,src:000002,op:int32,pos:53,val:be:+32767,+cov
diff --git a/src/mint/afl-tests/id:000779,src:000002,op:ext_AO,pos:22,+cov b/src/exchange/afl-tests/id:000779,src:000002,op:ext_AO,pos:22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000779,src:000002,op:ext_AO,pos:22,+cov
rename to src/exchange/afl-tests/id:000779,src:000002,op:ext_AO,pos:22,+cov
diff --git a/src/mint/afl-tests/id:000779,src:000002,op:flip4,pos:15,+cov b/src/exchange/afl-tests/id:000779,src:000002,op:flip4,pos:15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000779,src:000002,op:flip4,pos:15,+cov
rename to src/exchange/afl-tests/id:000779,src:000002,op:flip4,pos:15,+cov
diff --git a/src/mint/afl-tests/id:000780,src:000002,op:arith8,pos:10,val:-7,+cov b/src/exchange/afl-tests/id:000780,src:000002,op:arith8,pos:10,val:-7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000780,src:000002,op:arith8,pos:10,val:-7,+cov
rename to src/exchange/afl-tests/id:000780,src:000002,op:arith8,pos:10,val:-7,+cov
diff --git a/src/mint/afl-tests/id:000780,src:000002,op:ext_AO,pos:130,+cov b/src/exchange/afl-tests/id:000780,src:000002,op:ext_AO,pos:130,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000780,src:000002,op:ext_AO,pos:130,+cov
rename to src/exchange/afl-tests/id:000780,src:000002,op:ext_AO,pos:130,+cov
diff --git a/src/mint/afl-tests/id:000781,src:000002,op:arith8,pos:29,val:+21,+cov b/src/exchange/afl-tests/id:000781,src:000002,op:arith8,pos:29,val:+21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000781,src:000002,op:arith8,pos:29,val:+21,+cov
rename to src/exchange/afl-tests/id:000781,src:000002,op:arith8,pos:29,val:+21,+cov
diff --git a/src/mint/afl-tests/id:000781,src:000002,op:havoc,rep:8 b/src/exchange/afl-tests/id:000781,src:000002,op:havoc,rep:8
similarity index 100%
rename from src/mint/afl-tests/id:000781,src:000002,op:havoc,rep:8
rename to src/exchange/afl-tests/id:000781,src:000002,op:havoc,rep:8
diff --git a/src/mint/afl-tests/id:000782,src:000002,op:arith8,pos:109,val:-35 b/src/exchange/afl-tests/id:000782,src:000002,op:arith8,pos:109,val:-35
similarity index 100%
rename from src/mint/afl-tests/id:000782,src:000002,op:arith8,pos:109,val:-35
rename to src/exchange/afl-tests/id:000782,src:000002,op:arith8,pos:109,val:-35
diff --git a/src/mint/afl-tests/id:000782,src:000002,op:havoc,rep:2 b/src/exchange/afl-tests/id:000782,src:000002,op:havoc,rep:2
similarity index 100%
rename from src/mint/afl-tests/id:000782,src:000002,op:havoc,rep:2
rename to src/exchange/afl-tests/id:000782,src:000002,op:havoc,rep:2
diff --git a/src/mint/afl-tests/id:000783,src:000002,op:arith8,pos:132,val:+34,+cov b/src/exchange/afl-tests/id:000783,src:000002,op:arith8,pos:132,val:+34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000783,src:000002,op:arith8,pos:132,val:+34,+cov
rename to src/exchange/afl-tests/id:000783,src:000002,op:arith8,pos:132,val:+34,+cov
diff --git a/src/mint/afl-tests/id:000783,src:000002,op:havoc,rep:4 b/src/exchange/afl-tests/id:000783,src:000002,op:havoc,rep:4
similarity index 100%
rename from src/mint/afl-tests/id:000783,src:000002,op:havoc,rep:4
rename to src/exchange/afl-tests/id:000783,src:000002,op:havoc,rep:4
diff --git a/src/mint/afl-tests/id:000784,src:000002,op:havoc,rep:64,+cov b/src/exchange/afl-tests/id:000784,src:000002,op:havoc,rep:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000784,src:000002,op:havoc,rep:64,+cov
rename to src/exchange/afl-tests/id:000784,src:000002,op:havoc,rep:64,+cov
diff --git a/src/mint/afl-tests/id:000784,src:000002,op:int16,pos:20,val:-129,+cov b/src/exchange/afl-tests/id:000784,src:000002,op:int16,pos:20,val:-129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000784,src:000002,op:int16,pos:20,val:-129,+cov
rename to src/exchange/afl-tests/id:000784,src:000002,op:int16,pos:20,val:-129,+cov
diff --git a/src/mint/afl-tests/id:000785,src:000002,op:havoc,rep:64 b/src/exchange/afl-tests/id:000785,src:000002,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000785,src:000002,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000785,src:000002,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000785,src:000002,op:int16,pos:82,val:+64,+cov b/src/exchange/afl-tests/id:000785,src:000002,op:int16,pos:82,val:+64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000785,src:000002,op:int16,pos:82,val:+64,+cov
rename to src/exchange/afl-tests/id:000785,src:000002,op:int16,pos:82,val:+64,+cov
diff --git a/src/mint/afl-tests/id:000786,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000786,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000786,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000786,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000786,src:000002,op:int16,pos:96,val:+32 b/src/exchange/afl-tests/id:000786,src:000002,op:int16,pos:96,val:+32
similarity index 100%
rename from src/mint/afl-tests/id:000786,src:000002,op:int16,pos:96,val:+32
rename to src/exchange/afl-tests/id:000786,src:000002,op:int16,pos:96,val:+32
diff --git a/src/mint/afl-tests/id:000787,src:000002,op:havoc,rep:64 b/src/exchange/afl-tests/id:000787,src:000002,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000787,src:000002,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000787,src:000002,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000787,src:000002,op:int16,pos:112,val:be:-128,+cov b/src/exchange/afl-tests/id:000787,src:000002,op:int16,pos:112,val:be:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000787,src:000002,op:int16,pos:112,val:be:-128,+cov
rename to src/exchange/afl-tests/id:000787,src:000002,op:int16,pos:112,val:be:-128,+cov
diff --git a/src/mint/afl-tests/id:000788,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000788,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000788,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000788,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000788,src:000002,op:int32,pos:26,val:+65536,+cov b/src/exchange/afl-tests/id:000788,src:000002,op:int32,pos:26,val:+65536,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000788,src:000002,op:int32,pos:26,val:+65536,+cov
rename to src/exchange/afl-tests/id:000788,src:000002,op:int32,pos:26,val:+65536,+cov
diff --git a/src/mint/afl-tests/id:000789,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000789,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000789,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000789,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000789,src:000002,op:int32,pos:54,val:+32,+cov b/src/exchange/afl-tests/id:000789,src:000002,op:int32,pos:54,val:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000789,src:000002,op:int32,pos:54,val:+32,+cov
rename to src/exchange/afl-tests/id:000789,src:000002,op:int32,pos:54,val:+32,+cov
diff --git a/src/mint/afl-tests/id:000790,src:000002,op:ext_AO,pos:95,+cov b/src/exchange/afl-tests/id:000790,src:000002,op:ext_AO,pos:95,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000790,src:000002,op:ext_AO,pos:95,+cov
rename to src/exchange/afl-tests/id:000790,src:000002,op:ext_AO,pos:95,+cov
diff --git a/src/mint/afl-tests/id:000790,src:000002,op:havoc,rep:64 b/src/exchange/afl-tests/id:000790,src:000002,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000790,src:000002,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000790,src:000002,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000791,src:000002,op:ext_AO,pos:98,+cov b/src/exchange/afl-tests/id:000791,src:000002,op:ext_AO,pos:98,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000791,src:000002,op:ext_AO,pos:98,+cov
rename to src/exchange/afl-tests/id:000791,src:000002,op:ext_AO,pos:98,+cov
diff --git a/src/mint/afl-tests/id:000791,src:000002,op:havoc,rep:4 b/src/exchange/afl-tests/id:000791,src:000002,op:havoc,rep:4
similarity index 100%
rename from src/mint/afl-tests/id:000791,src:000002,op:havoc,rep:4
rename to src/exchange/afl-tests/id:000791,src:000002,op:havoc,rep:4
diff --git a/src/mint/afl-tests/id:000792,src:000002,op:ext_AO,pos:130,+cov b/src/exchange/afl-tests/id:000792,src:000002,op:ext_AO,pos:130,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000792,src:000002,op:ext_AO,pos:130,+cov
rename to src/exchange/afl-tests/id:000792,src:000002,op:ext_AO,pos:130,+cov
diff --git a/src/mint/afl-tests/id:000792,src:000002,op:havoc,rep:8 b/src/exchange/afl-tests/id:000792,src:000002,op:havoc,rep:8
similarity index 100%
rename from src/mint/afl-tests/id:000792,src:000002,op:havoc,rep:8
rename to src/exchange/afl-tests/id:000792,src:000002,op:havoc,rep:8
diff --git a/src/mint/afl-tests/id:000793,src:000002,op:ext_AO,pos:135,+cov b/src/exchange/afl-tests/id:000793,src:000002,op:ext_AO,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000793,src:000002,op:ext_AO,pos:135,+cov
rename to src/exchange/afl-tests/id:000793,src:000002,op:ext_AO,pos:135,+cov
diff --git a/src/mint/afl-tests/id:000793,src:000002,op:havoc,rep:64 b/src/exchange/afl-tests/id:000793,src:000002,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000793,src:000002,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000793,src:000002,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000794,src:000002,op:ext_AO,pos:138,+cov b/src/exchange/afl-tests/id:000794,src:000002,op:ext_AO,pos:138,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000794,src:000002,op:ext_AO,pos:138,+cov
rename to src/exchange/afl-tests/id:000794,src:000002,op:ext_AO,pos:138,+cov
diff --git a/src/mint/afl-tests/id:000794,src:000002,op:havoc,rep:64 b/src/exchange/afl-tests/id:000794,src:000002,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000794,src:000002,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000794,src:000002,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000795,src:000002,op:havoc,rep:4 b/src/exchange/afl-tests/id:000795,src:000002,op:havoc,rep:4
similarity index 100%
rename from src/mint/afl-tests/id:000795,src:000002,op:havoc,rep:4
rename to src/exchange/afl-tests/id:000795,src:000002,op:havoc,rep:4
diff --git a/src/mint/afl-tests/id:000795,src:000002,op:havoc,rep:8 b/src/exchange/afl-tests/id:000795,src:000002,op:havoc,rep:8
similarity index 100%
rename from src/mint/afl-tests/id:000795,src:000002,op:havoc,rep:8
rename to src/exchange/afl-tests/id:000795,src:000002,op:havoc,rep:8
diff --git a/src/mint/afl-tests/id:000796,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000796,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000796,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000796,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000796,src:000002,op:havoc,rep:32,+cov b/src/exchange/afl-tests/id:000796,src:000002,op:havoc,rep:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000796,src:000002,op:havoc,rep:32,+cov
rename to src/exchange/afl-tests/id:000796,src:000002,op:havoc,rep:32,+cov
diff --git a/src/mint/afl-tests/id:000797,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000797,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000797,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000797,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000797,src:000002,op:havoc,rep:2 b/src/exchange/afl-tests/id:000797,src:000002,op:havoc,rep:2
similarity index 100%
rename from src/mint/afl-tests/id:000797,src:000002,op:havoc,rep:2
rename to src/exchange/afl-tests/id:000797,src:000002,op:havoc,rep:2
diff --git a/src/mint/afl-tests/id:000798,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000798,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000798,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000798,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000798,src:000002,op:havoc,rep:64 b/src/exchange/afl-tests/id:000798,src:000002,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000798,src:000002,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000798,src:000002,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000799,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000799,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000799,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000799,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000799,src:000002,op:havoc,rep:64 b/src/exchange/afl-tests/id:000799,src:000002,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000799,src:000002,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000799,src:000002,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000800,src:000002,op:havoc,rep:4 b/src/exchange/afl-tests/id:000800,src:000002,op:havoc,rep:4
similarity index 100%
rename from src/mint/afl-tests/id:000800,src:000002,op:havoc,rep:4
rename to src/exchange/afl-tests/id:000800,src:000002,op:havoc,rep:4
diff --git a/src/mint/afl-tests/id:000801,src:000002,op:havoc,rep:128 b/src/exchange/afl-tests/id:000801,src:000002,op:havoc,rep:128
similarity index 100%
rename from src/mint/afl-tests/id:000801,src:000002,op:havoc,rep:128
rename to src/exchange/afl-tests/id:000801,src:000002,op:havoc,rep:128
diff --git a/src/mint/afl-tests/id:000801,src:000002,op:havoc,rep:64 b/src/exchange/afl-tests/id:000801,src:000002,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000801,src:000002,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000801,src:000002,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000802,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000802,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000802,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000802,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000802,src:000002,op:havoc,rep:4 b/src/exchange/afl-tests/id:000802,src:000002,op:havoc,rep:4
similarity index 100%
rename from src/mint/afl-tests/id:000802,src:000002,op:havoc,rep:4
rename to src/exchange/afl-tests/id:000802,src:000002,op:havoc,rep:4
diff --git a/src/mint/afl-tests/id:000803,src:000002,op:havoc,rep:128,+cov b/src/exchange/afl-tests/id:000803,src:000002,op:havoc,rep:128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000803,src:000002,op:havoc,rep:128,+cov
rename to src/exchange/afl-tests/id:000803,src:000002,op:havoc,rep:128,+cov
diff --git a/src/mint/afl-tests/id:000803,src:000002,op:havoc,rep:2 b/src/exchange/afl-tests/id:000803,src:000002,op:havoc,rep:2
similarity index 100%
rename from src/mint/afl-tests/id:000803,src:000002,op:havoc,rep:2
rename to src/exchange/afl-tests/id:000803,src:000002,op:havoc,rep:2
diff --git a/src/mint/afl-tests/id:000804,src:000002,op:havoc,rep:32 b/src/exchange/afl-tests/id:000804,src:000002,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000804,src:000002,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000804,src:000002,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000804,src:000002,op:havoc,rep:64 b/src/exchange/afl-tests/id:000804,src:000002,op:havoc,rep:64
similarity index 100%
rename from src/mint/afl-tests/id:000804,src:000002,op:havoc,rep:64
rename to src/exchange/afl-tests/id:000804,src:000002,op:havoc,rep:64
diff --git a/src/mint/afl-tests/id:000805,src:000002,op:havoc,rep:4 b/src/exchange/afl-tests/id:000805,src:000002,op:havoc,rep:4
similarity index 100%
rename from src/mint/afl-tests/id:000805,src:000002,op:havoc,rep:4
rename to src/exchange/afl-tests/id:000805,src:000002,op:havoc,rep:4
diff --git a/src/mint/afl-tests/id:000805,src:000003,op:flip1,pos:0,+cov b/src/exchange/afl-tests/id:000805,src:000003,op:flip1,pos:0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000805,src:000003,op:flip1,pos:0,+cov
rename to src/exchange/afl-tests/id:000805,src:000003,op:flip1,pos:0,+cov
diff --git a/src/mint/afl-tests/id:000806,src:000002,op:havoc,rep:32 b/src/exchange/afl-tests/id:000806,src:000002,op:havoc,rep:32
similarity index 100%
rename from src/mint/afl-tests/id:000806,src:000002,op:havoc,rep:32
rename to src/exchange/afl-tests/id:000806,src:000002,op:havoc,rep:32
diff --git a/src/mint/afl-tests/id:000806,src:000003,op:flip1,pos:13,+cov b/src/exchange/afl-tests/id:000806,src:000003,op:flip1,pos:13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000806,src:000003,op:flip1,pos:13,+cov
rename to src/exchange/afl-tests/id:000806,src:000003,op:flip1,pos:13,+cov
diff --git a/src/mint/afl-tests/id:000807,src:000002,op:havoc,rep:128 b/src/exchange/afl-tests/id:000807,src:000002,op:havoc,rep:128
similarity index 100%
rename from src/mint/afl-tests/id:000807,src:000002,op:havoc,rep:128
rename to src/exchange/afl-tests/id:000807,src:000002,op:havoc,rep:128
diff --git a/src/mint/afl-tests/id:000807,src:000003,op:flip1,pos:18,+cov b/src/exchange/afl-tests/id:000807,src:000003,op:flip1,pos:18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000807,src:000003,op:flip1,pos:18,+cov
rename to src/exchange/afl-tests/id:000807,src:000003,op:flip1,pos:18,+cov
diff --git a/src/mint/afl-tests/id:000808,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000808,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000808,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000808,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000808,src:000003,op:flip1,pos:27,+cov b/src/exchange/afl-tests/id:000808,src:000003,op:flip1,pos:27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000808,src:000003,op:flip1,pos:27,+cov
rename to src/exchange/afl-tests/id:000808,src:000003,op:flip1,pos:27,+cov
diff --git a/src/mint/afl-tests/id:000809,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000809,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000809,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000809,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000809,src:000003,op:flip1,pos:27,+cov b/src/exchange/afl-tests/id:000809,src:000003,op:flip1,pos:27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000809,src:000003,op:flip1,pos:27,+cov
rename to src/exchange/afl-tests/id:000809,src:000003,op:flip1,pos:27,+cov
diff --git a/src/mint/afl-tests/id:000810,src:000002,op:havoc,rep:32,+cov b/src/exchange/afl-tests/id:000810,src:000002,op:havoc,rep:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000810,src:000002,op:havoc,rep:32,+cov
rename to src/exchange/afl-tests/id:000810,src:000002,op:havoc,rep:32,+cov
diff --git a/src/mint/afl-tests/id:000810,src:000003,op:flip1,pos:30,+cov b/src/exchange/afl-tests/id:000810,src:000003,op:flip1,pos:30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000810,src:000003,op:flip1,pos:30,+cov
rename to src/exchange/afl-tests/id:000810,src:000003,op:flip1,pos:30,+cov
diff --git a/src/mint/afl-tests/id:000811,src:000002,op:havoc,rep:2,+cov b/src/exchange/afl-tests/id:000811,src:000002,op:havoc,rep:2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000811,src:000002,op:havoc,rep:2,+cov
rename to src/exchange/afl-tests/id:000811,src:000002,op:havoc,rep:2,+cov
diff --git a/src/mint/afl-tests/id:000811,src:000003,op:flip1,pos:30,+cov b/src/exchange/afl-tests/id:000811,src:000003,op:flip1,pos:30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000811,src:000003,op:flip1,pos:30,+cov
rename to src/exchange/afl-tests/id:000811,src:000003,op:flip1,pos:30,+cov
diff --git a/src/mint/afl-tests/id:000812,src:000002,op:havoc,rep:4,+cov b/src/exchange/afl-tests/id:000812,src:000002,op:havoc,rep:4,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000812,src:000002,op:havoc,rep:4,+cov
rename to src/exchange/afl-tests/id:000812,src:000002,op:havoc,rep:4,+cov
diff --git a/src/mint/afl-tests/id:000812,src:000003,op:flip1,pos:32,+cov b/src/exchange/afl-tests/id:000812,src:000003,op:flip1,pos:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000812,src:000003,op:flip1,pos:32,+cov
rename to src/exchange/afl-tests/id:000812,src:000003,op:flip1,pos:32,+cov
diff --git a/src/mint/afl-tests/id:000813,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000813,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000813,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000813,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000813,src:000003,op:flip1,pos:34,+cov b/src/exchange/afl-tests/id:000813,src:000003,op:flip1,pos:34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000813,src:000003,op:flip1,pos:34,+cov
rename to src/exchange/afl-tests/id:000813,src:000003,op:flip1,pos:34,+cov
diff --git a/src/mint/afl-tests/id:000814,src:000002,op:havoc,rep:16,+cov b/src/exchange/afl-tests/id:000814,src:000002,op:havoc,rep:16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000814,src:000002,op:havoc,rep:16,+cov
rename to src/exchange/afl-tests/id:000814,src:000002,op:havoc,rep:16,+cov
diff --git a/src/mint/afl-tests/id:000814,src:000003,op:flip1,pos:40,+cov b/src/exchange/afl-tests/id:000814,src:000003,op:flip1,pos:40,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000814,src:000003,op:flip1,pos:40,+cov
rename to src/exchange/afl-tests/id:000814,src:000003,op:flip1,pos:40,+cov
diff --git a/src/mint/afl-tests/id:000815,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000815,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000815,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000815,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000815,src:000003,op:flip1,pos:42,+cov b/src/exchange/afl-tests/id:000815,src:000003,op:flip1,pos:42,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000815,src:000003,op:flip1,pos:42,+cov
rename to src/exchange/afl-tests/id:000815,src:000003,op:flip1,pos:42,+cov
diff --git a/src/mint/afl-tests/id:000816,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000816,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000816,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000816,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000816,src:000003,op:flip1,pos:43,+cov b/src/exchange/afl-tests/id:000816,src:000003,op:flip1,pos:43,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000816,src:000003,op:flip1,pos:43,+cov
rename to src/exchange/afl-tests/id:000816,src:000003,op:flip1,pos:43,+cov
diff --git a/src/mint/afl-tests/id:000817,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000817,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000817,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000817,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000817,src:000003,op:flip1,pos:48,+cov b/src/exchange/afl-tests/id:000817,src:000003,op:flip1,pos:48,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000817,src:000003,op:flip1,pos:48,+cov
rename to src/exchange/afl-tests/id:000817,src:000003,op:flip1,pos:48,+cov
diff --git a/src/mint/afl-tests/id:000818,src:000002,op:havoc,rep:16 b/src/exchange/afl-tests/id:000818,src:000002,op:havoc,rep:16
similarity index 100%
rename from src/mint/afl-tests/id:000818,src:000002,op:havoc,rep:16
rename to src/exchange/afl-tests/id:000818,src:000002,op:havoc,rep:16
diff --git a/src/mint/afl-tests/id:000818,src:000003,op:flip1,pos:50,+cov b/src/exchange/afl-tests/id:000818,src:000003,op:flip1,pos:50,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000818,src:000003,op:flip1,pos:50,+cov
rename to src/exchange/afl-tests/id:000818,src:000003,op:flip1,pos:50,+cov
diff --git a/src/mint/afl-tests/id:000819,src:000002,op:havoc,rep:16,+cov b/src/exchange/afl-tests/id:000819,src:000002,op:havoc,rep:16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000819,src:000002,op:havoc,rep:16,+cov
rename to src/exchange/afl-tests/id:000819,src:000002,op:havoc,rep:16,+cov
diff --git a/src/mint/afl-tests/id:000819,src:000003,op:flip1,pos:61,+cov b/src/exchange/afl-tests/id:000819,src:000003,op:flip1,pos:61,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000819,src:000003,op:flip1,pos:61,+cov
rename to src/exchange/afl-tests/id:000819,src:000003,op:flip1,pos:61,+cov
diff --git a/src/mint/afl-tests/id:000820,src:000002,op:havoc,rep:2 b/src/exchange/afl-tests/id:000820,src:000002,op:havoc,rep:2
similarity index 100%
rename from src/mint/afl-tests/id:000820,src:000002,op:havoc,rep:2
rename to src/exchange/afl-tests/id:000820,src:000002,op:havoc,rep:2
diff --git a/src/mint/afl-tests/id:000820,src:000003,op:flip1,pos:67,+cov b/src/exchange/afl-tests/id:000820,src:000003,op:flip1,pos:67,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000820,src:000003,op:flip1,pos:67,+cov
rename to src/exchange/afl-tests/id:000820,src:000003,op:flip1,pos:67,+cov
diff --git a/src/mint/afl-tests/id:000821,src:000003,op:flip1,pos:18,+cov b/src/exchange/afl-tests/id:000821,src:000003,op:flip1,pos:18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000821,src:000003,op:flip1,pos:18,+cov
rename to src/exchange/afl-tests/id:000821,src:000003,op:flip1,pos:18,+cov
diff --git a/src/mint/afl-tests/id:000821,src:000003,op:flip1,pos:70 b/src/exchange/afl-tests/id:000821,src:000003,op:flip1,pos:70
similarity index 100%
rename from src/mint/afl-tests/id:000821,src:000003,op:flip1,pos:70
rename to src/exchange/afl-tests/id:000821,src:000003,op:flip1,pos:70
diff --git a/src/mint/afl-tests/id:000822,src:000003,op:flip1,pos:27,+cov b/src/exchange/afl-tests/id:000822,src:000003,op:flip1,pos:27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000822,src:000003,op:flip1,pos:27,+cov
rename to src/exchange/afl-tests/id:000822,src:000003,op:flip1,pos:27,+cov
diff --git a/src/mint/afl-tests/id:000822,src:000003,op:flip1,pos:73,+cov b/src/exchange/afl-tests/id:000822,src:000003,op:flip1,pos:73,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000822,src:000003,op:flip1,pos:73,+cov
rename to src/exchange/afl-tests/id:000822,src:000003,op:flip1,pos:73,+cov
diff --git a/src/mint/afl-tests/id:000823,src:000003,op:flip1,pos:27,+cov b/src/exchange/afl-tests/id:000823,src:000003,op:flip1,pos:27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000823,src:000003,op:flip1,pos:27,+cov
rename to src/exchange/afl-tests/id:000823,src:000003,op:flip1,pos:27,+cov
diff --git a/src/mint/afl-tests/id:000823,src:000003,op:flip1,pos:77,+cov b/src/exchange/afl-tests/id:000823,src:000003,op:flip1,pos:77,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000823,src:000003,op:flip1,pos:77,+cov
rename to src/exchange/afl-tests/id:000823,src:000003,op:flip1,pos:77,+cov
diff --git a/src/mint/afl-tests/id:000824,src:000003,op:flip1,pos:27,+cov b/src/exchange/afl-tests/id:000824,src:000003,op:flip1,pos:27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000824,src:000003,op:flip1,pos:27,+cov
rename to src/exchange/afl-tests/id:000824,src:000003,op:flip1,pos:27,+cov
diff --git a/src/mint/afl-tests/id:000824,src:000003,op:flip1,pos:83,+cov b/src/exchange/afl-tests/id:000824,src:000003,op:flip1,pos:83,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000824,src:000003,op:flip1,pos:83,+cov
rename to src/exchange/afl-tests/id:000824,src:000003,op:flip1,pos:83,+cov
diff --git a/src/mint/afl-tests/id:000825,src:000003,op:flip1,pos:28,+cov b/src/exchange/afl-tests/id:000825,src:000003,op:flip1,pos:28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000825,src:000003,op:flip1,pos:28,+cov
rename to src/exchange/afl-tests/id:000825,src:000003,op:flip1,pos:28,+cov
diff --git a/src/mint/afl-tests/id:000825,src:000003,op:flip1,pos:85,+cov b/src/exchange/afl-tests/id:000825,src:000003,op:flip1,pos:85,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000825,src:000003,op:flip1,pos:85,+cov
rename to src/exchange/afl-tests/id:000825,src:000003,op:flip1,pos:85,+cov
diff --git a/src/mint/afl-tests/id:000826,src:000003,op:flip1,pos:28,+cov b/src/exchange/afl-tests/id:000826,src:000003,op:flip1,pos:28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000826,src:000003,op:flip1,pos:28,+cov
rename to src/exchange/afl-tests/id:000826,src:000003,op:flip1,pos:28,+cov
diff --git a/src/mint/afl-tests/id:000826,src:000003,op:flip1,pos:85,+cov b/src/exchange/afl-tests/id:000826,src:000003,op:flip1,pos:85,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000826,src:000003,op:flip1,pos:85,+cov
rename to src/exchange/afl-tests/id:000826,src:000003,op:flip1,pos:85,+cov
diff --git a/src/mint/afl-tests/id:000827,src:000003,op:flip1,pos:29,+cov b/src/exchange/afl-tests/id:000827,src:000003,op:flip1,pos:29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000827,src:000003,op:flip1,pos:29,+cov
rename to src/exchange/afl-tests/id:000827,src:000003,op:flip1,pos:29,+cov
diff --git a/src/mint/afl-tests/id:000827,src:000003,op:flip1,pos:88,+cov b/src/exchange/afl-tests/id:000827,src:000003,op:flip1,pos:88,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000827,src:000003,op:flip1,pos:88,+cov
rename to src/exchange/afl-tests/id:000827,src:000003,op:flip1,pos:88,+cov
diff --git a/src/mint/afl-tests/id:000828,src:000003,op:flip1,pos:29,+cov b/src/exchange/afl-tests/id:000828,src:000003,op:flip1,pos:29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000828,src:000003,op:flip1,pos:29,+cov
rename to src/exchange/afl-tests/id:000828,src:000003,op:flip1,pos:29,+cov
diff --git a/src/mint/afl-tests/id:000828,src:000003,op:flip1,pos:89 b/src/exchange/afl-tests/id:000828,src:000003,op:flip1,pos:89
similarity index 100%
rename from src/mint/afl-tests/id:000828,src:000003,op:flip1,pos:89
rename to src/exchange/afl-tests/id:000828,src:000003,op:flip1,pos:89
diff --git a/src/mint/afl-tests/id:000829,src:000003,op:flip1,pos:29,+cov b/src/exchange/afl-tests/id:000829,src:000003,op:flip1,pos:29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000829,src:000003,op:flip1,pos:29,+cov
rename to src/exchange/afl-tests/id:000829,src:000003,op:flip1,pos:29,+cov
diff --git a/src/mint/afl-tests/id:000829,src:000003,op:flip1,pos:91,+cov b/src/exchange/afl-tests/id:000829,src:000003,op:flip1,pos:91,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000829,src:000003,op:flip1,pos:91,+cov
rename to src/exchange/afl-tests/id:000829,src:000003,op:flip1,pos:91,+cov
diff --git a/src/mint/afl-tests/id:000830,src:000003,op:flip1,pos:30,+cov b/src/exchange/afl-tests/id:000830,src:000003,op:flip1,pos:30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000830,src:000003,op:flip1,pos:30,+cov
rename to src/exchange/afl-tests/id:000830,src:000003,op:flip1,pos:30,+cov
diff --git a/src/mint/afl-tests/id:000830,src:000003,op:flip1,pos:93,+cov b/src/exchange/afl-tests/id:000830,src:000003,op:flip1,pos:93,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000830,src:000003,op:flip1,pos:93,+cov
rename to src/exchange/afl-tests/id:000830,src:000003,op:flip1,pos:93,+cov
diff --git a/src/mint/afl-tests/id:000831,src:000003,op:flip1,pos:32,+cov b/src/exchange/afl-tests/id:000831,src:000003,op:flip1,pos:32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000831,src:000003,op:flip1,pos:32,+cov
rename to src/exchange/afl-tests/id:000831,src:000003,op:flip1,pos:32,+cov
diff --git a/src/mint/afl-tests/id:000831,src:000003,op:flip1,pos:93,+cov b/src/exchange/afl-tests/id:000831,src:000003,op:flip1,pos:93,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000831,src:000003,op:flip1,pos:93,+cov
rename to src/exchange/afl-tests/id:000831,src:000003,op:flip1,pos:93,+cov
diff --git a/src/mint/afl-tests/id:000832,src:000003,op:flip1,pos:34,+cov b/src/exchange/afl-tests/id:000832,src:000003,op:flip1,pos:34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000832,src:000003,op:flip1,pos:34,+cov
rename to src/exchange/afl-tests/id:000832,src:000003,op:flip1,pos:34,+cov
diff --git a/src/mint/afl-tests/id:000832,src:000003,op:flip1,pos:97,+cov b/src/exchange/afl-tests/id:000832,src:000003,op:flip1,pos:97,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000832,src:000003,op:flip1,pos:97,+cov
rename to src/exchange/afl-tests/id:000832,src:000003,op:flip1,pos:97,+cov
diff --git a/src/mint/afl-tests/id:000833,src:000003,op:flip1,pos:109,+cov b/src/exchange/afl-tests/id:000833,src:000003,op:flip1,pos:109,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000833,src:000003,op:flip1,pos:109,+cov
rename to src/exchange/afl-tests/id:000833,src:000003,op:flip1,pos:109,+cov
diff --git a/src/mint/afl-tests/id:000833,src:000003,op:flip1,pos:36,+cov b/src/exchange/afl-tests/id:000833,src:000003,op:flip1,pos:36,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000833,src:000003,op:flip1,pos:36,+cov
rename to src/exchange/afl-tests/id:000833,src:000003,op:flip1,pos:36,+cov
diff --git a/src/mint/afl-tests/id:000834,src:000003,op:flip1,pos:111,+cov b/src/exchange/afl-tests/id:000834,src:000003,op:flip1,pos:111,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000834,src:000003,op:flip1,pos:111,+cov
rename to src/exchange/afl-tests/id:000834,src:000003,op:flip1,pos:111,+cov
diff --git a/src/mint/afl-tests/id:000834,src:000003,op:flip1,pos:39 b/src/exchange/afl-tests/id:000834,src:000003,op:flip1,pos:39
similarity index 100%
rename from src/mint/afl-tests/id:000834,src:000003,op:flip1,pos:39
rename to src/exchange/afl-tests/id:000834,src:000003,op:flip1,pos:39
diff --git a/src/mint/afl-tests/id:000835,src:000003,op:flip1,pos:113,+cov b/src/exchange/afl-tests/id:000835,src:000003,op:flip1,pos:113,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000835,src:000003,op:flip1,pos:113,+cov
rename to src/exchange/afl-tests/id:000835,src:000003,op:flip1,pos:113,+cov
diff --git a/src/mint/afl-tests/id:000835,src:000003,op:flip1,pos:39,+cov b/src/exchange/afl-tests/id:000835,src:000003,op:flip1,pos:39,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000835,src:000003,op:flip1,pos:39,+cov
rename to src/exchange/afl-tests/id:000835,src:000003,op:flip1,pos:39,+cov
diff --git a/src/mint/afl-tests/id:000836,src:000003,op:flip1,pos:114,+cov b/src/exchange/afl-tests/id:000836,src:000003,op:flip1,pos:114,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000836,src:000003,op:flip1,pos:114,+cov
rename to src/exchange/afl-tests/id:000836,src:000003,op:flip1,pos:114,+cov
diff --git a/src/mint/afl-tests/id:000836,src:000003,op:flip1,pos:40,+cov b/src/exchange/afl-tests/id:000836,src:000003,op:flip1,pos:40,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000836,src:000003,op:flip1,pos:40,+cov
rename to src/exchange/afl-tests/id:000836,src:000003,op:flip1,pos:40,+cov
diff --git a/src/mint/afl-tests/id:000837,src:000003,op:flip1,pos:119,+cov b/src/exchange/afl-tests/id:000837,src:000003,op:flip1,pos:119,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000837,src:000003,op:flip1,pos:119,+cov
rename to src/exchange/afl-tests/id:000837,src:000003,op:flip1,pos:119,+cov
diff --git a/src/mint/afl-tests/id:000837,src:000003,op:flip1,pos:41,+cov b/src/exchange/afl-tests/id:000837,src:000003,op:flip1,pos:41,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000837,src:000003,op:flip1,pos:41,+cov
rename to src/exchange/afl-tests/id:000837,src:000003,op:flip1,pos:41,+cov
diff --git a/src/mint/afl-tests/id:000838,src:000003,op:flip1,pos:120,+cov b/src/exchange/afl-tests/id:000838,src:000003,op:flip1,pos:120,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000838,src:000003,op:flip1,pos:120,+cov
rename to src/exchange/afl-tests/id:000838,src:000003,op:flip1,pos:120,+cov
diff --git a/src/mint/afl-tests/id:000838,src:000003,op:flip1,pos:44,+cov b/src/exchange/afl-tests/id:000838,src:000003,op:flip1,pos:44,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000838,src:000003,op:flip1,pos:44,+cov
rename to src/exchange/afl-tests/id:000838,src:000003,op:flip1,pos:44,+cov
diff --git a/src/mint/afl-tests/id:000839,src:000003,op:flip1,pos:128,+cov b/src/exchange/afl-tests/id:000839,src:000003,op:flip1,pos:128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000839,src:000003,op:flip1,pos:128,+cov
rename to src/exchange/afl-tests/id:000839,src:000003,op:flip1,pos:128,+cov
diff --git a/src/mint/afl-tests/id:000839,src:000003,op:flip1,pos:46,+cov b/src/exchange/afl-tests/id:000839,src:000003,op:flip1,pos:46,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000839,src:000003,op:flip1,pos:46,+cov
rename to src/exchange/afl-tests/id:000839,src:000003,op:flip1,pos:46,+cov
diff --git a/src/mint/afl-tests/id:000840,src:000003,op:flip1,pos:141,+cov b/src/exchange/afl-tests/id:000840,src:000003,op:flip1,pos:141,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000840,src:000003,op:flip1,pos:141,+cov
rename to src/exchange/afl-tests/id:000840,src:000003,op:flip1,pos:141,+cov
diff --git a/src/mint/afl-tests/id:000840,src:000003,op:flip1,pos:48,+cov b/src/exchange/afl-tests/id:000840,src:000003,op:flip1,pos:48,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000840,src:000003,op:flip1,pos:48,+cov
rename to src/exchange/afl-tests/id:000840,src:000003,op:flip1,pos:48,+cov
diff --git a/src/mint/afl-tests/id:000841,src:000003,op:flip1,pos:145,+cov b/src/exchange/afl-tests/id:000841,src:000003,op:flip1,pos:145,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000841,src:000003,op:flip1,pos:145,+cov
rename to src/exchange/afl-tests/id:000841,src:000003,op:flip1,pos:145,+cov
diff --git a/src/mint/afl-tests/id:000841,src:000003,op:flip1,pos:48,+cov b/src/exchange/afl-tests/id:000841,src:000003,op:flip1,pos:48,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000841,src:000003,op:flip1,pos:48,+cov
rename to src/exchange/afl-tests/id:000841,src:000003,op:flip1,pos:48,+cov
diff --git a/src/mint/afl-tests/id:000842,src:000003,op:flip1,pos:147,+cov b/src/exchange/afl-tests/id:000842,src:000003,op:flip1,pos:147,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000842,src:000003,op:flip1,pos:147,+cov
rename to src/exchange/afl-tests/id:000842,src:000003,op:flip1,pos:147,+cov
diff --git a/src/mint/afl-tests/id:000842,src:000003,op:flip1,pos:51 b/src/exchange/afl-tests/id:000842,src:000003,op:flip1,pos:51
similarity index 100%
rename from src/mint/afl-tests/id:000842,src:000003,op:flip1,pos:51
rename to src/exchange/afl-tests/id:000842,src:000003,op:flip1,pos:51
diff --git a/src/mint/afl-tests/id:000843,src:000003,op:flip1,pos:150,+cov b/src/exchange/afl-tests/id:000843,src:000003,op:flip1,pos:150,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000843,src:000003,op:flip1,pos:150,+cov
rename to src/exchange/afl-tests/id:000843,src:000003,op:flip1,pos:150,+cov
diff --git a/src/mint/afl-tests/id:000843,src:000003,op:flip1,pos:51,+cov b/src/exchange/afl-tests/id:000843,src:000003,op:flip1,pos:51,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000843,src:000003,op:flip1,pos:51,+cov
rename to src/exchange/afl-tests/id:000843,src:000003,op:flip1,pos:51,+cov
diff --git a/src/mint/afl-tests/id:000844,src:000003,op:flip1,pos:150,+cov b/src/exchange/afl-tests/id:000844,src:000003,op:flip1,pos:150,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000844,src:000003,op:flip1,pos:150,+cov
rename to src/exchange/afl-tests/id:000844,src:000003,op:flip1,pos:150,+cov
diff --git a/src/mint/afl-tests/id:000844,src:000003,op:flip1,pos:54,+cov b/src/exchange/afl-tests/id:000844,src:000003,op:flip1,pos:54,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000844,src:000003,op:flip1,pos:54,+cov
rename to src/exchange/afl-tests/id:000844,src:000003,op:flip1,pos:54,+cov
diff --git a/src/mint/afl-tests/id:000845,src:000003,op:flip1,pos:58,+cov b/src/exchange/afl-tests/id:000845,src:000003,op:flip1,pos:58,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000845,src:000003,op:flip1,pos:58,+cov
rename to src/exchange/afl-tests/id:000845,src:000003,op:flip1,pos:58,+cov
diff --git a/src/mint/afl-tests/id:000845,src:000003,op:flip2,pos:65,+cov b/src/exchange/afl-tests/id:000845,src:000003,op:flip2,pos:65,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000845,src:000003,op:flip2,pos:65,+cov
rename to src/exchange/afl-tests/id:000845,src:000003,op:flip2,pos:65,+cov
diff --git a/src/mint/afl-tests/id:000846,src:000003,op:flip1,pos:64,+cov b/src/exchange/afl-tests/id:000846,src:000003,op:flip1,pos:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000846,src:000003,op:flip1,pos:64,+cov
rename to src/exchange/afl-tests/id:000846,src:000003,op:flip1,pos:64,+cov
diff --git a/src/mint/afl-tests/id:000846,src:000003,op:flip2,pos:84,+cov b/src/exchange/afl-tests/id:000846,src:000003,op:flip2,pos:84,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000846,src:000003,op:flip2,pos:84,+cov
rename to src/exchange/afl-tests/id:000846,src:000003,op:flip2,pos:84,+cov
diff --git a/src/mint/afl-tests/id:000847,src:000003,op:flip1,pos:64,+cov b/src/exchange/afl-tests/id:000847,src:000003,op:flip1,pos:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000847,src:000003,op:flip1,pos:64,+cov
rename to src/exchange/afl-tests/id:000847,src:000003,op:flip1,pos:64,+cov
diff --git a/src/mint/afl-tests/id:000847,src:000003,op:flip2,pos:99,+cov b/src/exchange/afl-tests/id:000847,src:000003,op:flip2,pos:99,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000847,src:000003,op:flip2,pos:99,+cov
rename to src/exchange/afl-tests/id:000847,src:000003,op:flip2,pos:99,+cov
diff --git a/src/mint/afl-tests/id:000848,src:000003,op:flip1,pos:66,+cov b/src/exchange/afl-tests/id:000848,src:000003,op:flip1,pos:66,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000848,src:000003,op:flip1,pos:66,+cov
rename to src/exchange/afl-tests/id:000848,src:000003,op:flip1,pos:66,+cov
diff --git a/src/mint/afl-tests/id:000848,src:000003,op:flip2,pos:102,+cov b/src/exchange/afl-tests/id:000848,src:000003,op:flip2,pos:102,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000848,src:000003,op:flip2,pos:102,+cov
rename to src/exchange/afl-tests/id:000848,src:000003,op:flip2,pos:102,+cov
diff --git a/src/mint/afl-tests/id:000849,src:000003,op:flip1,pos:67,+cov b/src/exchange/afl-tests/id:000849,src:000003,op:flip1,pos:67,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000849,src:000003,op:flip1,pos:67,+cov
rename to src/exchange/afl-tests/id:000849,src:000003,op:flip1,pos:67,+cov
diff --git a/src/mint/afl-tests/id:000849,src:000003,op:flip2,pos:115,+cov b/src/exchange/afl-tests/id:000849,src:000003,op:flip2,pos:115,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000849,src:000003,op:flip2,pos:115,+cov
rename to src/exchange/afl-tests/id:000849,src:000003,op:flip2,pos:115,+cov
diff --git a/src/mint/afl-tests/id:000850,src:000003,op:flip1,pos:67,+cov b/src/exchange/afl-tests/id:000850,src:000003,op:flip1,pos:67,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000850,src:000003,op:flip1,pos:67,+cov
rename to src/exchange/afl-tests/id:000850,src:000003,op:flip1,pos:67,+cov
diff --git a/src/mint/afl-tests/id:000850,src:000003,op:flip2,pos:132,+cov b/src/exchange/afl-tests/id:000850,src:000003,op:flip2,pos:132,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000850,src:000003,op:flip2,pos:132,+cov
rename to src/exchange/afl-tests/id:000850,src:000003,op:flip2,pos:132,+cov
diff --git a/src/mint/afl-tests/id:000851,src:000003,op:flip1,pos:74,+cov b/src/exchange/afl-tests/id:000851,src:000003,op:flip1,pos:74,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000851,src:000003,op:flip1,pos:74,+cov
rename to src/exchange/afl-tests/id:000851,src:000003,op:flip1,pos:74,+cov
diff --git a/src/mint/afl-tests/id:000851,src:000003,op:flip2,pos:133,+cov b/src/exchange/afl-tests/id:000851,src:000003,op:flip2,pos:133,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000851,src:000003,op:flip2,pos:133,+cov
rename to src/exchange/afl-tests/id:000851,src:000003,op:flip2,pos:133,+cov
diff --git a/src/mint/afl-tests/id:000852,src:000003,op:flip1,pos:76,+cov b/src/exchange/afl-tests/id:000852,src:000003,op:flip1,pos:76,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000852,src:000003,op:flip1,pos:76,+cov
rename to src/exchange/afl-tests/id:000852,src:000003,op:flip1,pos:76,+cov
diff --git a/src/mint/afl-tests/id:000852,src:000003,op:flip2,pos:139,+cov b/src/exchange/afl-tests/id:000852,src:000003,op:flip2,pos:139,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000852,src:000003,op:flip2,pos:139,+cov
rename to src/exchange/afl-tests/id:000852,src:000003,op:flip2,pos:139,+cov
diff --git a/src/mint/afl-tests/id:000853,src:000003,op:flip1,pos:78,+cov b/src/exchange/afl-tests/id:000853,src:000003,op:flip1,pos:78,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000853,src:000003,op:flip1,pos:78,+cov
rename to src/exchange/afl-tests/id:000853,src:000003,op:flip1,pos:78,+cov
diff --git a/src/mint/afl-tests/id:000853,src:000003,op:flip2,pos:139,+cov b/src/exchange/afl-tests/id:000853,src:000003,op:flip2,pos:139,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000853,src:000003,op:flip2,pos:139,+cov
rename to src/exchange/afl-tests/id:000853,src:000003,op:flip2,pos:139,+cov
diff --git a/src/mint/afl-tests/id:000854,src:000003,op:flip2,pos:145,+cov b/src/exchange/afl-tests/id:000854,src:000003,op:flip2,pos:145,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000854,src:000003,op:flip2,pos:145,+cov
rename to src/exchange/afl-tests/id:000854,src:000003,op:flip2,pos:145,+cov
diff --git a/src/mint/afl-tests/id:000854,src:000003,op:flip2,pos:28,+cov b/src/exchange/afl-tests/id:000854,src:000003,op:flip2,pos:28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000854,src:000003,op:flip2,pos:28,+cov
rename to src/exchange/afl-tests/id:000854,src:000003,op:flip2,pos:28,+cov
diff --git a/src/mint/afl-tests/id:000855,src:000003,op:flip2,pos:147,+cov b/src/exchange/afl-tests/id:000855,src:000003,op:flip2,pos:147,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000855,src:000003,op:flip2,pos:147,+cov
rename to src/exchange/afl-tests/id:000855,src:000003,op:flip2,pos:147,+cov
diff --git a/src/mint/afl-tests/id:000855,src:000003,op:flip2,pos:29,+cov b/src/exchange/afl-tests/id:000855,src:000003,op:flip2,pos:29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000855,src:000003,op:flip2,pos:29,+cov
rename to src/exchange/afl-tests/id:000855,src:000003,op:flip2,pos:29,+cov
diff --git a/src/mint/afl-tests/id:000856,src:000003,op:flip2,pos:151,+cov b/src/exchange/afl-tests/id:000856,src:000003,op:flip2,pos:151,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000856,src:000003,op:flip2,pos:151,+cov
rename to src/exchange/afl-tests/id:000856,src:000003,op:flip2,pos:151,+cov
diff --git a/src/mint/afl-tests/id:000856,src:000003,op:flip2,pos:29,+cov b/src/exchange/afl-tests/id:000856,src:000003,op:flip2,pos:29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000856,src:000003,op:flip2,pos:29,+cov
rename to src/exchange/afl-tests/id:000856,src:000003,op:flip2,pos:29,+cov
diff --git a/src/mint/afl-tests/id:000857,src:000003,op:flip2,pos:30,+cov b/src/exchange/afl-tests/id:000857,src:000003,op:flip2,pos:30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000857,src:000003,op:flip2,pos:30,+cov
rename to src/exchange/afl-tests/id:000857,src:000003,op:flip2,pos:30,+cov
diff --git a/src/mint/afl-tests/id:000857,src:000003,op:flip4,pos:110,+cov b/src/exchange/afl-tests/id:000857,src:000003,op:flip4,pos:110,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000857,src:000003,op:flip4,pos:110,+cov
rename to src/exchange/afl-tests/id:000857,src:000003,op:flip4,pos:110,+cov
diff --git a/src/mint/afl-tests/id:000858,src:000003,op:flip2,pos:35 b/src/exchange/afl-tests/id:000858,src:000003,op:flip2,pos:35
similarity index 100%
rename from src/mint/afl-tests/id:000858,src:000003,op:flip2,pos:35
rename to src/exchange/afl-tests/id:000858,src:000003,op:flip2,pos:35
diff --git a/src/mint/afl-tests/id:000858,src:000003,op:flip4,pos:120,+cov b/src/exchange/afl-tests/id:000858,src:000003,op:flip4,pos:120,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000858,src:000003,op:flip4,pos:120,+cov
rename to src/exchange/afl-tests/id:000858,src:000003,op:flip4,pos:120,+cov
diff --git a/src/mint/afl-tests/id:000859,src:000003,op:flip2,pos:37,+cov b/src/exchange/afl-tests/id:000859,src:000003,op:flip2,pos:37,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000859,src:000003,op:flip2,pos:37,+cov
rename to src/exchange/afl-tests/id:000859,src:000003,op:flip2,pos:37,+cov
diff --git a/src/mint/afl-tests/id:000859,src:000003,op:flip4,pos:123,+cov b/src/exchange/afl-tests/id:000859,src:000003,op:flip4,pos:123,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000859,src:000003,op:flip4,pos:123,+cov
rename to src/exchange/afl-tests/id:000859,src:000003,op:flip4,pos:123,+cov
diff --git a/src/mint/afl-tests/id:000860,src:000003,op:flip2,pos:41,+cov b/src/exchange/afl-tests/id:000860,src:000003,op:flip2,pos:41,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000860,src:000003,op:flip2,pos:41,+cov
rename to src/exchange/afl-tests/id:000860,src:000003,op:flip2,pos:41,+cov
diff --git a/src/mint/afl-tests/id:000860,src:000003,op:flip4,pos:124,+cov b/src/exchange/afl-tests/id:000860,src:000003,op:flip4,pos:124,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000860,src:000003,op:flip4,pos:124,+cov
rename to src/exchange/afl-tests/id:000860,src:000003,op:flip4,pos:124,+cov
diff --git a/src/mint/afl-tests/id:000861,src:000003,op:flip2,pos:42,+cov b/src/exchange/afl-tests/id:000861,src:000003,op:flip2,pos:42,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000861,src:000003,op:flip2,pos:42,+cov
rename to src/exchange/afl-tests/id:000861,src:000003,op:flip2,pos:42,+cov
diff --git a/src/mint/afl-tests/id:000861,src:000003,op:flip4,pos:124,+cov b/src/exchange/afl-tests/id:000861,src:000003,op:flip4,pos:124,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000861,src:000003,op:flip4,pos:124,+cov
rename to src/exchange/afl-tests/id:000861,src:000003,op:flip4,pos:124,+cov
diff --git a/src/mint/afl-tests/id:000862,src:000003,op:flip2,pos:43,+cov b/src/exchange/afl-tests/id:000862,src:000003,op:flip2,pos:43,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000862,src:000003,op:flip2,pos:43,+cov
rename to src/exchange/afl-tests/id:000862,src:000003,op:flip2,pos:43,+cov
diff --git a/src/mint/afl-tests/id:000862,src:000003,op:flip4,pos:124,+cov b/src/exchange/afl-tests/id:000862,src:000003,op:flip4,pos:124,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000862,src:000003,op:flip4,pos:124,+cov
rename to src/exchange/afl-tests/id:000862,src:000003,op:flip4,pos:124,+cov
diff --git a/src/mint/afl-tests/id:000863,src:000003,op:flip2,pos:43,+cov b/src/exchange/afl-tests/id:000863,src:000003,op:flip2,pos:43,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000863,src:000003,op:flip2,pos:43,+cov
rename to src/exchange/afl-tests/id:000863,src:000003,op:flip2,pos:43,+cov
diff --git a/src/mint/afl-tests/id:000863,src:000003,op:flip4,pos:129,+cov b/src/exchange/afl-tests/id:000863,src:000003,op:flip4,pos:129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000863,src:000003,op:flip4,pos:129,+cov
rename to src/exchange/afl-tests/id:000863,src:000003,op:flip4,pos:129,+cov
diff --git a/src/mint/afl-tests/id:000864,src:000003,op:flip2,pos:43 b/src/exchange/afl-tests/id:000864,src:000003,op:flip2,pos:43
similarity index 100%
rename from src/mint/afl-tests/id:000864,src:000003,op:flip2,pos:43
rename to src/exchange/afl-tests/id:000864,src:000003,op:flip2,pos:43
diff --git a/src/mint/afl-tests/id:000864,src:000003,op:flip4,pos:138,+cov b/src/exchange/afl-tests/id:000864,src:000003,op:flip4,pos:138,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000864,src:000003,op:flip4,pos:138,+cov
rename to src/exchange/afl-tests/id:000864,src:000003,op:flip4,pos:138,+cov
diff --git a/src/mint/afl-tests/id:000865,src:000003,op:flip2,pos:45,+cov b/src/exchange/afl-tests/id:000865,src:000003,op:flip2,pos:45,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000865,src:000003,op:flip2,pos:45,+cov
rename to src/exchange/afl-tests/id:000865,src:000003,op:flip2,pos:45,+cov
diff --git a/src/mint/afl-tests/id:000865,src:000003,op:flip8,pos:118,+cov b/src/exchange/afl-tests/id:000865,src:000003,op:flip8,pos:118,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000865,src:000003,op:flip8,pos:118,+cov
rename to src/exchange/afl-tests/id:000865,src:000003,op:flip8,pos:118,+cov
diff --git a/src/mint/afl-tests/id:000866,src:000003,op:flip2,pos:47,+cov b/src/exchange/afl-tests/id:000866,src:000003,op:flip2,pos:47,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000866,src:000003,op:flip2,pos:47,+cov
rename to src/exchange/afl-tests/id:000866,src:000003,op:flip2,pos:47,+cov
diff --git a/src/mint/afl-tests/id:000866,src:000003,op:flip8,pos:129,+cov b/src/exchange/afl-tests/id:000866,src:000003,op:flip8,pos:129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000866,src:000003,op:flip8,pos:129,+cov
rename to src/exchange/afl-tests/id:000866,src:000003,op:flip8,pos:129,+cov
diff --git a/src/mint/afl-tests/id:000867,src:000003,op:flip2,pos:49,+cov b/src/exchange/afl-tests/id:000867,src:000003,op:flip2,pos:49,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000867,src:000003,op:flip2,pos:49,+cov
rename to src/exchange/afl-tests/id:000867,src:000003,op:flip2,pos:49,+cov
diff --git a/src/mint/afl-tests/id:000867,src:000003,op:flip8,pos:130,+cov b/src/exchange/afl-tests/id:000867,src:000003,op:flip8,pos:130,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000867,src:000003,op:flip8,pos:130,+cov
rename to src/exchange/afl-tests/id:000867,src:000003,op:flip8,pos:130,+cov
diff --git a/src/mint/afl-tests/id:000868,src:000003,op:flip2,pos:54,+cov b/src/exchange/afl-tests/id:000868,src:000003,op:flip2,pos:54,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000868,src:000003,op:flip2,pos:54,+cov
rename to src/exchange/afl-tests/id:000868,src:000003,op:flip2,pos:54,+cov
diff --git a/src/mint/afl-tests/id:000868,src:000003,op:flip8,pos:132,+cov b/src/exchange/afl-tests/id:000868,src:000003,op:flip8,pos:132,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000868,src:000003,op:flip8,pos:132,+cov
rename to src/exchange/afl-tests/id:000868,src:000003,op:flip8,pos:132,+cov
diff --git a/src/mint/afl-tests/id:000869,src:000003,op:arith8,pos:17,val:-31 b/src/exchange/afl-tests/id:000869,src:000003,op:arith8,pos:17,val:-31
similarity index 100%
rename from src/mint/afl-tests/id:000869,src:000003,op:arith8,pos:17,val:-31
rename to src/exchange/afl-tests/id:000869,src:000003,op:arith8,pos:17,val:-31
diff --git a/src/mint/afl-tests/id:000869,src:000003,op:flip2,pos:62,+cov b/src/exchange/afl-tests/id:000869,src:000003,op:flip2,pos:62,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000869,src:000003,op:flip2,pos:62,+cov
rename to src/exchange/afl-tests/id:000869,src:000003,op:flip2,pos:62,+cov
diff --git a/src/mint/afl-tests/id:000870,src:000003,op:arith8,pos:27,val:+26,+cov b/src/exchange/afl-tests/id:000870,src:000003,op:arith8,pos:27,val:+26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000870,src:000003,op:arith8,pos:27,val:+26,+cov
rename to src/exchange/afl-tests/id:000870,src:000003,op:arith8,pos:27,val:+26,+cov
diff --git a/src/mint/afl-tests/id:000870,src:000003,op:flip2,pos:63,+cov b/src/exchange/afl-tests/id:000870,src:000003,op:flip2,pos:63,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000870,src:000003,op:flip2,pos:63,+cov
rename to src/exchange/afl-tests/id:000870,src:000003,op:flip2,pos:63,+cov
diff --git a/src/mint/afl-tests/id:000871,src:000003,op:arith8,pos:29,val:+11,+cov b/src/exchange/afl-tests/id:000871,src:000003,op:arith8,pos:29,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000871,src:000003,op:arith8,pos:29,val:+11,+cov
rename to src/exchange/afl-tests/id:000871,src:000003,op:arith8,pos:29,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000871,src:000003,op:flip2,pos:68,+cov b/src/exchange/afl-tests/id:000871,src:000003,op:flip2,pos:68,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000871,src:000003,op:flip2,pos:68,+cov
rename to src/exchange/afl-tests/id:000871,src:000003,op:flip2,pos:68,+cov
diff --git a/src/mint/afl-tests/id:000872,src:000003,op:arith8,pos:29,val:+33 b/src/exchange/afl-tests/id:000872,src:000003,op:arith8,pos:29,val:+33
similarity index 100%
rename from src/mint/afl-tests/id:000872,src:000003,op:arith8,pos:29,val:+33
rename to src/exchange/afl-tests/id:000872,src:000003,op:arith8,pos:29,val:+33
diff --git a/src/mint/afl-tests/id:000873,src:000003,op:arith8,pos:30,val:-14,+cov b/src/exchange/afl-tests/id:000873,src:000003,op:arith8,pos:30,val:-14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000873,src:000003,op:arith8,pos:30,val:-14,+cov
rename to src/exchange/afl-tests/id:000873,src:000003,op:arith8,pos:30,val:-14,+cov
diff --git a/src/mint/afl-tests/id:000874,src:000003,op:arith8,pos:30,val:+28,+cov b/src/exchange/afl-tests/id:000874,src:000003,op:arith8,pos:30,val:+28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000874,src:000003,op:arith8,pos:30,val:+28,+cov
rename to src/exchange/afl-tests/id:000874,src:000003,op:arith8,pos:30,val:+28,+cov
diff --git a/src/mint/afl-tests/id:000875,src:000003,op:arith8,pos:35,val:+18,+cov b/src/exchange/afl-tests/id:000875,src:000003,op:arith8,pos:35,val:+18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000875,src:000003,op:arith8,pos:35,val:+18,+cov
rename to src/exchange/afl-tests/id:000875,src:000003,op:arith8,pos:35,val:+18,+cov
diff --git a/src/mint/afl-tests/id:000876,src:000003,op:arith8,pos:35,val:+26,+cov b/src/exchange/afl-tests/id:000876,src:000003,op:arith8,pos:35,val:+26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000876,src:000003,op:arith8,pos:35,val:+26,+cov
rename to src/exchange/afl-tests/id:000876,src:000003,op:arith8,pos:35,val:+26,+cov
diff --git a/src/mint/afl-tests/id:000877,src:000003,op:arith8,pos:36,val:-23,+cov b/src/exchange/afl-tests/id:000877,src:000003,op:arith8,pos:36,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000877,src:000003,op:arith8,pos:36,val:-23,+cov
rename to src/exchange/afl-tests/id:000877,src:000003,op:arith8,pos:36,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000878,src:000003,op:arith8,pos:37,val:+20,+cov b/src/exchange/afl-tests/id:000878,src:000003,op:arith8,pos:37,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000878,src:000003,op:arith8,pos:37,val:+20,+cov
rename to src/exchange/afl-tests/id:000878,src:000003,op:arith8,pos:37,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000879,src:000003,op:arith8,pos:37,val:-27,+cov b/src/exchange/afl-tests/id:000879,src:000003,op:arith8,pos:37,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000879,src:000003,op:arith8,pos:37,val:-27,+cov
rename to src/exchange/afl-tests/id:000879,src:000003,op:arith8,pos:37,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000880,src:000003,op:arith8,pos:42,val:+31,+cov b/src/exchange/afl-tests/id:000880,src:000003,op:arith8,pos:42,val:+31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000880,src:000003,op:arith8,pos:42,val:+31,+cov
rename to src/exchange/afl-tests/id:000880,src:000003,op:arith8,pos:42,val:+31,+cov
diff --git a/src/mint/afl-tests/id:000881,src:000003,op:arith8,pos:46,val:+26,+cov b/src/exchange/afl-tests/id:000881,src:000003,op:arith8,pos:46,val:+26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000881,src:000003,op:arith8,pos:46,val:+26,+cov
rename to src/exchange/afl-tests/id:000881,src:000003,op:arith8,pos:46,val:+26,+cov
diff --git a/src/mint/afl-tests/id:000882,src:000003,op:arith8,pos:47,val:-35,+cov b/src/exchange/afl-tests/id:000882,src:000003,op:arith8,pos:47,val:-35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000882,src:000003,op:arith8,pos:47,val:-35,+cov
rename to src/exchange/afl-tests/id:000882,src:000003,op:arith8,pos:47,val:-35,+cov
diff --git a/src/mint/afl-tests/id:000883,src:000003,op:arith8,pos:49,val:-2,+cov b/src/exchange/afl-tests/id:000883,src:000003,op:arith8,pos:49,val:-2,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000883,src:000003,op:arith8,pos:49,val:-2,+cov
rename to src/exchange/afl-tests/id:000883,src:000003,op:arith8,pos:49,val:-2,+cov
diff --git a/src/mint/afl-tests/id:000884,src:000003,op:arith8,pos:51,val:+15,+cov b/src/exchange/afl-tests/id:000884,src:000003,op:arith8,pos:51,val:+15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000884,src:000003,op:arith8,pos:51,val:+15,+cov
rename to src/exchange/afl-tests/id:000884,src:000003,op:arith8,pos:51,val:+15,+cov
diff --git a/src/mint/afl-tests/id:000885,src:000003,op:arith8,pos:52,val:+11,+cov b/src/exchange/afl-tests/id:000885,src:000003,op:arith8,pos:52,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000885,src:000003,op:arith8,pos:52,val:+11,+cov
rename to src/exchange/afl-tests/id:000885,src:000003,op:arith8,pos:52,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000886,src:000003,op:arith8,pos:61,val:+34 b/src/exchange/afl-tests/id:000886,src:000003,op:arith8,pos:61,val:+34
similarity index 100%
rename from src/mint/afl-tests/id:000886,src:000003,op:arith8,pos:61,val:+34
rename to src/exchange/afl-tests/id:000886,src:000003,op:arith8,pos:61,val:+34
diff --git a/src/mint/afl-tests/id:000887,src:000003,op:arith8,pos:62,val:-18,+cov b/src/exchange/afl-tests/id:000887,src:000003,op:arith8,pos:62,val:-18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000887,src:000003,op:arith8,pos:62,val:-18,+cov
rename to src/exchange/afl-tests/id:000887,src:000003,op:arith8,pos:62,val:-18,+cov
diff --git a/src/mint/afl-tests/id:000888,src:000003,op:arith8,pos:68,val:+21,+cov b/src/exchange/afl-tests/id:000888,src:000003,op:arith8,pos:68,val:+21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000888,src:000003,op:arith8,pos:68,val:+21,+cov
rename to src/exchange/afl-tests/id:000888,src:000003,op:arith8,pos:68,val:+21,+cov
diff --git a/src/mint/afl-tests/id:000889,src:000003,op:arith8,pos:71,val:-12,+cov b/src/exchange/afl-tests/id:000889,src:000003,op:arith8,pos:71,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000889,src:000003,op:arith8,pos:71,val:-12,+cov
rename to src/exchange/afl-tests/id:000889,src:000003,op:arith8,pos:71,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000890,src:000003,op:arith8,pos:75,val:+15,+cov b/src/exchange/afl-tests/id:000890,src:000003,op:arith8,pos:75,val:+15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000890,src:000003,op:arith8,pos:75,val:+15,+cov
rename to src/exchange/afl-tests/id:000890,src:000003,op:arith8,pos:75,val:+15,+cov
diff --git a/src/mint/afl-tests/id:000891,src:000003,op:arith8,pos:77,val:+13,+cov b/src/exchange/afl-tests/id:000891,src:000003,op:arith8,pos:77,val:+13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000891,src:000003,op:arith8,pos:77,val:+13,+cov
rename to src/exchange/afl-tests/id:000891,src:000003,op:arith8,pos:77,val:+13,+cov
diff --git a/src/mint/afl-tests/id:000892,src:000003,op:arith8,pos:80,val:-17,+cov b/src/exchange/afl-tests/id:000892,src:000003,op:arith8,pos:80,val:-17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000892,src:000003,op:arith8,pos:80,val:-17,+cov
rename to src/exchange/afl-tests/id:000892,src:000003,op:arith8,pos:80,val:-17,+cov
diff --git a/src/mint/afl-tests/id:000893,src:000003,op:arith8,pos:80,val:-23,+cov b/src/exchange/afl-tests/id:000893,src:000003,op:arith8,pos:80,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000893,src:000003,op:arith8,pos:80,val:-23,+cov
rename to src/exchange/afl-tests/id:000893,src:000003,op:arith8,pos:80,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000894,src:000003,op:arith8,pos:81,val:-9,+cov b/src/exchange/afl-tests/id:000894,src:000003,op:arith8,pos:81,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000894,src:000003,op:arith8,pos:81,val:-9,+cov
rename to src/exchange/afl-tests/id:000894,src:000003,op:arith8,pos:81,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000895,src:000003,op:arith8,pos:83,val:-18,+cov b/src/exchange/afl-tests/id:000895,src:000003,op:arith8,pos:83,val:-18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000895,src:000003,op:arith8,pos:83,val:-18,+cov
rename to src/exchange/afl-tests/id:000895,src:000003,op:arith8,pos:83,val:-18,+cov
diff --git a/src/mint/afl-tests/id:000896,src:000003,op:arith8,pos:83,val:+25,+cov b/src/exchange/afl-tests/id:000896,src:000003,op:arith8,pos:83,val:+25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000896,src:000003,op:arith8,pos:83,val:+25,+cov
rename to src/exchange/afl-tests/id:000896,src:000003,op:arith8,pos:83,val:+25,+cov
diff --git a/src/mint/afl-tests/id:000897,src:000003,op:arith8,pos:84,val:-18,+cov b/src/exchange/afl-tests/id:000897,src:000003,op:arith8,pos:84,val:-18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000897,src:000003,op:arith8,pos:84,val:-18,+cov
rename to src/exchange/afl-tests/id:000897,src:000003,op:arith8,pos:84,val:-18,+cov
diff --git a/src/mint/afl-tests/id:000898,src:000003,op:arith8,pos:86,val:+11,+cov b/src/exchange/afl-tests/id:000898,src:000003,op:arith8,pos:86,val:+11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000898,src:000003,op:arith8,pos:86,val:+11,+cov
rename to src/exchange/afl-tests/id:000898,src:000003,op:arith8,pos:86,val:+11,+cov
diff --git a/src/mint/afl-tests/id:000899,src:000003,op:arith8,pos:86,val:+27,+cov b/src/exchange/afl-tests/id:000899,src:000003,op:arith8,pos:86,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000899,src:000003,op:arith8,pos:86,val:+27,+cov
rename to src/exchange/afl-tests/id:000899,src:000003,op:arith8,pos:86,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000900,src:000003,op:arith8,pos:87,val:-23,+cov b/src/exchange/afl-tests/id:000900,src:000003,op:arith8,pos:87,val:-23,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000900,src:000003,op:arith8,pos:87,val:-23,+cov
rename to src/exchange/afl-tests/id:000900,src:000003,op:arith8,pos:87,val:-23,+cov
diff --git a/src/mint/afl-tests/id:000901,src:000003,op:arith8,pos:88,val:+35,+cov b/src/exchange/afl-tests/id:000901,src:000003,op:arith8,pos:88,val:+35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000901,src:000003,op:arith8,pos:88,val:+35,+cov
rename to src/exchange/afl-tests/id:000901,src:000003,op:arith8,pos:88,val:+35,+cov
diff --git a/src/mint/afl-tests/id:000902,src:000003,op:arith8,pos:89,val:-14,+cov b/src/exchange/afl-tests/id:000902,src:000003,op:arith8,pos:89,val:-14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000902,src:000003,op:arith8,pos:89,val:-14,+cov
rename to src/exchange/afl-tests/id:000902,src:000003,op:arith8,pos:89,val:-14,+cov
diff --git a/src/mint/afl-tests/id:000903,src:000003,op:arith8,pos:89,val:-33,+cov b/src/exchange/afl-tests/id:000903,src:000003,op:arith8,pos:89,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000903,src:000003,op:arith8,pos:89,val:-33,+cov
rename to src/exchange/afl-tests/id:000903,src:000003,op:arith8,pos:89,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000904,src:000003,op:arith8,pos:90,val:-25,+cov b/src/exchange/afl-tests/id:000904,src:000003,op:arith8,pos:90,val:-25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000904,src:000003,op:arith8,pos:90,val:-25,+cov
rename to src/exchange/afl-tests/id:000904,src:000003,op:arith8,pos:90,val:-25,+cov
diff --git a/src/mint/afl-tests/id:000905,src:000003,op:arith8,pos:92,val:-25,+cov b/src/exchange/afl-tests/id:000905,src:000003,op:arith8,pos:92,val:-25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000905,src:000003,op:arith8,pos:92,val:-25,+cov
rename to src/exchange/afl-tests/id:000905,src:000003,op:arith8,pos:92,val:-25,+cov
diff --git a/src/mint/afl-tests/id:000906,src:000003,op:arith8,pos:96,val:+10,+cov b/src/exchange/afl-tests/id:000906,src:000003,op:arith8,pos:96,val:+10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000906,src:000003,op:arith8,pos:96,val:+10,+cov
rename to src/exchange/afl-tests/id:000906,src:000003,op:arith8,pos:96,val:+10,+cov
diff --git a/src/mint/afl-tests/id:000907,src:000003,op:arith8,pos:96,val:-19,+cov b/src/exchange/afl-tests/id:000907,src:000003,op:arith8,pos:96,val:-19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000907,src:000003,op:arith8,pos:96,val:-19,+cov
rename to src/exchange/afl-tests/id:000907,src:000003,op:arith8,pos:96,val:-19,+cov
diff --git a/src/mint/afl-tests/id:000908,src:000003,op:arith8,pos:96,val:+25,+cov b/src/exchange/afl-tests/id:000908,src:000003,op:arith8,pos:96,val:+25,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000908,src:000003,op:arith8,pos:96,val:+25,+cov
rename to src/exchange/afl-tests/id:000908,src:000003,op:arith8,pos:96,val:+25,+cov
diff --git a/src/mint/afl-tests/id:000909,src:000003,op:arith8,pos:97,val:-17,+cov b/src/exchange/afl-tests/id:000909,src:000003,op:arith8,pos:97,val:-17,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000909,src:000003,op:arith8,pos:97,val:-17,+cov
rename to src/exchange/afl-tests/id:000909,src:000003,op:arith8,pos:97,val:-17,+cov
diff --git a/src/mint/afl-tests/id:000910,src:000003,op:arith8,pos:100,val:-15,+cov b/src/exchange/afl-tests/id:000910,src:000003,op:arith8,pos:100,val:-15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000910,src:000003,op:arith8,pos:100,val:-15,+cov
rename to src/exchange/afl-tests/id:000910,src:000003,op:arith8,pos:100,val:-15,+cov
diff --git a/src/mint/afl-tests/id:000911,src:000003,op:arith8,pos:102,val:-27,+cov b/src/exchange/afl-tests/id:000911,src:000003,op:arith8,pos:102,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000911,src:000003,op:arith8,pos:102,val:-27,+cov
rename to src/exchange/afl-tests/id:000911,src:000003,op:arith8,pos:102,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000912,src:000003,op:arith8,pos:102,val:-34,+cov b/src/exchange/afl-tests/id:000912,src:000003,op:arith8,pos:102,val:-34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000912,src:000003,op:arith8,pos:102,val:-34,+cov
rename to src/exchange/afl-tests/id:000912,src:000003,op:arith8,pos:102,val:-34,+cov
diff --git a/src/mint/afl-tests/id:000913,src:000003,op:arith8,pos:103,val:-9,+cov b/src/exchange/afl-tests/id:000913,src:000003,op:arith8,pos:103,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000913,src:000003,op:arith8,pos:103,val:-9,+cov
rename to src/exchange/afl-tests/id:000913,src:000003,op:arith8,pos:103,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000914,src:000003,op:arith8,pos:103,val:+12 b/src/exchange/afl-tests/id:000914,src:000003,op:arith8,pos:103,val:+12
similarity index 100%
rename from src/mint/afl-tests/id:000914,src:000003,op:arith8,pos:103,val:+12
rename to src/exchange/afl-tests/id:000914,src:000003,op:arith8,pos:103,val:+12
diff --git a/src/mint/afl-tests/id:000915,src:000003,op:arith8,pos:103,val:+20,+cov b/src/exchange/afl-tests/id:000915,src:000003,op:arith8,pos:103,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000915,src:000003,op:arith8,pos:103,val:+20,+cov
rename to src/exchange/afl-tests/id:000915,src:000003,op:arith8,pos:103,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000916,src:000003,op:arith8,pos:103,val:+22,+cov b/src/exchange/afl-tests/id:000916,src:000003,op:arith8,pos:103,val:+22,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000916,src:000003,op:arith8,pos:103,val:+22,+cov
rename to src/exchange/afl-tests/id:000916,src:000003,op:arith8,pos:103,val:+22,+cov
diff --git a/src/mint/afl-tests/id:000917,src:000003,op:arith8,pos:103,val:+29,+cov b/src/exchange/afl-tests/id:000917,src:000003,op:arith8,pos:103,val:+29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000917,src:000003,op:arith8,pos:103,val:+29,+cov
rename to src/exchange/afl-tests/id:000917,src:000003,op:arith8,pos:103,val:+29,+cov
diff --git a/src/mint/afl-tests/id:000918,src:000003,op:arith8,pos:103,val:+33,+cov b/src/exchange/afl-tests/id:000918,src:000003,op:arith8,pos:103,val:+33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000918,src:000003,op:arith8,pos:103,val:+33,+cov
rename to src/exchange/afl-tests/id:000918,src:000003,op:arith8,pos:103,val:+33,+cov
diff --git a/src/mint/afl-tests/id:000919,src:000003,op:arith8,pos:104,val:-10,+cov b/src/exchange/afl-tests/id:000919,src:000003,op:arith8,pos:104,val:-10,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000919,src:000003,op:arith8,pos:104,val:-10,+cov
rename to src/exchange/afl-tests/id:000919,src:000003,op:arith8,pos:104,val:-10,+cov
diff --git a/src/mint/afl-tests/id:000920,src:000003,op:arith8,pos:104,val:-12,+cov b/src/exchange/afl-tests/id:000920,src:000003,op:arith8,pos:104,val:-12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000920,src:000003,op:arith8,pos:104,val:-12,+cov
rename to src/exchange/afl-tests/id:000920,src:000003,op:arith8,pos:104,val:-12,+cov
diff --git a/src/mint/afl-tests/id:000921,src:000003,op:arith8,pos:104,val:+34,+cov b/src/exchange/afl-tests/id:000921,src:000003,op:arith8,pos:104,val:+34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000921,src:000003,op:arith8,pos:104,val:+34,+cov
rename to src/exchange/afl-tests/id:000921,src:000003,op:arith8,pos:104,val:+34,+cov
diff --git a/src/mint/afl-tests/id:000922,src:000003,op:arith8,pos:106,val:+5,+cov b/src/exchange/afl-tests/id:000922,src:000003,op:arith8,pos:106,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000922,src:000003,op:arith8,pos:106,val:+5,+cov
rename to src/exchange/afl-tests/id:000922,src:000003,op:arith8,pos:106,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000923,src:000003,op:arith8,pos:106,val:-13,+cov b/src/exchange/afl-tests/id:000923,src:000003,op:arith8,pos:106,val:-13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000923,src:000003,op:arith8,pos:106,val:-13,+cov
rename to src/exchange/afl-tests/id:000923,src:000003,op:arith8,pos:106,val:-13,+cov
diff --git a/src/mint/afl-tests/id:000924,src:000003,op:arith8,pos:110,val:+15,+cov b/src/exchange/afl-tests/id:000924,src:000003,op:arith8,pos:110,val:+15,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000924,src:000003,op:arith8,pos:110,val:+15,+cov
rename to src/exchange/afl-tests/id:000924,src:000003,op:arith8,pos:110,val:+15,+cov
diff --git a/src/mint/afl-tests/id:000925,src:000003,op:arith8,pos:112,val:-13,+cov b/src/exchange/afl-tests/id:000925,src:000003,op:arith8,pos:112,val:-13,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000925,src:000003,op:arith8,pos:112,val:-13,+cov
rename to src/exchange/afl-tests/id:000925,src:000003,op:arith8,pos:112,val:-13,+cov
diff --git a/src/mint/afl-tests/id:000926,src:000003,op:arith8,pos:113,val:+34,+cov b/src/exchange/afl-tests/id:000926,src:000003,op:arith8,pos:113,val:+34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000926,src:000003,op:arith8,pos:113,val:+34,+cov
rename to src/exchange/afl-tests/id:000926,src:000003,op:arith8,pos:113,val:+34,+cov
diff --git a/src/mint/afl-tests/id:000927,src:000003,op:arith8,pos:114,val:+5,+cov b/src/exchange/afl-tests/id:000927,src:000003,op:arith8,pos:114,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000927,src:000003,op:arith8,pos:114,val:+5,+cov
rename to src/exchange/afl-tests/id:000927,src:000003,op:arith8,pos:114,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000928,src:000003,op:arith8,pos:114,val:+26,+cov b/src/exchange/afl-tests/id:000928,src:000003,op:arith8,pos:114,val:+26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000928,src:000003,op:arith8,pos:114,val:+26,+cov
rename to src/exchange/afl-tests/id:000928,src:000003,op:arith8,pos:114,val:+26,+cov
diff --git a/src/mint/afl-tests/id:000929,src:000003,op:arith8,pos:114,val:-27,+cov b/src/exchange/afl-tests/id:000929,src:000003,op:arith8,pos:114,val:-27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000929,src:000003,op:arith8,pos:114,val:-27,+cov
rename to src/exchange/afl-tests/id:000929,src:000003,op:arith8,pos:114,val:-27,+cov
diff --git a/src/mint/afl-tests/id:000930,src:000003,op:arith8,pos:118,val:-28,+cov b/src/exchange/afl-tests/id:000930,src:000003,op:arith8,pos:118,val:-28,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000930,src:000003,op:arith8,pos:118,val:-28,+cov
rename to src/exchange/afl-tests/id:000930,src:000003,op:arith8,pos:118,val:-28,+cov
diff --git a/src/mint/afl-tests/id:000931,src:000003,op:arith8,pos:119,val:+12,+cov b/src/exchange/afl-tests/id:000931,src:000003,op:arith8,pos:119,val:+12,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000931,src:000003,op:arith8,pos:119,val:+12,+cov
rename to src/exchange/afl-tests/id:000931,src:000003,op:arith8,pos:119,val:+12,+cov
diff --git a/src/mint/afl-tests/id:000932,src:000003,op:arith8,pos:119,val:+27,+cov b/src/exchange/afl-tests/id:000932,src:000003,op:arith8,pos:119,val:+27,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000932,src:000003,op:arith8,pos:119,val:+27,+cov
rename to src/exchange/afl-tests/id:000932,src:000003,op:arith8,pos:119,val:+27,+cov
diff --git a/src/mint/afl-tests/id:000933,src:000003,op:arith8,pos:122,val:-4,+cov b/src/exchange/afl-tests/id:000933,src:000003,op:arith8,pos:122,val:-4,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000933,src:000003,op:arith8,pos:122,val:-4,+cov
rename to src/exchange/afl-tests/id:000933,src:000003,op:arith8,pos:122,val:-4,+cov
diff --git a/src/mint/afl-tests/id:000934,src:000003,op:arith8,pos:122,val:-26,+cov b/src/exchange/afl-tests/id:000934,src:000003,op:arith8,pos:122,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000934,src:000003,op:arith8,pos:122,val:-26,+cov
rename to src/exchange/afl-tests/id:000934,src:000003,op:arith8,pos:122,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000935,src:000003,op:arith8,pos:122,val:+35,+cov b/src/exchange/afl-tests/id:000935,src:000003,op:arith8,pos:122,val:+35,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000935,src:000003,op:arith8,pos:122,val:+35,+cov
rename to src/exchange/afl-tests/id:000935,src:000003,op:arith8,pos:122,val:+35,+cov
diff --git a/src/mint/afl-tests/id:000936,src:000003,op:arith8,pos:123,val:-11,+cov b/src/exchange/afl-tests/id:000936,src:000003,op:arith8,pos:123,val:-11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000936,src:000003,op:arith8,pos:123,val:-11,+cov
rename to src/exchange/afl-tests/id:000936,src:000003,op:arith8,pos:123,val:-11,+cov
diff --git a/src/mint/afl-tests/id:000937,src:000003,op:arith8,pos:124,val:-14,+cov b/src/exchange/afl-tests/id:000937,src:000003,op:arith8,pos:124,val:-14,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000937,src:000003,op:arith8,pos:124,val:-14,+cov
rename to src/exchange/afl-tests/id:000937,src:000003,op:arith8,pos:124,val:-14,+cov
diff --git a/src/mint/afl-tests/id:000938,src:000003,op:arith8,pos:128,val:+5,+cov b/src/exchange/afl-tests/id:000938,src:000003,op:arith8,pos:128,val:+5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000938,src:000003,op:arith8,pos:128,val:+5,+cov
rename to src/exchange/afl-tests/id:000938,src:000003,op:arith8,pos:128,val:+5,+cov
diff --git a/src/mint/afl-tests/id:000939,src:000003,op:arith8,pos:129,val:+21,+cov b/src/exchange/afl-tests/id:000939,src:000003,op:arith8,pos:129,val:+21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000939,src:000003,op:arith8,pos:129,val:+21,+cov
rename to src/exchange/afl-tests/id:000939,src:000003,op:arith8,pos:129,val:+21,+cov
diff --git a/src/mint/afl-tests/id:000940,src:000003,op:arith8,pos:133,val:-7,+cov b/src/exchange/afl-tests/id:000940,src:000003,op:arith8,pos:133,val:-7,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000940,src:000003,op:arith8,pos:133,val:-7,+cov
rename to src/exchange/afl-tests/id:000940,src:000003,op:arith8,pos:133,val:-7,+cov
diff --git a/src/mint/afl-tests/id:000941,src:000003,op:arith8,pos:133,val:+20,+cov b/src/exchange/afl-tests/id:000941,src:000003,op:arith8,pos:133,val:+20,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000941,src:000003,op:arith8,pos:133,val:+20,+cov
rename to src/exchange/afl-tests/id:000941,src:000003,op:arith8,pos:133,val:+20,+cov
diff --git a/src/mint/afl-tests/id:000942,src:000003,op:arith8,pos:135,val:-26,+cov b/src/exchange/afl-tests/id:000942,src:000003,op:arith8,pos:135,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000942,src:000003,op:arith8,pos:135,val:-26,+cov
rename to src/exchange/afl-tests/id:000942,src:000003,op:arith8,pos:135,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000943,src:000003,op:arith8,pos:141,val:+1,+cov b/src/exchange/afl-tests/id:000943,src:000003,op:arith8,pos:141,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000943,src:000003,op:arith8,pos:141,val:+1,+cov
rename to src/exchange/afl-tests/id:000943,src:000003,op:arith8,pos:141,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000944,src:000003,op:arith8,pos:143,val:-5,+cov b/src/exchange/afl-tests/id:000944,src:000003,op:arith8,pos:143,val:-5,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000944,src:000003,op:arith8,pos:143,val:-5,+cov
rename to src/exchange/afl-tests/id:000944,src:000003,op:arith8,pos:143,val:-5,+cov
diff --git a/src/mint/afl-tests/id:000945,src:000003,op:arith8,pos:145,val:+21,+cov b/src/exchange/afl-tests/id:000945,src:000003,op:arith8,pos:145,val:+21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000945,src:000003,op:arith8,pos:145,val:+21,+cov
rename to src/exchange/afl-tests/id:000945,src:000003,op:arith8,pos:145,val:+21,+cov
diff --git a/src/mint/afl-tests/id:000946,src:000003,op:arith8,pos:147,val:-9,+cov b/src/exchange/afl-tests/id:000946,src:000003,op:arith8,pos:147,val:-9,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000946,src:000003,op:arith8,pos:147,val:-9,+cov
rename to src/exchange/afl-tests/id:000946,src:000003,op:arith8,pos:147,val:-9,+cov
diff --git a/src/mint/afl-tests/id:000947,src:000003,op:arith8,pos:147,val:+31,+cov b/src/exchange/afl-tests/id:000947,src:000003,op:arith8,pos:147,val:+31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000947,src:000003,op:arith8,pos:147,val:+31,+cov
rename to src/exchange/afl-tests/id:000947,src:000003,op:arith8,pos:147,val:+31,+cov
diff --git a/src/mint/afl-tests/id:000948,src:000003,op:arith8,pos:148,val:+3,+cov b/src/exchange/afl-tests/id:000948,src:000003,op:arith8,pos:148,val:+3,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000948,src:000003,op:arith8,pos:148,val:+3,+cov
rename to src/exchange/afl-tests/id:000948,src:000003,op:arith8,pos:148,val:+3,+cov
diff --git a/src/mint/afl-tests/id:000949,src:000003,op:arith8,pos:148,val:-11,+cov b/src/exchange/afl-tests/id:000949,src:000003,op:arith8,pos:148,val:-11,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000949,src:000003,op:arith8,pos:148,val:-11,+cov
rename to src/exchange/afl-tests/id:000949,src:000003,op:arith8,pos:148,val:-11,+cov
diff --git a/src/mint/afl-tests/id:000950,src:000003,op:arith8,pos:149,val:-18,+cov b/src/exchange/afl-tests/id:000950,src:000003,op:arith8,pos:149,val:-18,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000950,src:000003,op:arith8,pos:149,val:-18,+cov
rename to src/exchange/afl-tests/id:000950,src:000003,op:arith8,pos:149,val:-18,+cov
diff --git a/src/mint/afl-tests/id:000951,src:000003,op:arith8,pos:151,val:-21,+cov b/src/exchange/afl-tests/id:000951,src:000003,op:arith8,pos:151,val:-21,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000951,src:000003,op:arith8,pos:151,val:-21,+cov
rename to src/exchange/afl-tests/id:000951,src:000003,op:arith8,pos:151,val:-21,+cov
diff --git a/src/mint/afl-tests/id:000952,src:000003,op:arith8,pos:151,val:+26,+cov b/src/exchange/afl-tests/id:000952,src:000003,op:arith8,pos:151,val:+26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000952,src:000003,op:arith8,pos:151,val:+26,+cov
rename to src/exchange/afl-tests/id:000952,src:000003,op:arith8,pos:151,val:+26,+cov
diff --git a/src/mint/afl-tests/id:000953,src:000003,op:arith8,pos:151,val:-30,+cov b/src/exchange/afl-tests/id:000953,src:000003,op:arith8,pos:151,val:-30,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000953,src:000003,op:arith8,pos:151,val:-30,+cov
rename to src/exchange/afl-tests/id:000953,src:000003,op:arith8,pos:151,val:-30,+cov
diff --git a/src/mint/afl-tests/id:000954,src:000003,op:arith16,pos:88,val:-16,+cov b/src/exchange/afl-tests/id:000954,src:000003,op:arith16,pos:88,val:-16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000954,src:000003,op:arith16,pos:88,val:-16,+cov
rename to src/exchange/afl-tests/id:000954,src:000003,op:arith16,pos:88,val:-16,+cov
diff --git a/src/mint/afl-tests/id:000955,src:000003,op:arith16,pos:109,val:-19,+cov b/src/exchange/afl-tests/id:000955,src:000003,op:arith16,pos:109,val:-19,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000955,src:000003,op:arith16,pos:109,val:-19,+cov
rename to src/exchange/afl-tests/id:000955,src:000003,op:arith16,pos:109,val:-19,+cov
diff --git a/src/mint/afl-tests/id:000956,src:000003,op:arith16,pos:109,val:-26,+cov b/src/exchange/afl-tests/id:000956,src:000003,op:arith16,pos:109,val:-26,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000956,src:000003,op:arith16,pos:109,val:-26,+cov
rename to src/exchange/afl-tests/id:000956,src:000003,op:arith16,pos:109,val:-26,+cov
diff --git a/src/mint/afl-tests/id:000957,src:000003,op:arith16,pos:109,val:-33,+cov b/src/exchange/afl-tests/id:000957,src:000003,op:arith16,pos:109,val:-33,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000957,src:000003,op:arith16,pos:109,val:-33,+cov
rename to src/exchange/afl-tests/id:000957,src:000003,op:arith16,pos:109,val:-33,+cov
diff --git a/src/mint/afl-tests/id:000958,src:000003,op:arith16,pos:121,val:-34,+cov b/src/exchange/afl-tests/id:000958,src:000003,op:arith16,pos:121,val:-34,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000958,src:000003,op:arith16,pos:121,val:-34,+cov
rename to src/exchange/afl-tests/id:000958,src:000003,op:arith16,pos:121,val:-34,+cov
diff --git a/src/mint/afl-tests/id:000959,src:000003,op:int8,pos:80,val:+16,+cov b/src/exchange/afl-tests/id:000959,src:000003,op:int8,pos:80,val:+16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000959,src:000003,op:int8,pos:80,val:+16,+cov
rename to src/exchange/afl-tests/id:000959,src:000003,op:int8,pos:80,val:+16,+cov
diff --git a/src/mint/afl-tests/id:000960,src:000003,op:int8,pos:83,val:+1,+cov b/src/exchange/afl-tests/id:000960,src:000003,op:int8,pos:83,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000960,src:000003,op:int8,pos:83,val:+1,+cov
rename to src/exchange/afl-tests/id:000960,src:000003,op:int8,pos:83,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000961,src:000003,op:int8,pos:101,val:+64,+cov b/src/exchange/afl-tests/id:000961,src:000003,op:int8,pos:101,val:+64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000961,src:000003,op:int8,pos:101,val:+64,+cov
rename to src/exchange/afl-tests/id:000961,src:000003,op:int8,pos:101,val:+64,+cov
diff --git a/src/mint/afl-tests/id:000962,src:000003,op:int8,pos:120,val:-128,+cov b/src/exchange/afl-tests/id:000962,src:000003,op:int8,pos:120,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000962,src:000003,op:int8,pos:120,val:-128,+cov
rename to src/exchange/afl-tests/id:000962,src:000003,op:int8,pos:120,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000963,src:000003,op:int8,pos:139,val:+16,+cov b/src/exchange/afl-tests/id:000963,src:000003,op:int8,pos:139,val:+16,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000963,src:000003,op:int8,pos:139,val:+16,+cov
rename to src/exchange/afl-tests/id:000963,src:000003,op:int8,pos:139,val:+16,+cov
diff --git a/src/mint/afl-tests/id:000964,src:000003,op:int16,pos:81,val:+127,+cov b/src/exchange/afl-tests/id:000964,src:000003,op:int16,pos:81,val:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000964,src:000003,op:int16,pos:81,val:+127,+cov
rename to src/exchange/afl-tests/id:000964,src:000003,op:int16,pos:81,val:+127,+cov
diff --git a/src/mint/afl-tests/id:000965,src:000003,op:int16,pos:95,val:+1,+cov b/src/exchange/afl-tests/id:000965,src:000003,op:int16,pos:95,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000965,src:000003,op:int16,pos:95,val:+1,+cov
rename to src/exchange/afl-tests/id:000965,src:000003,op:int16,pos:95,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000966,src:000003,op:int16,pos:97,val:be:+127,+cov b/src/exchange/afl-tests/id:000966,src:000003,op:int16,pos:97,val:be:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000966,src:000003,op:int16,pos:97,val:be:+127,+cov
rename to src/exchange/afl-tests/id:000966,src:000003,op:int16,pos:97,val:be:+127,+cov
diff --git a/src/mint/afl-tests/id:000967,src:000003,op:int16,pos:98,val:+1,+cov b/src/exchange/afl-tests/id:000967,src:000003,op:int16,pos:98,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000967,src:000003,op:int16,pos:98,val:+1,+cov
rename to src/exchange/afl-tests/id:000967,src:000003,op:int16,pos:98,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000968,src:000003,op:int16,pos:100,val:-1,+cov b/src/exchange/afl-tests/id:000968,src:000003,op:int16,pos:100,val:-1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000968,src:000003,op:int16,pos:100,val:-1,+cov
rename to src/exchange/afl-tests/id:000968,src:000003,op:int16,pos:100,val:-1,+cov
diff --git a/src/mint/afl-tests/id:000969,src:000003,op:int16,pos:102,val:be:+127,+cov b/src/exchange/afl-tests/id:000969,src:000003,op:int16,pos:102,val:be:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000969,src:000003,op:int16,pos:102,val:be:+127,+cov
rename to src/exchange/afl-tests/id:000969,src:000003,op:int16,pos:102,val:be:+127,+cov
diff --git a/src/mint/afl-tests/id:000970,src:000003,op:int16,pos:107,val:-128,+cov b/src/exchange/afl-tests/id:000970,src:000003,op:int16,pos:107,val:-128,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000970,src:000003,op:int16,pos:107,val:-128,+cov
rename to src/exchange/afl-tests/id:000970,src:000003,op:int16,pos:107,val:-128,+cov
diff --git a/src/mint/afl-tests/id:000971,src:000003,op:int16,pos:108,val:be:+127,+cov b/src/exchange/afl-tests/id:000971,src:000003,op:int16,pos:108,val:be:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000971,src:000003,op:int16,pos:108,val:be:+127,+cov
rename to src/exchange/afl-tests/id:000971,src:000003,op:int16,pos:108,val:be:+127,+cov
diff --git a/src/mint/afl-tests/id:000972,src:000003,op:int16,pos:109,val:be:+100,+cov b/src/exchange/afl-tests/id:000972,src:000003,op:int16,pos:109,val:be:+100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000972,src:000003,op:int16,pos:109,val:be:+100,+cov
rename to src/exchange/afl-tests/id:000972,src:000003,op:int16,pos:109,val:be:+100,+cov
diff --git a/src/mint/afl-tests/id:000973,src:000003,op:int16,pos:125,val:+1000,+cov b/src/exchange/afl-tests/id:000973,src:000003,op:int16,pos:125,val:+1000,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000973,src:000003,op:int16,pos:125,val:+1000,+cov
rename to src/exchange/afl-tests/id:000973,src:000003,op:int16,pos:125,val:+1000,+cov
diff --git a/src/mint/afl-tests/id:000974,src:000003,op:int16,pos:137,val:be:+32,+cov b/src/exchange/afl-tests/id:000974,src:000003,op:int16,pos:137,val:be:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000974,src:000003,op:int16,pos:137,val:be:+32,+cov
rename to src/exchange/afl-tests/id:000974,src:000003,op:int16,pos:137,val:be:+32,+cov
diff --git a/src/mint/afl-tests/id:000975,src:000003,op:int16,pos:150,val:be:+255,+cov b/src/exchange/afl-tests/id:000975,src:000003,op:int16,pos:150,val:be:+255,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000975,src:000003,op:int16,pos:150,val:be:+255,+cov
rename to src/exchange/afl-tests/id:000975,src:000003,op:int16,pos:150,val:be:+255,+cov
diff --git a/src/mint/afl-tests/id:000976,src:000003,op:int32,pos:1,val:be:+65535 b/src/exchange/afl-tests/id:000976,src:000003,op:int32,pos:1,val:be:+65535
similarity index 100%
rename from src/mint/afl-tests/id:000976,src:000003,op:int32,pos:1,val:be:+65535
rename to src/exchange/afl-tests/id:000976,src:000003,op:int32,pos:1,val:be:+65535
diff --git a/src/mint/afl-tests/id:000977,src:000003,op:int32,pos:54,val:+32768,+cov b/src/exchange/afl-tests/id:000977,src:000003,op:int32,pos:54,val:+32768,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000977,src:000003,op:int32,pos:54,val:+32768,+cov
rename to src/exchange/afl-tests/id:000977,src:000003,op:int32,pos:54,val:+32768,+cov
diff --git a/src/mint/afl-tests/id:000978,src:000003,op:int32,pos:80,val:be:+32767,+cov b/src/exchange/afl-tests/id:000978,src:000003,op:int32,pos:80,val:be:+32767,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000978,src:000003,op:int32,pos:80,val:be:+32767,+cov
rename to src/exchange/afl-tests/id:000978,src:000003,op:int32,pos:80,val:be:+32767,+cov
diff --git a/src/mint/afl-tests/id:000979,src:000003,op:int32,pos:84,val:+2147483647 b/src/exchange/afl-tests/id:000979,src:000003,op:int32,pos:84,val:+2147483647
similarity index 100%
rename from src/mint/afl-tests/id:000979,src:000003,op:int32,pos:84,val:+2147483647
rename to src/exchange/afl-tests/id:000979,src:000003,op:int32,pos:84,val:+2147483647
diff --git a/src/mint/afl-tests/id:000980,src:000003,op:int32,pos:89,val:be:+4096,+cov b/src/exchange/afl-tests/id:000980,src:000003,op:int32,pos:89,val:be:+4096,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000980,src:000003,op:int32,pos:89,val:be:+4096,+cov
rename to src/exchange/afl-tests/id:000980,src:000003,op:int32,pos:89,val:be:+4096,+cov
diff --git a/src/mint/afl-tests/id:000981,src:000003,op:int32,pos:98,val:-129,+cov b/src/exchange/afl-tests/id:000981,src:000003,op:int32,pos:98,val:-129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000981,src:000003,op:int32,pos:98,val:-129,+cov
rename to src/exchange/afl-tests/id:000981,src:000003,op:int32,pos:98,val:-129,+cov
diff --git a/src/mint/afl-tests/id:000982,src:000003,op:int32,pos:99,val:-32769,+cov b/src/exchange/afl-tests/id:000982,src:000003,op:int32,pos:99,val:-32769,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000982,src:000003,op:int32,pos:99,val:-32769,+cov
rename to src/exchange/afl-tests/id:000982,src:000003,op:int32,pos:99,val:-32769,+cov
diff --git a/src/mint/afl-tests/id:000983,src:000003,op:int32,pos:99,val:+100663045,+cov b/src/exchange/afl-tests/id:000983,src:000003,op:int32,pos:99,val:+100663045,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000983,src:000003,op:int32,pos:99,val:+100663045,+cov
rename to src/exchange/afl-tests/id:000983,src:000003,op:int32,pos:99,val:+100663045,+cov
diff --git a/src/mint/afl-tests/id:000984,src:000003,op:int32,pos:101,val:+64,+cov b/src/exchange/afl-tests/id:000984,src:000003,op:int32,pos:101,val:+64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000984,src:000003,op:int32,pos:101,val:+64,+cov
rename to src/exchange/afl-tests/id:000984,src:000003,op:int32,pos:101,val:+64,+cov
diff --git a/src/mint/afl-tests/id:000985,src:000003,op:int32,pos:102,val:be:+32,+cov b/src/exchange/afl-tests/id:000985,src:000003,op:int32,pos:102,val:be:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000985,src:000003,op:int32,pos:102,val:be:+32,+cov
rename to src/exchange/afl-tests/id:000985,src:000003,op:int32,pos:102,val:be:+32,+cov
diff --git a/src/mint/afl-tests/id:000986,src:000003,op:int32,pos:105,val:be:+512,+cov b/src/exchange/afl-tests/id:000986,src:000003,op:int32,pos:105,val:be:+512,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000986,src:000003,op:int32,pos:105,val:be:+512,+cov
rename to src/exchange/afl-tests/id:000986,src:000003,op:int32,pos:105,val:be:+512,+cov
diff --git a/src/mint/afl-tests/id:000987,src:000003,op:int32,pos:106,val:+100,+cov b/src/exchange/afl-tests/id:000987,src:000003,op:int32,pos:106,val:+100,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000987,src:000003,op:int32,pos:106,val:+100,+cov
rename to src/exchange/afl-tests/id:000987,src:000003,op:int32,pos:106,val:+100,+cov
diff --git a/src/mint/afl-tests/id:000988,src:000003,op:int32,pos:109,val:-100663046,+cov b/src/exchange/afl-tests/id:000988,src:000003,op:int32,pos:109,val:-100663046,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000988,src:000003,op:int32,pos:109,val:-100663046,+cov
rename to src/exchange/afl-tests/id:000988,src:000003,op:int32,pos:109,val:-100663046,+cov
diff --git a/src/mint/afl-tests/id:000989,src:000003,op:int32,pos:120,val:+255,+cov b/src/exchange/afl-tests/id:000989,src:000003,op:int32,pos:120,val:+255,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000989,src:000003,op:int32,pos:120,val:+255,+cov
rename to src/exchange/afl-tests/id:000989,src:000003,op:int32,pos:120,val:+255,+cov
diff --git a/src/mint/afl-tests/id:000990,src:000003,op:int32,pos:121,val:+1000,+cov b/src/exchange/afl-tests/id:000990,src:000003,op:int32,pos:121,val:+1000,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000990,src:000003,op:int32,pos:121,val:+1000,+cov
rename to src/exchange/afl-tests/id:000990,src:000003,op:int32,pos:121,val:+1000,+cov
diff --git a/src/mint/afl-tests/id:000991,src:000003,op:int32,pos:121,val:-100663046,+cov b/src/exchange/afl-tests/id:000991,src:000003,op:int32,pos:121,val:-100663046,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000991,src:000003,op:int32,pos:121,val:-100663046,+cov
rename to src/exchange/afl-tests/id:000991,src:000003,op:int32,pos:121,val:-100663046,+cov
diff --git a/src/mint/afl-tests/id:000992,src:000003,op:int32,pos:121,val:be:+65535,+cov b/src/exchange/afl-tests/id:000992,src:000003,op:int32,pos:121,val:be:+65535,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000992,src:000003,op:int32,pos:121,val:be:+65535,+cov
rename to src/exchange/afl-tests/id:000992,src:000003,op:int32,pos:121,val:be:+65535,+cov
diff --git a/src/mint/afl-tests/id:000993,src:000003,op:int32,pos:130,val:+100663045,+cov b/src/exchange/afl-tests/id:000993,src:000003,op:int32,pos:130,val:+100663045,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000993,src:000003,op:int32,pos:130,val:+100663045,+cov
rename to src/exchange/afl-tests/id:000993,src:000003,op:int32,pos:130,val:+100663045,+cov
diff --git a/src/mint/afl-tests/id:000994,src:000003,op:int32,pos:135,val:be:+32,+cov b/src/exchange/afl-tests/id:000994,src:000003,op:int32,pos:135,val:be:+32,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000994,src:000003,op:int32,pos:135,val:be:+32,+cov
rename to src/exchange/afl-tests/id:000994,src:000003,op:int32,pos:135,val:be:+32,+cov
diff --git a/src/mint/afl-tests/id:000995,src:000003,op:int32,pos:136,val:be:+127,+cov b/src/exchange/afl-tests/id:000995,src:000003,op:int32,pos:136,val:be:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000995,src:000003,op:int32,pos:136,val:be:+127,+cov
rename to src/exchange/afl-tests/id:000995,src:000003,op:int32,pos:136,val:be:+127,+cov
diff --git a/src/mint/afl-tests/id:000996,src:000003,op:int32,pos:138,val:+1,+cov b/src/exchange/afl-tests/id:000996,src:000003,op:int32,pos:138,val:+1,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000996,src:000003,op:int32,pos:138,val:+1,+cov
rename to src/exchange/afl-tests/id:000996,src:000003,op:int32,pos:138,val:+1,+cov
diff --git a/src/mint/afl-tests/id:000997,src:000003,op:int32,pos:147,val:be:+127,+cov b/src/exchange/afl-tests/id:000997,src:000003,op:int32,pos:147,val:be:+127,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000997,src:000003,op:int32,pos:147,val:be:+127,+cov
rename to src/exchange/afl-tests/id:000997,src:000003,op:int32,pos:147,val:be:+127,+cov
diff --git a/src/mint/afl-tests/id:000998,src:000003,op:ext_AO,pos:29,+cov b/src/exchange/afl-tests/id:000998,src:000003,op:ext_AO,pos:29,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000998,src:000003,op:ext_AO,pos:29,+cov
rename to src/exchange/afl-tests/id:000998,src:000003,op:ext_AO,pos:29,+cov
diff --git a/src/mint/afl-tests/id:000999,src:000003,op:ext_AO,pos:31,+cov b/src/exchange/afl-tests/id:000999,src:000003,op:ext_AO,pos:31,+cov
similarity index 100%
rename from src/mint/afl-tests/id:000999,src:000003,op:ext_AO,pos:31,+cov
rename to src/exchange/afl-tests/id:000999,src:000003,op:ext_AO,pos:31,+cov
diff --git a/src/mint/afl-tests/id:001000,src:000003,op:ext_AO,pos:37,+cov b/src/exchange/afl-tests/id:001000,src:000003,op:ext_AO,pos:37,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001000,src:000003,op:ext_AO,pos:37,+cov
rename to src/exchange/afl-tests/id:001000,src:000003,op:ext_AO,pos:37,+cov
diff --git a/src/mint/afl-tests/id:001001,src:000003,op:ext_AO,pos:40,+cov b/src/exchange/afl-tests/id:001001,src:000003,op:ext_AO,pos:40,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001001,src:000003,op:ext_AO,pos:40,+cov
rename to src/exchange/afl-tests/id:001001,src:000003,op:ext_AO,pos:40,+cov
diff --git a/src/mint/afl-tests/id:001002,src:000003,op:ext_AO,pos:44,+cov b/src/exchange/afl-tests/id:001002,src:000003,op:ext_AO,pos:44,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001002,src:000003,op:ext_AO,pos:44,+cov
rename to src/exchange/afl-tests/id:001002,src:000003,op:ext_AO,pos:44,+cov
diff --git a/src/mint/afl-tests/id:001003,src:000003,op:ext_AO,pos:44,+cov b/src/exchange/afl-tests/id:001003,src:000003,op:ext_AO,pos:44,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001003,src:000003,op:ext_AO,pos:44,+cov
rename to src/exchange/afl-tests/id:001003,src:000003,op:ext_AO,pos:44,+cov
diff --git a/src/mint/afl-tests/id:001004,src:000003,op:ext_AO,pos:51,+cov b/src/exchange/afl-tests/id:001004,src:000003,op:ext_AO,pos:51,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001004,src:000003,op:ext_AO,pos:51,+cov
rename to src/exchange/afl-tests/id:001004,src:000003,op:ext_AO,pos:51,+cov
diff --git a/src/mint/afl-tests/id:001005,src:000003,op:ext_AO,pos:54,+cov b/src/exchange/afl-tests/id:001005,src:000003,op:ext_AO,pos:54,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001005,src:000003,op:ext_AO,pos:54,+cov
rename to src/exchange/afl-tests/id:001005,src:000003,op:ext_AO,pos:54,+cov
diff --git a/src/mint/afl-tests/id:001006,src:000003,op:ext_AO,pos:55,+cov b/src/exchange/afl-tests/id:001006,src:000003,op:ext_AO,pos:55,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001006,src:000003,op:ext_AO,pos:55,+cov
rename to src/exchange/afl-tests/id:001006,src:000003,op:ext_AO,pos:55,+cov
diff --git a/src/mint/afl-tests/id:001007,src:000003,op:ext_AO,pos:61,+cov b/src/exchange/afl-tests/id:001007,src:000003,op:ext_AO,pos:61,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001007,src:000003,op:ext_AO,pos:61,+cov
rename to src/exchange/afl-tests/id:001007,src:000003,op:ext_AO,pos:61,+cov
diff --git a/src/mint/afl-tests/id:001008,src:000003,op:ext_AO,pos:64,+cov b/src/exchange/afl-tests/id:001008,src:000003,op:ext_AO,pos:64,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001008,src:000003,op:ext_AO,pos:64,+cov
rename to src/exchange/afl-tests/id:001008,src:000003,op:ext_AO,pos:64,+cov
diff --git a/src/mint/afl-tests/id:001009,src:000003,op:ext_AO,pos:66,+cov b/src/exchange/afl-tests/id:001009,src:000003,op:ext_AO,pos:66,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001009,src:000003,op:ext_AO,pos:66,+cov
rename to src/exchange/afl-tests/id:001009,src:000003,op:ext_AO,pos:66,+cov
diff --git a/src/mint/afl-tests/id:001010,src:000003,op:ext_AO,pos:67,+cov b/src/exchange/afl-tests/id:001010,src:000003,op:ext_AO,pos:67,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001010,src:000003,op:ext_AO,pos:67,+cov
rename to src/exchange/afl-tests/id:001010,src:000003,op:ext_AO,pos:67,+cov
diff --git a/src/mint/afl-tests/id:001011,src:000003,op:ext_AO,pos:71,+cov b/src/exchange/afl-tests/id:001011,src:000003,op:ext_AO,pos:71,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001011,src:000003,op:ext_AO,pos:71,+cov
rename to src/exchange/afl-tests/id:001011,src:000003,op:ext_AO,pos:71,+cov
diff --git a/src/mint/afl-tests/id:001012,src:000003,op:ext_AO,pos:80,+cov b/src/exchange/afl-tests/id:001012,src:000003,op:ext_AO,pos:80,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001012,src:000003,op:ext_AO,pos:80,+cov
rename to src/exchange/afl-tests/id:001012,src:000003,op:ext_AO,pos:80,+cov
diff --git a/src/mint/afl-tests/id:001013,src:000003,op:ext_AO,pos:84,+cov b/src/exchange/afl-tests/id:001013,src:000003,op:ext_AO,pos:84,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001013,src:000003,op:ext_AO,pos:84,+cov
rename to src/exchange/afl-tests/id:001013,src:000003,op:ext_AO,pos:84,+cov
diff --git a/src/mint/afl-tests/id:001014,src:000003,op:ext_AO,pos:84,+cov b/src/exchange/afl-tests/id:001014,src:000003,op:ext_AO,pos:84,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001014,src:000003,op:ext_AO,pos:84,+cov
rename to src/exchange/afl-tests/id:001014,src:000003,op:ext_AO,pos:84,+cov
diff --git a/src/mint/afl-tests/id:001015,src:000003,op:ext_AO,pos:85,+cov b/src/exchange/afl-tests/id:001015,src:000003,op:ext_AO,pos:85,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001015,src:000003,op:ext_AO,pos:85,+cov
rename to src/exchange/afl-tests/id:001015,src:000003,op:ext_AO,pos:85,+cov
diff --git a/src/mint/afl-tests/id:001016,src:000003,op:ext_AO,pos:86,+cov b/src/exchange/afl-tests/id:001016,src:000003,op:ext_AO,pos:86,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001016,src:000003,op:ext_AO,pos:86,+cov
rename to src/exchange/afl-tests/id:001016,src:000003,op:ext_AO,pos:86,+cov
diff --git a/src/mint/afl-tests/id:001017,src:000003,op:ext_AO,pos:89,+cov b/src/exchange/afl-tests/id:001017,src:000003,op:ext_AO,pos:89,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001017,src:000003,op:ext_AO,pos:89,+cov
rename to src/exchange/afl-tests/id:001017,src:000003,op:ext_AO,pos:89,+cov
diff --git a/src/mint/afl-tests/id:001018,src:000003,op:ext_AO,pos:90,+cov b/src/exchange/afl-tests/id:001018,src:000003,op:ext_AO,pos:90,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001018,src:000003,op:ext_AO,pos:90,+cov
rename to src/exchange/afl-tests/id:001018,src:000003,op:ext_AO,pos:90,+cov
diff --git a/src/mint/afl-tests/id:001019,src:000003,op:ext_AO,pos:90,+cov b/src/exchange/afl-tests/id:001019,src:000003,op:ext_AO,pos:90,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001019,src:000003,op:ext_AO,pos:90,+cov
rename to src/exchange/afl-tests/id:001019,src:000003,op:ext_AO,pos:90,+cov
diff --git a/src/mint/afl-tests/id:001020,src:000003,op:ext_AO,pos:101,+cov b/src/exchange/afl-tests/id:001020,src:000003,op:ext_AO,pos:101,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001020,src:000003,op:ext_AO,pos:101,+cov
rename to src/exchange/afl-tests/id:001020,src:000003,op:ext_AO,pos:101,+cov
diff --git a/src/mint/afl-tests/id:001021,src:000003,op:ext_AO,pos:102,+cov b/src/exchange/afl-tests/id:001021,src:000003,op:ext_AO,pos:102,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001021,src:000003,op:ext_AO,pos:102,+cov
rename to src/exchange/afl-tests/id:001021,src:000003,op:ext_AO,pos:102,+cov
diff --git a/src/mint/afl-tests/id:001022,src:000003,op:ext_AO,pos:103,+cov b/src/exchange/afl-tests/id:001022,src:000003,op:ext_AO,pos:103,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001022,src:000003,op:ext_AO,pos:103,+cov
rename to src/exchange/afl-tests/id:001022,src:000003,op:ext_AO,pos:103,+cov
diff --git a/src/mint/afl-tests/id:001023,src:000003,op:ext_AO,pos:106,+cov b/src/exchange/afl-tests/id:001023,src:000003,op:ext_AO,pos:106,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001023,src:000003,op:ext_AO,pos:106,+cov
rename to src/exchange/afl-tests/id:001023,src:000003,op:ext_AO,pos:106,+cov
diff --git a/src/mint/afl-tests/id:001024,src:000003,op:ext_AO,pos:107,+cov b/src/exchange/afl-tests/id:001024,src:000003,op:ext_AO,pos:107,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001024,src:000003,op:ext_AO,pos:107,+cov
rename to src/exchange/afl-tests/id:001024,src:000003,op:ext_AO,pos:107,+cov
diff --git a/src/mint/afl-tests/id:001025,src:000003,op:ext_AO,pos:109,+cov b/src/exchange/afl-tests/id:001025,src:000003,op:ext_AO,pos:109,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001025,src:000003,op:ext_AO,pos:109,+cov
rename to src/exchange/afl-tests/id:001025,src:000003,op:ext_AO,pos:109,+cov
diff --git a/src/mint/afl-tests/id:001026,src:000003,op:ext_AO,pos:109,+cov b/src/exchange/afl-tests/id:001026,src:000003,op:ext_AO,pos:109,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001026,src:000003,op:ext_AO,pos:109,+cov
rename to src/exchange/afl-tests/id:001026,src:000003,op:ext_AO,pos:109,+cov
diff --git a/src/mint/afl-tests/id:001027,src:000003,op:ext_AO,pos:113,+cov b/src/exchange/afl-tests/id:001027,src:000003,op:ext_AO,pos:113,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001027,src:000003,op:ext_AO,pos:113,+cov
rename to src/exchange/afl-tests/id:001027,src:000003,op:ext_AO,pos:113,+cov
diff --git a/src/mint/afl-tests/id:001028,src:000003,op:ext_AO,pos:117,+cov b/src/exchange/afl-tests/id:001028,src:000003,op:ext_AO,pos:117,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001028,src:000003,op:ext_AO,pos:117,+cov
rename to src/exchange/afl-tests/id:001028,src:000003,op:ext_AO,pos:117,+cov
diff --git a/src/mint/afl-tests/id:001029,src:000003,op:ext_AO,pos:122,+cov b/src/exchange/afl-tests/id:001029,src:000003,op:ext_AO,pos:122,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001029,src:000003,op:ext_AO,pos:122,+cov
rename to src/exchange/afl-tests/id:001029,src:000003,op:ext_AO,pos:122,+cov
diff --git a/src/mint/afl-tests/id:001030,src:000003,op:ext_AO,pos:122,+cov b/src/exchange/afl-tests/id:001030,src:000003,op:ext_AO,pos:122,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001030,src:000003,op:ext_AO,pos:122,+cov
rename to src/exchange/afl-tests/id:001030,src:000003,op:ext_AO,pos:122,+cov
diff --git a/src/mint/afl-tests/id:001031,src:000003,op:ext_AO,pos:124,+cov b/src/exchange/afl-tests/id:001031,src:000003,op:ext_AO,pos:124,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001031,src:000003,op:ext_AO,pos:124,+cov
rename to src/exchange/afl-tests/id:001031,src:000003,op:ext_AO,pos:124,+cov
diff --git a/src/mint/afl-tests/id:001032,src:000003,op:ext_AO,pos:125,+cov b/src/exchange/afl-tests/id:001032,src:000003,op:ext_AO,pos:125,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001032,src:000003,op:ext_AO,pos:125,+cov
rename to src/exchange/afl-tests/id:001032,src:000003,op:ext_AO,pos:125,+cov
diff --git a/src/mint/afl-tests/id:001033,src:000003,op:ext_AO,pos:125,+cov b/src/exchange/afl-tests/id:001033,src:000003,op:ext_AO,pos:125,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001033,src:000003,op:ext_AO,pos:125,+cov
rename to src/exchange/afl-tests/id:001033,src:000003,op:ext_AO,pos:125,+cov
diff --git a/src/mint/afl-tests/id:001034,src:000003,op:ext_AO,pos:126,+cov b/src/exchange/afl-tests/id:001034,src:000003,op:ext_AO,pos:126,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001034,src:000003,op:ext_AO,pos:126,+cov
rename to src/exchange/afl-tests/id:001034,src:000003,op:ext_AO,pos:126,+cov
diff --git a/src/mint/afl-tests/id:001035,src:000003,op:ext_AO,pos:126,+cov b/src/exchange/afl-tests/id:001035,src:000003,op:ext_AO,pos:126,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001035,src:000003,op:ext_AO,pos:126,+cov
rename to src/exchange/afl-tests/id:001035,src:000003,op:ext_AO,pos:126,+cov
diff --git a/src/mint/afl-tests/id:001036,src:000003,op:ext_AO,pos:129,+cov b/src/exchange/afl-tests/id:001036,src:000003,op:ext_AO,pos:129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001036,src:000003,op:ext_AO,pos:129,+cov
rename to src/exchange/afl-tests/id:001036,src:000003,op:ext_AO,pos:129,+cov
diff --git a/src/mint/afl-tests/id:001037,src:000003,op:ext_AO,pos:129,+cov b/src/exchange/afl-tests/id:001037,src:000003,op:ext_AO,pos:129,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001037,src:000003,op:ext_AO,pos:129,+cov
rename to src/exchange/afl-tests/id:001037,src:000003,op:ext_AO,pos:129,+cov
diff --git a/src/mint/afl-tests/id:001038,src:000003,op:ext_AO,pos:130,+cov b/src/exchange/afl-tests/id:001038,src:000003,op:ext_AO,pos:130,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001038,src:000003,op:ext_AO,pos:130,+cov
rename to src/exchange/afl-tests/id:001038,src:000003,op:ext_AO,pos:130,+cov
diff --git a/src/mint/afl-tests/id:001039,src:000003,op:ext_AO,pos:135,+cov b/src/exchange/afl-tests/id:001039,src:000003,op:ext_AO,pos:135,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001039,src:000003,op:ext_AO,pos:135,+cov
rename to src/exchange/afl-tests/id:001039,src:000003,op:ext_AO,pos:135,+cov
diff --git a/src/mint/afl-tests/id:001040,src:000003,op:ext_AO,pos:136,+cov b/src/exchange/afl-tests/id:001040,src:000003,op:ext_AO,pos:136,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001040,src:000003,op:ext_AO,pos:136,+cov
rename to src/exchange/afl-tests/id:001040,src:000003,op:ext_AO,pos:136,+cov
diff --git a/src/mint/afl-tests/id:001041,src:000003,op:ext_AO,pos:140,+cov b/src/exchange/afl-tests/id:001041,src:000003,op:ext_AO,pos:140,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001041,src:000003,op:ext_AO,pos:140,+cov
rename to src/exchange/afl-tests/id:001041,src:000003,op:ext_AO,pos:140,+cov
diff --git a/src/mint/afl-tests/id:001042,src:000003,op:ext_AO,pos:142,+cov b/src/exchange/afl-tests/id:001042,src:000003,op:ext_AO,pos:142,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001042,src:000003,op:ext_AO,pos:142,+cov
rename to src/exchange/afl-tests/id:001042,src:000003,op:ext_AO,pos:142,+cov
diff --git a/src/mint/afl-tests/id:001043,src:000003,op:ext_AO,pos:142,+cov b/src/exchange/afl-tests/id:001043,src:000003,op:ext_AO,pos:142,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001043,src:000003,op:ext_AO,pos:142,+cov
rename to src/exchange/afl-tests/id:001043,src:000003,op:ext_AO,pos:142,+cov
diff --git a/src/mint/afl-tests/id:001044,src:000003,op:ext_AO,pos:145,+cov b/src/exchange/afl-tests/id:001044,src:000003,op:ext_AO,pos:145,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001044,src:000003,op:ext_AO,pos:145,+cov
rename to src/exchange/afl-tests/id:001044,src:000003,op:ext_AO,pos:145,+cov
diff --git a/src/mint/afl-tests/id:001045,src:000003,op:ext_AO,pos:147,+cov b/src/exchange/afl-tests/id:001045,src:000003,op:ext_AO,pos:147,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001045,src:000003,op:ext_AO,pos:147,+cov
rename to src/exchange/afl-tests/id:001045,src:000003,op:ext_AO,pos:147,+cov
diff --git a/src/mint/afl-tests/id:001046,src:000003,op:ext_AO,pos:149,+cov b/src/exchange/afl-tests/id:001046,src:000003,op:ext_AO,pos:149,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001046,src:000003,op:ext_AO,pos:149,+cov
rename to src/exchange/afl-tests/id:001046,src:000003,op:ext_AO,pos:149,+cov
diff --git a/src/mint/afl-tests/id:001047,src:000004,op:flip1,pos:0,+cov b/src/exchange/afl-tests/id:001047,src:000004,op:flip1,pos:0,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001047,src:000004,op:flip1,pos:0,+cov
rename to src/exchange/afl-tests/id:001047,src:000004,op:flip1,pos:0,+cov
diff --git a/src/mint/afl-tests/id:001048,src:000004,op:flip1,pos:4,+cov b/src/exchange/afl-tests/id:001048,src:000004,op:flip1,pos:4,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001048,src:000004,op:flip1,pos:4,+cov
rename to src/exchange/afl-tests/id:001048,src:000004,op:flip1,pos:4,+cov
diff --git a/src/mint/afl-tests/id:001049,src:000004,op:flip1,pos:4 b/src/exchange/afl-tests/id:001049,src:000004,op:flip1,pos:4
similarity index 100%
rename from src/mint/afl-tests/id:001049,src:000004,op:flip1,pos:4
rename to src/exchange/afl-tests/id:001049,src:000004,op:flip1,pos:4
diff --git a/src/mint/afl-tests/id:001050,src:000004,op:flip1,pos:18 b/src/exchange/afl-tests/id:001050,src:000004,op:flip1,pos:18
similarity index 100%
rename from src/mint/afl-tests/id:001050,src:000004,op:flip1,pos:18
rename to src/exchange/afl-tests/id:001050,src:000004,op:flip1,pos:18
diff --git a/src/mint/afl-tests/id:001051,src:000004,op:flip1,pos:55,+cov b/src/exchange/afl-tests/id:001051,src:000004,op:flip1,pos:55,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001051,src:000004,op:flip1,pos:55,+cov
rename to src/exchange/afl-tests/id:001051,src:000004,op:flip1,pos:55,+cov
diff --git a/src/mint/afl-tests/id:001052,src:000004,op:flip1,pos:59 b/src/exchange/afl-tests/id:001052,src:000004,op:flip1,pos:59
similarity index 100%
rename from src/mint/afl-tests/id:001052,src:000004,op:flip1,pos:59
rename to src/exchange/afl-tests/id:001052,src:000004,op:flip1,pos:59
diff --git a/src/mint/afl-tests/id:001053,src:000004,op:flip1,pos:87,+cov b/src/exchange/afl-tests/id:001053,src:000004,op:flip1,pos:87,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001053,src:000004,op:flip1,pos:87,+cov
rename to src/exchange/afl-tests/id:001053,src:000004,op:flip1,pos:87,+cov
diff --git a/src/mint/afl-tests/id:001054,src:000004,op:flip1,pos:89 b/src/exchange/afl-tests/id:001054,src:000004,op:flip1,pos:89
similarity index 100%
rename from src/mint/afl-tests/id:001054,src:000004,op:flip1,pos:89
rename to src/exchange/afl-tests/id:001054,src:000004,op:flip1,pos:89
diff --git a/src/mint/afl-tests/id:001055,src:000004,op:flip1,pos:106,+cov b/src/exchange/afl-tests/id:001055,src:000004,op:flip1,pos:106,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001055,src:000004,op:flip1,pos:106,+cov
rename to src/exchange/afl-tests/id:001055,src:000004,op:flip1,pos:106,+cov
diff --git a/src/mint/afl-tests/id:001056,src:000004,op:flip1,pos:108 b/src/exchange/afl-tests/id:001056,src:000004,op:flip1,pos:108
similarity index 100%
rename from src/mint/afl-tests/id:001056,src:000004,op:flip1,pos:108
rename to src/exchange/afl-tests/id:001056,src:000004,op:flip1,pos:108
diff --git a/src/mint/afl-tests/id:001057,src:000004,op:flip1,pos:108 b/src/exchange/afl-tests/id:001057,src:000004,op:flip1,pos:108
similarity index 100%
rename from src/mint/afl-tests/id:001057,src:000004,op:flip1,pos:108
rename to src/exchange/afl-tests/id:001057,src:000004,op:flip1,pos:108
diff --git a/src/mint/afl-tests/id:001058,src:000004,op:flip1,pos:110 b/src/exchange/afl-tests/id:001058,src:000004,op:flip1,pos:110
similarity index 100%
rename from src/mint/afl-tests/id:001058,src:000004,op:flip1,pos:110
rename to src/exchange/afl-tests/id:001058,src:000004,op:flip1,pos:110
diff --git a/src/mint/afl-tests/id:001059,src:000004,op:flip1,pos:111,+cov b/src/exchange/afl-tests/id:001059,src:000004,op:flip1,pos:111,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001059,src:000004,op:flip1,pos:111,+cov
rename to src/exchange/afl-tests/id:001059,src:000004,op:flip1,pos:111,+cov
diff --git a/src/mint/afl-tests/id:001060,src:000004,op:flip1,pos:112 b/src/exchange/afl-tests/id:001060,src:000004,op:flip1,pos:112
similarity index 100%
rename from src/mint/afl-tests/id:001060,src:000004,op:flip1,pos:112
rename to src/exchange/afl-tests/id:001060,src:000004,op:flip1,pos:112
diff --git a/src/mint/afl-tests/id:001061,src:000004,op:flip1,pos:134,+cov b/src/exchange/afl-tests/id:001061,src:000004,op:flip1,pos:134,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001061,src:000004,op:flip1,pos:134,+cov
rename to src/exchange/afl-tests/id:001061,src:000004,op:flip1,pos:134,+cov
diff --git a/src/mint/afl-tests/id:001062,src:000004,op:flip1,pos:138,+cov b/src/exchange/afl-tests/id:001062,src:000004,op:flip1,pos:138,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001062,src:000004,op:flip1,pos:138,+cov
rename to src/exchange/afl-tests/id:001062,src:000004,op:flip1,pos:138,+cov
diff --git a/src/mint/afl-tests/id:001063,src:000004,op:flip1,pos:152,+cov b/src/exchange/afl-tests/id:001063,src:000004,op:flip1,pos:152,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001063,src:000004,op:flip1,pos:152,+cov
rename to src/exchange/afl-tests/id:001063,src:000004,op:flip1,pos:152,+cov
diff --git a/src/mint/afl-tests/id:001064,src:000004,op:flip1,pos:154,+cov b/src/exchange/afl-tests/id:001064,src:000004,op:flip1,pos:154,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001064,src:000004,op:flip1,pos:154,+cov
rename to src/exchange/afl-tests/id:001064,src:000004,op:flip1,pos:154,+cov
diff --git a/src/mint/afl-tests/id:001065,src:000004,op:flip1,pos:475,+cov b/src/exchange/afl-tests/id:001065,src:000004,op:flip1,pos:475,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001065,src:000004,op:flip1,pos:475,+cov
rename to src/exchange/afl-tests/id:001065,src:000004,op:flip1,pos:475,+cov
diff --git a/src/mint/afl-tests/id:001066,src:000004,op:flip1,pos:651,+cov b/src/exchange/afl-tests/id:001066,src:000004,op:flip1,pos:651,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001066,src:000004,op:flip1,pos:651,+cov
rename to src/exchange/afl-tests/id:001066,src:000004,op:flip1,pos:651,+cov
diff --git a/src/mint/afl-tests/id:001067,src:000004,op:flip1,pos:783,+cov b/src/exchange/afl-tests/id:001067,src:000004,op:flip1,pos:783,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001067,src:000004,op:flip1,pos:783,+cov
rename to src/exchange/afl-tests/id:001067,src:000004,op:flip1,pos:783,+cov
diff --git a/src/mint/afl-tests/id:001068,src:000004,op:flip1,pos:1150 b/src/exchange/afl-tests/id:001068,src:000004,op:flip1,pos:1150
similarity index 100%
rename from src/mint/afl-tests/id:001068,src:000004,op:flip1,pos:1150
rename to src/exchange/afl-tests/id:001068,src:000004,op:flip1,pos:1150
diff --git a/src/mint/afl-tests/id:001069,src:000004,op:flip1,pos:1278,+cov b/src/exchange/afl-tests/id:001069,src:000004,op:flip1,pos:1278,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001069,src:000004,op:flip1,pos:1278,+cov
rename to src/exchange/afl-tests/id:001069,src:000004,op:flip1,pos:1278,+cov
diff --git a/src/mint/afl-tests/id:001070,src:000004,op:flip1,pos:1649 b/src/exchange/afl-tests/id:001070,src:000004,op:flip1,pos:1649
similarity index 100%
rename from src/mint/afl-tests/id:001070,src:000004,op:flip1,pos:1649
rename to src/exchange/afl-tests/id:001070,src:000004,op:flip1,pos:1649
diff --git a/src/mint/afl-tests/id:001071,src:000004,op:flip1,pos:1662,+cov b/src/exchange/afl-tests/id:001071,src:000004,op:flip1,pos:1662,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001071,src:000004,op:flip1,pos:1662,+cov
rename to src/exchange/afl-tests/id:001071,src:000004,op:flip1,pos:1662,+cov
diff --git a/src/mint/afl-tests/id:001072,src:000004,op:flip1,pos:2148 b/src/exchange/afl-tests/id:001072,src:000004,op:flip1,pos:2148
similarity index 100%
rename from src/mint/afl-tests/id:001072,src:000004,op:flip1,pos:2148
rename to src/exchange/afl-tests/id:001072,src:000004,op:flip1,pos:2148
diff --git a/src/mint/afl-tests/id:001073,src:000004,op:flip1,pos:2437,+cov b/src/exchange/afl-tests/id:001073,src:000004,op:flip1,pos:2437,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001073,src:000004,op:flip1,pos:2437,+cov
rename to src/exchange/afl-tests/id:001073,src:000004,op:flip1,pos:2437,+cov
diff --git a/src/mint/afl-tests/id:001074,src:000004,op:flip1,pos:2647 b/src/exchange/afl-tests/id:001074,src:000004,op:flip1,pos:2647
similarity index 100%
rename from src/mint/afl-tests/id:001074,src:000004,op:flip1,pos:2647
rename to src/exchange/afl-tests/id:001074,src:000004,op:flip1,pos:2647
diff --git a/src/mint/afl-tests/id:001075,src:000004,op:flip1,pos:3146 b/src/exchange/afl-tests/id:001075,src:000004,op:flip1,pos:3146
similarity index 100%
rename from src/mint/afl-tests/id:001075,src:000004,op:flip1,pos:3146
rename to src/exchange/afl-tests/id:001075,src:000004,op:flip1,pos:3146
diff --git a/src/mint/afl-tests/id:001076,src:000004,op:flip1,pos:3205,+cov b/src/exchange/afl-tests/id:001076,src:000004,op:flip1,pos:3205,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001076,src:000004,op:flip1,pos:3205,+cov
rename to src/exchange/afl-tests/id:001076,src:000004,op:flip1,pos:3205,+cov
diff --git a/src/mint/afl-tests/id:001077,src:000004,op:flip1,pos:3645 b/src/exchange/afl-tests/id:001077,src:000004,op:flip1,pos:3645
similarity index 100%
rename from src/mint/afl-tests/id:001077,src:000004,op:flip1,pos:3645
rename to src/exchange/afl-tests/id:001077,src:000004,op:flip1,pos:3645
diff --git a/src/mint/afl-tests/id:001078,src:000004,op:flip1,pos:3980,+cov b/src/exchange/afl-tests/id:001078,src:000004,op:flip1,pos:3980,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001078,src:000004,op:flip1,pos:3980,+cov
rename to src/exchange/afl-tests/id:001078,src:000004,op:flip1,pos:3980,+cov
diff --git a/src/mint/afl-tests/id:001079,src:000004,op:flip1,pos:4144 b/src/exchange/afl-tests/id:001079,src:000004,op:flip1,pos:4144
similarity index 100%
rename from src/mint/afl-tests/id:001079,src:000004,op:flip1,pos:4144
rename to src/exchange/afl-tests/id:001079,src:000004,op:flip1,pos:4144
diff --git a/src/mint/afl-tests/id:001080,src:000004,op:flip1,pos:4198,+cov b/src/exchange/afl-tests/id:001080,src:000004,op:flip1,pos:4198,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001080,src:000004,op:flip1,pos:4198,+cov
rename to src/exchange/afl-tests/id:001080,src:000004,op:flip1,pos:4198,+cov
diff --git a/src/mint/afl-tests/id:001081,src:000004,op:flip1,pos:4249,+cov b/src/exchange/afl-tests/id:001081,src:000004,op:flip1,pos:4249,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001081,src:000004,op:flip1,pos:4249,+cov
rename to src/exchange/afl-tests/id:001081,src:000004,op:flip1,pos:4249,+cov
diff --git a/src/mint/afl-tests/id:001082,src:000004,op:flip1,pos:4291,+cov b/src/exchange/afl-tests/id:001082,src:000004,op:flip1,pos:4291,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001082,src:000004,op:flip1,pos:4291,+cov
rename to src/exchange/afl-tests/id:001082,src:000004,op:flip1,pos:4291,+cov
diff --git a/src/mint/afl-tests/id:001083,src:000004,op:flip1,pos:4673,+cov b/src/exchange/afl-tests/id:001083,src:000004,op:flip1,pos:4673,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001083,src:000004,op:flip1,pos:4673,+cov
rename to src/exchange/afl-tests/id:001083,src:000004,op:flip1,pos:4673,+cov
diff --git a/src/mint/afl-tests/id:001084,src:000004,op:flip1,pos:5206,+cov b/src/exchange/afl-tests/id:001084,src:000004,op:flip1,pos:5206,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001084,src:000004,op:flip1,pos:5206,+cov
rename to src/exchange/afl-tests/id:001084,src:000004,op:flip1,pos:5206,+cov
diff --git a/src/mint/afl-tests/id:001085,src:000004,op:flip1,pos:5361,+cov b/src/exchange/afl-tests/id:001085,src:000004,op:flip1,pos:5361,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001085,src:000004,op:flip1,pos:5361,+cov
rename to src/exchange/afl-tests/id:001085,src:000004,op:flip1,pos:5361,+cov
diff --git a/src/mint/afl-tests/id:001086,src:000004,op:flip1,pos:5362 b/src/exchange/afl-tests/id:001086,src:000004,op:flip1,pos:5362
similarity index 100%
rename from src/mint/afl-tests/id:001086,src:000004,op:flip1,pos:5362
rename to src/exchange/afl-tests/id:001086,src:000004,op:flip1,pos:5362
diff --git a/src/mint/afl-tests/id:001087,src:000004,op:flip1,pos:5507,+cov b/src/exchange/afl-tests/id:001087,src:000004,op:flip1,pos:5507,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001087,src:000004,op:flip1,pos:5507,+cov
rename to src/exchange/afl-tests/id:001087,src:000004,op:flip1,pos:5507,+cov
diff --git a/src/mint/afl-tests/id:001088,src:000004,op:flip1,pos:6639 b/src/exchange/afl-tests/id:001088,src:000004,op:flip1,pos:6639
similarity index 100%
rename from src/mint/afl-tests/id:001088,src:000004,op:flip1,pos:6639
rename to src/exchange/afl-tests/id:001088,src:000004,op:flip1,pos:6639
diff --git a/src/mint/afl-tests/id:001089,src:000004,op:flip1,pos:7138 b/src/exchange/afl-tests/id:001089,src:000004,op:flip1,pos:7138
similarity index 100%
rename from src/mint/afl-tests/id:001089,src:000004,op:flip1,pos:7138
rename to src/exchange/afl-tests/id:001089,src:000004,op:flip1,pos:7138
diff --git a/src/mint/afl-tests/id:001090,src:000004,op:flip1,pos:8027,+cov b/src/exchange/afl-tests/id:001090,src:000004,op:flip1,pos:8027,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001090,src:000004,op:flip1,pos:8027,+cov
rename to src/exchange/afl-tests/id:001090,src:000004,op:flip1,pos:8027,+cov
diff --git a/src/mint/afl-tests/id:001091,src:000004,op:flip1,pos:8136 b/src/exchange/afl-tests/id:001091,src:000004,op:flip1,pos:8136
similarity index 100%
rename from src/mint/afl-tests/id:001091,src:000004,op:flip1,pos:8136
rename to src/exchange/afl-tests/id:001091,src:000004,op:flip1,pos:8136
diff --git a/src/mint/afl-tests/id:001092,src:000004,op:flip1,pos:8636 b/src/exchange/afl-tests/id:001092,src:000004,op:flip1,pos:8636
similarity index 100%
rename from src/mint/afl-tests/id:001092,src:000004,op:flip1,pos:8636
rename to src/exchange/afl-tests/id:001092,src:000004,op:flip1,pos:8636
diff --git a/src/mint/afl-tests/id:001093,src:000004,op:flip1,pos:8655,+cov b/src/exchange/afl-tests/id:001093,src:000004,op:flip1,pos:8655,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001093,src:000004,op:flip1,pos:8655,+cov
rename to src/exchange/afl-tests/id:001093,src:000004,op:flip1,pos:8655,+cov
diff --git a/src/mint/afl-tests/id:001094,src:000004,op:flip1,pos:8712 b/src/exchange/afl-tests/id:001094,src:000004,op:flip1,pos:8712
similarity index 100%
rename from src/mint/afl-tests/id:001094,src:000004,op:flip1,pos:8712
rename to src/exchange/afl-tests/id:001094,src:000004,op:flip1,pos:8712
diff --git a/src/mint/afl-tests/id:001095,src:000004,op:flip1,pos:8768 b/src/exchange/afl-tests/id:001095,src:000004,op:flip1,pos:8768
similarity index 100%
rename from src/mint/afl-tests/id:001095,src:000004,op:flip1,pos:8768
rename to src/exchange/afl-tests/id:001095,src:000004,op:flip1,pos:8768
diff --git a/src/mint/afl-tests/id:001096,src:000004,op:flip1,pos:8825 b/src/exchange/afl-tests/id:001096,src:000004,op:flip1,pos:8825
similarity index 100%
rename from src/mint/afl-tests/id:001096,src:000004,op:flip1,pos:8825
rename to src/exchange/afl-tests/id:001096,src:000004,op:flip1,pos:8825
diff --git a/src/mint/afl-tests/id:001097,src:000004,op:flip1,pos:8840,+cov b/src/exchange/afl-tests/id:001097,src:000004,op:flip1,pos:8840,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001097,src:000004,op:flip1,pos:8840,+cov
rename to src/exchange/afl-tests/id:001097,src:000004,op:flip1,pos:8840,+cov
diff --git a/src/mint/afl-tests/id:001098,src:000004,op:flip1,pos:8869,+cov b/src/exchange/afl-tests/id:001098,src:000004,op:flip1,pos:8869,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001098,src:000004,op:flip1,pos:8869,+cov
rename to src/exchange/afl-tests/id:001098,src:000004,op:flip1,pos:8869,+cov
diff --git a/src/mint/afl-tests/id:001099,src:000004,op:flip1,pos:8882,+cov b/src/exchange/afl-tests/id:001099,src:000004,op:flip1,pos:8882,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001099,src:000004,op:flip1,pos:8882,+cov
rename to src/exchange/afl-tests/id:001099,src:000004,op:flip1,pos:8882,+cov
diff --git a/src/mint/afl-tests/id:001100,src:000004,op:flip1,pos:8910,+cov b/src/exchange/afl-tests/id:001100,src:000004,op:flip1,pos:8910,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001100,src:000004,op:flip1,pos:8910,+cov
rename to src/exchange/afl-tests/id:001100,src:000004,op:flip1,pos:8910,+cov
diff --git a/src/mint/afl-tests/id:001101,src:000004,op:flip1,pos:9001,+cov b/src/exchange/afl-tests/id:001101,src:000004,op:flip1,pos:9001,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001101,src:000004,op:flip1,pos:9001,+cov
rename to src/exchange/afl-tests/id:001101,src:000004,op:flip1,pos:9001,+cov
diff --git a/src/mint/afl-tests/id:001102,src:000004,op:flip1,pos:9584,+cov b/src/exchange/afl-tests/id:001102,src:000004,op:flip1,pos:9584,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001102,src:000004,op:flip1,pos:9584,+cov
rename to src/exchange/afl-tests/id:001102,src:000004,op:flip1,pos:9584,+cov
diff --git a/src/mint/afl-tests/id:001103,src:000004,op:flip1,pos:9658,+cov b/src/exchange/afl-tests/id:001103,src:000004,op:flip1,pos:9658,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001103,src:000004,op:flip1,pos:9658,+cov
rename to src/exchange/afl-tests/id:001103,src:000004,op:flip1,pos:9658,+cov
diff --git a/src/mint/afl-tests/id:001104,src:000004,op:flip1,pos:9808,+cov b/src/exchange/afl-tests/id:001104,src:000004,op:flip1,pos:9808,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001104,src:000004,op:flip1,pos:9808,+cov
rename to src/exchange/afl-tests/id:001104,src:000004,op:flip1,pos:9808,+cov
diff --git a/src/mint/afl-tests/id:001105,src:000004,op:flip1,pos:9954,+cov b/src/exchange/afl-tests/id:001105,src:000004,op:flip1,pos:9954,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001105,src:000004,op:flip1,pos:9954,+cov
rename to src/exchange/afl-tests/id:001105,src:000004,op:flip1,pos:9954,+cov
diff --git a/src/mint/afl-tests/id:001106,src:000004,op:flip1,pos:10093,+cov b/src/exchange/afl-tests/id:001106,src:000004,op:flip1,pos:10093,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001106,src:000004,op:flip1,pos:10093,+cov
rename to src/exchange/afl-tests/id:001106,src:000004,op:flip1,pos:10093,+cov
diff --git a/src/mint/afl-tests/id:001107,src:000004,op:flip1,pos:10417 b/src/exchange/afl-tests/id:001107,src:000004,op:flip1,pos:10417
similarity index 100%
rename from src/mint/afl-tests/id:001107,src:000004,op:flip1,pos:10417
rename to src/exchange/afl-tests/id:001107,src:000004,op:flip1,pos:10417
diff --git a/src/mint/afl-tests/id:001108,src:000004,op:flip1,pos:10430,+cov b/src/exchange/afl-tests/id:001108,src:000004,op:flip1,pos:10430,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001108,src:000004,op:flip1,pos:10430,+cov
rename to src/exchange/afl-tests/id:001108,src:000004,op:flip1,pos:10430,+cov
diff --git a/src/mint/afl-tests/id:001109,src:000004,op:flip1,pos:10639 b/src/exchange/afl-tests/id:001109,src:000004,op:flip1,pos:10639
similarity index 100%
rename from src/mint/afl-tests/id:001109,src:000004,op:flip1,pos:10639
rename to src/exchange/afl-tests/id:001109,src:000004,op:flip1,pos:10639
diff --git a/src/mint/afl-tests/id:001110,src:000004,op:flip1,pos:10846 b/src/exchange/afl-tests/id:001110,src:000004,op:flip1,pos:10846
similarity index 100%
rename from src/mint/afl-tests/id:001110,src:000004,op:flip1,pos:10846
rename to src/exchange/afl-tests/id:001110,src:000004,op:flip1,pos:10846
diff --git a/src/mint/afl-tests/id:001111,src:000004,op:flip1,pos:10957,+cov b/src/exchange/afl-tests/id:001111,src:000004,op:flip1,pos:10957,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001111,src:000004,op:flip1,pos:10957,+cov
rename to src/exchange/afl-tests/id:001111,src:000004,op:flip1,pos:10957,+cov
diff --git a/src/mint/afl-tests/id:001112,src:000004,op:flip1,pos:11055 b/src/exchange/afl-tests/id:001112,src:000004,op:flip1,pos:11055
similarity index 100%
rename from src/mint/afl-tests/id:001112,src:000004,op:flip1,pos:11055
rename to src/exchange/afl-tests/id:001112,src:000004,op:flip1,pos:11055
diff --git a/src/mint/afl-tests/id:001113,src:000004,op:flip1,pos:11176,+cov b/src/exchange/afl-tests/id:001113,src:000004,op:flip1,pos:11176,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001113,src:000004,op:flip1,pos:11176,+cov
rename to src/exchange/afl-tests/id:001113,src:000004,op:flip1,pos:11176,+cov
diff --git a/src/mint/afl-tests/id:001114,src:000004,op:flip1,pos:11262 b/src/exchange/afl-tests/id:001114,src:000004,op:flip1,pos:11262
similarity index 100%
rename from src/mint/afl-tests/id:001114,src:000004,op:flip1,pos:11262
rename to src/exchange/afl-tests/id:001114,src:000004,op:flip1,pos:11262
diff --git a/src/mint/afl-tests/id:001115,src:000004,op:flip1,pos:11471 b/src/exchange/afl-tests/id:001115,src:000004,op:flip1,pos:11471
similarity index 100%
rename from src/mint/afl-tests/id:001115,src:000004,op:flip1,pos:11471
rename to src/exchange/afl-tests/id:001115,src:000004,op:flip1,pos:11471
diff --git a/src/mint/afl-tests/id:001116,src:000004,op:flip1,pos:11887 b/src/exchange/afl-tests/id:001116,src:000004,op:flip1,pos:11887
similarity index 100%
rename from src/mint/afl-tests/id:001116,src:000004,op:flip1,pos:11887
rename to src/exchange/afl-tests/id:001116,src:000004,op:flip1,pos:11887
diff --git a/src/mint/afl-tests/id:001117,src:000004,op:flip1,pos:11996,+cov b/src/exchange/afl-tests/id:001117,src:000004,op:flip1,pos:11996,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001117,src:000004,op:flip1,pos:11996,+cov
rename to src/exchange/afl-tests/id:001117,src:000004,op:flip1,pos:11996,+cov
diff --git a/src/mint/afl-tests/id:001118,src:000004,op:flip1,pos:12094 b/src/exchange/afl-tests/id:001118,src:000004,op:flip1,pos:12094
similarity index 100%
rename from src/mint/afl-tests/id:001118,src:000004,op:flip1,pos:12094
rename to src/exchange/afl-tests/id:001118,src:000004,op:flip1,pos:12094
diff --git a/src/mint/afl-tests/id:001119,src:000004,op:flip1,pos:12302 b/src/exchange/afl-tests/id:001119,src:000004,op:flip1,pos:12302
similarity index 100%
rename from src/mint/afl-tests/id:001119,src:000004,op:flip1,pos:12302
rename to src/exchange/afl-tests/id:001119,src:000004,op:flip1,pos:12302
diff --git a/src/mint/afl-tests/id:001120,src:000004,op:flip1,pos:12511 b/src/exchange/afl-tests/id:001120,src:000004,op:flip1,pos:12511
similarity index 100%
rename from src/mint/afl-tests/id:001120,src:000004,op:flip1,pos:12511
rename to src/exchange/afl-tests/id:001120,src:000004,op:flip1,pos:12511
diff --git a/src/mint/afl-tests/id:001121,src:000004,op:flip1,pos:12567,+cov b/src/exchange/afl-tests/id:001121,src:000004,op:flip1,pos:12567,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001121,src:000004,op:flip1,pos:12567,+cov
rename to src/exchange/afl-tests/id:001121,src:000004,op:flip1,pos:12567,+cov
diff --git a/src/mint/afl-tests/id:001122,src:000004,op:flip1,pos:12660,+cov b/src/exchange/afl-tests/id:001122,src:000004,op:flip1,pos:12660,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001122,src:000004,op:flip1,pos:12660,+cov
rename to src/exchange/afl-tests/id:001122,src:000004,op:flip1,pos:12660,+cov
diff --git a/src/mint/afl-tests/id:001123,src:000004,op:flip1,pos:13342 b/src/exchange/afl-tests/id:001123,src:000004,op:flip1,pos:13342
similarity index 100%
rename from src/mint/afl-tests/id:001123,src:000004,op:flip1,pos:13342
rename to src/exchange/afl-tests/id:001123,src:000004,op:flip1,pos:13342
diff --git a/src/mint/afl-tests/id:001124,src:000004,op:flip1,pos:13550 b/src/exchange/afl-tests/id:001124,src:000004,op:flip1,pos:13550
similarity index 100%
rename from src/mint/afl-tests/id:001124,src:000004,op:flip1,pos:13550
rename to src/exchange/afl-tests/id:001124,src:000004,op:flip1,pos:13550
diff --git a/src/mint/afl-tests/id:001125,src:000004,op:flip1,pos:13758 b/src/exchange/afl-tests/id:001125,src:000004,op:flip1,pos:13758
similarity index 100%
rename from src/mint/afl-tests/id:001125,src:000004,op:flip1,pos:13758
rename to src/exchange/afl-tests/id:001125,src:000004,op:flip1,pos:13758
diff --git a/src/mint/afl-tests/id:001126,src:000004,op:flip1,pos:13968 b/src/exchange/afl-tests/id:001126,src:000004,op:flip1,pos:13968
similarity index 100%
rename from src/mint/afl-tests/id:001126,src:000004,op:flip1,pos:13968
rename to src/exchange/afl-tests/id:001126,src:000004,op:flip1,pos:13968
diff --git a/src/mint/afl-tests/id:001127,src:000004,op:flip1,pos:14134,+cov b/src/exchange/afl-tests/id:001127,src:000004,op:flip1,pos:14134,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001127,src:000004,op:flip1,pos:14134,+cov
rename to src/exchange/afl-tests/id:001127,src:000004,op:flip1,pos:14134,+cov
diff --git a/src/mint/afl-tests/id:001128,src:000004,op:flip1,pos:14599,+cov b/src/exchange/afl-tests/id:001128,src:000004,op:flip1,pos:14599,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001128,src:000004,op:flip1,pos:14599,+cov
rename to src/exchange/afl-tests/id:001128,src:000004,op:flip1,pos:14599,+cov
diff --git a/src/mint/afl-tests/id:001129,src:000004,op:flip1,pos:14603 b/src/exchange/afl-tests/id:001129,src:000004,op:flip1,pos:14603
similarity index 100%
rename from src/mint/afl-tests/id:001129,src:000004,op:flip1,pos:14603
rename to src/exchange/afl-tests/id:001129,src:000004,op:flip1,pos:14603
diff --git a/src/mint/afl-tests/id:001130,src:000004,op:flip1,pos:15122,+cov b/src/exchange/afl-tests/id:001130,src:000004,op:flip1,pos:15122,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001130,src:000004,op:flip1,pos:15122,+cov
rename to src/exchange/afl-tests/id:001130,src:000004,op:flip1,pos:15122,+cov
diff --git a/src/mint/afl-tests/id:001131,src:000004,op:flip1,pos:15271,+cov b/src/exchange/afl-tests/id:001131,src:000004,op:flip1,pos:15271,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001131,src:000004,op:flip1,pos:15271,+cov
rename to src/exchange/afl-tests/id:001131,src:000004,op:flip1,pos:15271,+cov
diff --git a/src/mint/afl-tests/id:001132,src:000004,op:flip1,pos:15295,+cov b/src/exchange/afl-tests/id:001132,src:000004,op:flip1,pos:15295,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001132,src:000004,op:flip1,pos:15295,+cov
rename to src/exchange/afl-tests/id:001132,src:000004,op:flip1,pos:15295,+cov
diff --git a/src/mint/afl-tests/id:001133,src:000004,op:flip1,pos:16328,+cov b/src/exchange/afl-tests/id:001133,src:000004,op:flip1,pos:16328,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001133,src:000004,op:flip1,pos:16328,+cov
rename to src/exchange/afl-tests/id:001133,src:000004,op:flip1,pos:16328,+cov
diff --git a/src/mint/afl-tests/id:001134,src:000004,op:flip1,pos:17507 b/src/exchange/afl-tests/id:001134,src:000004,op:flip1,pos:17507
similarity index 100%
rename from src/mint/afl-tests/id:001134,src:000004,op:flip1,pos:17507
rename to src/exchange/afl-tests/id:001134,src:000004,op:flip1,pos:17507
diff --git a/src/mint/afl-tests/id:001135,src:000004,op:flip1,pos:17983,+cov b/src/exchange/afl-tests/id:001135,src:000004,op:flip1,pos:17983,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001135,src:000004,op:flip1,pos:17983,+cov
rename to src/exchange/afl-tests/id:001135,src:000004,op:flip1,pos:17983,+cov
diff --git a/src/mint/afl-tests/id:001136,src:000004,op:flip1,pos:18109,+cov b/src/exchange/afl-tests/id:001136,src:000004,op:flip1,pos:18109,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001136,src:000004,op:flip1,pos:18109,+cov
rename to src/exchange/afl-tests/id:001136,src:000004,op:flip1,pos:18109,+cov
diff --git a/src/mint/afl-tests/id:001137,src:000004,op:flip1,pos:19291,+cov b/src/exchange/afl-tests/id:001137,src:000004,op:flip1,pos:19291,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001137,src:000004,op:flip1,pos:19291,+cov
rename to src/exchange/afl-tests/id:001137,src:000004,op:flip1,pos:19291,+cov
diff --git a/src/mint/afl-tests/id:001138,src:000004,op:flip1,pos:20068,+cov b/src/exchange/afl-tests/id:001138,src:000004,op:flip1,pos:20068,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001138,src:000004,op:flip1,pos:20068,+cov
rename to src/exchange/afl-tests/id:001138,src:000004,op:flip1,pos:20068,+cov
diff --git a/src/mint/afl-tests/id:001139,src:000004,op:flip1,pos:20075,+cov b/src/exchange/afl-tests/id:001139,src:000004,op:flip1,pos:20075,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001139,src:000004,op:flip1,pos:20075,+cov
rename to src/exchange/afl-tests/id:001139,src:000004,op:flip1,pos:20075,+cov
diff --git a/src/mint/afl-tests/id:001140,src:000004,op:flip1,pos:20264,+cov b/src/exchange/afl-tests/id:001140,src:000004,op:flip1,pos:20264,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001140,src:000004,op:flip1,pos:20264,+cov
rename to src/exchange/afl-tests/id:001140,src:000004,op:flip1,pos:20264,+cov
diff --git a/src/mint/afl-tests/id:001141,src:000004,op:flip1,pos:20372,+cov b/src/exchange/afl-tests/id:001141,src:000004,op:flip1,pos:20372,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001141,src:000004,op:flip1,pos:20372,+cov
rename to src/exchange/afl-tests/id:001141,src:000004,op:flip1,pos:20372,+cov
diff --git a/src/mint/afl-tests/id:001142,src:000004,op:flip1,pos:20845,+cov b/src/exchange/afl-tests/id:001142,src:000004,op:flip1,pos:20845,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001142,src:000004,op:flip1,pos:20845,+cov
rename to src/exchange/afl-tests/id:001142,src:000004,op:flip1,pos:20845,+cov
diff --git a/src/mint/afl-tests/id:001143,src:000004,op:flip1,pos:21044 b/src/exchange/afl-tests/id:001143,src:000004,op:flip1,pos:21044
similarity index 100%
rename from src/mint/afl-tests/id:001143,src:000004,op:flip1,pos:21044
rename to src/exchange/afl-tests/id:001143,src:000004,op:flip1,pos:21044
diff --git a/src/mint/afl-tests/id:001144,src:000004,op:flip1,pos:21072,+cov b/src/exchange/afl-tests/id:001144,src:000004,op:flip1,pos:21072,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001144,src:000004,op:flip1,pos:21072,+cov
rename to src/exchange/afl-tests/id:001144,src:000004,op:flip1,pos:21072,+cov
diff --git a/src/mint/afl-tests/id:001145,src:000004,op:flip1,pos:22111,+cov b/src/exchange/afl-tests/id:001145,src:000004,op:flip1,pos:22111,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001145,src:000004,op:flip1,pos:22111,+cov
rename to src/exchange/afl-tests/id:001145,src:000004,op:flip1,pos:22111,+cov
diff --git a/src/mint/afl-tests/id:001146,src:000004,op:flip1,pos:22404,+cov b/src/exchange/afl-tests/id:001146,src:000004,op:flip1,pos:22404,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001146,src:000004,op:flip1,pos:22404,+cov
rename to src/exchange/afl-tests/id:001146,src:000004,op:flip1,pos:22404,+cov
diff --git a/src/mint/afl-tests/id:001147,src:000004,op:flip1,pos:23777,+cov b/src/exchange/afl-tests/id:001147,src:000004,op:flip1,pos:23777,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001147,src:000004,op:flip1,pos:23777,+cov
rename to src/exchange/afl-tests/id:001147,src:000004,op:flip1,pos:23777,+cov
diff --git a/src/mint/afl-tests/id:001148,src:000004,op:flip1,pos:24046,+cov b/src/exchange/afl-tests/id:001148,src:000004,op:flip1,pos:24046,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001148,src:000004,op:flip1,pos:24046,+cov
rename to src/exchange/afl-tests/id:001148,src:000004,op:flip1,pos:24046,+cov
diff --git a/src/mint/afl-tests/id:001149,src:000004,op:flip1,pos:27360,+cov b/src/exchange/afl-tests/id:001149,src:000004,op:flip1,pos:27360,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001149,src:000004,op:flip1,pos:27360,+cov
rename to src/exchange/afl-tests/id:001149,src:000004,op:flip1,pos:27360,+cov
diff --git a/src/mint/afl-tests/id:001150,src:000004,op:flip1,pos:27547,+cov b/src/exchange/afl-tests/id:001150,src:000004,op:flip1,pos:27547,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001150,src:000004,op:flip1,pos:27547,+cov
rename to src/exchange/afl-tests/id:001150,src:000004,op:flip1,pos:27547,+cov
diff --git a/src/mint/afl-tests/id:001151,src:000004,op:flip1,pos:28206,+cov b/src/exchange/afl-tests/id:001151,src:000004,op:flip1,pos:28206,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001151,src:000004,op:flip1,pos:28206,+cov
rename to src/exchange/afl-tests/id:001151,src:000004,op:flip1,pos:28206,+cov
diff --git a/src/mint/afl-tests/id:001152,src:000004,op:flip1,pos:29132,+cov b/src/exchange/afl-tests/id:001152,src:000004,op:flip1,pos:29132,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001152,src:000004,op:flip1,pos:29132,+cov
rename to src/exchange/afl-tests/id:001152,src:000004,op:flip1,pos:29132,+cov
diff --git a/src/mint/afl-tests/id:001153,src:000004,op:flip1,pos:29181,+cov b/src/exchange/afl-tests/id:001153,src:000004,op:flip1,pos:29181,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001153,src:000004,op:flip1,pos:29181,+cov
rename to src/exchange/afl-tests/id:001153,src:000004,op:flip1,pos:29181,+cov
diff --git a/src/mint/afl-tests/id:001154,src:000004,op:flip1,pos:30141,+cov b/src/exchange/afl-tests/id:001154,src:000004,op:flip1,pos:30141,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001154,src:000004,op:flip1,pos:30141,+cov
rename to src/exchange/afl-tests/id:001154,src:000004,op:flip1,pos:30141,+cov
diff --git a/src/mint/afl-tests/id:001155,src:000004,op:flip1,pos:30860,+cov b/src/exchange/afl-tests/id:001155,src:000004,op:flip1,pos:30860,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001155,src:000004,op:flip1,pos:30860,+cov
rename to src/exchange/afl-tests/id:001155,src:000004,op:flip1,pos:30860,+cov
diff --git a/src/mint/afl-tests/id:001156,src:000004,op:flip1,pos:31016,+cov b/src/exchange/afl-tests/id:001156,src:000004,op:flip1,pos:31016,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001156,src:000004,op:flip1,pos:31016,+cov
rename to src/exchange/afl-tests/id:001156,src:000004,op:flip1,pos:31016,+cov
diff --git a/src/mint/afl-tests/id:001157,src:000004,op:flip1,pos:31260,+cov b/src/exchange/afl-tests/id:001157,src:000004,op:flip1,pos:31260,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001157,src:000004,op:flip1,pos:31260,+cov
rename to src/exchange/afl-tests/id:001157,src:000004,op:flip1,pos:31260,+cov
diff --git a/src/mint/afl-tests/id:001158,src:000004,op:flip1,pos:32301,+cov b/src/exchange/afl-tests/id:001158,src:000004,op:flip1,pos:32301,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001158,src:000004,op:flip1,pos:32301,+cov
rename to src/exchange/afl-tests/id:001158,src:000004,op:flip1,pos:32301,+cov
diff --git a/src/mint/afl-tests/id:001159,src:000004,op:flip1,pos:32476,+cov b/src/exchange/afl-tests/id:001159,src:000004,op:flip1,pos:32476,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001159,src:000004,op:flip1,pos:32476,+cov
rename to src/exchange/afl-tests/id:001159,src:000004,op:flip1,pos:32476,+cov
diff --git a/src/mint/afl-tests/id:001160,src:000004,op:flip1,pos:33475,+cov b/src/exchange/afl-tests/id:001160,src:000004,op:flip1,pos:33475,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001160,src:000004,op:flip1,pos:33475,+cov
rename to src/exchange/afl-tests/id:001160,src:000004,op:flip1,pos:33475,+cov
diff --git a/src/mint/afl-tests/id:001161,src:000004,op:flip2,pos:108 b/src/exchange/afl-tests/id:001161,src:000004,op:flip2,pos:108
similarity index 100%
rename from src/mint/afl-tests/id:001161,src:000004,op:flip2,pos:108
rename to src/exchange/afl-tests/id:001161,src:000004,op:flip2,pos:108
diff --git a/src/mint/afl-tests/id:001162,src:000004,op:flip2,pos:272,+cov b/src/exchange/afl-tests/id:001162,src:000004,op:flip2,pos:272,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001162,src:000004,op:flip2,pos:272,+cov
rename to src/exchange/afl-tests/id:001162,src:000004,op:flip2,pos:272,+cov
diff --git a/src/mint/afl-tests/id:001163,src:000004,op:flip2,pos:501,+cov b/src/exchange/afl-tests/id:001163,src:000004,op:flip2,pos:501,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001163,src:000004,op:flip2,pos:501,+cov
rename to src/exchange/afl-tests/id:001163,src:000004,op:flip2,pos:501,+cov
diff --git a/src/mint/afl-tests/id:001164,src:000004,op:flip2,pos:1593,+cov b/src/exchange/afl-tests/id:001164,src:000004,op:flip2,pos:1593,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001164,src:000004,op:flip2,pos:1593,+cov
rename to src/exchange/afl-tests/id:001164,src:000004,op:flip2,pos:1593,+cov
diff --git a/src/mint/afl-tests/id:001165,src:000004,op:flip2,pos:1877,+cov b/src/exchange/afl-tests/id:001165,src:000004,op:flip2,pos:1877,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001165,src:000004,op:flip2,pos:1877,+cov
rename to src/exchange/afl-tests/id:001165,src:000004,op:flip2,pos:1877,+cov
diff --git a/src/mint/afl-tests/id:001166,src:000004,op:flip2,pos:2863,+cov b/src/exchange/afl-tests/id:001166,src:000004,op:flip2,pos:2863,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001166,src:000004,op:flip2,pos:2863,+cov
rename to src/exchange/afl-tests/id:001166,src:000004,op:flip2,pos:2863,+cov
diff --git a/src/mint/afl-tests/id:001167,src:000004,op:flip2,pos:3189,+cov b/src/exchange/afl-tests/id:001167,src:000004,op:flip2,pos:3189,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001167,src:000004,op:flip2,pos:3189,+cov
rename to src/exchange/afl-tests/id:001167,src:000004,op:flip2,pos:3189,+cov
diff --git a/src/mint/afl-tests/id:001168,src:000004,op:flip2,pos:5916,+cov b/src/exchange/afl-tests/id:001168,src:000004,op:flip2,pos:5916,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001168,src:000004,op:flip2,pos:5916,+cov
rename to src/exchange/afl-tests/id:001168,src:000004,op:flip2,pos:5916,+cov
diff --git a/src/mint/afl-tests/id:001169,src:000004,op:flip2,pos:6474,+cov b/src/exchange/afl-tests/id:001169,src:000004,op:flip2,pos:6474,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001169,src:000004,op:flip2,pos:6474,+cov
rename to src/exchange/afl-tests/id:001169,src:000004,op:flip2,pos:6474,+cov
diff --git a/src/mint/afl-tests/id:001170,src:000004,op:flip2,pos:8695,+cov b/src/exchange/afl-tests/id:001170,src:000004,op:flip2,pos:8695,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001170,src:000004,op:flip2,pos:8695,+cov
rename to src/exchange/afl-tests/id:001170,src:000004,op:flip2,pos:8695,+cov
diff --git a/src/mint/afl-tests/id:001171,src:000004,op:flip2,pos:9101,+cov b/src/exchange/afl-tests/id:001171,src:000004,op:flip2,pos:9101,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001171,src:000004,op:flip2,pos:9101,+cov
rename to src/exchange/afl-tests/id:001171,src:000004,op:flip2,pos:9101,+cov
diff --git a/src/mint/afl-tests/id:001172,src:000004,op:flip2,pos:9350,+cov b/src/exchange/afl-tests/id:001172,src:000004,op:flip2,pos:9350,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001172,src:000004,op:flip2,pos:9350,+cov
rename to src/exchange/afl-tests/id:001172,src:000004,op:flip2,pos:9350,+cov
diff --git a/src/mint/afl-tests/id:001173,src:000004,op:flip2,pos:9675,+cov b/src/exchange/afl-tests/id:001173,src:000004,op:flip2,pos:9675,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001173,src:000004,op:flip2,pos:9675,+cov
rename to src/exchange/afl-tests/id:001173,src:000004,op:flip2,pos:9675,+cov
diff --git a/src/mint/afl-tests/id:001174,src:000004,op:flip2,pos:9779,+cov b/src/exchange/afl-tests/id:001174,src:000004,op:flip2,pos:9779,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001174,src:000004,op:flip2,pos:9779,+cov
rename to src/exchange/afl-tests/id:001174,src:000004,op:flip2,pos:9779,+cov
diff --git a/src/mint/afl-tests/id:001175,src:000004,op:flip2,pos:10123,+cov b/src/exchange/afl-tests/id:001175,src:000004,op:flip2,pos:10123,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001175,src:000004,op:flip2,pos:10123,+cov
rename to src/exchange/afl-tests/id:001175,src:000004,op:flip2,pos:10123,+cov
diff --git a/src/mint/afl-tests/id:001176,src:000004,op:flip2,pos:10486,+cov b/src/exchange/afl-tests/id:001176,src:000004,op:flip2,pos:10486,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001176,src:000004,op:flip2,pos:10486,+cov
rename to src/exchange/afl-tests/id:001176,src:000004,op:flip2,pos:10486,+cov
diff --git a/src/mint/afl-tests/id:001177,src:000004,op:flip2,pos:11222,+cov b/src/exchange/afl-tests/id:001177,src:000004,op:flip2,pos:11222,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001177,src:000004,op:flip2,pos:11222,+cov
rename to src/exchange/afl-tests/id:001177,src:000004,op:flip2,pos:11222,+cov
diff --git a/src/mint/afl-tests/id:001178,src:000004,op:flip2,pos:11504,+cov b/src/exchange/afl-tests/id:001178,src:000004,op:flip2,pos:11504,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001178,src:000004,op:flip2,pos:11504,+cov
rename to src/exchange/afl-tests/id:001178,src:000004,op:flip2,pos:11504,+cov
diff --git a/src/mint/afl-tests/id:001179,src:000004,op:flip2,pos:13892,+cov b/src/exchange/afl-tests/id:001179,src:000004,op:flip2,pos:13892,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001179,src:000004,op:flip2,pos:13892,+cov
rename to src/exchange/afl-tests/id:001179,src:000004,op:flip2,pos:13892,+cov
diff --git a/src/mint/afl-tests/id:001180,src:000004,op:flip2,pos:14104,+cov b/src/exchange/afl-tests/id:001180,src:000004,op:flip2,pos:14104,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001180,src:000004,op:flip2,pos:14104,+cov
rename to src/exchange/afl-tests/id:001180,src:000004,op:flip2,pos:14104,+cov
diff --git a/src/mint/afl-tests/id:001181,src:000004,op:flip2,pos:16451,+cov b/src/exchange/afl-tests/id:001181,src:000004,op:flip2,pos:16451,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001181,src:000004,op:flip2,pos:16451,+cov
rename to src/exchange/afl-tests/id:001181,src:000004,op:flip2,pos:16451,+cov
diff --git a/src/mint/afl-tests/id:001182,src:000004,op:flip2,pos:17186,+cov b/src/exchange/afl-tests/id:001182,src:000004,op:flip2,pos:17186,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001182,src:000004,op:flip2,pos:17186,+cov
rename to src/exchange/afl-tests/id:001182,src:000004,op:flip2,pos:17186,+cov
diff --git a/src/mint/afl-tests/id:001183,src:000004,op:flip2,pos:18869,+cov b/src/exchange/afl-tests/id:001183,src:000004,op:flip2,pos:18869,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001183,src:000004,op:flip2,pos:18869,+cov
rename to src/exchange/afl-tests/id:001183,src:000004,op:flip2,pos:18869,+cov
diff --git a/src/mint/afl-tests/id:001184,src:000004,op:flip2,pos:20039,+cov b/src/exchange/afl-tests/id:001184,src:000004,op:flip2,pos:20039,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001184,src:000004,op:flip2,pos:20039,+cov
rename to src/exchange/afl-tests/id:001184,src:000004,op:flip2,pos:20039,+cov
diff --git a/src/mint/afl-tests/id:001185,src:000004,op:flip2,pos:20319,+cov b/src/exchange/afl-tests/id:001185,src:000004,op:flip2,pos:20319,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001185,src:000004,op:flip2,pos:20319,+cov
rename to src/exchange/afl-tests/id:001185,src:000004,op:flip2,pos:20319,+cov
diff --git a/src/mint/afl-tests/id:001186,src:000004,op:flip2,pos:20987,+cov b/src/exchange/afl-tests/id:001186,src:000004,op:flip2,pos:20987,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001186,src:000004,op:flip2,pos:20987,+cov
rename to src/exchange/afl-tests/id:001186,src:000004,op:flip2,pos:20987,+cov
diff --git a/src/mint/afl-tests/id:001187,src:000004,op:flip2,pos:22115,+cov b/src/exchange/afl-tests/id:001187,src:000004,op:flip2,pos:22115,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001187,src:000004,op:flip2,pos:22115,+cov
rename to src/exchange/afl-tests/id:001187,src:000004,op:flip2,pos:22115,+cov
diff --git a/src/mint/afl-tests/id:001188,src:000004,op:flip2,pos:22139,+cov b/src/exchange/afl-tests/id:001188,src:000004,op:flip2,pos:22139,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001188,src:000004,op:flip2,pos:22139,+cov
rename to src/exchange/afl-tests/id:001188,src:000004,op:flip2,pos:22139,+cov
diff --git a/src/mint/afl-tests/id:001189,src:000004,op:flip2,pos:22530,+cov b/src/exchange/afl-tests/id:001189,src:000004,op:flip2,pos:22530,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001189,src:000004,op:flip2,pos:22530,+cov
rename to src/exchange/afl-tests/id:001189,src:000004,op:flip2,pos:22530,+cov
diff --git a/src/mint/afl-tests/id:001190,src:000004,op:flip2,pos:22871,+cov b/src/exchange/afl-tests/id:001190,src:000004,op:flip2,pos:22871,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001190,src:000004,op:flip2,pos:22871,+cov
rename to src/exchange/afl-tests/id:001190,src:000004,op:flip2,pos:22871,+cov
diff --git a/src/mint/afl-tests/id:001191,src:000004,op:flip2,pos:22878,+cov b/src/exchange/afl-tests/id:001191,src:000004,op:flip2,pos:22878,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001191,src:000004,op:flip2,pos:22878,+cov
rename to src/exchange/afl-tests/id:001191,src:000004,op:flip2,pos:22878,+cov
diff --git a/src/mint/afl-tests/id:001192,src:000004,op:flip2,pos:23586,+cov b/src/exchange/afl-tests/id:001192,src:000004,op:flip2,pos:23586,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001192,src:000004,op:flip2,pos:23586,+cov
rename to src/exchange/afl-tests/id:001192,src:000004,op:flip2,pos:23586,+cov
diff --git a/src/mint/afl-tests/id:001193,src:000004,op:flip2,pos:24806,+cov b/src/exchange/afl-tests/id:001193,src:000004,op:flip2,pos:24806,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001193,src:000004,op:flip2,pos:24806,+cov
rename to src/exchange/afl-tests/id:001193,src:000004,op:flip2,pos:24806,+cov
diff --git a/src/mint/afl-tests/id:001194,src:000004,op:flip2,pos:25248,+cov b/src/exchange/afl-tests/id:001194,src:000004,op:flip2,pos:25248,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001194,src:000004,op:flip2,pos:25248,+cov
rename to src/exchange/afl-tests/id:001194,src:000004,op:flip2,pos:25248,+cov
diff --git a/src/mint/afl-tests/id:001195,src:000004,op:flip2,pos:26529,+cov b/src/exchange/afl-tests/id:001195,src:000004,op:flip2,pos:26529,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001195,src:000004,op:flip2,pos:26529,+cov
rename to src/exchange/afl-tests/id:001195,src:000004,op:flip2,pos:26529,+cov
diff --git a/src/mint/afl-tests/id:001196,src:000004,op:flip2,pos:28158,+cov b/src/exchange/afl-tests/id:001196,src:000004,op:flip2,pos:28158,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001196,src:000004,op:flip2,pos:28158,+cov
rename to src/exchange/afl-tests/id:001196,src:000004,op:flip2,pos:28158,+cov
diff --git a/src/mint/afl-tests/id:001197,src:000004,op:flip2,pos:29113,+cov b/src/exchange/afl-tests/id:001197,src:000004,op:flip2,pos:29113,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001197,src:000004,op:flip2,pos:29113,+cov
rename to src/exchange/afl-tests/id:001197,src:000004,op:flip2,pos:29113,+cov
diff --git a/src/mint/afl-tests/id:001198,src:000004,op:flip2,pos:29233,+cov b/src/exchange/afl-tests/id:001198,src:000004,op:flip2,pos:29233,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001198,src:000004,op:flip2,pos:29233,+cov
rename to src/exchange/afl-tests/id:001198,src:000004,op:flip2,pos:29233,+cov
diff --git a/src/mint/afl-tests/id:001199,src:000004,op:flip2,pos:31755,+cov b/src/exchange/afl-tests/id:001199,src:000004,op:flip2,pos:31755,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001199,src:000004,op:flip2,pos:31755,+cov
rename to src/exchange/afl-tests/id:001199,src:000004,op:flip2,pos:31755,+cov
diff --git a/src/mint/afl-tests/id:001200,src:000004,op:flip2,pos:32441,+cov b/src/exchange/afl-tests/id:001200,src:000004,op:flip2,pos:32441,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001200,src:000004,op:flip2,pos:32441,+cov
rename to src/exchange/afl-tests/id:001200,src:000004,op:flip2,pos:32441,+cov
diff --git a/src/mint/afl-tests/id:001201,src:000004,op:flip2,pos:32888,+cov b/src/exchange/afl-tests/id:001201,src:000004,op:flip2,pos:32888,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001201,src:000004,op:flip2,pos:32888,+cov
rename to src/exchange/afl-tests/id:001201,src:000004,op:flip2,pos:32888,+cov
diff --git a/src/mint/afl-tests/id:001202,src:000004,op:flip2,pos:33869,+cov b/src/exchange/afl-tests/id:001202,src:000004,op:flip2,pos:33869,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001202,src:000004,op:flip2,pos:33869,+cov
rename to src/exchange/afl-tests/id:001202,src:000004,op:flip2,pos:33869,+cov
diff --git a/src/mint/afl-tests/id:001203,src:000004,op:flip4,pos:399,+cov b/src/exchange/afl-tests/id:001203,src:000004,op:flip4,pos:399,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001203,src:000004,op:flip4,pos:399,+cov
rename to src/exchange/afl-tests/id:001203,src:000004,op:flip4,pos:399,+cov
diff --git a/src/mint/afl-tests/id:001204,src:000004,op:flip4,pos:1377,+cov b/src/exchange/afl-tests/id:001204,src:000004,op:flip4,pos:1377,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001204,src:000004,op:flip4,pos:1377,+cov
rename to src/exchange/afl-tests/id:001204,src:000004,op:flip4,pos:1377,+cov
diff --git a/src/mint/afl-tests/id:001205,src:000004,op:flip4,pos:1830,+cov b/src/exchange/afl-tests/id:001205,src:000004,op:flip4,pos:1830,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001205,src:000004,op:flip4,pos:1830,+cov
rename to src/exchange/afl-tests/id:001205,src:000004,op:flip4,pos:1830,+cov
diff --git a/src/mint/afl-tests/id:001206,src:000004,op:flip4,pos:3239,+cov b/src/exchange/afl-tests/id:001206,src:000004,op:flip4,pos:3239,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001206,src:000004,op:flip4,pos:3239,+cov
rename to src/exchange/afl-tests/id:001206,src:000004,op:flip4,pos:3239,+cov
diff --git a/src/mint/afl-tests/id:001207,src:000004,op:flip4,pos:3591,+cov b/src/exchange/afl-tests/id:001207,src:000004,op:flip4,pos:3591,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001207,src:000004,op:flip4,pos:3591,+cov
rename to src/exchange/afl-tests/id:001207,src:000004,op:flip4,pos:3591,+cov
diff --git a/src/mint/afl-tests/id:001208,src:000004,op:flip4,pos:3708,+cov b/src/exchange/afl-tests/id:001208,src:000004,op:flip4,pos:3708,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001208,src:000004,op:flip4,pos:3708,+cov
rename to src/exchange/afl-tests/id:001208,src:000004,op:flip4,pos:3708,+cov
diff --git a/src/mint/afl-tests/id:001209,src:000004,op:flip4,pos:4350,+cov b/src/exchange/afl-tests/id:001209,src:000004,op:flip4,pos:4350,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001209,src:000004,op:flip4,pos:4350,+cov
rename to src/exchange/afl-tests/id:001209,src:000004,op:flip4,pos:4350,+cov
diff --git a/src/mint/afl-tests/id:001210,src:000004,op:flip4,pos:4487,+cov b/src/exchange/afl-tests/id:001210,src:000004,op:flip4,pos:4487,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001210,src:000004,op:flip4,pos:4487,+cov
rename to src/exchange/afl-tests/id:001210,src:000004,op:flip4,pos:4487,+cov
diff --git a/src/mint/afl-tests/id:001211,src:000004,op:flip4,pos:4584,+cov b/src/exchange/afl-tests/id:001211,src:000004,op:flip4,pos:4584,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001211,src:000004,op:flip4,pos:4584,+cov
rename to src/exchange/afl-tests/id:001211,src:000004,op:flip4,pos:4584,+cov
diff --git a/src/mint/afl-tests/id:001212,src:000004,op:flip4,pos:5470,+cov b/src/exchange/afl-tests/id:001212,src:000004,op:flip4,pos:5470,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001212,src:000004,op:flip4,pos:5470,+cov
rename to src/exchange/afl-tests/id:001212,src:000004,op:flip4,pos:5470,+cov
diff --git a/src/mint/afl-tests/id:001213,src:000004,op:flip4,pos:6559,+cov b/src/exchange/afl-tests/id:001213,src:000004,op:flip4,pos:6559,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001213,src:000004,op:flip4,pos:6559,+cov
rename to src/exchange/afl-tests/id:001213,src:000004,op:flip4,pos:6559,+cov
diff --git a/src/mint/afl-tests/id:001214,src:000004,op:flip4,pos:6626,+cov b/src/exchange/afl-tests/id:001214,src:000004,op:flip4,pos:6626,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001214,src:000004,op:flip4,pos:6626,+cov
rename to src/exchange/afl-tests/id:001214,src:000004,op:flip4,pos:6626,+cov
diff --git a/src/mint/afl-tests/id:001215,src:000004,op:flip4,pos:7110,+cov b/src/exchange/afl-tests/id:001215,src:000004,op:flip4,pos:7110,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001215,src:000004,op:flip4,pos:7110,+cov
rename to src/exchange/afl-tests/id:001215,src:000004,op:flip4,pos:7110,+cov
diff --git a/src/mint/afl-tests/id:001216,src:000004,op:flip4,pos:7148,+cov b/src/exchange/afl-tests/id:001216,src:000004,op:flip4,pos:7148,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001216,src:000004,op:flip4,pos:7148,+cov
rename to src/exchange/afl-tests/id:001216,src:000004,op:flip4,pos:7148,+cov
diff --git a/src/mint/afl-tests/id:001217,src:000004,op:flip4,pos:7168,+cov b/src/exchange/afl-tests/id:001217,src:000004,op:flip4,pos:7168,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001217,src:000004,op:flip4,pos:7168,+cov
rename to src/exchange/afl-tests/id:001217,src:000004,op:flip4,pos:7168,+cov
diff --git a/src/mint/afl-tests/id:001218,src:000004,op:flip4,pos:7715,+cov b/src/exchange/afl-tests/id:001218,src:000004,op:flip4,pos:7715,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001218,src:000004,op:flip4,pos:7715,+cov
rename to src/exchange/afl-tests/id:001218,src:000004,op:flip4,pos:7715,+cov
diff --git a/src/mint/afl-tests/id:001219,src:000004,op:flip4,pos:9108,+cov b/src/exchange/afl-tests/id:001219,src:000004,op:flip4,pos:9108,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001219,src:000004,op:flip4,pos:9108,+cov
rename to src/exchange/afl-tests/id:001219,src:000004,op:flip4,pos:9108,+cov
diff --git a/src/mint/afl-tests/id:001220,src:000004,op:flip4,pos:9386,+cov b/src/exchange/afl-tests/id:001220,src:000004,op:flip4,pos:9386,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001220,src:000004,op:flip4,pos:9386,+cov
rename to src/exchange/afl-tests/id:001220,src:000004,op:flip4,pos:9386,+cov
diff --git a/src/mint/afl-tests/id:001221,src:000004,op:flip4,pos:9592,+cov b/src/exchange/afl-tests/id:001221,src:000004,op:flip4,pos:9592,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001221,src:000004,op:flip4,pos:9592,+cov
rename to src/exchange/afl-tests/id:001221,src:000004,op:flip4,pos:9592,+cov
diff --git a/src/mint/afl-tests/id:001222,src:000004,op:flip4,pos:9878,+cov b/src/exchange/afl-tests/id:001222,src:000004,op:flip4,pos:9878,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001222,src:000004,op:flip4,pos:9878,+cov
rename to src/exchange/afl-tests/id:001222,src:000004,op:flip4,pos:9878,+cov
diff --git a/src/mint/afl-tests/id:001223,src:000004,op:flip4,pos:9972,+cov b/src/exchange/afl-tests/id:001223,src:000004,op:flip4,pos:9972,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001223,src:000004,op:flip4,pos:9972,+cov
rename to src/exchange/afl-tests/id:001223,src:000004,op:flip4,pos:9972,+cov
diff --git a/src/mint/afl-tests/id:001224,src:000004,op:flip4,pos:10287,+cov b/src/exchange/afl-tests/id:001224,src:000004,op:flip4,pos:10287,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001224,src:000004,op:flip4,pos:10287,+cov
rename to src/exchange/afl-tests/id:001224,src:000004,op:flip4,pos:10287,+cov
diff --git a/src/mint/afl-tests/id:001225,src:000004,op:flip4,pos:10737,+cov b/src/exchange/afl-tests/id:001225,src:000004,op:flip4,pos:10737,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001225,src:000004,op:flip4,pos:10737,+cov
rename to src/exchange/afl-tests/id:001225,src:000004,op:flip4,pos:10737,+cov
diff --git a/src/mint/afl-tests/id:001226,src:000004,op:flip4,pos:12260,+cov b/src/exchange/afl-tests/id:001226,src:000004,op:flip4,pos:12260,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001226,src:000004,op:flip4,pos:12260,+cov
rename to src/exchange/afl-tests/id:001226,src:000004,op:flip4,pos:12260,+cov
diff --git a/src/mint/afl-tests/id:001227,src:000004,op:flip4,pos:15195,+cov b/src/exchange/afl-tests/id:001227,src:000004,op:flip4,pos:15195,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001227,src:000004,op:flip4,pos:15195,+cov
rename to src/exchange/afl-tests/id:001227,src:000004,op:flip4,pos:15195,+cov
diff --git a/src/mint/afl-tests/id:001228,src:000004,op:flip4,pos:15571,+cov b/src/exchange/afl-tests/id:001228,src:000004,op:flip4,pos:15571,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001228,src:000004,op:flip4,pos:15571,+cov
rename to src/exchange/afl-tests/id:001228,src:000004,op:flip4,pos:15571,+cov
diff --git a/src/mint/afl-tests/id:001229,src:000004,op:flip4,pos:19500,+cov b/src/exchange/afl-tests/id:001229,src:000004,op:flip4,pos:19500,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001229,src:000004,op:flip4,pos:19500,+cov
rename to src/exchange/afl-tests/id:001229,src:000004,op:flip4,pos:19500,+cov
diff --git a/src/mint/afl-tests/id:001230,src:000004,op:flip4,pos:20444,+cov b/src/exchange/afl-tests/id:001230,src:000004,op:flip4,pos:20444,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001230,src:000004,op:flip4,pos:20444,+cov
rename to src/exchange/afl-tests/id:001230,src:000004,op:flip4,pos:20444,+cov
diff --git a/src/mint/afl-tests/id:001231,src:000004,op:flip4,pos:22249,+cov b/src/exchange/afl-tests/id:001231,src:000004,op:flip4,pos:22249,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001231,src:000004,op:flip4,pos:22249,+cov
rename to src/exchange/afl-tests/id:001231,src:000004,op:flip4,pos:22249,+cov
diff --git a/src/mint/afl-tests/id:001232,src:000004,op:flip4,pos:22380,+cov b/src/exchange/afl-tests/id:001232,src:000004,op:flip4,pos:22380,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001232,src:000004,op:flip4,pos:22380,+cov
rename to src/exchange/afl-tests/id:001232,src:000004,op:flip4,pos:22380,+cov
diff --git a/src/mint/afl-tests/id:001233,src:000004,op:flip4,pos:25459,+cov b/src/exchange/afl-tests/id:001233,src:000004,op:flip4,pos:25459,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001233,src:000004,op:flip4,pos:25459,+cov
rename to src/exchange/afl-tests/id:001233,src:000004,op:flip4,pos:25459,+cov
diff --git a/src/mint/afl-tests/id:001234,src:000004,op:flip4,pos:27094,+cov b/src/exchange/afl-tests/id:001234,src:000004,op:flip4,pos:27094,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001234,src:000004,op:flip4,pos:27094,+cov
rename to src/exchange/afl-tests/id:001234,src:000004,op:flip4,pos:27094,+cov
diff --git a/src/mint/afl-tests/id:001235,src:000004,op:flip4,pos:28097,+cov b/src/exchange/afl-tests/id:001235,src:000004,op:flip4,pos:28097,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001235,src:000004,op:flip4,pos:28097,+cov
rename to src/exchange/afl-tests/id:001235,src:000004,op:flip4,pos:28097,+cov
diff --git a/src/mint/afl-tests/id:001236,src:000004,op:flip4,pos:28763,+cov b/src/exchange/afl-tests/id:001236,src:000004,op:flip4,pos:28763,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001236,src:000004,op:flip4,pos:28763,+cov
rename to src/exchange/afl-tests/id:001236,src:000004,op:flip4,pos:28763,+cov
diff --git a/src/mint/afl-tests/id:001237,src:000004,op:flip4,pos:28897,+cov b/src/exchange/afl-tests/id:001237,src:000004,op:flip4,pos:28897,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001237,src:000004,op:flip4,pos:28897,+cov
rename to src/exchange/afl-tests/id:001237,src:000004,op:flip4,pos:28897,+cov
diff --git a/src/mint/afl-tests/id:001238,src:000004,op:flip4,pos:29158,+cov b/src/exchange/afl-tests/id:001238,src:000004,op:flip4,pos:29158,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001238,src:000004,op:flip4,pos:29158,+cov
rename to src/exchange/afl-tests/id:001238,src:000004,op:flip4,pos:29158,+cov
diff --git a/src/mint/afl-tests/id:001239,src:000004,op:flip4,pos:29314,+cov b/src/exchange/afl-tests/id:001239,src:000004,op:flip4,pos:29314,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001239,src:000004,op:flip4,pos:29314,+cov
rename to src/exchange/afl-tests/id:001239,src:000004,op:flip4,pos:29314,+cov
diff --git a/src/mint/afl-tests/id:001240,src:000004,op:flip4,pos:29379,+cov b/src/exchange/afl-tests/id:001240,src:000004,op:flip4,pos:29379,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001240,src:000004,op:flip4,pos:29379,+cov
rename to src/exchange/afl-tests/id:001240,src:000004,op:flip4,pos:29379,+cov
diff --git a/src/mint/afl-tests/id:001241,src:000004,op:flip4,pos:30828,+cov b/src/exchange/afl-tests/id:001241,src:000004,op:flip4,pos:30828,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001241,src:000004,op:flip4,pos:30828,+cov
rename to src/exchange/afl-tests/id:001241,src:000004,op:flip4,pos:30828,+cov
diff --git a/src/mint/afl-tests/id:001242,src:000004,op:flip4,pos:31450,+cov b/src/exchange/afl-tests/id:001242,src:000004,op:flip4,pos:31450,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001242,src:000004,op:flip4,pos:31450,+cov
rename to src/exchange/afl-tests/id:001242,src:000004,op:flip4,pos:31450,+cov
diff --git a/src/mint/afl-tests/id:001243,src:000004,op:flip4,pos:32113,+cov b/src/exchange/afl-tests/id:001243,src:000004,op:flip4,pos:32113,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001243,src:000004,op:flip4,pos:32113,+cov
rename to src/exchange/afl-tests/id:001243,src:000004,op:flip4,pos:32113,+cov
diff --git a/src/mint/afl-tests/id:001244,src:000004,op:flip4,pos:32563,+cov b/src/exchange/afl-tests/id:001244,src:000004,op:flip4,pos:32563,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001244,src:000004,op:flip4,pos:32563,+cov
rename to src/exchange/afl-tests/id:001244,src:000004,op:flip4,pos:32563,+cov
diff --git a/src/mint/afl-tests/id:001245,src:000004,op:flip4,pos:32844,+cov b/src/exchange/afl-tests/id:001245,src:000004,op:flip4,pos:32844,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001245,src:000004,op:flip4,pos:32844,+cov
rename to src/exchange/afl-tests/id:001245,src:000004,op:flip4,pos:32844,+cov
diff --git a/src/mint/afl-tests/id:001246,src:000004,op:flip4,pos:33202,+cov b/src/exchange/afl-tests/id:001246,src:000004,op:flip4,pos:33202,+cov
similarity index 100%
rename from src/mint/afl-tests/id:001246,src:000004,op:flip4,pos:33202,+cov
rename to src/exchange/afl-tests/id:001246,src:000004,op:flip4,pos:33202,+cov
diff --git a/src/exchange/exchange.conf b/src/exchange/exchange.conf
new file mode 100644
index 000000000..eab476ccd
--- /dev/null
+++ b/src/exchange/exchange.conf
@@ -0,0 +1,29 @@
+# This file is in the public domain.
+#
+[exchange]
+# Currency supported by the exchange (can only be one)
+# CURRENCY = EUR
+
+# Where do we store the private keys the exchange needs at
+# runtime? (Denomination and signing keys are then stored
+# in respective subdirectories.)
+KEYDIR = ${TALER_DATA_HOME}/exchange/live-keys/
+
+# Wire format supported by the exchange. We use 'test' for testing of
+# the actual coin operations.
+# WIREFORMAT = test
+
+# HTTP port the exchange listens to
+# PORT = 8081
+
+# Master public key used to sign the exchange's various keys
+# MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
+
+# How to access our database
+DB = postgres
+
+# Is this is a testcase, use transient DB actions?
+# TESTRUN = YES
+
+# Where do we store the offline master private key of the exchange?
+MASTER_PRIV_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/master.priv
diff --git a/src/mint/taler-mint-aggregator.c b/src/exchange/taler-exchange-aggregator.c
similarity index 69%
rename from src/mint/taler-mint-aggregator.c
rename to src/exchange/taler-exchange-aggregator.c
index 5e05c8673..e4ba975a2 100644
--- a/src/mint/taler-mint-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -15,151 +15,48 @@
*/
/**
- * @file taler-mint-aggregator.c
+ * @file taler-exchange-aggregator.c
* @brief Process that aggregates outgoing transactions and executes them
* @author Christian Grothoff
- *
- * TODO:
- * - simplify global_ret: make it a global!
- * - handle shutdown more nicely (call 'cancel' method on wire transfers)
*/
#include "platform.h"
#include
#include
#include
-#include "taler_mintdb_lib.h"
-#include "taler_mintdb_plugin.h"
+#include "taler_exchangedb_lib.h"
+#include "taler_exchangedb_plugin.h"
+#include "taler_json_lib.h"
#include "taler_wire_lib.h"
-/**
- * Which currency is used by this mint?
- */
-static char *mint_currency_string;
/**
- * Which wireformat should be supported by this aggregator?
+ * Data we keep to #run_transfers(). There is at most
+ * one of these around at any given point in time.
*/
-static char *mint_wireformat;
-
-/**
- * Base directory of the mint (global)
- */
-static char *mint_directory;
-
-/**
- * The mint's configuration (global)
- */
-static struct GNUNET_CONFIGURATION_Handle *cfg;
-
-/**
- * Our DB plugin.
- */
-static struct TALER_MINTDB_Plugin *db_plugin;
-
-/**
- * Our wire plugin.
- */
-static struct TALER_WIRE_Plugin *wire_plugin;
-
-/**
- * Task for the main #run() function.
- */
-static struct GNUNET_SCHEDULER_Task *task;
-
-/**
- * Limit on the number of transactions we aggregate at once. Note
- * that the limit must be big enough to ensure that when transactions
- * of the smallest possible unit are aggregated, they do surpass the
- * "tiny" threshold beyond which we never trigger a wire transaction!
- *
- * TODO: make configurable (via config file or command line option)
- */
-static unsigned int aggregation_limit = 10000;
-
-
-/**
- * Load configuration parameters for the mint
- * server into the corresponding global variables.
- *
- * @param mint_directory the mint's directory
- * @return #GNUNET_OK on success
- */
-static int
-mint_serve_process_config (const char *mint_directory)
+struct WirePrepareData
{
- char *type;
- cfg = TALER_config_load (mint_directory);
- if (NULL == cfg)
- {
- fprintf (stderr,
- "Failed to load mint configuration\n");
- return GNUNET_SYSERR;
- }
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint",
- "currency",
- &mint_currency_string))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint",
- "currency");
- return GNUNET_SYSERR;
- }
- if (strlen (mint_currency_string) >= TALER_CURRENCY_LEN)
- {
- fprintf (stderr,
- "Currency `%s' longer than the allowed limit of %u characters.",
- mint_currency_string,
- (unsigned int) TALER_CURRENCY_LEN);
- return GNUNET_SYSERR;
- }
- if (NULL != mint_wireformat)
- GNUNET_CONFIGURATION_set_value_string (cfg,
- "mint",
- "wireformat",
- mint_wireformat);
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint",
- "wireformat",
- &type))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint",
- "wireformat");
- return GNUNET_SYSERR;
- }
+ /**
+ * Database session for all of our transactions.
+ */
+ struct TALER_EXCHANGEDB_Session *session;
- if (NULL ==
- (db_plugin = TALER_MINTDB_plugin_load (cfg)))
- {
- fprintf (stderr,
- "Failed to initialize DB subsystem\n");
- GNUNET_free (type);
- return GNUNET_SYSERR;
- }
+ /**
+ * Wire execution handle.
+ */
+ struct TALER_WIRE_ExecuteHandle *eh;
- if (NULL ==
- (wire_plugin = TALER_WIRE_plugin_load (cfg,
- type)))
- {
- fprintf (stderr,
- "Failed to load wire plugin for `%s'\n",
- type);
- GNUNET_free (type);
- return GNUNET_SYSERR;
- }
- GNUNET_free (type);
+ /**
+ * Row ID of the transfer.
+ */
+ unsigned long long row_id;
- return GNUNET_OK;
-}
+};
/**
- * Information about one aggregation process to
- * be executed.
+ * Information about one aggregation process to be executed. There is
+ * at most one of these around at any given point in time.
*/
struct AggregationUnit
{
@@ -201,7 +98,7 @@ struct AggregationUnit
/**
* Database session for all of our transactions.
*/
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
/**
* Wire preparation handle.
@@ -214,11 +111,6 @@ struct AggregationUnit
*/
unsigned long long *additional_rows;
- /**
- * Pointer to global return value. Closure for #run().
- */
- int *global_ret;
-
/**
* Offset specifying how many #additional_rows are in use.
*/
@@ -232,16 +124,196 @@ struct AggregationUnit
};
+/**
+ * Which currency is used by this exchange?
+ */
+static char *exchange_currency_string;
+
+/**
+ * Which wireformat should be supported by this aggregator?
+ */
+static char *exchange_wireformat;
+
+/**
+ * The exchange's configuration (global)
+ */
+static struct GNUNET_CONFIGURATION_Handle *cfg;
+
+/**
+ * Our DB plugin.
+ */
+static struct TALER_EXCHANGEDB_Plugin *db_plugin;
+
+/**
+ * Our wire plugin.
+ */
+static struct TALER_WIRE_Plugin *wire_plugin;
+
+/**
+ * Next task to run, if any.
+ */
+static struct GNUNET_SCHEDULER_Task *task;
+
+/**
+ * If we are currently executing a transfer, information about
+ * the active transfer is here. Otherwise, this variable is NULL.
+ */
+static struct WirePrepareData *wpd;
+
+/**
+ * If we are currently aggregating transactions, information about the
+ * active aggregation is here. Otherwise, this variable is NULL.
+ */
+static struct AggregationUnit *au;
+
+/**
+ * Value to return from main(). #GNUNET_OK on success, #GNUNET_SYSERR
+ * on serious errors.
+ */
+static int global_ret;
+
+/**
+ * #GNUNET_YES if we are in test mode and are using temporary tables.
+ */
+static int test_mode;
+
+/**
+ * Limit on the number of transactions we aggregate at once. Note
+ * that the limit must be big enough to ensure that when transactions
+ * of the smallest possible unit are aggregated, they do surpass the
+ * "tiny" threshold beyond which we never trigger a wire transaction!
+ *
+ * Note: do not change here, Postgres requires us to hard-code the
+ * LIMIT in the prepared statement.
+ */
+static unsigned int aggregation_limit = TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT;
+
+
+/**
+ * We're being aborted with CTRL-C (or SIGTERM). Shut down.
+ *
+ * @param cls closure
+ */
+static void
+shutdown_task (void *cls)
+{
+ if (NULL != task)
+ {
+ GNUNET_SCHEDULER_cancel (task);
+ task = NULL;
+ }
+ if (NULL != wpd)
+ {
+ if (NULL != wpd->eh)
+ {
+ wire_plugin->execute_wire_transfer_cancel (wire_plugin->cls,
+ wpd->eh);
+ wpd->eh = NULL;
+ }
+ db_plugin->rollback (db_plugin->cls,
+ wpd->session);
+ GNUNET_free (wpd);
+ wpd = NULL;
+ }
+ if (NULL != au)
+ {
+ if (NULL != au->ph)
+ {
+ wire_plugin->prepare_wire_transfer_cancel (wire_plugin->cls,
+ au->ph);
+ au->ph = NULL;
+ }
+ db_plugin->rollback (db_plugin->cls,
+ au->session);
+ GNUNET_free_non_null (au->additional_rows);
+ if (NULL != au->wire)
+ json_decref (au->wire);
+ au = NULL;
+ GNUNET_free (au);
+ }
+ TALER_EXCHANGEDB_plugin_unload (db_plugin);
+ TALER_WIRE_plugin_unload (wire_plugin);
+ GNUNET_CONFIGURATION_destroy (cfg);
+ cfg = NULL;
+}
+
+
+/**
+ * Parse configuration parameters for the exchange server into the
+ * corresponding global variables.
+ *
+ * @return #GNUNET_OK on success
+ */
+static int
+exchange_serve_process_config ()
+{
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "exchange",
+ "currency",
+ &exchange_currency_string))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "currency");
+ return GNUNET_SYSERR;
+ }
+ if (strlen (exchange_currency_string) >= TALER_CURRENCY_LEN)
+ {
+ fprintf (stderr,
+ "Currency `%s' longer than the allowed limit of %u characters.",
+ exchange_currency_string,
+ (unsigned int) TALER_CURRENCY_LEN);
+ return GNUNET_SYSERR;
+ }
+ if (NULL != exchange_wireformat)
+ GNUNET_CONFIGURATION_set_value_string (cfg,
+ "exchange",
+ "wireformat",
+ exchange_wireformat);
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "exchange",
+ "wireformat",
+ &exchange_wireformat))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "wireformat");
+ return GNUNET_SYSERR;
+ }
+
+ if (NULL ==
+ (db_plugin = TALER_EXCHANGEDB_plugin_load (cfg)))
+ {
+ fprintf (stderr,
+ "Failed to initialize DB subsystem\n");
+ return GNUNET_SYSERR;
+ }
+
+ if (NULL ==
+ (wire_plugin = TALER_WIRE_plugin_load (cfg,
+ exchange_wireformat)))
+ {
+ fprintf (stderr,
+ "Failed to load wire plugin for `%s'\n",
+ exchange_wireformat);
+ return GNUNET_SYSERR;
+ }
+ return GNUNET_OK;
+}
+
+
/**
* Function called with details about deposits that have been made,
* with the goal of executing the corresponding wire transaction.
*
- * @param cls closure with the `struct AggregationUnit`
+ * @param cls NULL
* @param row_id identifies database entry
* @param merchant_pub public key of the merchant
* @param coin_pub public key of the coin
* @param amount_with_fee amount that was deposited including fee
- * @param deposit_fee amount the mint gets to keep as transaction fees
+ * @param deposit_fee amount the exchange gets to keep as transaction fees
* @param transaction_id unique transaction ID chosen by the merchant
* @param h_contract hash of the contract between merchant and customer
* @param wire_deadline by which the merchant adviced that he would like the
@@ -261,8 +333,6 @@ deposit_cb (void *cls,
struct GNUNET_TIME_Absolute wire_deadline,
const json_t *wire)
{
- struct AggregationUnit *au = cls;
-
au->merchant_pub = *merchant_pub;
if (GNUNET_OK !=
TALER_amount_subtract (&au->total_amount,
@@ -270,19 +340,22 @@ deposit_cb (void *cls,
deposit_fee))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Fatally malformed record at %llu\n",
+ "Fatally malformed record at row %llu\n",
row_id);
return GNUNET_SYSERR;
}
au->row_id = row_id;
au->wire = (json_t *) wire;
au->execution_time = GNUNET_TIME_absolute_get ();
- TALER_hash_json (au->wire,
+ TALER_JSON_hash (au->wire,
&au->h_wire);
json_incref (au->wire);
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
&au->wtid,
sizeof (au->wtid));
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Starting aggregation under WTID %s\n",
+ TALER_B2S (&au->wtid));
if (GNUNET_OK !=
db_plugin->insert_aggregation_tracking (db_plugin->cls,
au->session,
@@ -312,17 +385,16 @@ deposit_cb (void *cls,
}
-
/**
* Function called with details about another deposit we
* can aggregate into an existing aggregation unit.
*
- * @param cls closure with the `struct AggregationUnit`
+ * @param cls NULL
* @param row_id identifies database entry
* @param merchant_pub public key of the merchant
* @param coin_pub public key of the coin
* @param amount_with_fee amount that was deposited including fee
- * @param deposit_fee amount the mint gets to keep as transaction fees
+ * @param deposit_fee amount the exchange gets to keep as transaction fees
* @param transaction_id unique transaction ID chosen by the merchant
* @param h_contract hash of the contract between merchant and customer
* @param wire_deadline by which the merchant adviced that he would like the
@@ -342,7 +414,6 @@ aggregate_cb (void *cls,
struct GNUNET_TIME_Absolute wire_deadline,
const json_t *wire)
{
- struct AggregationUnit *au = cls;
struct TALER_Amount delta;
GNUNET_break (0 ==
@@ -431,27 +502,28 @@ prepare_cb (void *cls,
* Main work function that queries the DB and aggregates transactions
* into larger wire transfers.
*
- * @param cls pointer to an `int` which we will return from main()
- * @param tc scheduler context
+ * @param cls NULL
*/
static void
-run_aggregation (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run_aggregation (void *cls)
{
- int *global_ret = cls;
- struct TALER_MINTDB_Session *session;
- struct AggregationUnit *au;
+ struct TALER_EXCHANGEDB_Session *session;
unsigned int i;
int ret;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Checking for ready deposits to aggregate\n");
if (NULL == (session = db_plugin->get_session (db_plugin->cls,
- GNUNET_NO)))
+ test_mode)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to obtain database session!\n");
- *global_ret = GNUNET_SYSERR;
+ global_ret = GNUNET_SYSERR;
return;
}
if (GNUNET_OK !=
@@ -460,7 +532,7 @@ run_aggregation (void *cls,
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to start database transaction!\n");
- *global_ret = GNUNET_SYSERR;
+ global_ret = GNUNET_SYSERR;
return;
}
au = GNUNET_new (struct AggregationUnit);
@@ -471,23 +543,39 @@ run_aggregation (void *cls,
au);
if (GNUNET_OK != ret)
{
+ if (NULL != au->wire)
+ json_decref (au->wire);
GNUNET_free (au);
+ au = NULL;
db_plugin->rollback (db_plugin->cls,
session);
if (0 != ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to execute deposit iteration!\n");
- *global_ret = GNUNET_SYSERR;
+ global_ret = GNUNET_SYSERR;
return;
}
- /* nothing to do, sleep for a minute and try again */
- task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
- &run_aggregation,
- global_ret);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "No more ready deposits, going to sleep\n");
+ if (GNUNET_YES == test_mode)
+ {
+ /* in test mode, shutdown if we end up being idle */
+ GNUNET_SCHEDULER_shutdown ();
+ }
+ else
+ {
+ /* nothing to do, sleep for a minute and try again */
+ task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
+ &run_aggregation,
+ NULL);
+ }
return;
}
/* Now try to find other deposits to aggregate */
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Found ready deposit for %s, aggregating\n",
+ TALER_B2S (&au->merchant_pub));
ret = db_plugin->iterate_matching_deposits (db_plugin->cls,
session,
&au->h_wire,
@@ -501,10 +589,13 @@ run_aggregation (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to execute deposit iteration!\n");
GNUNET_free_non_null (au->additional_rows);
+ if (NULL != au->wire)
+ json_decref (au->wire);
GNUNET_free (au);
+ au = NULL;
db_plugin->rollback (db_plugin->cls,
session);
- *global_ret = GNUNET_SYSERR;
+ global_ret = GNUNET_SYSERR;
return;
}
/* Round to the unit supported by the wire transfer method */
@@ -515,6 +606,8 @@ run_aggregation (void *cls,
if ( (0 == au->total_amount.value) &&
(0 == au->total_amount.fraction) )
{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Aggregate value too low for transfer\n");
/* Rollback ongoing transaction, as we will not use the respective
WTID and thus need to remove the tracking data */
db_plugin->rollback (db_plugin->cls,
@@ -527,9 +620,12 @@ run_aggregation (void *cls,
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to start database transaction!\n");
- *global_ret = GNUNET_SYSERR;
+ global_ret = GNUNET_SYSERR;
GNUNET_free_non_null (au->additional_rows);
+ if (NULL != au->wire)
+ json_decref (au->wire);
GNUNET_free (au);
+ au = NULL;
return;
}
/* Mark transactions by row_id as minor */
@@ -555,32 +651,43 @@ run_aggregation (void *cls,
"Failed to commit database transaction!\n");
}
GNUNET_free_non_null (au->additional_rows);
+ if (NULL != au->wire)
+ json_decref (au->wire);
GNUNET_free (au);
+ au = NULL;
/* start again */
task = GNUNET_SCHEDULER_add_now (&run_aggregation,
- global_ret);
+ NULL);
return;
}
- au->global_ret = global_ret;
+ {
+ char *amount_s;
+
+ amount_s = TALER_amount_to_string (&au->total_amount);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Preparing wire transfer of %s to %s\n",
+ amount_s,
+ TALER_B2S (&au->merchant_pub));
+ }
au->ph = wire_plugin->prepare_wire_transfer (wire_plugin->cls,
au->wire,
&au->total_amount,
&au->wtid,
&prepare_cb,
au);
- /* FIXME: currently we have no clean-up plan on
- shutdown to call prepare_wire_transfer_cancel!
- Maybe make 'au' global? */
if (NULL == au->ph)
{
GNUNET_break (0); /* why? how to best recover? */
db_plugin->rollback (db_plugin->cls,
session);
GNUNET_free_non_null (au->additional_rows);
+ if (NULL != au->wire)
+ json_decref (au->wire);
+ au = NULL;
GNUNET_free (au);
/* start again */
task = GNUNET_SCHEDULER_add_now (&run_aggregation,
- global_ret);
+ NULL);
return;
}
/* otherwise we continue with #prepare_cb(), see below */
@@ -592,17 +699,15 @@ run_aggregation (void *cls,
* do.
*
* @param cls pointer to an `int` which we will return from main()
- * @param tc scheduler context
*/
static void
-run_transfers (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+run_transfers (void *cls);
/**
* Function to be called with the prepared transfer data.
*
- * @param cls closure with the `struct AggregationUnit`
+ * @param cls NULL
* @param buf transaction data to persist, NULL on error
* @param buf_size number of bytes in @a buf, 0 on error
*/
@@ -611,12 +716,13 @@ prepare_cb (void *cls,
const char *buf,
size_t buf_size)
{
- struct AggregationUnit *au = cls;
- int *global_ret = au->global_ret;
- struct TALER_MINTDB_Session *session = au->session;
+ struct TALER_EXCHANGEDB_Session *session = au->session;
GNUNET_free_non_null (au->additional_rows);
+ if (NULL != au->wire)
+ json_decref (au->wire);
GNUNET_free (au);
+ au = NULL;
if (NULL == buf)
{
GNUNET_break (0); /* why? how to best recover? */
@@ -624,7 +730,7 @@ prepare_cb (void *cls,
session);
/* start again */
task = GNUNET_SCHEDULER_add_now (&run_aggregation,
- global_ret);
+ NULL);
return;
}
@@ -632,7 +738,7 @@ prepare_cb (void *cls,
if (GNUNET_OK !=
db_plugin->wire_prepare_data_insert (db_plugin->cls,
session,
- mint_wireformat,
+ exchange_wireformat,
buf,
buf_size))
{
@@ -641,7 +747,7 @@ prepare_cb (void *cls,
session);
/* start again */
task = GNUNET_SCHEDULER_add_now (&run_aggregation,
- global_ret);
+ NULL);
return;
}
@@ -655,50 +761,21 @@ prepare_cb (void *cls,
"Failed to commit database transaction!\n");
/* try again */
task = GNUNET_SCHEDULER_add_now (&run_aggregation,
- global_ret);
+ NULL);
return;
}
-
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Preparation complete, switching to transfer mode\n");
/* run alternative task: actually do wire transfer! */
task = GNUNET_SCHEDULER_add_now (&run_transfers,
- &global_ret);
+ NULL);
}
-/**
- * Data we keep to #run_transfers().
- */
-struct WirePrepareData
-{
-
- /**
- * Database session for all of our transactions.
- */
- struct TALER_MINTDB_Session *session;
-
- /**
- * Wire execution handle.
- */
- struct TALER_WIRE_ExecuteHandle *eh;
-
- /**
- * Pointer to global return value. Closure for #run().
- */
- int *global_ret;
-
-
- /**
- * Row ID of the transfer.
- */
- unsigned long long row_id;
-
-};
-
-
/**
* Function called with the result from the execute step.
*
- * @param cls closure with the `struct WirePrepareData`
+ * @param cls NULL
* @param success #GNUNET_OK on success, #GNUNET_SYSERR on failure
* @param emsg NULL on success, otherwise an error message
*/
@@ -707,9 +784,7 @@ wire_confirm_cb (void *cls,
int success,
const char *emsg)
{
- struct WirePrepareData *wpd = cls;
- int *global_ret = wpd->global_ret;
- struct TALER_MINTDB_Session *session = wpd->session;
+ struct TALER_EXCHANGEDB_Session *session = wpd->session;
wpd->eh = NULL;
if (GNUNET_SYSERR == success)
@@ -719,8 +794,9 @@ wire_confirm_cb (void *cls,
emsg);
db_plugin->rollback (db_plugin->cls,
session);
- *global_ret = GNUNET_SYSERR;
+ global_ret = GNUNET_SYSERR;
GNUNET_free (wpd);
+ wpd = NULL;
return;
}
if (GNUNET_OK !=
@@ -731,11 +807,13 @@ wire_confirm_cb (void *cls,
GNUNET_break (0); /* why!? */
db_plugin->rollback (db_plugin->cls,
session);
- *global_ret = GNUNET_SYSERR;
+ global_ret = GNUNET_SYSERR;
GNUNET_free (wpd);
+ wpd = NULL;
return;
}
GNUNET_free (wpd);
+ wpd = NULL;
if (GNUNET_OK !=
db_plugin->commit (db_plugin->cls,
session))
@@ -744,13 +822,15 @@ wire_confirm_cb (void *cls,
"Failed to commit database transaction!\n");
/* try again */
task = GNUNET_SCHEDULER_add_now (&run_aggregation,
- global_ret);
+ NULL);
return;
}
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Wire transfer complete\n");
/* continue with #run_transfers(), just to guard
against the unlikely case that there are more. */
task = GNUNET_SCHEDULER_add_now (&run_transfers,
- &global_ret);
+ NULL);
}
@@ -758,7 +838,7 @@ wire_confirm_cb (void *cls,
/**
* Callback with data about a prepared transaction.
*
- * @param cls closure with the `struct WirePrepareData`
+ * @param cls NULL
* @param rowid row identifier used to mark prepared transaction as done
* @param buf transaction data that was persisted, NULL on error
* @param buf_size number of bytes in @a buf, 0 on error
@@ -769,25 +849,23 @@ wire_prepare_cb (void *cls,
const char *buf,
size_t buf_size)
{
- struct WirePrepareData *wpd = cls;
- int *global_ret = wpd->global_ret;
-
wpd->row_id = rowid;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Starting wire transfer %llu\n",
+ rowid);
wpd->eh = wire_plugin->execute_wire_transfer (wire_plugin->cls,
buf,
buf_size,
&wire_confirm_cb,
- wpd);
- /* FIXME: currently we have no clean-up plan on
- shutdown to call execute_wire_transfer_cancel!
- Maybe make 'wpd' global? */
+ NULL);
if (NULL == wpd->eh)
{
GNUNET_break (0); /* why? how to best recover? */
db_plugin->rollback (db_plugin->cls,
wpd->session);
- *global_ret = GNUNET_SYSERR;
+ global_ret = GNUNET_SYSERR;
GNUNET_free (wpd);
+ wpd = NULL;
return;
}
}
@@ -797,26 +875,28 @@ wire_prepare_cb (void *cls,
* Execute the wire transfers that we have committed to
* do.
*
- * @param cls pointer to an `int` which we will return from main()
+ * @param cls NULL
* @param tc scheduler context
*/
static void
-run_transfers (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run_transfers (void *cls)
{
- int *global_ret = cls;
int ret;
- struct WirePrepareData *wpd;
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ task = NULL;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Checking for pending wire transfers\n");
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
if (NULL == (session = db_plugin->get_session (db_plugin->cls,
- GNUNET_NO)))
+ test_mode)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to obtain database session!\n");
- *global_ret = GNUNET_SYSERR;
+ global_ret = GNUNET_SYSERR;
return;
}
if (GNUNET_OK !=
@@ -825,34 +905,37 @@ run_transfers (void *cls,
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to start database transaction!\n");
- *global_ret = GNUNET_SYSERR;
+ global_ret = GNUNET_SYSERR;
return;
}
wpd = GNUNET_new (struct WirePrepareData);
wpd->session = session;
- wpd->global_ret = global_ret;
ret = db_plugin->wire_prepare_data_get (db_plugin->cls,
session,
- mint_wireformat,
+ exchange_wireformat,
&wire_prepare_cb,
- wpd);
+ NULL);
if (GNUNET_SYSERR == ret)
{
GNUNET_break (0); /* why? how to best recover? */
db_plugin->rollback (db_plugin->cls,
session);
- *global_ret = GNUNET_SYSERR;
+ global_ret = GNUNET_SYSERR;
GNUNET_free (wpd);
+ wpd = NULL;
return;
}
if (GNUNET_NO == ret)
{
/* no more prepared wire transfers, go back to aggregation! */
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "No more pending wire transfers, starting aggregation\n");
db_plugin->rollback (db_plugin->cls,
session);
task = GNUNET_SCHEDULER_add_now (&run_aggregation,
- global_ret);
+ NULL);
GNUNET_free (wpd);
+ wpd = NULL;
return;
}
/* otherwise, continues in #wire_prepare_cb() */
@@ -860,7 +943,37 @@ run_transfers (void *cls,
/**
- * The main function of the taler-mint-httpd server ("the mint").
+ * First task.
+ *
+ * @param cls closure, NULL
+ * @param args remaining command-line arguments
+ * @param cfgfile name of the configuration file used (for saving, can be NULL!)
+ * @param c configuration
+ */
+static void
+run (void *cls,
+ char *const *args,
+ const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *c)
+{
+ cfg = GNUNET_CONFIGURATION_dup (c);
+ if (GNUNET_OK != exchange_serve_process_config ())
+ {
+ GNUNET_CONFIGURATION_destroy (cfg);
+ cfg = NULL;
+ global_ret = 1;
+ return;
+ }
+ task = GNUNET_SCHEDULER_add_now (&run_transfers,
+ NULL);
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &shutdown_task,
+ cls);
+}
+
+
+/**
+ * The main function of the taler-exchange-httpd server ("the exchange").
*
* @param argc number of arguments from the command line
* @param argv command line arguments
@@ -871,44 +984,27 @@ main (int argc,
char *const *argv)
{
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'d', "mint-dir", "DIR",
- "mint directory with configuration and keys for operating the mint", 1,
- &GNUNET_GETOPT_set_filename, &mint_directory},
{'f', "format", "WIREFORMAT",
- "wireformat to use, overrides WIREFORMAT option in [mint] section", 1,
- &GNUNET_GETOPT_set_filename, &mint_wireformat},
- TALER_GETOPT_OPTION_HELP ("background process that aggregates and executes wire transfers to merchants"),
+ "wireformat to use, overrides WIREFORMAT option in [exchange] section", 1,
+ &GNUNET_GETOPT_set_filename, &exchange_wireformat},
+ {'t', "test", NULL,
+ "run in test mode with temporary tables", 0,
+ &GNUNET_GETOPT_set_one, &test_mode},
GNUNET_GETOPT_OPTION_VERSION (VERSION "-" VCS_VERSION),
GNUNET_GETOPT_OPTION_END
};
- int ret = GNUNET_OK;
- GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-mint-aggregator",
- "INFO",
- NULL));
- if (0 >=
- GNUNET_GETOPT_run ("taler-mint-aggregator",
- options,
- argc, argv))
- return 1;
- if (NULL == mint_directory)
- {
- fprintf (stderr,
- "Mint directory not specified\n");
- return 1;
- }
+ if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
+ return 2;
if (GNUNET_OK !=
- mint_serve_process_config (mint_directory))
- {
+ GNUNET_PROGRAM_run (argc, argv,
+ "taler-exchange-aggregator",
+ gettext_noop ("background process that aggregates and executes wire transfers to merchants"),
+ options,
+ &run, NULL))
return 1;
- }
-
- GNUNET_SCHEDULER_run (&run_transfers, &ret);
-
- TALER_MINTDB_plugin_unload (db_plugin);
- TALER_WIRE_plugin_unload (wire_plugin);
- return (GNUNET_SYSERR == ret) ? 1 : 0;
+ return global_ret;
}
-/* end of taler-mint-aggregator.c */
+/* end of taler-exchange-aggregator.c */
diff --git a/src/mint/taler-mint-httpd.c b/src/exchange/taler-exchange-httpd.c
similarity index 86%
rename from src/mint/taler-mint-httpd.c
rename to src/exchange/taler-exchange-httpd.c
index 5d6aa0589..a8e9b3b08 100644
--- a/src/mint/taler-mint-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
+ Copyright (C) 2014, 2015, 2016 Inria and GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
@@ -15,8 +15,8 @@
*/
/**
- * @file taler-mint-httpd.c
- * @brief Serve the HTTP interface of the mint
+ * @file taler-exchange-httpd.c
+ * @brief Serve the HTTP interface of the exchange
* @author Florian Dold
* @author Benedikt Mueller
* @author Christian Grothoff
@@ -26,51 +26,51 @@
#include
#include
#include
-#include "taler-mint-httpd_parsing.h"
-#include "taler-mint-httpd_mhd.h"
-#include "taler-mint-httpd_admin.h"
-#include "taler-mint-httpd_deposit.h"
-#include "taler-mint-httpd_reserve.h"
-#include "taler-mint-httpd_wire.h"
-#include "taler-mint-httpd_refresh.h"
-#include "taler-mint-httpd_tracking.h"
-#include "taler-mint-httpd_keystate.h"
+#include "taler-exchange-httpd_parsing.h"
+#include "taler-exchange-httpd_mhd.h"
+#include "taler-exchange-httpd_admin.h"
+#include "taler-exchange-httpd_deposit.h"
+#include "taler-exchange-httpd_reserve.h"
+#include "taler-exchange-httpd_wire.h"
+#include "taler-exchange-httpd_refresh.h"
+#include "taler-exchange-httpd_tracking.h"
+#include "taler-exchange-httpd_keystate.h"
#if HAVE_DEVELOPER
-#include "taler-mint-httpd_test.h"
+#include "taler-exchange-httpd_test.h"
#endif
-#include "taler_mintdb_plugin.h"
-#include "taler-mint-httpd_validation.h"
+#include "taler_exchangedb_plugin.h"
+#include "taler-exchange-httpd_validation.h"
/**
- * Which currency is used by this mint?
+ * Which currency is used by this exchange?
*/
-char *TMH_mint_currency_string;
+char *TMH_exchange_currency_string;
/**
* Should we return "Connection: close" in each response?
*/
-int TMH_mint_connection_close;
+int TMH_exchange_connection_close;
/**
- * Base directory of the mint (global)
+ * Base directory of the exchange (global)
*/
-char *TMH_mint_directory;
+char *TMH_exchange_directory;
/**
- * The mint's configuration (global)
+ * The exchange's configuration (global)
*/
struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Master public key (according to the
- * configuration in the mint directory).
+ * configuration in the exchange directory).
*/
-struct GNUNET_CRYPTO_EddsaPublicKey TMH_master_public_key;
+struct TALER_MasterPublicKeyP TMH_master_public_key;
/**
* Our DB plugin.
*/
-struct TALER_MINTDB_Plugin *TMH_plugin;
+struct TALER_EXCHANGEDB_Plugin *TMH_plugin;
/**
* Are we running in test mode?
@@ -121,7 +121,7 @@ handle_mhd_completion_callback (void *cls,
/**
- * Handle a request coming from libmicrohttpd.
+ * Handle incoming HTTP request.
*
* @param cls closure for MHD daemon (unused)
* @param connection the connection
@@ -147,7 +147,7 @@ handle_mhd_request (void *cls,
{
/* Landing page, tell humans to go away. */
{ "/", MHD_HTTP_METHOD_GET, "text/plain",
- "Hello, I'm the Taler mint. This HTTP server is not for humans.\n", 0,
+ "Hello, I'm the Taler exchange. This HTTP server is not for humans.\n", 0,
&TMH_MHD_handler_static_response, MHD_HTTP_OK },
/* /robots.txt: disallow everything */
{ "/robots.txt", MHD_HTTP_METHOD_GET, "text/plain",
@@ -161,7 +161,7 @@ handle_mhd_request (void *cls,
NULL, 0,
&TMH_MHD_handler_agpl_redirect, MHD_HTTP_FOUND },
- /* Return key material and fundamental properties for this mint */
+ /* Return key material and fundamental properties for this exchange */
{ "/keys", MHD_HTTP_METHOD_GET, "application/json",
NULL, 0,
&TMH_KS_handler_keys, MHD_HTTP_OK },
@@ -177,20 +177,6 @@ handle_mhd_request (void *cls,
"Only GET is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
- { "/wire/test", MHD_HTTP_METHOD_GET, "application/json",
- NULL, 0,
- &TMH_WIRE_handler_wire_test, MHD_HTTP_FOUND },
- { "/wire/test", NULL, "text/plain",
- "Only GET is allowed", 0,
- &TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
-
- { "/wire/sepa", MHD_HTTP_METHOD_GET, "application/json",
- NULL, 0,
- &TMH_WIRE_handler_wire_sepa, MHD_HTTP_OK },
- { "/wire/sepa", NULL, "text/plain",
- "Only GET is allowed", 0,
- &TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
-
/* Withdrawing coins / interaction with reserves */
{ "/reserve/status", MHD_HTTP_METHOD_GET, "application/json",
NULL, 0,
@@ -367,41 +353,45 @@ handle_mhd_request (void *cls,
/**
- * Load configuration parameters for the mint
+ * Load configuration parameters for the exchange
* server into the corresponding global variables.
*
- * @param mint_directory the mint's directory
+ * @param exchange_directory the exchange's directory
* @return #GNUNET_OK on success
*/
static int
-mint_serve_process_config (const char *mint_directory)
+exchange_serve_process_config ()
{
unsigned long long port;
char *TMH_master_public_key_str;
- cfg = TALER_config_load (mint_directory);
- if (NULL == cfg)
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ "exchange",
+ "KEYDIR",
+ &TMH_exchange_directory))
{
- fprintf (stderr,
- "Failed to load mint configuration\n");
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "KEYDIR");
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint",
+ "exchange",
"currency",
- &TMH_mint_currency_string))
+ &TMH_exchange_currency_string))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint",
+ "exchange",
"currency");
return GNUNET_SYSERR;
}
- if (strlen (TMH_mint_currency_string) >= TALER_CURRENCY_LEN)
+ if (strlen (TMH_exchange_currency_string) >= TALER_CURRENCY_LEN)
{
fprintf (stderr,
"Currency `%s' longer than the allowed limit of %u characters.",
- TMH_mint_currency_string,
+ TMH_exchange_currency_string,
(unsigned int) TALER_CURRENCY_LEN);
return GNUNET_SYSERR;
}
@@ -411,12 +401,12 @@ mint_serve_process_config (const char *mint_directory)
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint",
+ "exchange",
"master_public_key",
&TMH_master_public_key_str))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint",
+ "exchange",
"master_public_key");
TMH_VALIDATION_done ();
return GNUNET_SYSERR;
@@ -424,10 +414,10 @@ mint_serve_process_config (const char *mint_directory)
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_public_key_from_string (TMH_master_public_key_str,
strlen (TMH_master_public_key_str),
- &TMH_master_public_key))
+ &TMH_master_public_key.eddsa_pub))
{
fprintf (stderr,
- "Invalid master public key given in mint configuration.");
+ "Invalid master public key given in exchange configuration.");
GNUNET_free (TMH_master_public_key_str);
TMH_VALIDATION_done ();
return GNUNET_SYSERR;
@@ -435,7 +425,7 @@ mint_serve_process_config (const char *mint_directory)
GNUNET_free (TMH_master_public_key_str);
if (NULL ==
- (TMH_plugin = TALER_MINTDB_plugin_load (cfg)))
+ (TMH_plugin = TALER_EXCHANGEDB_plugin_load (cfg)))
{
fprintf (stderr,
"Failed to initialize DB subsystem\n");
@@ -444,7 +434,7 @@ mint_serve_process_config (const char *mint_directory)
}
if (GNUNET_YES ==
GNUNET_CONFIGURATION_get_value_yesno (cfg,
- "mint",
+ "exchange",
"TESTRUN"))
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -456,12 +446,12 @@ mint_serve_process_config (const char *mint_directory)
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_number (cfg,
- "mint",
+ "exchange",
"port",
&port))
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "mint",
+ "exchange",
"port",
"port number required");
TMH_VALIDATION_done ();
@@ -619,7 +609,7 @@ handle_mhd_logs (void *cls,
/**
- * The main function of the taler-mint-httpd server ("the mint").
+ * The main function of the taler-exchange-httpd server ("the exchange").
*
* @param argc number of arguments from the command line
* @param argv command line arguments
@@ -629,13 +619,12 @@ int
main (int argc,
char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+ char *cfgfile = NULL;
+ const struct GNUNET_GETOPT_CommandLineOption options[] = {
{'C', "connection-close", NULL,
"force HTTP connections to be closed after each request", 0,
- &GNUNET_GETOPT_set_one, &TMH_mint_connection_close},
- {'d', "mint-dir", "DIR",
- "mint directory with configuration and keys for operating the mint", 1,
- &GNUNET_GETOPT_set_filename, &TMH_mint_directory},
+ &GNUNET_GETOPT_set_one, &TMH_exchange_connection_close},
+ GNUNET_GETOPT_OPTION_CFG_FILE (&cfgfile),
{'t', "timeout", "SECONDS",
"after how long do connections timeout by default (in seconds)", 1,
&GNUNET_GETOPT_set_uint, &connection_timeout},
@@ -644,30 +633,33 @@ main (int argc,
"run in test-mode using FILENAME as the HTTP request to process", 1,
&GNUNET_GETOPT_set_filename, &input_filename},
#endif
- TALER_GETOPT_OPTION_HELP ("HTTP server providing a RESTful API to access a Taler mint"),
+ GNUNET_GETOPT_OPTION_HELP ("HTTP server providing a RESTful API to access a Taler exchange"),
GNUNET_GETOPT_OPTION_VERSION (VERSION "-" VCS_VERSION),
GNUNET_GETOPT_OPTION_END
};
int ret;
GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-mint-httpd",
+ GNUNET_log_setup ("taler-exchange-httpd",
"INFO",
NULL));
if (0 >=
- GNUNET_GETOPT_run ("taler-mint-httpd",
+ GNUNET_GETOPT_run ("taler-exchange-httpd",
options,
argc, argv))
return 1;
- if (NULL == TMH_mint_directory)
+ cfg = GNUNET_CONFIGURATION_create ();
+ if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, cfgfile))
{
- fprintf (stderr,
- "Mint directory not specified\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Malformed configuration file `%s', exit ...\n"),
+ cfgfile);
+ GNUNET_free_non_null (cfgfile);
return 1;
}
-
+ GNUNET_free_non_null (cfgfile);
if (GNUNET_OK !=
- mint_serve_process_config (TMH_mint_directory))
+ exchange_serve_process_config ())
return 1;
mydaemon = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
@@ -731,7 +723,7 @@ main (int argc,
if (GNUNET_YES == TMH_test_mode)
{
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
session = TMH_plugin->get_session (TMH_plugin->cls,
GNUNET_YES);
@@ -741,9 +733,9 @@ main (int argc,
TMH_plugin->drop_temporary (TMH_plugin->cls,
session);
}
- TALER_MINTDB_plugin_unload (TMH_plugin);
+ TALER_EXCHANGEDB_plugin_unload (TMH_plugin);
TMH_VALIDATION_done ();
return (GNUNET_SYSERR == ret) ? 1 : 0;
}
-/* end of taler-mint-httpd.c */
+/* end of taler-exchange-httpd.c */
diff --git a/src/mint/taler-mint-httpd.h b/src/exchange/taler-exchange-httpd.h
similarity index 78%
rename from src/mint/taler-mint-httpd.h
rename to src/exchange/taler-exchange-httpd.h
index d45325aa6..236df9e19 100644
--- a/src/mint/taler-mint-httpd.h
+++ b/src/exchange/taler-exchange-httpd.h
@@ -14,32 +14,32 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd.h
- * @brief Global declarations for the mint
+ * @file taler-exchange-httpd.h
+ * @brief Global declarations for the exchange
* @author Florian Dold
* @author Benedikt Mueller
* @author Christian Grothoff
*
* FIXME: Consider which of these need to really be globals...
*/
-#ifndef TALER_MINT_HTTPD_H
-#define TALER_MINT_HTTPD_H
+#ifndef TALER_EXCHANGE_HTTPD_H
+#define TALER_EXCHANGE_HTTPD_H
#include
/**
- * Which currency is used by this mint?
+ * Which currency is used by this exchange?
*/
-extern char *TMH_mint_currency_string;
+extern char *TMH_exchange_currency_string;
/**
* Should we return "Connection: close" in each response?
*/
-extern int TMH_mint_connection_close;
+extern int TMH_exchange_connection_close;
/**
- * The mint's configuration.
+ * The exchange's configuration.
*/
extern struct GNUNET_CONFIGURATION_Handle *cfg;
@@ -49,25 +49,25 @@ extern struct GNUNET_CONFIGURATION_Handle *cfg;
extern int TMH_test_mode;
/**
- * Main directory with mint data.
+ * Main directory with exchange data.
*/
-extern char *TMH_mint_directory;
+extern char *TMH_exchange_directory;
/**
* Master public key (according to the
- * configuration in the mint directory).
+ * configuration in the exchange directory).
*/
-extern struct GNUNET_CRYPTO_EddsaPublicKey TMH_master_public_key;
+extern struct TALER_MasterPublicKeyP TMH_master_public_key;
/**
- * Private key of the mint we use to sign messages.
+ * Private key of the exchange we use to sign messages.
*/
-extern struct GNUNET_CRYPTO_EddsaPrivateKey TMH_mint_private_signing_key;
+extern struct GNUNET_CRYPTO_EddsaPrivateKey TMH_exchange_private_signing_key;
/**
* Our DB plugin.
*/
-extern struct TALER_MINTDB_Plugin *TMH_plugin;
+extern struct TALER_EXCHANGEDB_Plugin *TMH_plugin;
/**
diff --git a/src/mint/taler-mint-httpd_admin.c b/src/exchange/taler-exchange-httpd_admin.c
similarity index 87%
rename from src/mint/taler-mint-httpd_admin.c
rename to src/exchange/taler-exchange-httpd_admin.c
index e6f186f0b..29da2d441 100644
--- a/src/mint/taler-mint-httpd_admin.c
+++ b/src/exchange/taler-exchange-httpd_admin.c
@@ -14,17 +14,17 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_admin.c
+ * @file taler-exchange-httpd_admin.c
* @brief Handle /admin/ requests
* @author Christian Grothoff
*/
#include "platform.h"
#include
#include
-#include "taler-mint-httpd_admin.h"
-#include "taler-mint-httpd_parsing.h"
-#include "taler-mint-httpd_responses.h"
-#include "taler-mint-httpd_validation.h"
+#include "taler-exchange-httpd_admin.h"
+#include "taler-exchange-httpd_parsing.h"
+#include "taler-exchange-httpd_responses.h"
+#include "taler-exchange-httpd_validation.h"
/**
@@ -113,12 +113,12 @@ TMH_ADMIN_handler_admin_add_incoming (struct TMH_RequestHandler *rh,
struct GNUNET_TIME_Absolute at;
json_t *wire;
json_t *root;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_fixed ("reserve_pub", &reserve_pub),
- TMH_PARSE_member_amount ("amount", &amount),
- TMH_PARSE_member_time_abs ("execution_date", &at),
- TMH_PARSE_member_object ("wire", &wire),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("reserve_pub", &reserve_pub),
+ TALER_JSON_spec_amount ("amount", &amount),
+ GNUNET_JSON_spec_absolute_time ("execution_date", &at),
+ GNUNET_JSON_spec_json ("wire", &wire),
+ GNUNET_JSON_spec_end ()
};
int res;
@@ -145,10 +145,11 @@ TMH_ADMIN_handler_admin_add_incoming (struct TMH_RequestHandler *rh,
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
}
if (GNUNET_YES !=
- TMH_json_validate_wireformat (wire))
+ TMH_json_validate_wireformat (wire,
+ GNUNET_NO))
{
GNUNET_break_op (0);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_unknown (connection,
"wire");
}
@@ -157,8 +158,8 @@ TMH_ADMIN_handler_admin_add_incoming (struct TMH_RequestHandler *rh,
&amount,
at,
wire);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return res;
}
-/* end of taler-mint-httpd_admin.c */
+/* end of taler-exchange-httpd_admin.c */
diff --git a/src/mint/taler-mint-httpd_admin.h b/src/exchange/taler-exchange-httpd_admin.h
similarity index 91%
rename from src/mint/taler-mint-httpd_admin.h
rename to src/exchange/taler-exchange-httpd_admin.h
index b8ca3ce59..d720d61d3 100644
--- a/src/mint/taler-mint-httpd_admin.h
+++ b/src/exchange/taler-exchange-httpd_admin.h
@@ -14,15 +14,15 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_admin.h
+ * @file taler-exchange-httpd_admin.h
* @brief Handle /admin/ requests
* @author Christian Grothoff
*/
-#ifndef TALER_MINT_HTTPD_ADMIN_H
-#define TALER_MINT_HTTPD_ADMIN_H
+#ifndef TALER_EXCHANGE_HTTPD_ADMIN_H
+#define TALER_EXCHANGE_HTTPD_ADMIN_H
#include
-#include "taler-mint-httpd.h"
+#include "taler-exchange-httpd.h"
/**
* Handle a "/admin/add/incoming" request. Parses the
diff --git a/src/mint/taler-mint-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c
similarity index 91%
rename from src/mint/taler-mint-httpd_db.c
rename to src/exchange/taler-exchange-httpd_db.c
index cff24bdc8..1e392c584 100644
--- a/src/mint/taler-mint-httpd_db.c
+++ b/src/exchange/taler-exchange-httpd_db.c
@@ -14,15 +14,17 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_db.c
- * @brief High-level (transactional-layer) database operations for the mint.
+ * @file taler-exchange-httpd_db.c
+ * @brief High-level (transactional-layer) database operations for the exchange.
* @author Christian Grothoff
*/
#include "platform.h"
#include
#include
-#include "taler-mint-httpd_responses.h"
-#include "taler-mint-httpd_keystate.h"
+#include
+#include "taler_json_lib.h"
+#include "taler-exchange-httpd_responses.h"
+#include "taler-exchange-httpd_keystate.h"
/**
* How often should we retry a transaction before giving up
@@ -97,18 +99,18 @@ transaction_start_label: /* we will use goto for retries */ \
* @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
*/
static int
-calculate_transaction_list_totals (struct TALER_MINTDB_TransactionList *tl,
+calculate_transaction_list_totals (struct TALER_EXCHANGEDB_TransactionList *tl,
const struct TALER_Amount *off,
struct TALER_Amount *ret)
{
struct TALER_Amount spent = *off;
- struct TALER_MINTDB_TransactionList *pos;
+ struct TALER_EXCHANGEDB_TransactionList *pos;
for (pos = tl; NULL != pos; pos = pos->next)
{
switch (pos->type)
{
- case TALER_MINTDB_TT_DEPOSIT:
+ case TALER_EXCHANGEDB_TT_DEPOSIT:
if (GNUNET_OK !=
TALER_amount_add (&spent,
&spent,
@@ -118,7 +120,7 @@ calculate_transaction_list_totals (struct TALER_MINTDB_TransactionList *tl,
return GNUNET_SYSERR;
}
break;
- case TALER_MINTDB_TT_REFRESH_MELT:
+ case TALER_EXCHANGEDB_TT_REFRESH_MELT:
if (GNUNET_OK !=
TALER_amount_add (&spent,
&spent,
@@ -147,15 +149,15 @@ calculate_transaction_list_totals (struct TALER_MINTDB_TransactionList *tl,
*/
int
TMH_DB_execute_deposit (struct MHD_Connection *connection,
- const struct TALER_MINTDB_Deposit *deposit)
+ const struct TALER_EXCHANGEDB_Deposit *deposit)
{
- struct TALER_MINTDB_Session *session;
- struct TALER_MINTDB_TransactionList *tl;
+ struct TALER_EXCHANGEDB_Session *session;
+ struct TALER_EXCHANGEDB_TransactionList *tl;
struct TALER_Amount spent;
struct TALER_Amount value;
struct TALER_Amount amount_without_fee;
struct TMH_KS_StateHandle *mks;
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
int ret;
if (NULL == (session = TMH_plugin->get_session (TMH_plugin->cls,
@@ -272,8 +274,8 @@ int
TMH_DB_execute_reserve_status (struct MHD_Connection *connection,
const struct TALER_ReservePublicKeyP *reserve_pub)
{
- struct TALER_MINTDB_Session *session;
- struct TALER_MINTDB_ReserveHistory *rh;
+ struct TALER_EXCHANGEDB_Session *session;
+ struct TALER_EXCHANGEDB_ReserveHistory *rh;
int res;
if (NULL == (session = TMH_plugin->get_session (TMH_plugin->cls,
@@ -318,21 +320,21 @@ TMH_DB_execute_reserve_status (struct MHD_Connection *connection,
*/
static int
execute_reserve_withdraw_transaction (struct MHD_Connection *connection,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
struct TMH_KS_StateHandle *key_state,
const struct TALER_ReservePublicKeyP *reserve,
const struct TALER_DenominationPublicKey *denomination_pub,
- const struct TALER_MINTDB_DenominationKeyIssueInformation *dki,
+ const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki,
const char *blinded_msg,
size_t blinded_msg_len,
const struct GNUNET_HashCode *h_blind,
const struct TALER_ReserveSignatureP *signature,
struct TALER_DenominationSignature *denom_sig)
{
- struct TALER_MINTDB_ReserveHistory *rh;
- const struct TALER_MINTDB_ReserveHistory *pos;
- struct TALER_MINTDB_DenominationKeyIssueInformation *tdki;
- struct TALER_MINTDB_CollectableBlindcoin collectable;
+ struct TALER_EXCHANGEDB_ReserveHistory *rh;
+ const struct TALER_EXCHANGEDB_ReserveHistory *pos;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *tdki;
+ struct TALER_EXCHANGEDB_CollectableBlindcoin collectable;
struct TALER_Amount amount_required;
struct TALER_Amount deposit_total;
struct TALER_Amount withdraw_total;
@@ -376,7 +378,7 @@ execute_reserve_withdraw_transaction (struct MHD_Connection *connection,
{
switch (pos->type)
{
- case TALER_MINTDB_RO_BANK_TO_MINT:
+ case TALER_EXCHANGEDB_RO_BANK_TO_EXCHANGE:
if (0 == (res & 1))
deposit_total = pos->details.bank->amount;
else
@@ -391,7 +393,7 @@ execute_reserve_withdraw_transaction (struct MHD_Connection *connection,
}
res |= 1;
break;
- case TALER_MINTDB_RO_WITHDRAW_COIN:
+ case TALER_EXCHANGEDB_RO_WITHDRAW_COIN:
tdki = TMH_KS_denomination_key_lookup (key_state,
&pos->details.withdraw->denom_pub,
TMH_KS_DKU_WITHDRAW);
@@ -453,9 +455,9 @@ execute_reserve_withdraw_transaction (struct MHD_Connection *connection,
/* Balance is good, sign the coin! */
denom_sig->rsa_signature
- = GNUNET_CRYPTO_rsa_sign (dki->denom_priv.rsa_private_key,
- blinded_msg,
- blinded_msg_len);
+ = GNUNET_CRYPTO_rsa_sign_blinded (dki->denom_priv.rsa_private_key,
+ blinded_msg,
+ blinded_msg_len);
if (NULL == denom_sig->rsa_signature)
{
GNUNET_break (0);
@@ -511,10 +513,10 @@ TMH_DB_execute_reserve_withdraw (struct MHD_Connection *connection,
size_t blinded_msg_len,
const struct TALER_ReserveSignatureP *signature)
{
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
struct TMH_KS_StateHandle *key_state;
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki;
- struct TALER_MINTDB_CollectableBlindcoin collectable;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
+ struct TALER_EXCHANGEDB_CollectableBlindcoin collectable;
struct TALER_DenominationSignature denom_sig;
struct GNUNET_HashCode h_blind;
int res;
@@ -587,7 +589,7 @@ TMH_DB_execute_reserve_withdraw (struct MHD_Connection *connection,
*
* @param connection the connection to send errors to
* @param session the database connection
- * @param key_state the mint's key state
+ * @param key_state the exchange's key state
* @param session_hash hash identifying the refresh session
* @param coin_details details about the coin being melted
* @param oldcoin_index what is the number assigned to this coin
@@ -597,19 +599,19 @@ TMH_DB_execute_reserve_withdraw (struct MHD_Connection *connection,
*/
static int
refresh_accept_melts (struct MHD_Connection *connection,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TMH_KS_StateHandle *key_state,
const struct GNUNET_HashCode *session_hash,
const struct TMH_DB_MeltDetails *coin_details,
uint16_t oldcoin_index)
{
- struct TALER_MINTDB_DenominationKeyIssueInformation *dk;
- struct TALER_MINTDB_DenominationKeyInformationP *dki;
- struct TALER_MINTDB_TransactionList *tl;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dk;
+ struct TALER_EXCHANGEDB_DenominationKeyInformationP *dki;
+ struct TALER_EXCHANGEDB_TransactionList *tl;
struct TALER_Amount coin_value;
struct TALER_Amount coin_residual;
struct TALER_Amount spent;
- struct TALER_MINTDB_RefreshMelt melt;
+ struct TALER_EXCHANGEDB_RefreshMelt melt;
int res;
dk = TMH_KS_denomination_key_lookup (key_state,
@@ -698,10 +700,10 @@ refresh_accept_melts (struct MHD_Connection *connection,
* @param denom_pubs public keys of the coins we want to withdraw in the end
* @param coin_count number of entries in @a coin_melt_details, size of y-dimension of @a commit_link array
* @param coin_melt_details signatures and (residual) value of the respective coin should be melted
- * @param commit_coin 2d array of coin commitments (what the mint is to sign
+ * @param commit_coin 2d array of coin commitments (what the exchange is to sign
* once the "/refres/reveal" of cut and choose is done),
* x-dimension must be #TALER_CNC_KAPPA
- * @param commit_link 2d array of coin link commitments (what the mint is
+ * @param commit_link 2d array of coin link commitments (what the exchange is
* to return via "/refresh/link" to enable linkage in the
* future)
* x-dimension must be #TALER_CNC_KAPPA
@@ -714,12 +716,12 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
const struct TALER_DenominationPublicKey *denom_pubs,
unsigned int coin_count,
const struct TMH_DB_MeltDetails *coin_melt_details,
- struct TALER_MINTDB_RefreshCommitCoin *const* commit_coin,
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *const* commit_coin,
struct TALER_RefreshCommitLinkP *const* commit_link)
{
struct TMH_KS_StateHandle *key_state;
- struct TALER_MINTDB_RefreshSession refresh_session;
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_RefreshSession refresh_session;
+ struct TALER_EXCHANGEDB_Session *session;
int res;
unsigned int i;
@@ -853,13 +855,13 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
*/
static int
send_melt_commitment_error (struct MHD_Connection *connection,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
unsigned int off,
unsigned int index,
const char *object_name)
{
- struct TALER_MINTDB_MeltCommitment *mc;
+ struct TALER_EXCHANGEDB_MeltCommitment *mc;
int ret;
mc = TMH_plugin->get_melt_commitment (TMH_plugin->cls,
@@ -907,12 +909,12 @@ send_melt_commitment_error (struct MHD_Connection *connection,
*/
static int
check_commitment (struct MHD_Connection *connection,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
unsigned int off,
unsigned int num_oldcoins,
const struct TALER_TransferPrivateKeyP *transfer_privs,
- const struct TALER_MINTDB_RefreshMelt *melts,
+ const struct TALER_EXCHANGEDB_RefreshMelt *melts,
unsigned int num_newcoins,
const struct TALER_DenominationPublicKey *denom_pubs)
{
@@ -920,7 +922,7 @@ check_commitment (struct MHD_Connection *connection,
struct TALER_LinkSecretP last_shared_secret;
int secret_initialized = GNUNET_NO;
struct TALER_RefreshCommitLinkP *commit_links;
- struct TALER_MINTDB_RefreshCommitCoin *commit_coins;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins;
commit_links = GNUNET_malloc (num_oldcoins *
sizeof (struct TALER_RefreshCommitLinkP));
@@ -998,7 +1000,7 @@ check_commitment (struct MHD_Connection *connection,
/* Check that the commitments for all new coins were correct */
commit_coins = GNUNET_malloc (num_newcoins *
- sizeof (struct TALER_MINTDB_RefreshCommitCoin));
+ sizeof (struct TALER_EXCHANGEDB_RefreshCommitCoin));
if (GNUNET_OK !=
TMH_plugin->get_refresh_commit_coins (TMH_plugin->cls,
@@ -1078,7 +1080,7 @@ check_commitment (struct MHD_Connection *connection,
/**
- * Mint a coin as part of a refresh operation. Obtains the
+ * Exchange a coin as part of a refresh operation. Obtains the
* envelope from the database and performs the signing operation.
*
* @param connection the MHD connection to handle
@@ -1091,15 +1093,15 @@ check_commitment (struct MHD_Connection *connection,
* @return NULL on error, otherwise signature over the coin
*/
static struct TALER_DenominationSignature
-refresh_mint_coin (struct MHD_Connection *connection,
- struct TALER_MINTDB_Session *session,
+refresh_exchange_coin (struct MHD_Connection *connection,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
struct TMH_KS_StateHandle *key_state,
const struct TALER_DenominationPublicKey *denom_pub,
- const struct TALER_MINTDB_RefreshCommitCoin *commit_coin,
+ const struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coin,
unsigned int coin_off)
{
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
struct TALER_DenominationSignature ev_sig;
dki = TMH_KS_denomination_key_lookup (key_state,
@@ -1112,9 +1114,9 @@ refresh_mint_coin (struct MHD_Connection *connection,
return ev_sig;
}
ev_sig.rsa_signature
- = GNUNET_CRYPTO_rsa_sign (dki->denom_priv.rsa_private_key,
- commit_coin->coin_ev,
- commit_coin->coin_ev_size);
+ = GNUNET_CRYPTO_rsa_sign_blinded (dki->denom_priv.rsa_private_key,
+ commit_coin->coin_ev,
+ commit_coin->coin_ev_size);
if (NULL == ev_sig.rsa_signature)
{
GNUNET_break (0);
@@ -1156,13 +1158,13 @@ refresh_mint_coin (struct MHD_Connection *connection,
*/
static int
execute_refresh_reveal_transaction (struct MHD_Connection *connection,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
- const struct TALER_MINTDB_RefreshSession *refresh_session,
- const struct TALER_MINTDB_RefreshMelt *melts,
+ const struct TALER_EXCHANGEDB_RefreshSession *refresh_session,
+ const struct TALER_EXCHANGEDB_RefreshMelt *melts,
const struct TALER_DenominationPublicKey *denom_pubs,
struct TALER_DenominationSignature *ev_sigs,
- struct TALER_MINTDB_RefreshCommitCoin *commit_coins)
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins)
{
unsigned int j;
struct TMH_KS_StateHandle *key_state;
@@ -1183,7 +1185,7 @@ execute_refresh_reveal_transaction (struct MHD_Connection *connection,
for (j=0;jnum_newcoins;j++)
{
if (NULL == ev_sigs[j].rsa_signature) /* could be non-NULL during retries */
- ev_sigs[j] = refresh_mint_coin (connection,
+ ev_sigs[j] = refresh_exchange_coin (connection,
session,
session_hash,
key_state,
@@ -1225,12 +1227,12 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
struct TALER_TransferPrivateKeyP **transfer_privs)
{
int res;
- struct TALER_MINTDB_Session *session;
- struct TALER_MINTDB_RefreshSession refresh_session;
- struct TALER_MINTDB_RefreshMelt *melts;
+ struct TALER_EXCHANGEDB_Session *session;
+ struct TALER_EXCHANGEDB_RefreshSession refresh_session;
+ struct TALER_EXCHANGEDB_RefreshMelt *melts;
struct TALER_DenominationPublicKey *denom_pubs;
struct TALER_DenominationSignature *ev_sigs;
- struct TALER_MINTDB_RefreshCommitCoin *commit_coins;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins;
unsigned int i;
unsigned int j;
unsigned int off;
@@ -1258,7 +1260,7 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
}
melts = GNUNET_malloc (refresh_session.num_oldcoins *
- sizeof (struct TALER_MINTDB_RefreshMelt));
+ sizeof (struct TALER_EXCHANGEDB_RefreshMelt));
for (j=0;jstatus)
@@ -1523,7 +1525,7 @@ TMH_DB_execute_admin_add_incoming (struct MHD_Connection *connection,
struct GNUNET_TIME_Absolute execution_time,
json_t *wire)
{
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
int ret;
if (NULL == (session = TMH_plugin->get_session (TMH_plugin->cls,
@@ -1579,6 +1581,16 @@ struct WtidTransactionContext
*/
struct GNUNET_HashCode h_wire;
+ /**
+ * Head of DLL with details for /wire/deposit response.
+ */
+ struct TMH_WireDepositDetail *wdd_head;
+
+ /**
+ * Head of DLL with details for /wire/deposit response.
+ */
+ struct TMH_WireDepositDetail *wdd_tail;
+
/**
* JSON array with details about the individual deposits.
*/
@@ -1607,7 +1619,7 @@ struct WtidTransactionContext
* @param transaction_id merchant's transaction ID for the payment
* @param coin_pub which public key was this payment about
* @param deposit_value amount contributed by this coin in total
- * @param deposit_fee deposit fee charged by mint for this coin
+ * @param deposit_fee deposit fee charged by exchange for this coin
*/
static void
handle_transaction_data (void *cls,
@@ -1621,6 +1633,7 @@ handle_transaction_data (void *cls,
{
struct WtidTransactionContext *ctx = cls;
struct TALER_Amount delta;
+ struct TMH_WireDepositDetail *wdd;
if (GNUNET_SYSERR == ctx->is_valid)
return;
@@ -1671,17 +1684,15 @@ handle_transaction_data (void *cls,
return;
}
}
- /* NOTE: We usually keep JSON stuff out of the _DB file, and this
- is also ugly if we ever add signatures over this data. (#4135) */
- json_array_append (ctx->deposits,
- json_pack ("{s:o, s:o, s:o, s:I, s:o}",
- "deposit_value", TALER_json_from_amount (deposit_value),
- "deposit_fee", TALER_json_from_amount (deposit_fee),
- "H_contract", TALER_json_from_data (h_contract,
- sizeof (struct GNUNET_HashCode)),
- "transaction_id", (json_int_t) transaction_id,
- "coin_pub", TALER_json_from_data (coin_pub,
- sizeof (struct TALER_CoinSpendPublicKeyP))));
+ wdd = GNUNET_new (struct TMH_WireDepositDetail);
+ wdd->deposit_value = *deposit_value;
+ wdd->deposit_fee = *deposit_fee;
+ wdd->h_contract = *h_contract;
+ wdd->transaction_id = transaction_id;
+ wdd->coin_pub = *coin_pub;
+ GNUNET_CONTAINER_DLL_insert (ctx->wdd_head,
+ ctx->wdd_tail,
+ wdd);
}
@@ -1699,7 +1710,8 @@ TMH_DB_execute_wire_deposits (struct MHD_Connection *connection,
{
int ret;
struct WtidTransactionContext ctx;
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
+ struct TMH_WireDepositDetail *wdd;
if (NULL == (session = TMH_plugin->get_session (TMH_plugin->cls,
TMH_test_mode)))
@@ -1708,7 +1720,8 @@ TMH_DB_execute_wire_deposits (struct MHD_Connection *connection,
return TMH_RESPONSE_reply_internal_db_error (connection);
}
ctx.is_valid = GNUNET_NO;
- ctx.deposits = json_array ();
+ ctx.wdd_head = NULL;
+ ctx.wdd_tail = NULL;
ret = TMH_plugin->lookup_wire_transfer (TMH_plugin->cls,
session,
wtid,
@@ -1717,26 +1730,35 @@ TMH_DB_execute_wire_deposits (struct MHD_Connection *connection,
if (GNUNET_SYSERR == ret)
{
GNUNET_break (0);
- json_decref (ctx.deposits);
- return TMH_RESPONSE_reply_internal_db_error (connection);
+ ret = TMH_RESPONSE_reply_internal_db_error (connection);
+ goto cleanup;
}
if (GNUNET_SYSERR == ctx.is_valid)
{
GNUNET_break (0);
- json_decref (ctx.deposits);
- return TMH_RESPONSE_reply_internal_db_error (connection);
+ ret = TMH_RESPONSE_reply_internal_db_error (connection);
+ goto cleanup;
}
if (GNUNET_NO == ctx.is_valid)
{
- json_decref (ctx.deposits);
- return TMH_RESPONSE_reply_arg_unknown (connection,
- "wtid");
+ ret = TMH_RESPONSE_reply_arg_unknown (connection,
+ "wtid");
+ goto cleanup;
}
- return TMH_RESPONSE_reply_wire_deposit_details (connection,
- &ctx.total,
- &ctx.merchant_pub,
- &ctx.h_wire,
- ctx.deposits);
+ ret = TMH_RESPONSE_reply_wire_deposit_details (connection,
+ &ctx.total,
+ &ctx.merchant_pub,
+ &ctx.h_wire,
+ ctx.wdd_head);
+ cleanup:
+ while (NULL != (wdd = ctx.wdd_head))
+ {
+ GNUNET_CONTAINER_DLL_remove (ctx.wdd_head,
+ ctx.wdd_tail,
+ wdd);
+ GNUNET_free (wdd);
+ }
+ return ret;
}
@@ -1787,11 +1809,11 @@ struct DepositWtidContext
* if the transaction was not yet done
* @param coin_contribution how much did the coin we asked about
* contribute to the total transfer value? (deposit value including fee)
- * @param coin_fee how much did the mint charge for the deposit fee
+ * @param coin_fee how much did the exchange charge for the deposit fee
* @param execution_time when was the transaction done, or
* when we expect it to be done (if @a wtid was NULL);
* #GNUNET_TIME_UNIT_FOREVER_ABS if the /deposit is unknown
- * to the mint
+ * to the exchange
*/
static void
handle_wtid_data (void *cls,
@@ -1855,7 +1877,7 @@ TMH_DB_execute_deposit_wtid (struct MHD_Connection *connection,
{
int ret;
struct DepositWtidContext ctx;
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
if (NULL == (session = TMH_plugin->get_session (TMH_plugin->cls,
TMH_test_mode)))
@@ -1899,4 +1921,4 @@ TMH_DB_execute_deposit_wtid (struct MHD_Connection *connection,
}
-/* end of taler-mint-httpd_db.c */
+/* end of taler-exchange-httpd_db.c */
diff --git a/src/mint/taler-mint-httpd_db.h b/src/exchange/taler-exchange-httpd_db.h
similarity index 93%
rename from src/mint/taler-mint-httpd_db.h
rename to src/exchange/taler-exchange-httpd_db.h
index 0327bef2a..d6245a702 100644
--- a/src/mint/taler-mint-httpd_db.h
+++ b/src/exchange/taler-exchange-httpd_db.h
@@ -14,15 +14,15 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mint/taler-mint-httpd_db.h
- * @brief High-level (transactional-layer) database operations for the mint
+ * @file exchange/taler-exchange-httpd_db.h
+ * @brief High-level (transactional-layer) database operations for the exchange
* @author Chrisitan Grothoff
*/
-#ifndef TALER_MINT_HTTPD_DB_H
-#define TALER_MINT_HTTPD_DB_H
+#ifndef TALER_EXCHANGE_HTTPD_DB_H
+#define TALER_EXCHANGE_HTTPD_DB_H
#include
-#include "taler_mintdb_plugin.h"
+#include "taler_exchangedb_plugin.h"
/**
@@ -37,7 +37,7 @@
*/
int
TMH_DB_execute_deposit (struct MHD_Connection *connection,
- const struct TALER_MINTDB_Deposit *deposit);
+ const struct TALER_EXCHANGEDB_Deposit *deposit);
/**
@@ -89,7 +89,7 @@ struct TMH_DB_MeltDetails
/**
* Signature allowing the melt (using
- * a `struct TALER_MINTDB_RefreshMeltConfirmSignRequestBody`) to sign over.
+ * a `struct TALER_EXCHANGEDB_RefreshMeltConfirmSignRequestBody`) to sign over.
*/
struct TALER_CoinSpendSignatureP melt_sig;
@@ -101,7 +101,7 @@ struct TMH_DB_MeltDetails
struct TALER_Amount melt_amount_with_fee;
/**
- * What fee is earned by the mint? Set delayed during
+ * What fee is earned by the exchange? Set delayed during
* #verify_coin_public_info().
*/
struct TALER_Amount melt_fee;
@@ -121,9 +121,9 @@ struct TMH_DB_MeltDetails
* @param denom_pubs array of public denomination keys for the refresh (?)
* @param coin_count number of entries in @ a coin_melt_details, size of y-dimension of @a commit_link array
* @param coin_melt_details signatures and (residual) value of and information about the respective coin to be melted
- * @param commit_coin 2d array of coin commitments (what the mint is to sign
+ * @param commit_coin 2d array of coin commitments (what the exchange is to sign
* once the "/refres/reveal" of cut and choose is done)
- * @param commit_link 2d array of coin link commitments (what the mint is
+ * @param commit_link 2d array of coin link commitments (what the exchange is
* to return via "/refresh/link" to enable linkage in the
* future)
* @return MHD result code
@@ -135,7 +135,7 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
const struct TALER_DenominationPublicKey *denom_pubs,
unsigned int coin_count,
const struct TMH_DB_MeltDetails *coin_melt_details,
- struct TALER_MINTDB_RefreshCommitCoin *const* commit_coin,
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *const* commit_coin,
struct TALER_RefreshCommitLinkP *const* commit_link);
@@ -227,4 +227,4 @@ TMH_DB_execute_deposit_wtid (struct MHD_Connection *connection,
#endif
-/* TALER_MINT_HTTPD_DB_H */
+/* TALER_EXCHANGE_HTTPD_DB_H */
diff --git a/src/mint/taler-mint-httpd_deposit.c b/src/exchange/taler-exchange-httpd_deposit.c
similarity index 81%
rename from src/mint/taler-mint-httpd_deposit.c
rename to src/exchange/taler-exchange-httpd_deposit.c
index 40c5a4db7..efef3d04e 100644
--- a/src/mint/taler-mint-httpd_deposit.c
+++ b/src/exchange/taler-exchange-httpd_deposit.c
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_deposit.c
+ * @file taler-exchange-httpd_deposit.c
* @brief Handle /deposit requests; parses the POST and JSON and
* verifies the coin signature before handing things off
* to the database.
@@ -27,14 +27,16 @@
*/
#include "platform.h"
#include
+#include
#include
#include
#include
-#include "taler-mint-httpd_parsing.h"
-#include "taler-mint-httpd_deposit.h"
-#include "taler-mint-httpd_responses.h"
-#include "taler-mint-httpd_keystate.h"
-#include "taler-mint-httpd_validation.h"
+#include "taler_json_lib.h"
+#include "taler-exchange-httpd_parsing.h"
+#include "taler-exchange-httpd_deposit.h"
+#include "taler-exchange-httpd_responses.h"
+#include "taler-exchange-httpd_keystate.h"
+#include "taler-exchange-httpd_validation.h"
/**
@@ -49,11 +51,11 @@
*/
static int
verify_and_execute_deposit (struct MHD_Connection *connection,
- const struct TALER_MINTDB_Deposit *deposit)
+ const struct TALER_EXCHANGEDB_Deposit *deposit)
{
struct TMH_KS_StateHandle *key_state;
struct TALER_DepositRequestPS dr;
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
struct TALER_Amount fee_deposit;
dr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_DEPOSIT);
@@ -134,23 +136,23 @@ parse_and_handle_deposit_request (struct MHD_Connection *connection,
json_t *wire)
{
int res;
- struct TALER_MINTDB_Deposit deposit;
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki;
+ struct TALER_EXCHANGEDB_Deposit deposit;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
struct TMH_KS_StateHandle *ks;
struct GNUNET_HashCode my_h_wire;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_denomination_public_key ("denom_pub", &deposit.coin.denom_pub),
- TMH_PARSE_member_denomination_signature ("ub_sig", &deposit.coin.denom_sig),
- TMH_PARSE_member_fixed ("coin_pub", &deposit.coin.coin_pub),
- TMH_PARSE_member_fixed ("merchant_pub", &deposit.merchant_pub),
- TMH_PARSE_member_fixed ("H_contract", &deposit.h_contract),
- TMH_PARSE_member_fixed ("H_wire", &deposit.h_wire),
- TMH_PARSE_member_fixed ("coin_sig", &deposit.csig),
- TMH_PARSE_member_uint64 ("transaction_id", &deposit.transaction_id),
- TMH_PARSE_member_time_abs ("timestamp", &deposit.timestamp),
- TMH_PARSE_member_time_abs ("refund_deadline", &deposit.refund_deadline),
- TMH_PARSE_member_time_abs ("edate", &deposit.wire_deadline),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ TALER_JSON_spec_denomination_public_key ("denom_pub", &deposit.coin.denom_pub),
+ TALER_JSON_spec_denomination_signature ("ub_sig", &deposit.coin.denom_sig),
+ GNUNET_JSON_spec_fixed_auto ("coin_pub", &deposit.coin.coin_pub),
+ GNUNET_JSON_spec_fixed_auto ("merchant_pub", &deposit.merchant_pub),
+ GNUNET_JSON_spec_fixed_auto ("H_contract", &deposit.h_contract),
+ GNUNET_JSON_spec_fixed_auto ("H_wire", &deposit.h_wire),
+ GNUNET_JSON_spec_fixed_auto ("coin_sig", &deposit.csig),
+ GNUNET_JSON_spec_uint64 ("transaction_id", &deposit.transaction_id),
+ GNUNET_JSON_spec_absolute_time ("timestamp", &deposit.timestamp),
+ GNUNET_JSON_spec_absolute_time ("refund_deadline", &deposit.refund_deadline),
+ GNUNET_JSON_spec_absolute_time ("edate", &deposit.wire_deadline),
+ GNUNET_JSON_spec_end ()
};
memset (&deposit, 0, sizeof (deposit));
@@ -163,18 +165,19 @@ parse_and_handle_deposit_request (struct MHD_Connection *connection,
return MHD_YES; /* failure */
if (GNUNET_YES !=
- TMH_json_validate_wireformat (wire))
+ TMH_json_validate_wireformat (wire,
+ GNUNET_NO))
{
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_unknown (connection,
"wire");
}
if (GNUNET_OK !=
- TALER_hash_json (wire,
+ TALER_JSON_hash (wire,
&my_h_wire))
{
TALER_LOG_WARNING ("Failed to parse JSON wire format specification for /deposit request\n");
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
"wire");
}
@@ -183,7 +186,7 @@ parse_and_handle_deposit_request (struct MHD_Connection *connection,
sizeof (struct GNUNET_HashCode)))
{
/* Client hashed contract differently than we did, reject */
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
"H_wire");
}
@@ -194,7 +197,7 @@ parse_and_handle_deposit_request (struct MHD_Connection *connection,
if (NULL == dki)
{
TMH_KS_release (ks);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_unknown (connection,
"denom_pub");
}
@@ -207,13 +210,13 @@ parse_and_handle_deposit_request (struct MHD_Connection *connection,
&deposit.deposit_fee))
{
/* Total amount smaller than fee, invalid */
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
"f");
}
res = verify_and_execute_deposit (connection,
&deposit);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return res;
}
@@ -245,10 +248,10 @@ TMH_DEPOSIT_handler_deposit (struct TMH_RequestHandler *rh,
json_t *wire;
int res;
struct TALER_Amount amount;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_object ("wire", &wire),
- TMH_PARSE_member_amount ("f", &amount),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_json ("wire", &wire),
+ TALER_JSON_spec_amount ("f", &amount),
+ GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
@@ -272,10 +275,10 @@ TMH_DEPOSIT_handler_deposit (struct TMH_RequestHandler *rh,
json,
&amount,
wire);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
json_decref (json);
return res;
}
-/* end of taler-mint-httpd_deposit.c */
+/* end of taler-exchange-httpd_deposit.c */
diff --git a/src/mint/taler-mint-httpd_deposit.h b/src/exchange/taler-exchange-httpd_deposit.h
similarity index 92%
rename from src/mint/taler-mint-httpd_deposit.h
rename to src/exchange/taler-exchange-httpd_deposit.h
index c2d3fe13c..6e84573e5 100644
--- a/src/mint/taler-mint-httpd_deposit.h
+++ b/src/exchange/taler-exchange-httpd_deposit.h
@@ -14,18 +14,18 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_deposit.h
+ * @file taler-exchange-httpd_deposit.h
* @brief Handle /deposit requests
* @author Florian Dold
* @author Benedikt Mueller
* @author Christian Grothoff
*/
-#ifndef TALER_MINT_HTTPD_DEPOSIT_H
-#define TALER_MINT_HTTPD_DEPOSIT_H
+#ifndef TALER_EXCHANGE_HTTPD_DEPOSIT_H
+#define TALER_EXCHANGE_HTTPD_DEPOSIT_H
#include
#include
-#include "taler-mint-httpd.h"
+#include "taler-exchange-httpd.h"
/**
diff --git a/src/mint/taler-mint-httpd_keystate.c b/src/exchange/taler-exchange-httpd_keystate.c
similarity index 85%
rename from src/mint/taler-mint-httpd_keystate.c
rename to src/exchange/taler-exchange-httpd_keystate.c
index f1856e673..c9db50895 100644
--- a/src/mint/taler-mint-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_keystate.c
+ * @file taler-exchange-httpd_keystate.c
* @brief management of our coin signing keys
* @author Florian Dold
* @author Benedikt Mueller
@@ -22,14 +22,15 @@
*/
#include "platform.h"
#include
-#include "taler-mint-httpd_keystate.h"
-#include "taler-mint-httpd_responses.h"
-#include "taler_mintdb_plugin.h"
+#include "taler_json_lib.h"
+#include "taler-exchange-httpd_keystate.h"
+#include "taler-exchange-httpd_responses.h"
+#include "taler_exchangedb_plugin.h"
/**
* Snapshot of the (coin and signing) keys (including private keys) of
- * the mint. There can be multiple instances of this struct, as it is
+ * the exchange. There can be multiple instances of this struct, as it is
* reference counted and only destroyed once the last user is done
* with it. The current instance is acquired using
* #TMH_KS_acquire(). Using this function increases the
@@ -58,7 +59,7 @@ struct TMH_KS_StateHandle
json_t *auditors_array;
/**
- * Cached JSON text that the mint will send for a "/keys" request.
+ * Cached JSON text that the exchange will send for a "/keys" request.
* Includes our @e TMH_master_public_key public key, the signing and
* denomination keys as well as the @e reload_time.
*/
@@ -88,9 +89,9 @@ struct TMH_KS_StateHandle
struct GNUNET_TIME_Absolute next_reload;
/**
- * Mint signing key that should be used currently.
+ * Exchange signing key that should be used currently.
*/
- struct TALER_MINTDB_PrivateSigningKeyInformationP current_sign_key_issue;
+ struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP current_sign_key_issue;
/**
* Reference count. The struct is released when the RC hits zero.
@@ -100,7 +101,7 @@ struct TMH_KS_StateHandle
/**
- * Mint key state. Never use directly, instead access via
+ * Exchange key state. Never use directly, instead access via
* #TMH_KS_acquire() and #TMH_KS_release().
*/
static struct TMH_KS_StateHandle *internal_key_state;
@@ -126,7 +127,7 @@ static int reload_pipe[2];
*/
static json_t *
denom_key_issue_to_json (const struct TALER_DenominationPublicKey *pk,
- const struct TALER_MINTDB_DenominationKeyInformationP *dki)
+ const struct TALER_EXCHANGEDB_DenominationKeyInformationP *dki)
{
struct TALER_Amount value;
struct TALER_Amount fee_withdraw;
@@ -144,26 +145,26 @@ denom_key_issue_to_json (const struct TALER_DenominationPublicKey *pk,
return
json_pack ("{s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o}",
"master_sig",
- TALER_json_from_data (&dki->signature,
+ GNUNET_JSON_from_data (&dki->signature,
sizeof (struct GNUNET_CRYPTO_EddsaSignature)),
"stamp_start",
- TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->properties.start)),
+ GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (dki->properties.start)),
"stamp_expire_withdraw",
- TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_withdraw)),
+ GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_withdraw)),
"stamp_expire_deposit",
- TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_spend)),
+ GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_spend)),
"stamp_expire_legal",
- TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_legal)),
+ GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_legal)),
"denom_pub",
- TALER_json_from_rsa_public_key (pk->rsa_public_key),
+ GNUNET_JSON_from_rsa_public_key (pk->rsa_public_key),
"value",
- TALER_json_from_amount (&value),
+ TALER_JSON_from_amount (&value),
"fee_withdraw",
- TALER_json_from_amount (&fee_withdraw),
+ TALER_JSON_from_amount (&fee_withdraw),
"fee_deposit",
- TALER_json_from_amount (&fee_deposit),
+ TALER_JSON_from_amount (&fee_deposit),
"fee_refresh",
- TALER_json_from_amount (&fee_refresh));
+ TALER_JSON_from_amount (&fee_refresh));
}
@@ -174,18 +175,18 @@ denom_key_issue_to_json (const struct TALER_DenominationPublicKey *pk,
* @return the provide duration
*/
static struct GNUNET_TIME_Relative
-TALER_MINT_conf_duration_provide ()
+TALER_EXCHANGE_conf_duration_provide ()
{
struct GNUNET_TIME_Relative rel;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (cfg,
- "mint_keys",
+ "exchange_keys",
"lookahead_provide",
&rel))
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "mint_keys",
+ "exchange_keys",
"lookahead_provide",
"time value required");
GNUNET_assert (0);
@@ -207,20 +208,20 @@ TALER_MINT_conf_duration_provide ()
static int
reload_keys_denom_iter (void *cls,
const char *alias,
- const struct TALER_MINTDB_DenominationKeyIssueInformation *dki)
+ const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki)
{
struct TMH_KS_StateHandle *ctx = cls;
struct GNUNET_TIME_Absolute now;
struct GNUNET_TIME_Absolute horizon;
struct GNUNET_HashCode denom_key_hash;
- struct TALER_MINTDB_DenominationKeyIssueInformation *d2;
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *d2;
+ struct TALER_EXCHANGEDB_Session *session;
int res;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Loading denomination key `%s'\n",
alias);
- horizon = GNUNET_TIME_relative_to_absolute (TALER_MINT_conf_duration_provide ());
+ horizon = GNUNET_TIME_relative_to_absolute (TALER_EXCHANGE_conf_duration_provide ());
if (GNUNET_TIME_absolute_ntoh (dki->issue.properties.start).abs_value_us >
horizon.abs_value_us)
{
@@ -303,7 +304,7 @@ reload_keys_denom_iter (void *cls,
as it is possible we just retry until we succeed. */
}
- d2 = GNUNET_new (struct TALER_MINTDB_DenominationKeyIssueInformation);
+ d2 = GNUNET_new (struct TALER_EXCHANGEDB_DenominationKeyIssueInformation);
d2->issue = dki->issue;
d2->denom_priv.rsa_private_key
= GNUNET_CRYPTO_rsa_private_key_dup (dki->denom_priv.rsa_private_key);
@@ -337,25 +338,25 @@ reload_keys_denom_iter (void *cls,
* @return a JSON object describing the sign key issue (public part)
*/
static json_t *
-sign_key_issue_to_json (const struct TALER_MintSigningKeyValidityPS *ski)
+sign_key_issue_to_json (const struct TALER_ExchangeSigningKeyValidityPS *ski)
{
return
json_pack ("{s:o, s:o, s:o, s:o, s:o, s:o}",
"stamp_start",
- TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (ski->start)),
+ GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (ski->start)),
"stamp_expire",
- TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (ski->expire)),
+ GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (ski->expire)),
"stamp_end",
- TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (ski->end)),
+ GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (ski->end)),
"master_pub",
- TALER_json_from_data (&ski->master_public_key,
+ GNUNET_JSON_from_data (&ski->master_public_key,
sizeof (struct TALER_MasterPublicKeyP)),
"master_sig",
- TALER_json_from_data (&ski->signature,
+ GNUNET_JSON_from_data (&ski->signature,
sizeof (struct TALER_MasterSignatureP)),
"key",
- TALER_json_from_data (&ski->signkey_pub,
- sizeof (struct TALER_MintPublicKeyP)));
+ GNUNET_JSON_from_data (&ski->signkey_pub,
+ sizeof (struct TALER_ExchangePublicKeyP)));
}
@@ -372,13 +373,13 @@ sign_key_issue_to_json (const struct TALER_MintSigningKeyValidityPS *ski)
static int
reload_keys_sign_iter (void *cls,
const char *filename,
- const struct TALER_MINTDB_PrivateSigningKeyInformationP *ski)
+ const struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP *ski)
{
struct TMH_KS_StateHandle *ctx = cls;
struct GNUNET_TIME_Absolute now;
struct GNUNET_TIME_Absolute horizon;
- horizon = GNUNET_TIME_relative_to_absolute (TALER_MINT_conf_duration_provide ());
+ horizon = GNUNET_TIME_relative_to_absolute (TALER_EXCHANGE_conf_duration_provide ());
if (GNUNET_TIME_absolute_ntoh (ski->issue.start).abs_value_us >
horizon.abs_value_us)
{
@@ -418,6 +419,7 @@ reload_keys_sign_iter (void *cls,
* Convert information from an auditor to a JSON object.
*
* @param apub the auditor's public key
+ * @param auditor_url URL of the auditor
* @param dki_len length of @a dki and @a asigs arrays
* @param asigs the auditor's signatures
* @param dki array of denomination coin data signed by the auditor
@@ -425,6 +427,7 @@ reload_keys_sign_iter (void *cls,
*/
static json_t *
auditor_to_json (const struct TALER_AuditorPublicKeyP *apub,
+ const char *auditor_url,
unsigned int dki_len,
const struct TALER_AuditorSignatureP **asigs,
const struct TALER_DenominationKeyValidityPS **dki)
@@ -437,29 +440,31 @@ auditor_to_json (const struct TALER_AuditorPublicKeyP *apub,
json_array_append_new (ja,
json_pack ("{s:o, s:o}",
"denom_pub_h",
- TALER_json_from_data (&dki[i]->denom_hash,
+ GNUNET_JSON_from_data (&dki[i]->denom_hash,
sizeof (struct GNUNET_HashCode)),
"auditor_sig",
- TALER_json_from_data (asigs[i],
- sizeof (struct TALER_AuditorSignatureP))));
+ GNUNET_JSON_from_data (asigs[i],
+ sizeof (struct TALER_AuditorSignatureP))));
return
- json_pack ("{s:o, s:o}",
+ json_pack ("{s:o, s:s, s:o}",
"denomination_keys", ja,
+ "auditor_url", auditor_url,
"auditor_pub",
- TALER_json_from_data (apub,
+ GNUNET_JSON_from_data (apub,
sizeof (struct TALER_AuditorPublicKeyP)));
}
/**
* @brief Iterator called with auditor information.
- * Check that the @a mpub actually matches this mint, and then
+ * Check that the @a mpub actually matches this exchange, and then
* add the auditor information to our /keys response (if it is
* (still) applicable).
*
* @param cls closure with the `struct TMH_KS_StateHandle *`
* @param apub the auditor's public key
- * @param mpub the mint's public key (as expected by the auditor)
+ * @param auditor_url URL of the auditor
+ * @param mpub the exchange's public key (as expected by the auditor)
* @param dki_len length of @a dki and @a asigs
* @param asigs array with the auditor's signatures, of length @a dki_len
* @param dki array of denomination coin data signed by the auditor
@@ -470,6 +475,7 @@ auditor_to_json (const struct TALER_AuditorPublicKeyP *apub,
static int
reload_auditor_iter (void *cls,
const struct TALER_AuditorPublicKeyP *apub,
+ const char *auditor_url,
const struct TALER_MasterPublicKeyP *mpub,
unsigned int dki_len,
const struct TALER_AuditorSignatureP *asigs,
@@ -481,13 +487,13 @@ reload_auditor_iter (void *cls,
const struct TALER_AuditorSignatureP *kept_asigs[dki_len];
const struct TALER_DenominationKeyValidityPS *kept_dkis[dki_len];
- /* Check if the signature is at least for this mint. */
+ /* Check if the signature is at least for this exchange. */
if (0 != memcmp (&mpub->eddsa_pub,
&TMH_master_public_key,
sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Auditing information provided for a different mint, ignored\n");
+ "Auditing information provided for a different exchange, ignored\n");
return GNUNET_OK;
}
/* Filter the auditor information for those for which the
@@ -507,6 +513,7 @@ reload_auditor_iter (void *cls,
/* add auditor information to our /keys response */
json_array_append_new (ctx->auditors_array,
auditor_to_json (apub,
+ auditor_url,
keep,
kept_asigs,
kept_dkis));
@@ -529,7 +536,7 @@ free_denom_key (void *cls,
const struct GNUNET_HashCode *key,
void *value)
{
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki = value;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki = value;
GNUNET_CRYPTO_rsa_private_key_free (dki->denom_priv.rsa_private_key);
GNUNET_CRYPTO_rsa_public_key_free (dki->denom_pub.rsa_public_key);
@@ -592,7 +599,7 @@ TMH_KS_release_ (const char *location,
/**
- * Acquire the key state of the mint. Updates keys if necessary.
+ * Acquire the key state of the exchange. Updates keys if necessary.
* For every call to #TMH_KS_acquire(), a matching call
* to #TMH_KS_release() must be made.
*
@@ -605,8 +612,8 @@ TMH_KS_acquire_ (const char *location)
struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
struct TMH_KS_StateHandle *key_state;
json_t *keys;
- struct TALER_MintKeySetPS ks;
- struct TALER_MintSignatureP sig;
+ struct TALER_ExchangeKeySetPS ks;
+ struct TALER_ExchangeSignatureP sig;
GNUNET_assert (0 == pthread_mutex_lock (&internal_key_state_mutex));
if ( (NULL != internal_key_state) &&
@@ -633,21 +640,21 @@ TMH_KS_acquire_ (const char *location)
key_state->denomkey_map = GNUNET_CONTAINER_multihashmap_create (32,
GNUNET_NO);
key_state->reload_time = GNUNET_TIME_absolute_get ();
- TALER_round_abs_time (&key_state->reload_time);
+ GNUNET_TIME_round_abs (&key_state->reload_time);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Loading keys from `%s'\n",
- TMH_mint_directory);
- TALER_MINTDB_denomination_keys_iterate (TMH_mint_directory,
+ TMH_exchange_directory);
+ TALER_EXCHANGEDB_denomination_keys_iterate (TMH_exchange_directory,
&reload_keys_denom_iter,
key_state);
- TALER_MINTDB_signing_keys_iterate (TMH_mint_directory,
+ TALER_EXCHANGEDB_signing_keys_iterate (TMH_exchange_directory,
&reload_keys_sign_iter,
key_state);
- TALER_MINTDB_auditor_iterate (TMH_mint_directory,
- &reload_auditor_iter,
- key_state);
+ TALER_EXCHANGEDB_auditor_iterate (cfg,
+ &reload_auditor_iter,
+ key_state);
ks.purpose.size = htonl (sizeof (ks));
- ks.purpose.purpose = htonl (TALER_SIGNATURE_MINT_KEY_SET);
+ ks.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_KEY_SET);
ks.list_issue_date = GNUNET_TIME_absolute_hton (key_state->reload_time);
GNUNET_CRYPTO_hash_context_finish (key_state->hash_context,
&ks.hc);
@@ -663,16 +670,16 @@ TMH_KS_acquire_ (const char *location)
keys = json_pack ("{s:o, s:o, s:o, s:o, s:o, s:o, s:o}",
"master_public_key",
- TALER_json_from_data (&TMH_master_public_key,
+ GNUNET_JSON_from_data (&TMH_master_public_key,
sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)),
"signkeys", key_state->sign_keys_array,
"denoms", key_state->denom_keys_array,
"auditors", key_state->auditors_array,
- "list_issue_date", TALER_json_from_abs (key_state->reload_time),
- "eddsa_pub", TALER_json_from_data (&key_state->current_sign_key_issue.issue.signkey_pub,
- sizeof (struct TALER_MintPublicKeyP)),
- "eddsa_sig", TALER_json_from_data (&sig,
- sizeof (struct TALER_MintSignatureP)));
+ "list_issue_date", GNUNET_JSON_from_time_abs (key_state->reload_time),
+ "eddsa_pub", GNUNET_JSON_from_data (&key_state->current_sign_key_issue.issue.signkey_pub,
+ sizeof (struct TALER_ExchangePublicKeyP)),
+ "eddsa_sig", GNUNET_JSON_from_data (&sig,
+ sizeof (struct TALER_ExchangeSignatureP)));
key_state->auditors_array = NULL;
key_state->sign_keys_array = NULL;
key_state->denom_keys_array = NULL;
@@ -698,13 +705,13 @@ TMH_KS_acquire_ (const char *location)
* @return the denomination key issue,
* or NULL if denom_pub could not be found
*/
-struct TALER_MINTDB_DenominationKeyIssueInformation *
+struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *
TMH_KS_denomination_key_lookup (const struct TMH_KS_StateHandle *key_state,
const struct TALER_DenominationPublicKey *denom_pub,
enum TMH_KS_DenominationKeyUse use)
{
struct GNUNET_HashCode hc;
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
struct GNUNET_TIME_Absolute now;
GNUNET_CRYPTO_rsa_public_key_hash (denom_pub->rsa_public_key,
@@ -940,16 +947,16 @@ read_again:
/**
- * Sign the message in @a purpose with the mint's signing key.
+ * Sign the message in @a purpose with the exchange's signing key.
*
* @param purpose the message to sign
- * @param[out] pub set to the current public signing key of the mint
+ * @param[out] pub set to the current public signing key of the exchange
* @param[out] sig signature over purpose using current signing key
*/
void
TMH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
- struct TALER_MintPublicKeyP *pub,
- struct TALER_MintSignatureP *sig)
+ struct TALER_ExchangePublicKeyP *pub,
+ struct TALER_ExchangeSignatureP *sig)
{
struct TMH_KS_StateHandle *key_state;
@@ -1008,4 +1015,4 @@ TMH_KS_handler_keys (struct TMH_RequestHandler *rh,
}
-/* end of taler-mint-httpd_keystate.c */
+/* end of taler-exchange-httpd_keystate.c */
diff --git a/src/mint/taler-mint-httpd_keystate.h b/src/exchange/taler-exchange-httpd_keystate.h
similarity index 87%
rename from src/mint/taler-mint-httpd_keystate.h
rename to src/exchange/taler-exchange-httpd_keystate.h
index 0e20ef588..56151a878 100644
--- a/src/mint/taler-mint-httpd_keystate.h
+++ b/src/exchange/taler-exchange-httpd_keystate.h
@@ -14,30 +14,30 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mint/taler-mint-httpd_keystate.h
+ * @file exchange/taler-exchange-httpd_keystate.h
* @brief management of our private signing keys (denomination keys)
* @author Florian Dold
* @author Benedikt Mueller
* @author Christian Grothoff
*/
-#ifndef TALER_MINT_HTTPD_KEYSTATE_H
-#define TALER_MINT_HTTPD_KEYSTATE_H
+#ifndef TALER_EXCHANGE_HTTPD_KEYSTATE_H
+#define TALER_EXCHANGE_HTTPD_KEYSTATE_H
#include
#include
-#include "taler-mint-httpd.h"
-#include "taler_mintdb_lib.h"
+#include "taler-exchange-httpd.h"
+#include "taler_exchangedb_lib.h"
/**
* Snapshot of the (coin and signing)
- * keys (including private keys) of the mint.
+ * keys (including private keys) of the exchange.
*/
struct TMH_KS_StateHandle;
/**
- * Acquire the key state of the mint. Updates keys if necessary.
+ * Acquire the key state of the exchange. Updates keys if necessary.
* For every call to #TMH_KS_acquire(), a matching call
* to #TMH_KS_release() must be made.
*
@@ -60,7 +60,7 @@ TMH_KS_release_ (const char *location,
/**
- * Acquire the key state of the mint. Updates keys if necessary.
+ * Acquire the key state of the exchange. Updates keys if necessary.
* For every call to #TMH_KS_acquire(), a matching call
* to #TMH_KS_release() must be made.
*
@@ -86,7 +86,7 @@ TMH_KS_release_ (const char *location,
enum TMH_KS_DenominationKeyUse {
/**
- * The key is to be used for a /reserve/withdraw or /refresh (mint)
+ * The key is to be used for a /reserve/withdraw or /refresh (exchange)
* operation.
*/
TMH_KS_DKU_WITHDRAW,
@@ -109,7 +109,7 @@ enum TMH_KS_DenominationKeyUse {
* @return the denomination key issue,
* or NULL if denom_pub could not be found (or is not valid at this time for the given @a use)
*/
-struct TALER_MINTDB_DenominationKeyIssueInformation *
+struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *
TMH_KS_denomination_key_lookup (const struct TMH_KS_StateHandle *key_state,
const struct TALER_DenominationPublicKey *denom_pub,
enum TMH_KS_DenominationKeyUse use);
@@ -129,17 +129,17 @@ TMH_KS_loop (void);
/**
- * Sign the message in @a purpose with the mint's signing
+ * Sign the message in @a purpose with the exchange's signing
* key.
*
* @param purpose the message to sign
- * @param[out] pub set to the current public signing key of the mint
+ * @param[out] pub set to the current public signing key of the exchange
* @param[out] sig signature over purpose using current signing key
*/
void
TMH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
- struct TALER_MintPublicKeyP *pub,
- struct TALER_MintSignatureP *sig);
+ struct TALER_ExchangePublicKeyP *pub,
+ struct TALER_ExchangeSignatureP *sig);
/**
diff --git a/src/mint/taler-mint-httpd_mhd.c b/src/exchange/taler-exchange-httpd_mhd.c
similarity index 93%
rename from src/mint/taler-mint-httpd_mhd.c
rename to src/exchange/taler-exchange-httpd_mhd.c
index 5719d921a..b7ad437aa 100644
--- a/src/mint/taler-mint-httpd_mhd.c
+++ b/src/exchange/taler-exchange-httpd_mhd.c
@@ -15,8 +15,8 @@
*/
/**
- * @file taler-mint-httpd_mhd.c
- * @brief helpers for MHD interaction; these are TALER_MINT_handler_ functions
+ * @file taler-exchange-httpd_mhd.c
+ * @brief helpers for MHD interaction; these are TALER_EXCHANGE_handler_ functions
* that generate simple MHD replies that do not require any real operations
* to be performed (error handling, static pages, etc.)
* @author Florian Dold
@@ -28,9 +28,9 @@
#include
#include
#include
-#include "taler-mint-httpd_responses.h"
-#include "taler-mint-httpd.h"
-#include "taler-mint-httpd_mhd.h"
+#include "taler-exchange-httpd_responses.h"
+#include "taler-exchange-httpd.h"
+#include "taler-exchange-httpd_mhd.h"
/**
* Function to call to handle the request by sending
@@ -114,7 +114,7 @@ TMH_MHD_handler_agpl_redirect (struct TMH_RequestHandler *rh,
rh->mime_type);
MHD_add_response_header (response,
MHD_HTTP_HEADER_LOCATION,
- "http://www.git.taler.net/?p=mint.git");
+ "http://www.git.taler.net/?p=exchange.git");
ret = MHD_queue_response (connection,
rh->response_code,
response);
@@ -149,4 +149,4 @@ TMH_MHD_handler_send_json_pack_error (struct TMH_RequestHandler *rh,
}
-/* end of taler-mint-httpd_mhd.c */
+/* end of taler-exchange-httpd_mhd.c */
diff --git a/src/mint/taler-mint-httpd_mhd.h b/src/exchange/taler-exchange-httpd_mhd.h
similarity index 96%
rename from src/mint/taler-mint-httpd_mhd.h
rename to src/exchange/taler-exchange-httpd_mhd.h
index a9f575df0..3e825c559 100644
--- a/src/mint/taler-mint-httpd_mhd.h
+++ b/src/exchange/taler-exchange-httpd_mhd.h
@@ -15,17 +15,17 @@
*/
/**
- * @file taler-mint-httpd_mhd.h
+ * @file taler-exchange-httpd_mhd.h
* @brief helpers for MHD interaction, used to generate simple responses
* @author Florian Dold
* @author Benedikt Mueller
* @author Christian Grothoff
*/
-#ifndef TALER_MINT_HTTPD_MHD_H
-#define TALER_MINT_HTTPD_MHD_H
+#ifndef TALER_EXCHANGE_HTTPD_MHD_H
+#define TALER_EXCHANGE_HTTPD_MHD_H
#include
#include
-#include "taler-mint-httpd.h"
+#include "taler-exchange-httpd.h"
/**
diff --git a/src/exchange/taler-exchange-httpd_parsing.c b/src/exchange/taler-exchange-httpd_parsing.c
new file mode 100644
index 000000000..beac81a1c
--- /dev/null
+++ b/src/exchange/taler-exchange-httpd_parsing.c
@@ -0,0 +1,275 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2014, 2015, 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU Affero General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+*/
+
+/**
+ * @file taler-exchange-httpd_parsing.c
+ * @brief functions to parse incoming requests (MHD arguments and JSON snippets)
+ * @author Florian Dold
+ * @author Benedikt Mueller
+ * @author Christian Grothoff
+ */
+
+#include "platform.h"
+#include
+#include
+#include "taler_json_lib.h"
+#include "taler-exchange-httpd_parsing.h"
+#include "taler-exchange-httpd_responses.h"
+
+
+/**
+ * Maximum POST request size.
+ */
+#define REQUEST_BUFFER_MAX (1024*1024)
+
+
+
+/**
+ * Process a POST request containing a JSON object. This function
+ * realizes an MHD POST processor that will (incrementally) process
+ * JSON data uploaded to the HTTP server. It will store the required
+ * state in the @a con_cls, which must be cleaned up using
+ * #TMH_PARSE_post_cleanup_callback().
+ *
+ * @param connection the MHD connection
+ * @param con_cls the closure (points to a `struct Buffer *`)
+ * @param upload_data the POST data
+ * @param upload_data_size number of bytes in @a upload_data
+ * @param json the JSON object for a completed request
+ * @return
+ * #GNUNET_YES if json object was parsed or at least
+ * may be parsed in the future (call again);
+ * `*json` will be NULL if we need to be called again,
+ * and non-NULL if we are done.
+ * #GNUNET_NO is request incomplete or invalid
+ * (error message was generated)
+ * #GNUNET_SYSERR on internal error
+ * (we could not even queue an error message,
+ * close HTTP session with MHD_NO)
+ */
+int
+TMH_PARSE_post_json (struct MHD_Connection *connection,
+ void **con_cls,
+ const char *upload_data,
+ size_t *upload_data_size,
+ json_t **json)
+{
+ enum GNUNET_JSON_PostResult pr;
+
+ pr = GNUNET_JSON_post_parser (REQUEST_BUFFER_MAX,
+ con_cls,
+ upload_data,
+ upload_data_size,
+ json);
+ switch (pr)
+ {
+ case GNUNET_JSON_PR_OUT_OF_MEMORY:
+ return (MHD_NO ==
+ TMH_RESPONSE_reply_internal_error (connection,
+ "out of memory"))
+ ? GNUNET_SYSERR : GNUNET_NO;
+ case GNUNET_JSON_PR_CONTINUE:
+ return GNUNET_YES;
+ case GNUNET_JSON_PR_REQUEST_TOO_LARGE:
+ return (MHD_NO ==
+ TMH_RESPONSE_reply_request_too_large (connection))
+ ? GNUNET_SYSERR : GNUNET_NO;
+ case GNUNET_JSON_PR_JSON_INVALID:
+ return (MHD_YES ==
+ TMH_RESPONSE_reply_invalid_json (connection))
+ ? GNUNET_NO : GNUNET_SYSERR;
+ case GNUNET_JSON_PR_SUCCESS:
+ GNUNET_break (NULL != *json);
+ return GNUNET_YES;
+ }
+ /* this should never happen */
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+}
+
+
+/**
+ * Function called whenever we are done with a request
+ * to clean up our state.
+ *
+ * @param con_cls value as it was left by
+ * #TMH_PARSE_post_json(), to be cleaned up
+ */
+void
+TMH_PARSE_post_cleanup_callback (void *con_cls)
+{
+ GNUNET_JSON_post_parser_cleanup (con_cls);
+}
+
+
+/**
+ * Extract base32crockford encoded data from request.
+ *
+ * Queues an error response to the connection if the parameter is
+ * missing or invalid.
+ *
+ * @param connection the MHD connection
+ * @param param_name the name of the parameter with the key
+ * @param[out] out_data pointer to store the result
+ * @param out_size expected size of data
+ * @return
+ * #GNUNET_YES if the the argument is present
+ * #GNUNET_NO if the argument is absent or malformed
+ * #GNUNET_SYSERR on internal error (error response could not be sent)
+ */
+int
+TMH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
+ const char *param_name,
+ void *out_data,
+ size_t out_size)
+{
+ const char *str;
+
+ str = MHD_lookup_connection_value (connection,
+ MHD_GET_ARGUMENT_KIND,
+ param_name);
+ if (NULL == str)
+ {
+ return (MHD_NO ==
+ TMH_RESPONSE_reply_arg_missing (connection, param_name))
+ ? GNUNET_SYSERR : GNUNET_NO;
+ }
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_string_to_data (str,
+ strlen (str),
+ out_data,
+ out_size))
+ return (MHD_NO ==
+ TMH_RESPONSE_reply_arg_invalid (connection, param_name))
+ ? GNUNET_SYSERR : GNUNET_NO;
+ return GNUNET_OK;
+}
+
+
+/**
+ * Parse JSON object into components based on the given field
+ * specification. Generates error response on parse errors.
+ *
+ * @param connection the connection to send an error response to
+ * @param root the JSON node to start the navigation at.
+ * @param[in,out] spec field specification for the parser
+ * @return
+ * #GNUNET_YES if navigation was successful (caller is responsible
+ * for freeing allocated variable-size data using
+ * #GNUNET_JSON_parse_free() when done)
+ * #GNUNET_NO if json is malformed, error response was generated
+ * #GNUNET_SYSERR on internal error
+ */
+int
+TMH_PARSE_json_data (struct MHD_Connection *connection,
+ const json_t *root,
+ struct GNUNET_JSON_Specification *spec)
+{
+ int ret;
+ const char *error_json_name;
+ unsigned int error_line;
+
+ ret = GNUNET_JSON_parse (root,
+ spec,
+ &error_json_name,
+ &error_line);
+ if (GNUNET_SYSERR == ret)
+ {
+ if (NULL == error_json_name)
+ error_json_name = "";
+ ret = (MHD_YES ==
+ TMH_RESPONSE_reply_json_pack (connection,
+ MHD_HTTP_BAD_REQUEST,
+ "{s:s, s:s, s:I}",
+ "error", "parse error",
+ "field", error_json_name,
+ "line", (json_int_t) error_line))
+ ? GNUNET_NO : GNUNET_SYSERR;
+ return ret;
+ }
+ return GNUNET_YES;
+}
+
+
+/**
+ * Parse JSON array into components based on the given field
+ * specification. Generates error response on parse errors.
+ *
+ * @param connection the connection to send an error response to
+ * @param root the JSON node to start the navigation at.
+ * @param[in,out] spec field specification for the parser
+ * @param ... -1-terminated list of array offsets of type 'int'
+ * @return
+ * #GNUNET_YES if navigation was successful (caller is responsible
+ * for freeing allocated variable-size data using
+ * #GNUNET_JSON_parse_free() when done)
+ * #GNUNET_NO if json is malformed, error response was generated
+ * #GNUNET_SYSERR on internal error
+ */
+int
+TMH_PARSE_json_array (struct MHD_Connection *connection,
+ const json_t *root,
+ struct GNUNET_JSON_Specification *spec,
+ ...)
+{
+ int ret;
+ const char *error_json_name;
+ unsigned int error_line;
+ va_list ap;
+ json_int_t dim;
+
+ va_start (ap, spec);
+ dim = 0;
+ while ( (-1 != (ret = va_arg (ap, int))) &&
+ (NULL != root) )
+ {
+ dim++;
+ root = json_array_get (root, ret);
+ }
+ if (NULL == root)
+ {
+ ret = (MHD_YES ==
+ TMH_RESPONSE_reply_json_pack (connection,
+ MHD_HTTP_BAD_REQUEST,
+ "{s:s, s:I}",
+ "error", "parse error",
+ "dimension", dim))
+ ? GNUNET_NO : GNUNET_SYSERR;
+ return ret;
+ }
+ ret = GNUNET_JSON_parse (root,
+ spec,
+ &error_json_name,
+ &error_line);
+ if (GNUNET_SYSERR == ret)
+ {
+ if (NULL == error_json_name)
+ error_json_name = "";
+ ret = (MHD_YES ==
+ TMH_RESPONSE_reply_json_pack (connection,
+ MHD_HTTP_BAD_REQUEST,
+ "{s:s, s:s, s:I}",
+ "error", "parse error",
+ "field", error_json_name,
+ "line", (json_int_t) error_line))
+ ? GNUNET_NO : GNUNET_SYSERR;
+ return ret;
+ }
+ return GNUNET_YES;
+}
+
+
+/* end of taler-exchange-httpd_parsing.c */
diff --git a/src/exchange/taler-exchange-httpd_parsing.h b/src/exchange/taler-exchange-httpd_parsing.h
new file mode 100644
index 000000000..d09f58767
--- /dev/null
+++ b/src/exchange/taler-exchange-httpd_parsing.h
@@ -0,0 +1,139 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2014, 2015, 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU Affero General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+*/
+/**
+ * @file taler-exchange-httpd_parsing.h
+ * @brief functions to parse incoming requests
+ * @author Florian Dold
+ * @author Benedikt Mueller
+ * @author Christian Grothoff
+ */
+#ifndef TALER_EXCHANGE_HTTPD_PARSING_H
+#define TALER_EXCHANGE_HTTPD_PARSING_H
+
+#include
+#include
+#include "taler_util.h"
+#include "taler_json_lib.h"
+
+
+/**
+ * Process a POST request containing a JSON object. This
+ * function realizes an MHD POST processor that will
+ * (incrementally) process JSON data uploaded to the HTTP
+ * server. It will store the required state in the
+ * "connection_cls", which must be cleaned up using
+ * #TMH_PARSE_post_cleanup_callback().
+ *
+ * @param connection the MHD connection
+ * @param con_cls the closure (points to a `struct Buffer *`)
+ * @param upload_data the POST data
+ * @param upload_data_size number of bytes in @a upload_data
+ * @param json the JSON object for a completed request
+ * @return
+ * #GNUNET_YES if json object was parsed or at least
+ * may be parsed in the future (call again);
+ * `*json` will be NULL if we need to be called again,
+ * and non-NULL if we are done.
+ * #GNUNET_NO is request incomplete or invalid
+ * (error message was generated)
+ * #GNUNET_SYSERR on internal error
+ * (we could not even queue an error message,
+ * close HTTP session with MHD_NO)
+ */
+int
+TMH_PARSE_post_json (struct MHD_Connection *connection,
+ void **con_cls,
+ const char *upload_data,
+ size_t *upload_data_size,
+ json_t **json);
+
+
+/**
+ * Function called whenever we are done with a request
+ * to clean up our state.
+ *
+ * @param con_cls value as it was left by
+ * #TMH_PARSE_post_json(), to be cleaned up
+ */
+void
+TMH_PARSE_post_cleanup_callback (void *con_cls);
+
+
+/**
+ * Parse JSON object into components based on the given field
+ * specification.
+ *
+ * @param connection the connection to send an error response to
+ * @param root the JSON node to start the navigation at.
+ * @param spec field specification for the parser
+ * @return
+ * #GNUNET_YES if navigation was successful (caller is responsible
+ * for freeing allocated variable-size data using
+ * #GNUNET_JSON_parse_free() when done)
+ * #GNUNET_NO if json is malformed, error response was generated
+ * #GNUNET_SYSERR on internal error
+ */
+int
+TMH_PARSE_json_data (struct MHD_Connection *connection,
+ const json_t *root,
+ struct GNUNET_JSON_Specification *spec);
+
+
+/**
+ * Parse JSON array into components based on the given field
+ * specification. Generates error response on parse errors.
+ *
+ * @param connection the connection to send an error response to
+ * @param root the JSON node to start the navigation at.
+ * @param[in,out] spec field specification for the parser
+ * @param ... -1-terminated list of array offsets of type 'int'
+ * @return
+ * #GNUNET_YES if navigation was successful (caller is responsible
+ * for freeing allocated variable-size data using
+ * #GNUNET_JSON_parse_free() when done)
+ * #GNUNET_NO if json is malformed, error response was generated
+ * #GNUNET_SYSERR on internal error
+ */
+int
+TMH_PARSE_json_array (struct MHD_Connection *connection,
+ const json_t *root,
+ struct GNUNET_JSON_Specification *spec,
+ ...);
+
+
+/**
+ * Extraxt fixed-size base32crockford encoded data from request.
+ *
+ * Queues an error response to the connection if the parameter is missing or
+ * invalid.
+ *
+ * @param connection the MHD connection
+ * @param param_name the name of the parameter with the key
+ * @param[out] out_data pointer to store the result
+ * @param out_size expected size of @a out_data
+ * @return
+ * #GNUNET_YES if the the argument is present
+ * #GNUNET_NO if the argument is absent or malformed
+ * #GNUNET_SYSERR on internal error (error response could not be sent)
+ */
+int
+TMH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
+ const char *param_name,
+ void *out_data,
+ size_t out_size);
+
+
+#endif /* TALER_EXCHANGE_HTTPD_PARSING_H */
diff --git a/src/mint/taler-mint-httpd_refresh.c b/src/exchange/taler-exchange-httpd_refresh.c
similarity index 82%
rename from src/mint/taler-mint-httpd_refresh.c
rename to src/exchange/taler-exchange-httpd_refresh.c
index 4d89fe892..2349d90ac 100644
--- a/src/mint/taler-mint-httpd_refresh.c
+++ b/src/exchange/taler-exchange-httpd_refresh.c
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_refresh.c
+ * @file taler-exchange-httpd_refresh.c
* @brief Handle /refresh/ requests
* @author Florian Dold
* @author Benedikt Mueller
@@ -24,11 +24,11 @@
#include
#include
#include
-#include "taler-mint-httpd_parsing.h"
-#include "taler-mint-httpd_mhd.h"
-#include "taler-mint-httpd_refresh.h"
-#include "taler-mint-httpd_responses.h"
-#include "taler-mint-httpd_keystate.h"
+#include "taler-exchange-httpd_parsing.h"
+#include "taler-exchange-httpd_mhd.h"
+#include "taler-exchange-httpd_refresh.h"
+#include "taler-exchange-httpd_responses.h"
+#include "taler-exchange-httpd_keystate.h"
/**
@@ -42,9 +42,9 @@
* @param coin_count number of coins to be melted, size of y-dimension of @a commit_coin array
* @param coin_melt_details array with @a coin_count entries with melting details
* @param session_hash hash over the data that the client commits to
- * @param commit_coin 2d array of coin commitments (what the mint is to sign
+ * @param commit_coin 2d array of coin commitments (what the exchange is to sign
* once the "/refres/reveal" of cut and choose is done)
- * @param commit_link 2d array of coin link commitments (what the mint is
+ * @param commit_link 2d array of coin link commitments (what the exchange is
* to return via "/refresh/link" to enable linkage in the
* future)
* @return MHD result code
@@ -56,13 +56,13 @@ handle_refresh_melt_binary (struct MHD_Connection *connection,
unsigned int coin_count,
const struct TMH_DB_MeltDetails *coin_melt_details,
const struct GNUNET_HashCode *session_hash,
- struct TALER_MINTDB_RefreshCommitCoin *const* commit_coin,
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *const* commit_coin,
struct TALER_RefreshCommitLinkP *const* commit_link)
{
unsigned int i;
struct TMH_KS_StateHandle *key_state;
- struct TALER_MINTDB_DenominationKeyIssueInformation *dk;
- struct TALER_MINTDB_DenominationKeyInformationP *dki;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dk;
+ struct TALER_EXCHANGEDB_DenominationKeyInformationP *dki;
struct TALER_Amount cost;
struct TALER_Amount total_cost;
struct TALER_Amount melt;
@@ -72,7 +72,7 @@ handle_refresh_melt_binary (struct MHD_Connection *connection,
struct TALER_Amount total_melt;
GNUNET_assert (GNUNET_OK ==
- TALER_amount_get_zero (TMH_mint_currency_string,
+ TALER_amount_get_zero (TMH_exchange_currency_string,
&total_cost));
key_state = TMH_KS_acquire ();
for (i=0;icoin_info.coin_pub),
- TMH_PARSE_member_denomination_signature ("denom_sig", &sig),
- TMH_PARSE_member_denomination_public_key ("denom_pub", &pk),
- TMH_PARSE_member_fixed ("confirm_sig", &melt_sig),
- TMH_PARSE_member_amount ("value_with_fee", &amount),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("coin_pub", &r_melt_detail->coin_info.coin_pub),
+ TALER_JSON_spec_denomination_signature ("denom_sig", &sig),
+ TALER_JSON_spec_denomination_public_key ("denom_pub", &pk),
+ GNUNET_JSON_spec_fixed_auto ("confirm_sig", &melt_sig),
+ TALER_JSON_spec_amount ("value_with_fee", &amount),
+ GNUNET_JSON_spec_end ()
};
ret = TMH_PARSE_json_data (connection,
@@ -209,14 +209,14 @@ get_coin_public_info (struct MHD_Connection *connection,
GNUNET_break_op (0);
return ret;
}
- /* check mint signature on the coin */
+ /* check exchange signature on the coin */
r_melt_detail->coin_info.denom_sig = sig;
r_melt_detail->coin_info.denom_pub = pk;
if (GNUNET_OK !=
TALER_test_coin_valid (&r_melt_detail->coin_info))
{
GNUNET_break_op (0);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
r_melt_detail->coin_info.denom_sig.rsa_signature = NULL;
r_melt_detail->coin_info.denom_pub.rsa_public_key = NULL;
return (MHD_YES ==
@@ -252,7 +252,7 @@ verify_coin_public_info (struct MHD_Connection *connection,
{
struct TALER_RefreshMeltCoinAffirmationPS body;
struct TMH_KS_StateHandle *key_state;
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
struct TALER_Amount fee_refresh;
key_state = TMH_KS_acquire ();
@@ -314,7 +314,7 @@ verify_coin_public_info (struct MHD_Connection *connection,
* @param num_new_coins size of 2nd dimension
*/
static void
-free_commit_coins (struct TALER_MINTDB_RefreshCommitCoin **commit_coin,
+free_commit_coins (struct TALER_EXCHANGEDB_RefreshCommitCoin **commit_coin,
unsigned int kappa,
unsigned int num_new_coins)
{
@@ -396,7 +396,7 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
unsigned int coin_count;
struct GNUNET_HashCode session_hash;
struct GNUNET_HashContext *hash_context;
- struct TALER_MINTDB_RefreshCommitCoin *commit_coin[TALER_CNC_KAPPA];
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coin[TALER_CNC_KAPPA];
struct TALER_RefreshCommitLinkP *commit_link[TALER_CNC_KAPPA];
/* For the signature check, we hash most of the inputs together
@@ -409,12 +409,16 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
{
char *buf;
size_t buf_size;
+ struct GNUNET_JSON_Specification spec[] = {
+ TALER_JSON_spec_denomination_public_key (NULL,
+ &denom_pubs[i]),
+ GNUNET_JSON_spec_end ()
+ };
- res = TMH_PARSE_navigate_json (connection,
- new_denoms,
- TMH_PARSE_JNC_INDEX, (int) i,
- TMH_PARSE_JNC_RET_RSA_PUBLIC_KEY,
- &denom_pubs[i].rsa_public_key);
+ res = TMH_PARSE_json_array (connection,
+ new_denoms,
+ spec,
+ i, -1);
if (GNUNET_OK != res)
{
res = (GNUNET_NO == res) ? MHD_YES : MHD_NO;
@@ -436,6 +440,7 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
/* decode JSON data on coin to melt */
struct TALER_AmountNBO melt_amount;
+ // FIXME: check json_array_get() return value for NULL!
res = get_coin_public_info (connection,
json_array_get (melt_coins, i),
&coin_melt_details[i]);
@@ -476,21 +481,29 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
for (i = 0; i < TALER_CNC_KAPPA; i++)
{
commit_coin[i] = GNUNET_malloc (num_newcoins *
- sizeof (struct TALER_MINTDB_RefreshCommitCoin));
+ sizeof (struct TALER_EXCHANGEDB_RefreshCommitCoin));
for (j = 0; j < num_newcoins; j++)
{
char *link_enc;
size_t link_enc_size;
- struct TALER_MINTDB_RefreshCommitCoin *rcc = &commit_coin[i][j];
-
- res = TMH_PARSE_navigate_json (connection,
- coin_evs,
- TMH_PARSE_JNC_INDEX, (int) i,
- TMH_PARSE_JNC_INDEX, (int) j,
- TMH_PARSE_JNC_RET_DATA_VAR,
- &rcc->coin_ev,
- &rcc->coin_ev_size);
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *rcc = &commit_coin[i][j];
+ struct GNUNET_JSON_Specification coin_spec[] = {
+ GNUNET_JSON_spec_varsize (NULL,
+ (void **) &rcc->coin_ev,
+ &rcc->coin_ev_size),
+ GNUNET_JSON_spec_end ()
+ };
+ struct GNUNET_JSON_Specification link_spec[] = {
+ GNUNET_JSON_spec_varsize (NULL,
+ (void **) &link_enc,
+ &link_enc_size),
+ GNUNET_JSON_spec_end ()
+ };
+ res = TMH_PARSE_json_array (connection,
+ coin_evs,
+ coin_spec,
+ i, j, -1);
if (GNUNET_OK != res)
{
GNUNET_break_op (0);
@@ -501,13 +514,10 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
GNUNET_CRYPTO_hash_context_read (hash_context,
rcc->coin_ev,
rcc->coin_ev_size);
- res = TMH_PARSE_navigate_json (connection,
- link_encs,
- TMH_PARSE_JNC_INDEX, (int) i,
- TMH_PARSE_JNC_INDEX, (int) j,
- TMH_PARSE_JNC_RET_DATA_VAR,
- &link_enc,
- &link_enc_size);
+ res = TMH_PARSE_json_array (connection,
+ link_encs,
+ link_spec,
+ i, j, -1);
if (GNUNET_OK != res)
{
GNUNET_break_op (0);
@@ -520,7 +530,7 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
GNUNET_CRYPTO_hash_context_read (hash_context,
link_enc,
link_enc_size);
- GNUNET_free (link_enc);
+ GNUNET_JSON_parse_free (link_spec);
}
}
@@ -531,27 +541,29 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
for (j = 0; j < num_oldcoins; j++)
{
struct TALER_RefreshCommitLinkP *rcl = &commit_link[i][j];
+ struct GNUNET_JSON_Specification trans_spec[] = {
+ GNUNET_JSON_spec_fixed_auto (NULL, &rcl->transfer_pub),
+ GNUNET_JSON_spec_end ()
+ };
+ struct GNUNET_JSON_Specification sec_spec[] = {
+ GNUNET_JSON_spec_fixed_auto (NULL, &rcl->shared_secret_enc),
+ GNUNET_JSON_spec_end ()
+ };
- res = TMH_PARSE_navigate_json (connection,
- transfer_pubs,
- TMH_PARSE_JNC_INDEX, (int) i,
- TMH_PARSE_JNC_INDEX, (int) j,
- TMH_PARSE_JNC_RET_DATA,
- &rcl->transfer_pub,
- sizeof (struct TALER_TransferPublicKeyP));
+ res = TMH_PARSE_json_array (connection,
+ transfer_pubs,
+ trans_spec,
+ i, j, -1);
if (GNUNET_OK != res)
{
GNUNET_break_op (0);
res = (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
goto cleanup;
}
- res = TMH_PARSE_navigate_json (connection,
- secret_encs,
- TMH_PARSE_JNC_INDEX, (int) i,
- TMH_PARSE_JNC_INDEX, (int) j,
- TMH_PARSE_JNC_RET_DATA,
- &rcl->shared_secret_enc,
- sizeof (struct TALER_EncryptedLinkSecretP));
+ res = TMH_PARSE_json_array (connection,
+ secret_encs,
+ sec_spec,
+ i, j, -1);
if (GNUNET_OK != res)
{
GNUNET_break_op (0);
@@ -646,15 +658,16 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
unsigned int num_oldcoins;
unsigned int num_newcoins;
json_t *coin_detail;
+ json_t *trans_detail;
int res;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_array ("new_denoms", &new_denoms),
- TMH_PARSE_member_array ("melt_coins", &melt_coins),
- TMH_PARSE_member_array ("coin_evs", &coin_evs),
- TMH_PARSE_member_array ("link_encs", &link_encs),
- TMH_PARSE_member_array ("transfer_pubs", &transfer_pubs),
- TMH_PARSE_member_array ("secret_encs", &secret_encs),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_json ("new_denoms", &new_denoms),
+ GNUNET_JSON_spec_json ("melt_coins", &melt_coins),
+ GNUNET_JSON_spec_json ("coin_evs", &coin_evs),
+ GNUNET_JSON_spec_json ("link_encs", &link_encs),
+ GNUNET_JSON_spec_json ("transfer_pubs", &transfer_pubs),
+ GNUNET_JSON_spec_json ("secret_encs", &secret_encs),
+ GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
@@ -678,43 +691,36 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
if (TALER_CNC_KAPPA != json_array_size (coin_evs))
{
GNUNET_break_op (0);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
"coin_evs");
}
if (TALER_CNC_KAPPA != json_array_size (transfer_pubs))
{
GNUNET_break_op (0);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
"transfer_pubs");
}
- res = TMH_PARSE_navigate_json (connection,
- coin_evs,
- TMH_PARSE_JNC_INDEX, (int) 0,
- TMH_PARSE_JNC_RET_TYPED_JSON,
- JSON_ARRAY, &coin_detail);
- if (GNUNET_OK != res)
+ coin_detail = json_array_get (coin_evs, 0);
+ if (NULL == coin_detail)
{
+ // FIXME: generate proper HTTP response!
GNUNET_break_op (0);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
}
num_newcoins = json_array_size (coin_detail);
- json_decref (coin_detail);
- res = TMH_PARSE_navigate_json (connection,
- transfer_pubs,
- TMH_PARSE_JNC_INDEX, (int) 0,
- TMH_PARSE_JNC_RET_TYPED_JSON,
- JSON_ARRAY, &coin_detail);
- if (GNUNET_OK != res)
+
+ trans_detail = json_array_get (transfer_pubs, 0);
+ if (NULL == trans_detail)
{
+ // FIXME: generate proper HTTP response!
GNUNET_break_op (0);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
}
- num_oldcoins = json_array_size (coin_detail);
- json_decref (coin_detail);
+ num_oldcoins = json_array_size (trans_detail);
res = handle_refresh_melt_json (connection,
new_denoms,
melt_coins,
@@ -724,7 +730,7 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
num_newcoins,
coin_evs,
link_encs);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return res;
}
@@ -763,15 +769,16 @@ handle_refresh_reveal_json (struct MHD_Connection *connection,
break;
for (j = 0; j < num_oldcoins; j++)
{
+ struct GNUNET_JSON_Specification tp_spec[] = {
+ GNUNET_JSON_spec_fixed_auto (NULL, &transfer_privs[i][j]),
+ GNUNET_JSON_spec_end ()
+ };
if (GNUNET_OK != res)
break;
- res = TMH_PARSE_navigate_json (connection,
- tp_json,
- TMH_PARSE_JNC_INDEX, (int) i,
- TMH_PARSE_JNC_INDEX, (int) j,
- TMH_PARSE_JNC_RET_DATA,
- &transfer_privs[i][j],
- sizeof (struct TALER_TransferPrivateKeyP));
+ res = TMH_PARSE_json_array (connection,
+ tp_json,
+ tp_spec,
+ i, j, -1);
GNUNET_break_op (GNUNET_OK == res);
}
}
@@ -817,10 +824,10 @@ TMH_REFRESH_handler_refresh_reveal (struct TMH_RequestHandler *rh,
json_t *reveal_detail;
json_t *root;
json_t *transfer_privs;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_fixed ("session_hash", &session_hash),
- TMH_PARSE_member_array ("transfer_privs", &transfer_privs),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("session_hash", &session_hash),
+ GNUNET_JSON_spec_json ("transfer_privs", &transfer_privs),
+ GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
@@ -846,30 +853,25 @@ TMH_REFRESH_handler_refresh_reveal (struct TMH_RequestHandler *rh,
/* Note we do +1 as 1 row (cut-and-choose!) is missing! */
if (TALER_CNC_KAPPA != json_array_size (transfer_privs) + 1)
{
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
GNUNET_break_op (0);
return TMH_RESPONSE_reply_arg_invalid (connection,
"transfer_privs");
}
- res = TMH_PARSE_navigate_json (connection,
- transfer_privs,
- TMH_PARSE_JNC_INDEX, 0,
- TMH_PARSE_JNC_RET_TYPED_JSON,
- JSON_ARRAY,
- &reveal_detail);
- if (GNUNET_OK != res)
+ reveal_detail = json_array_get (transfer_privs, 0);
+ if (NULL == reveal_detail)
{
- TMH_PARSE_release_data (spec);
+ // FIXME: generate proper HTTP response!
+ GNUNET_JSON_parse_free (spec);
GNUNET_break_op (0);
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
}
num_oldcoins = json_array_size (reveal_detail);
- json_decref (reveal_detail);
res = handle_refresh_reveal_json (connection,
&session_hash,
num_oldcoins,
transfer_privs);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return res;
}
@@ -908,4 +910,4 @@ TMH_REFRESH_handler_refresh_link (struct TMH_RequestHandler *rh,
}
-/* end of taler-mint-httpd_refresh.c */
+/* end of taler-exchange-httpd_refresh.c */
diff --git a/src/mint/taler-mint-httpd_refresh.h b/src/exchange/taler-exchange-httpd_refresh.h
similarity index 95%
rename from src/mint/taler-mint-httpd_refresh.h
rename to src/exchange/taler-exchange-httpd_refresh.h
index 8fe12a272..aae9c4c6c 100644
--- a/src/mint/taler-mint-httpd_refresh.h
+++ b/src/exchange/taler-exchange-httpd_refresh.h
@@ -14,18 +14,18 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_refresh.h
+ * @file taler-exchange-httpd_refresh.h
* @brief Handle /refresh/ requests
* @author Florian Dold
* @author Benedikt Mueller
* @author Christian Grothoff
*/
-#ifndef TALER_MINT_HTTPD_REFRESH_H
-#define TALER_MINT_HTTPD_REFRESH_H
+#ifndef TALER_EXCHANGE_HTTPD_REFRESH_H
+#define TALER_EXCHANGE_HTTPD_REFRESH_H
#include
#include
-#include "taler-mint-httpd.h"
+#include "taler-exchange-httpd.h"
/**
diff --git a/src/mint/taler-mint-httpd_reserve.c b/src/exchange/taler-exchange-httpd_reserve.c
similarity index 90%
rename from src/mint/taler-mint-httpd_reserve.c
rename to src/exchange/taler-exchange-httpd_reserve.c
index c887ee750..1763280ed 100644
--- a/src/mint/taler-mint-httpd_reserve.c
+++ b/src/exchange/taler-exchange-httpd_reserve.c
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_reserve.c
+ * @file taler-exchange-httpd_reserve.c
* @brief Handle /reserve/ requests
* @author Florian Dold
* @author Benedikt Mueller
@@ -23,10 +23,10 @@
#include "platform.h"
#include
#include
-#include "taler-mint-httpd_reserve.h"
-#include "taler-mint-httpd_parsing.h"
-#include "taler-mint-httpd_responses.h"
-#include "taler-mint-httpd_keystate.h"
+#include "taler-exchange-httpd_reserve.h"
+#include "taler-exchange-httpd_parsing.h"
+#include "taler-exchange-httpd_responses.h"
+#include "taler-exchange-httpd_keystate.h"
/**
@@ -98,20 +98,20 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh,
struct TALER_Amount amount_with_fee;
struct TALER_Amount fee_withdraw;
struct TALER_ReserveSignatureP signature;
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
struct TMH_KS_StateHandle *ks;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_variable ("coin_ev",
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_varsize ("coin_ev",
(void **) &blinded_msg,
&blinded_msg_len),
- TMH_PARSE_member_fixed ("reserve_pub",
+ GNUNET_JSON_spec_fixed_auto ("reserve_pub",
&wsrd.reserve_pub),
- TMH_PARSE_member_fixed ("reserve_sig",
+ GNUNET_JSON_spec_fixed_auto ("reserve_sig",
&signature),
- TMH_PARSE_member_denomination_public_key ("denom_pub",
+ TALER_JSON_spec_denomination_public_key ("denom_pub",
&denomination_pub),
- TMH_PARSE_MEMBER_END
+ GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
@@ -135,7 +135,7 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh,
TMH_KS_DKU_WITHDRAW);
if (NULL == dki)
{
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
TMH_KS_release (ks);
return TMH_RESPONSE_reply_arg_unknown (connection,
"denom_pub");
@@ -169,7 +169,7 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh,
&wsrd.reserve_pub.eddsa_pub))
{
TALER_LOG_WARNING ("Client supplied invalid signature for /reserve/withdraw request\n");
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_signature_invalid (connection,
"reserve_sig");
}
@@ -179,8 +179,8 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh,
blinded_msg,
blinded_msg_len,
&signature);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return res;
}
-/* end of taler-mint-httpd_reserve.c */
+/* end of taler-exchange-httpd_reserve.c */
diff --git a/src/mint/taler-mint-httpd_reserve.h b/src/exchange/taler-exchange-httpd_reserve.h
similarity index 94%
rename from src/mint/taler-mint-httpd_reserve.h
rename to src/exchange/taler-exchange-httpd_reserve.h
index 71a779fe3..9a4960066 100644
--- a/src/mint/taler-mint-httpd_reserve.h
+++ b/src/exchange/taler-exchange-httpd_reserve.h
@@ -14,17 +14,17 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_reserve.h
+ * @file taler-exchange-httpd_reserve.h
* @brief Handle /reserve/ requests
* @author Florian Dold
* @author Benedikt Mueller
* @author Christian Grothoff
*/
-#ifndef TALER_MINT_HTTPD_RESERVE_H
-#define TALER_MINT_HTTPD_RESERVE_H
+#ifndef TALER_EXCHANGE_HTTPD_RESERVE_H
+#define TALER_EXCHANGE_HTTPD_RESERVE_H
#include
-#include "taler-mint-httpd.h"
+#include "taler-exchange-httpd.h"
/**
* Handle a "/reserve/status" request. Parses the
diff --git a/src/mint/taler-mint-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
similarity index 81%
rename from src/mint/taler-mint-httpd_responses.c
rename to src/exchange/taler-exchange-httpd_responses.c
index 2ebd0d331..f8ff67228 100644
--- a/src/mint/taler-mint-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -14,8 +14,8 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_responses.c
- * @brief API for generating the various replies of the mint; these
+ * @file taler-exchange-httpd_responses.c
+ * @brief API for generating the various replies of the exchange; these
* functions are called TMH_RESPONSE_reply_ and they generate
* and queue MHD response objects for a given connection.
* @author Florian Dold
@@ -23,10 +23,10 @@
* @author Christian Grothoff
*/
#include "platform.h"
-#include "taler-mint-httpd_responses.h"
+#include "taler-exchange-httpd_responses.h"
#include "taler_util.h"
-#include
-#include "taler-mint-httpd_keystate.h"
+#include "taler_json_lib.h"
+#include "taler-exchange-httpd_keystate.h"
/**
@@ -39,7 +39,7 @@
void
TMH_RESPONSE_add_global_headers (struct MHD_Response *response)
{
- if (TMH_mint_connection_close)
+ if (TMH_exchange_connection_close)
(void) MHD_add_response_header (response,
MHD_HTTP_HEADER_CONNECTION,
"close");
@@ -147,7 +147,7 @@ TMH_RESPONSE_reply_arg_invalid (struct MHD_Connection *connection,
/**
* Send a response indicating an argument refering to a
- * resource unknown to the mint (i.e. unknown reserve or
+ * resource unknown to the exchange (i.e. unknown reserve or
* denomination key).
*
* @param connection the MHD connection to use
@@ -279,7 +279,7 @@ TMH_RESPONSE_reply_commit_error (struct MHD_Connection *connection)
/**
- * Send a response indicating a failure to talk to the Mint's
+ * Send a response indicating a failure to talk to the Exchange's
* database.
*
* @param connection the MHD connection to use
@@ -339,7 +339,7 @@ TMH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection)
/**
* Send confirmation of deposit success to client. This function
* will create a signed message affirming the given information
- * and return it to the client. By this, the mint affirms that
+ * and return it to the client. By this, the exchange affirms that
* the coin had sufficient (residual) value for the specified
* transaction and that it will execute the requested deposit
* operation with the given wiring details.
@@ -367,10 +367,10 @@ TMH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
const struct TALER_Amount *amount_without_fee)
{
struct TALER_DepositConfirmationPS dc;
- struct TALER_MintPublicKeyP pub;
- struct TALER_MintSignatureP sig;
+ struct TALER_ExchangePublicKeyP pub;
+ struct TALER_ExchangeSignatureP sig;
- dc.purpose.purpose = htonl (TALER_SIGNATURE_MINT_CONFIRM_DEPOSIT);
+ dc.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT);
dc.purpose.size = htonl (sizeof (struct TALER_DepositConfirmationPS));
dc.h_contract = *h_contract;
dc.h_wire = *h_wire;
@@ -388,9 +388,9 @@ TMH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
MHD_HTTP_OK,
"{s:s, s:o, s:o}",
"status", "DEPOSIT_OK",
- "sig", TALER_json_from_data (&sig,
+ "sig", GNUNET_JSON_from_data (&sig,
sizeof (sig)),
- "pub", TALER_json_from_data (&pub,
+ "pub", GNUNET_JSON_from_data (&pub,
sizeof (pub)));
}
@@ -402,24 +402,24 @@ TMH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
* @return json representation of the @a rh
*/
static json_t *
-compile_transaction_history (const struct TALER_MINTDB_TransactionList *tl)
+compile_transaction_history (const struct TALER_EXCHANGEDB_TransactionList *tl)
{
json_t *details;
const char *type;
struct TALER_Amount value;
json_t *history;
const struct TALER_CoinSpendSignatureP *sig;
- const struct TALER_MINTDB_TransactionList *pos;
+ const struct TALER_EXCHANGEDB_TransactionList *pos;
history = json_array ();
for (pos = tl; NULL != pos; pos = pos->next)
{
switch (pos->type)
{
- case TALER_MINTDB_TT_DEPOSIT:
+ case TALER_EXCHANGEDB_TT_DEPOSIT:
{
struct TALER_DepositRequestPS dr;
- const struct TALER_MINTDB_Deposit *deposit = pos->details.deposit;
+ const struct TALER_EXCHANGEDB_Deposit *deposit = pos->details.deposit;
type = "DEPOSIT";
value = deposit->amount_with_fee;
@@ -449,14 +449,14 @@ compile_transaction_history (const struct TALER_MINTDB_TransactionList *tl)
return NULL;
}
- details = TALER_json_from_data (&dr.purpose,
+ details = GNUNET_JSON_from_data (&dr.purpose,
sizeof (struct TALER_DepositRequestPS));
break;
}
- case TALER_MINTDB_TT_REFRESH_MELT:
+ case TALER_EXCHANGEDB_TT_REFRESH_MELT:
{
struct TALER_RefreshMeltCoinAffirmationPS ms;
- const struct TALER_MINTDB_RefreshMelt *melt = pos->details.melt;
+ const struct TALER_EXCHANGEDB_RefreshMelt *melt = pos->details.melt;
type = "MELT";
value = melt->amount_with_fee;
@@ -481,7 +481,7 @@ compile_transaction_history (const struct TALER_MINTDB_TransactionList *tl)
return NULL;
}
- details = TALER_json_from_data (&ms.purpose,
+ details = GNUNET_JSON_from_data (&ms.purpose,
sizeof (struct TALER_RefreshMeltCoinAffirmationPS));
}
break;
@@ -491,8 +491,8 @@ compile_transaction_history (const struct TALER_MINTDB_TransactionList *tl)
json_array_append_new (history,
json_pack ("{s:s, s:o, s:o, s:o}",
"type", type,
- "amount", TALER_json_from_amount (&value),
- "signature", TALER_json_from_data (sig,
+ "amount", TALER_JSON_from_amount (&value),
+ "signature", GNUNET_JSON_from_data (sig,
sizeof (struct TALER_CoinSpendSignatureP)),
"details", details));
}
@@ -511,7 +511,7 @@ compile_transaction_history (const struct TALER_MINTDB_TransactionList *tl)
*/
int
TMH_RESPONSE_reply_deposit_insufficient_funds (struct MHD_Connection *connection,
- const struct TALER_MINTDB_TransactionList *tl)
+ const struct TALER_EXCHANGEDB_TransactionList *tl)
{
json_t *history;
@@ -535,7 +535,7 @@ TMH_RESPONSE_reply_deposit_insufficient_funds (struct MHD_Connection *connection
* @return json representation of the @a rh, NULL on error
*/
static json_t *
-compile_reserve_history (const struct TALER_MINTDB_ReserveHistory *rh,
+compile_reserve_history (const struct TALER_EXCHANGEDB_ReserveHistory *rh,
struct TALER_Amount *balance)
{
struct TALER_Amount deposit_total;
@@ -543,7 +543,7 @@ compile_reserve_history (const struct TALER_MINTDB_ReserveHistory *rh,
struct TALER_Amount value;
json_t *json_history;
int ret;
- const struct TALER_MINTDB_ReserveHistory *pos;
+ const struct TALER_EXCHANGEDB_ReserveHistory *pos;
struct TALER_WithdrawRequestPS wr;
json_history = json_array ();
@@ -552,7 +552,7 @@ compile_reserve_history (const struct TALER_MINTDB_ReserveHistory *rh,
{
switch (pos->type)
{
- case TALER_MINTDB_RO_BANK_TO_MINT:
+ case TALER_EXCHANGEDB_RO_BANK_TO_EXCHANGE:
if (0 == ret)
deposit_total = pos->details.bank->amount;
else
@@ -569,9 +569,9 @@ compile_reserve_history (const struct TALER_MINTDB_ReserveHistory *rh,
json_pack ("{s:s, s:O, s:o}",
"type", "DEPOSIT",
"wire", pos->details.bank->wire,
- "amount", TALER_json_from_amount (&pos->details.bank->amount)));
+ "amount", TALER_JSON_from_amount (&pos->details.bank->amount)));
break;
- case TALER_MINTDB_RO_WITHDRAW_COIN:
+ case TALER_EXCHANGEDB_RO_WITHDRAW_COIN:
break;
}
}
@@ -581,9 +581,9 @@ compile_reserve_history (const struct TALER_MINTDB_ReserveHistory *rh,
{
switch (pos->type)
{
- case TALER_MINTDB_RO_BANK_TO_MINT:
+ case TALER_EXCHANGEDB_RO_BANK_TO_EXCHANGE:
break;
- case TALER_MINTDB_RO_WITHDRAW_COIN:
+ case TALER_EXCHANGEDB_RO_WITHDRAW_COIN:
value = pos->details.withdraw->amount_with_fee;
if (0 == ret)
{
@@ -614,11 +614,11 @@ compile_reserve_history (const struct TALER_MINTDB_ReserveHistory *rh,
json_array_append_new (json_history,
json_pack ("{s:s, s:o, s:o, s:o}",
"type", "WITHDRAW",
- "signature", TALER_json_from_data (&pos->details.withdraw->reserve_sig,
+ "signature", GNUNET_JSON_from_data (&pos->details.withdraw->reserve_sig,
sizeof (struct TALER_ReserveSignatureP)),
- "details", TALER_json_from_data (&wr,
+ "details", GNUNET_JSON_from_data (&wr,
sizeof (wr)),
- "amount", TALER_json_from_amount (&value)));
+ "amount", TALER_JSON_from_amount (&value)));
break;
}
}
@@ -651,7 +651,7 @@ compile_reserve_history (const struct TALER_MINTDB_ReserveHistory *rh,
*/
int
TMH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
- const struct TALER_MINTDB_ReserveHistory *rh)
+ const struct TALER_EXCHANGEDB_ReserveHistory *rh)
{
json_t *json_balance;
json_t *json_history;
@@ -662,7 +662,7 @@ TMH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
if (NULL == json_history)
return TMH_RESPONSE_reply_internal_error (connection,
"balance calculation failure");
- json_balance = TALER_json_from_amount (&balance);
+ json_balance = TALER_JSON_from_amount (&balance);
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o, s:o}",
@@ -682,7 +682,7 @@ TMH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
*/
int
TMH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *connection,
- const struct TALER_MINTDB_ReserveHistory *rh)
+ const struct TALER_EXCHANGEDB_ReserveHistory *rh)
{
json_t *json_balance;
json_t *json_history;
@@ -693,7 +693,7 @@ TMH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *c
if (NULL == json_history)
return TMH_RESPONSE_reply_internal_error (connection,
"balance calculation failure");
- json_balance = TALER_json_from_amount (&balance);
+ json_balance = TALER_JSON_from_amount (&balance);
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_PAYMENT_REQUIRED,
"{s:s, s:o, s:o}",
@@ -712,11 +712,11 @@ TMH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *c
*/
int
TMH_RESPONSE_reply_reserve_withdraw_success (struct MHD_Connection *connection,
- const struct TALER_MINTDB_CollectableBlindcoin *collectable)
+ const struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable)
{
json_t *sig_json;
- sig_json = TALER_json_from_rsa_signature (collectable->sig.rsa_signature);
+ sig_json = GNUNET_JSON_from_rsa_signature (collectable->sig.rsa_signature);
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
@@ -728,7 +728,7 @@ TMH_RESPONSE_reply_reserve_withdraw_success (struct MHD_Connection *connection,
* Send a response for a failed "/refresh/melt" request. The
* transaction history of the given coin demonstrates that the
* @a residual value of the coin is below the @a requested
- * contribution of the coin for the melt. Thus, the mint
+ * contribution of the coin for the melt. Thus, the exchange
* refuses the melt operation.
*
* @param connection the connection to send the response to
@@ -743,7 +743,7 @@ int
TMH_RESPONSE_reply_refresh_melt_insufficient_funds (struct MHD_Connection *connection,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_Amount coin_value,
- struct TALER_MINTDB_TransactionList *tl,
+ struct TALER_EXCHANGEDB_TransactionList *tl,
struct TALER_Amount requested,
struct TALER_Amount residual)
{
@@ -758,14 +758,14 @@ TMH_RESPONSE_reply_refresh_melt_insufficient_funds (struct MHD_Connection *conne
"error",
"insufficient funds",
"coin_pub",
- TALER_json_from_data (coin_pub,
+ GNUNET_JSON_from_data (coin_pub,
sizeof (struct TALER_CoinSpendPublicKeyP)),
"original_value",
- TALER_json_from_amount (&coin_value),
+ TALER_JSON_from_amount (&coin_value),
"residual_value",
- TALER_json_from_amount (&residual),
+ TALER_JSON_from_amount (&residual),
"requested_value",
- TALER_json_from_amount (&requested),
+ TALER_JSON_from_amount (&requested),
"history",
history);
}
@@ -785,27 +785,27 @@ TMH_RESPONSE_reply_refresh_melt_success (struct MHD_Connection *connection,
uint16_t noreveal_index)
{
struct TALER_RefreshMeltConfirmationPS body;
- struct TALER_MintPublicKeyP pub;
- struct TALER_MintSignatureP sig;
+ struct TALER_ExchangePublicKeyP pub;
+ struct TALER_ExchangeSignatureP sig;
json_t *sig_json;
body.purpose.size = htonl (sizeof (struct TALER_RefreshMeltConfirmationPS));
- body.purpose.purpose = htonl (TALER_SIGNATURE_MINT_CONFIRM_MELT);
+ body.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT);
body.session_hash = *session_hash;
body.noreveal_index = htons (noreveal_index);
body.reserved = htons (0);
TMH_KS_sign (&body.purpose,
&pub,
&sig);
- sig_json = TALER_json_from_data (&sig,
+ sig_json = GNUNET_JSON_from_data (&sig,
sizeof (sig));
GNUNET_assert (NULL != sig_json);
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:i, s:o, s:o}",
"noreveal_index", (int) noreveal_index,
- "mint_sig", sig_json,
- "mint_pub", TALER_json_from_data (&pub,
+ "exchange_sig", sig_json,
+ "exchange_pub", GNUNET_JSON_from_data (&pub,
sizeof (pub)));
}
@@ -835,7 +835,7 @@ TMH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,
obj = json_object ();
json_object_set_new (obj,
"ev_sig",
- TALER_json_from_rsa_signature (sigs[newcoin_index].rsa_signature));
+ GNUNET_JSON_from_rsa_signature (sigs[newcoin_index].rsa_signature));
json_array_append_new (list,
obj);
}
@@ -867,7 +867,7 @@ TMH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,
*/
int
TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
- const struct TALER_MINTDB_MeltCommitment *mc,
+ const struct TALER_EXCHANGEDB_MeltCommitment *mc,
unsigned int off,
unsigned int j,
const char *missmatch_object)
@@ -882,25 +882,25 @@ TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
info_old = json_array ();
for (i=0;inum_oldcoins;i++)
{
- const struct TALER_MINTDB_RefreshMelt *rm;
+ const struct TALER_EXCHANGEDB_RefreshMelt *rm;
json_t *rm_json;
rm = &mc->melts[i];
rm_json = json_object ();
json_object_set_new (rm_json,
"coin_sig",
- TALER_json_from_data (&rm->coin_sig,
+ GNUNET_JSON_from_data (&rm->coin_sig,
sizeof (struct TALER_CoinSpendSignatureP)));
json_object_set_new (rm_json,
"coin_pub",
- TALER_json_from_data (&rm->coin.coin_pub,
+ GNUNET_JSON_from_data (&rm->coin.coin_pub,
sizeof (struct TALER_CoinSpendPublicKeyP)));
json_object_set_new (rm_json,
"melt_amount_with_fee",
- TALER_json_from_amount (&rm->amount_with_fee));
+ TALER_JSON_from_amount (&rm->amount_with_fee));
json_object_set_new (rm_json,
"melt_fee",
- TALER_json_from_amount (&rm->melt_fee));
+ TALER_JSON_from_amount (&rm->melt_fee));
json_array_append_new (info_old,
rm_json);
}
@@ -911,7 +911,7 @@ TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
pk = &mc->denom_pubs[i];
json_array_append_new (info_new,
- TALER_json_from_rsa_public_key (pk->rsa_public_key));
+ GNUNET_JSON_from_rsa_public_key (pk->rsa_public_key));
}
info_commit = json_array ();
@@ -924,22 +924,22 @@ TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
info_commit_k = json_array ();
for (i=0;inum_newcoins;i++)
{
- const struct TALER_MINTDB_RefreshCommitCoin *cc;
+ const struct TALER_EXCHANGEDB_RefreshCommitCoin *cc;
json_t *cc_json;
cc = &mc->commit_coins[k][i];
cc_json = json_object ();
json_object_set_new (cc_json,
"coin_ev",
- TALER_json_from_data (cc->coin_ev,
+ GNUNET_JSON_from_data (cc->coin_ev,
cc->coin_ev_size));
json_object_set_new (cc_json,
"coin_priv_enc",
- TALER_json_from_data (cc->refresh_link->coin_priv_enc,
+ GNUNET_JSON_from_data (cc->refresh_link->coin_priv_enc,
sizeof (struct TALER_CoinSpendPrivateKeyP)));
json_object_set_new (cc_json,
"blinding_key_enc",
- TALER_json_from_data (cc->refresh_link->blinding_key_enc,
+ GNUNET_JSON_from_data (cc->refresh_link->blinding_key_enc,
cc->refresh_link->blinding_key_enc_size));
json_array_append_new (info_commit_k,
@@ -957,11 +957,11 @@ TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
cl_json = json_object ();
json_object_set_new (cl_json,
"transfer_pub",
- TALER_json_from_data (&cl->transfer_pub,
+ GNUNET_JSON_from_data (&cl->transfer_pub,
sizeof (struct TALER_TransferPublicKeyP)));
json_object_set_new (cl_json,
"shared_secret_enc",
- TALER_json_from_data (&cl->shared_secret_enc,
+ GNUNET_JSON_from_data (&cl->shared_secret_enc,
sizeof (struct TALER_EncryptedLinkSecretP)));
json_array_append_new (info_link_k,
cl_json);
@@ -1005,7 +1005,7 @@ TMH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection,
mlist = json_array ();
for (i=0;inext)
@@ -1015,15 +1015,15 @@ TMH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection,
obj = json_object ();
json_object_set_new (obj,
"link_enc",
- TALER_json_from_data (pos->link_data_enc->coin_priv_enc,
+ GNUNET_JSON_from_data (pos->link_data_enc->coin_priv_enc,
sizeof (struct TALER_CoinSpendPrivateKeyP) +
pos->link_data_enc->blinding_key_enc_size));
json_object_set_new (obj,
"denom_pub",
- TALER_json_from_rsa_public_key (pos->denom_pub.rsa_public_key));
+ GNUNET_JSON_from_rsa_public_key (pos->denom_pub.rsa_public_key));
json_object_set_new (obj,
"ev_sig",
- TALER_json_from_rsa_signature (pos->ev_sig.rsa_signature));
+ GNUNET_JSON_from_rsa_signature (pos->ev_sig.rsa_signature));
json_array_append_new (list,
obj);
}
@@ -1033,11 +1033,11 @@ TMH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection,
list);
json_object_set_new (root,
"transfer_pub",
- TALER_json_from_data (&sessions[i].transfer_pub,
+ GNUNET_JSON_from_data (&sessions[i].transfer_pub,
sizeof (struct TALER_TransferPublicKeyP)));
json_object_set_new (root,
"secret_enc",
- TALER_json_from_data (&sessions[i].shared_secret_enc,
+ GNUNET_JSON_from_data (&sessions[i].shared_secret_enc,
sizeof (struct TALER_EncryptedLinkSecretP)));
json_array_append_new (mlist,
root);
@@ -1083,7 +1083,7 @@ TMH_RESPONSE_reply_deposit_pending (struct MHD_Connection *connection,
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_ACCEPTED,
"{s:o}",
- "execution_time", TALER_json_from_abs (planned_exec_time));
+ "execution_time", GNUNET_JSON_from_time_abs (planned_exec_time));
}
@@ -1113,10 +1113,10 @@ TMH_RESPONSE_reply_deposit_wtid (struct MHD_Connection *connection,
struct GNUNET_TIME_Absolute exec_time)
{
struct TALER_ConfirmWirePS cw;
- struct TALER_MintPublicKeyP pub;
- struct TALER_MintSignatureP sig;
+ struct TALER_ExchangePublicKeyP pub;
+ struct TALER_ExchangeSignatureP sig;
- cw.purpose.purpose = htonl (TALER_SIGNATURE_MINT_CONFIRM_WIRE);
+ cw.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE);
cw.purpose.size = htonl (sizeof (struct TALER_ConfirmWirePS));
cw.h_wire = *h_wire;
cw.h_contract = *h_contract;
@@ -1132,14 +1132,14 @@ TMH_RESPONSE_reply_deposit_wtid (struct MHD_Connection *connection,
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o, s:o, s:o, s:o, s:o, s:o}",
- "wtid", TALER_json_from_data (wtid,
- sizeof (*wtid)),
- "execution_time", TALER_json_from_abs (exec_time),
- "coin_contribution", TALER_json_from_amount (coin_contribution),
- "mint_sig", TALER_json_from_data (&sig,
- sizeof (sig)),
- "mint_pub", TALER_json_from_data (&pub,
- sizeof (pub)));
+ "wtid", GNUNET_JSON_from_data (wtid,
+ sizeof (*wtid)),
+ "execution_time", GNUNET_JSON_from_time_abs (exec_time),
+ "coin_contribution", TALER_JSON_from_amount (coin_contribution),
+ "exchange_sig", GNUNET_JSON_from_data (&sig,
+ sizeof (sig)),
+ "exchange_pub", GNUNET_JSON_from_data (&pub,
+ sizeof (pub)));
}
@@ -1151,7 +1151,7 @@ TMH_RESPONSE_reply_deposit_wtid (struct MHD_Connection *connection,
* @param total total amount that was transferred
* @param merchant_pub public key of the merchant
* @param h_wire destination account
- * @param deposits details about the combined deposits
+ * @param wdd_head linked list with details about the combined deposits
* @return MHD result code
*/
int
@@ -1159,19 +1159,65 @@ TMH_RESPONSE_reply_wire_deposit_details (struct MHD_Connection *connection,
const struct TALER_Amount *total,
const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct GNUNET_HashCode *h_wire,
- json_t *deposits)
+ const struct TMH_WireDepositDetail *wdd_head)
{
- /* FIXME: #4135: signing not implemented here */
+ const struct TMH_WireDepositDetail *wdd_pos;
+ json_t *deposits;
+ struct TALER_WireDepositDetailP dd;
+ struct GNUNET_HashContext *hash_context;
+ struct TALER_WireDepositDataPS wdp;
+ struct TALER_ExchangePublicKeyP pub;
+ struct TALER_ExchangeSignatureP sig;
+
+ deposits = json_array ();
+ hash_context = GNUNET_CRYPTO_hash_context_start ();
+ for (wdd_pos = wdd_head; NULL != wdd_pos; wdd_pos = wdd_pos->next)
+ {
+ dd.h_contract = wdd_pos->h_contract;
+ dd.transaction_id = GNUNET_htonll (wdd_pos->transaction_id);
+ dd.coin_pub = wdd_pos->coin_pub;
+ TALER_amount_hton (&dd.deposit_value,
+ &wdd_pos->deposit_value);
+ TALER_amount_hton (&dd.deposit_fee,
+ &wdd_pos->deposit_fee);
+ GNUNET_CRYPTO_hash_context_read (hash_context,
+ &dd,
+ sizeof (struct TALER_WireDepositDetailP));
+ json_array_append (deposits,
+ json_pack ("{s:o, s:o, s:o, s:I, s:o}",
+ "deposit_value", TALER_JSON_from_amount (&wdd_pos->deposit_value),
+ "deposit_fee", TALER_JSON_from_amount (&wdd_pos->deposit_fee),
+ "H_contract", GNUNET_JSON_from_data (&wdd_pos->h_contract,
+ sizeof (struct GNUNET_HashCode)),
+ "transaction_id", (json_int_t) wdd_pos->transaction_id,
+ "coin_pub", GNUNET_JSON_from_data (&wdd_pos->coin_pub,
+ sizeof (struct TALER_CoinSpendPublicKeyP))));
+ }
+ wdp.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT);
+ wdp.purpose.size = htonl (sizeof (struct TALER_WireDepositDataPS));
+ TALER_amount_hton (&wdp.total,
+ total);
+ wdp.merchant_pub = *merchant_pub;
+ wdp.h_wire = *h_wire;
+ GNUNET_CRYPTO_hash_context_finish (hash_context,
+ &wdp.h_details);
+ TMH_KS_sign (&wdp.purpose,
+ &pub,
+ &sig);
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o, s:o, s:o, s:o}",
- "total", TALER_json_from_amount (total),
- "merchant_pub", TALER_json_from_data (merchant_pub,
+ "total", TALER_JSON_from_amount (total),
+ "merchant_pub", GNUNET_JSON_from_data (merchant_pub,
sizeof (struct TALER_MerchantPublicKeyP)),
- "h_wire", TALER_json_from_data (h_wire,
+ "h_wire", GNUNET_JSON_from_data (h_wire,
sizeof (struct GNUNET_HashCode)),
- "deposits", deposits);
+ "deposits", deposits,
+ "exchange_sig", GNUNET_JSON_from_data (&sig,
+ sizeof (sig)),
+ "exchange_pub", GNUNET_JSON_from_data (&pub,
+ sizeof (pub)));
}
-/* end of taler-mint-httpd_responses.c */
+/* end of taler-exchange-httpd_responses.c */
diff --git a/src/mint/taler-mint-httpd_responses.h b/src/exchange/taler-exchange-httpd_responses.h
similarity index 89%
rename from src/mint/taler-mint-httpd_responses.h
rename to src/exchange/taler-exchange-httpd_responses.h
index a0396c8a1..c7139bf20 100644
--- a/src/mint/taler-mint-httpd_responses.h
+++ b/src/exchange/taler-exchange-httpd_responses.h
@@ -15,22 +15,22 @@
*/
/**
- * @file taler-mint-httpd_responses.h
- * @brief API for generating the various replies of the mint; these
+ * @file taler-exchange-httpd_responses.h
+ * @brief API for generating the various replies of the exchange; these
* functions are called TMH_RESPONSE_reply_ and they generate
* and queue MHD response objects for a given connection.
* @author Florian Dold
* @author Benedikt Mueller
* @author Christian Grothoff
*/
-#ifndef TALER_MINT_HTTPD_RESPONSES_H
-#define TALER_MINT_HTTPD_RESPONSES_H
+#ifndef TALER_EXCHANGE_HTTPD_RESPONSES_H
+#define TALER_EXCHANGE_HTTPD_RESPONSES_H
#include
#include
#include
#include
-#include "taler-mint-httpd.h"
-#include "taler-mint-httpd_db.h"
+#include "taler-exchange-httpd.h"
+#include "taler-exchange-httpd_db.h"
/**
* Add headers we want to return in every response.
@@ -100,7 +100,7 @@ TMH_RESPONSE_reply_arg_invalid (struct MHD_Connection *connection,
/**
* Send a response indicating an argument refering to a
- * resource unknown to the mint (i.e. unknown reserve or
+ * resource unknown to the exchange (i.e. unknown reserve or
* denomination key).
*
* @param connection the MHD connection to use
@@ -172,7 +172,7 @@ TMH_RESPONSE_reply_commit_error (struct MHD_Connection *connection);
/**
- * Send a response indicating a failure to talk to the Mint's
+ * Send a response indicating a failure to talk to the Exchange's
* database.
*
* @param connection the MHD connection to use
@@ -205,7 +205,7 @@ TMH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection);
/**
* Send confirmation of deposit success to client. This function
* will create a signed message affirming the given information
- * and return it to the client. By this, the mint affirms that
+ * and return it to the client. By this, the exchange affirms that
* the coin had sufficient (residual) value for the specified
* transaction and that it will execute the requested deposit
* operation with the given wiring details.
@@ -244,7 +244,7 @@ TMH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
*/
int
TMH_RESPONSE_reply_deposit_insufficient_funds (struct MHD_Connection *connection,
- const struct TALER_MINTDB_TransactionList *tl);
+ const struct TALER_EXCHANGEDB_TransactionList *tl);
/**
@@ -297,6 +297,49 @@ TMH_RESPONSE_reply_deposit_wtid (struct MHD_Connection *connection,
struct GNUNET_TIME_Absolute exec_time);
+/**
+ * Detail for /wire/deposit response.
+ */
+struct TMH_WireDepositDetail
+{
+
+ /**
+ * We keep deposit details in a DLL.
+ */
+ struct TMH_WireDepositDetail *next;
+
+ /**
+ * We keep deposit details in a DLL.
+ */
+ struct TMH_WireDepositDetail *prev;
+
+ /**
+ * Hash of the contract
+ */
+ struct GNUNET_HashCode h_contract;
+
+ /**
+ * Merchant's transaction ID.
+ */
+ uint64_t transaction_id;
+
+ /**
+ * Coin's public key.
+ */
+ struct TALER_CoinSpendPublicKeyP coin_pub;
+
+ /**
+ * Total value of the coin.
+ */
+ struct TALER_Amount deposit_value;
+
+ /**
+ * Fees charged by the exchange for the deposit.
+ */
+ struct TALER_Amount deposit_fee;
+};
+
+
/**
* A merchant asked for transaction details about a wire transfer.
* Provide them. Generates the 200 reply.
@@ -305,7 +348,7 @@ TMH_RESPONSE_reply_deposit_wtid (struct MHD_Connection *connection,
* @param total total amount that was transferred
* @param merchant_pub public key of the merchant
* @param h_wire destination account
- * @param deposits details about the combined deposits
+ * @param wdd_head linked list with details about the combined deposits
* @return MHD result code
*/
int
@@ -313,7 +356,7 @@ TMH_RESPONSE_reply_wire_deposit_details (struct MHD_Connection *connection,
const struct TALER_Amount *total,
const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct GNUNET_HashCode *h_wire,
- json_t *deposits);
+ const struct TMH_WireDepositDetail *wdd_head);
/**
@@ -325,7 +368,7 @@ TMH_RESPONSE_reply_wire_deposit_details (struct MHD_Connection *connection,
*/
int
TMH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
- const struct TALER_MINTDB_ReserveHistory *rh);
+ const struct TALER_EXCHANGEDB_ReserveHistory *rh);
/**
@@ -339,7 +382,7 @@ TMH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
*/
int
TMH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *connection,
- const struct TALER_MINTDB_ReserveHistory *rh);
+ const struct TALER_EXCHANGEDB_ReserveHistory *rh);
/**
@@ -351,7 +394,7 @@ TMH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *c
*/
int
TMH_RESPONSE_reply_reserve_withdraw_success (struct MHD_Connection *connection,
- const struct TALER_MINTDB_CollectableBlindcoin *collectable);
+ const struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable);
/**
@@ -372,7 +415,7 @@ TMH_RESPONSE_reply_refresh_melt_success (struct MHD_Connection *connection,
* Send a response for a failed "/refresh/melt" request. The
* transaction history of the given coin demonstrates that the
* @a residual value of the coin is below the @a requested
- * contribution of the coin for the melt. Thus, the mint
+ * contribution of the coin for the melt. Thus, the exchange
* refuses the melt operation.
*
* @param connection the connection to send the response to
@@ -387,7 +430,7 @@ int
TMH_RESPONSE_reply_refresh_melt_insufficient_funds (struct MHD_Connection *connection,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_Amount coin_value,
- struct TALER_MINTDB_TransactionList *tl,
+ struct TALER_EXCHANGEDB_TransactionList *tl,
struct TALER_Amount requested,
struct TALER_Amount residual);
@@ -422,7 +465,7 @@ TMH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,
*/
int
TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
- const struct TALER_MINTDB_MeltCommitment *mc,
+ const struct TALER_EXCHANGEDB_MeltCommitment *mc,
unsigned int off,
unsigned int j,
const char *missmatch_object);
@@ -446,7 +489,7 @@ struct TMH_RESPONSE_LinkSessionInfo
/**
* Linked data of coins being created in the session.
*/
- struct TALER_MINTDB_LinkDataList *ldl;
+ struct TALER_EXCHANGEDB_LinkDataList *ldl;
};
diff --git a/src/mint/taler-mint-httpd_test.c b/src/exchange/taler-exchange-httpd_test.c
similarity index 87%
rename from src/mint/taler-mint-httpd_test.c
rename to src/exchange/taler-exchange-httpd_test.c
index b894854f3..7c9e0820d 100644
--- a/src/mint/taler-mint-httpd_test.c
+++ b/src/exchange/taler-exchange-httpd_test.c
@@ -14,25 +14,26 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_test.c
+ * @file taler-exchange-httpd_test.c
* @brief Handle /test requests; parses the POST and JSON and
* checks that the client is binary-compatible
* @author Christian Grothoff
*/
#include "platform.h"
#include
+#include
#include
#include
#include "taler_signatures.h"
-#include "taler-mint-httpd_test.h"
-#include "taler-mint-httpd_parsing.h"
-#include "taler-mint-httpd_responses.h"
+#include "taler-exchange-httpd_test.h"
+#include "taler-exchange-httpd_parsing.h"
+#include "taler-exchange-httpd_responses.h"
/**
* Private key the test module uses for signing.
*/
-static struct GNUNET_CRYPTO_rsa_PrivateKey *rsa_pk;
+static struct GNUNET_CRYPTO_RsaPrivateKey *rsa_pk;
/**
@@ -62,9 +63,9 @@ TMH_TEST_handler_test_base32 (struct TMH_RequestHandler *rh,
void *in_ptr;
size_t in_ptr_size;
struct GNUNET_HashCode hc;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_variable ("input", &in_ptr, &in_ptr_size),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_varsize ("input", &in_ptr, &in_ptr_size),
+ GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
@@ -84,13 +85,13 @@ TMH_TEST_handler_test_base32 (struct TMH_RequestHandler *rh,
GNUNET_CRYPTO_hash (in_ptr,
in_ptr_size,
&hc);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
json_decref (json);
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
"output",
- TALER_json_from_data (&hc, sizeof (struct GNUNET_HashCode)));
+ GNUNET_JSON_from_data (&hc, sizeof (struct GNUNET_HashCode)));
}
@@ -125,10 +126,10 @@ TMH_TEST_handler_test_encrypt (struct TMH_RequestHandler *rh,
struct GNUNET_CRYPTO_SymmetricSessionKey skey;
void *in_ptr;
size_t in_ptr_size;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_variable ("input", &in_ptr, &in_ptr_size),
- TMH_PARSE_member_fixed ("key_hash", &key),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_varsize ("input", &in_ptr, &in_ptr_size),
+ GNUNET_JSON_spec_fixed_auto ("key_hash", &key),
+ GNUNET_JSON_spec_end ()
};
char *out;
@@ -164,10 +165,10 @@ TMH_TEST_handler_test_encrypt (struct TMH_RequestHandler *rh,
&skey,
&iv,
out));
- json = TALER_json_from_data (out,
+ json = GNUNET_JSON_from_data (out,
in_ptr_size);
GNUNET_free (out);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
@@ -205,9 +206,9 @@ TMH_TEST_handler_test_hkdf (struct TMH_RequestHandler *rh,
struct GNUNET_HashCode hc;
void *in_ptr;
size_t in_ptr_size;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_variable ("input", &in_ptr, &in_ptr_size),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_varsize ("input", &in_ptr, &in_ptr_size),
+ GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
@@ -230,8 +231,8 @@ TMH_TEST_handler_test_hkdf (struct TMH_RequestHandler *rh,
in_ptr,
in_ptr_size,
NULL, 0);
- TMH_PARSE_release_data (spec);
- json = TALER_json_from_data (&hc,
+ GNUNET_JSON_parse_free (spec);
+ json = GNUNET_JSON_from_data (&hc,
sizeof (struct GNUNET_HashCode));
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
@@ -267,10 +268,10 @@ TMH_TEST_handler_test_ecdhe (struct TMH_RequestHandler *rh,
struct GNUNET_CRYPTO_EcdhePublicKey pub;
struct GNUNET_CRYPTO_EcdhePrivateKey priv;
struct GNUNET_HashCode hc;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_fixed ("ecdhe_pub", &pub),
- TMH_PARSE_member_fixed ("ecdhe_priv", &priv),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("ecdhe_pub", &pub),
+ GNUNET_JSON_spec_fixed_auto ("ecdhe_priv", &priv),
+ GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
@@ -293,16 +294,16 @@ TMH_TEST_handler_test_ecdhe (struct TMH_RequestHandler *rh,
&pub,
&hc))
{
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_internal_error (connection,
"Failed to perform ECDH");
}
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
"ecdh_hash",
- TALER_json_from_data (&hc,
+ GNUNET_JSON_from_data (&hc,
sizeof (hc)));
}
@@ -312,7 +313,7 @@ TMH_TEST_handler_test_ecdhe (struct TMH_RequestHandler *rh,
* which must contain a "eddsa_pub" with a public key and an
*"eddsa_sig" with the corresponding signature for a purpose
* of #TALER_SIGNATURE_CLIENT_TEST_EDDSA. If the signature is
- * valid, a reply with a #TALER_SIGNATURE_MINT_TEST_EDDSA is
+ * valid, a reply with a #TALER_SIGNATURE_EXCHANGE_TEST_EDDSA is
* returned using the same JSON format.
*
* @param rh context of the handler
@@ -334,10 +335,10 @@ TMH_TEST_handler_test_eddsa (struct TMH_RequestHandler *rh,
struct GNUNET_CRYPTO_EddsaPublicKey pub;
struct GNUNET_CRYPTO_EddsaSignature sig;
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_fixed ("eddsa_pub", &pub),
- TMH_PARSE_member_fixed ("eddsa_sig", &sig),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("eddsa_pub", &pub),
+ GNUNET_JSON_spec_fixed_auto ("eddsa_sig", &sig),
+ GNUNET_JSON_spec_end ()
};
struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
@@ -364,13 +365,13 @@ TMH_TEST_handler_test_eddsa (struct TMH_RequestHandler *rh,
&sig,
&pub))
{
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_signature_invalid (connection,
"eddsa_sig");
}
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
pk = GNUNET_CRYPTO_eddsa_key_create ();
- purpose.purpose = htonl (TALER_SIGNATURE_MINT_TEST_EDDSA);
+ purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_TEST_EDDSA);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_sign (pk,
&purpose,
@@ -387,10 +388,10 @@ TMH_TEST_handler_test_eddsa (struct TMH_RequestHandler *rh,
MHD_HTTP_OK,
"{s:o, s:o}",
"eddsa_pub",
- TALER_json_from_data (&pub,
+ GNUNET_JSON_from_data (&pub,
sizeof (pub)),
"eddsa_sig",
- TALER_json_from_data (&sig,
+ GNUNET_JSON_from_data (&sig,
sizeof (sig)));
}
@@ -414,7 +415,7 @@ TMH_TEST_handler_test_rsa_get (struct TMH_RequestHandler *rh,
size_t *upload_data_size)
{
int res;
- struct GNUNET_CRYPTO_rsa_PublicKey *pub;
+ struct GNUNET_CRYPTO_RsaPublicKey *pub;
if (NULL == rsa_pk)
rsa_pk = GNUNET_CRYPTO_rsa_private_key_create (1024);
@@ -435,7 +436,7 @@ TMH_TEST_handler_test_rsa_get (struct TMH_RequestHandler *rh,
MHD_HTTP_OK,
"{s:o}",
"rsa_pub",
- TALER_json_from_rsa_public_key (pub));
+ GNUNET_JSON_from_rsa_public_key (pub));
GNUNET_CRYPTO_rsa_public_key_free (pub);
return res;
}
@@ -462,12 +463,12 @@ TMH_TEST_handler_test_rsa_sign (struct TMH_RequestHandler *rh,
{
json_t *json;
int res;
- struct GNUNET_CRYPTO_rsa_Signature *sig;
+ struct GNUNET_CRYPTO_RsaSignature *sig;
void *in_ptr;
size_t in_ptr_size;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_variable ("blind_ev", &in_ptr, &in_ptr_size),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_varsize ("blind_ev", &in_ptr, &in_ptr_size),
+ GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
@@ -490,26 +491,26 @@ TMH_TEST_handler_test_rsa_sign (struct TMH_RequestHandler *rh,
if (NULL == rsa_pk)
{
GNUNET_break (0);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_internal_error (connection,
"Failed to create RSA key");
}
- sig = GNUNET_CRYPTO_rsa_sign (rsa_pk,
- in_ptr,
- in_ptr_size);
+ sig = GNUNET_CRYPTO_rsa_sign_blinded (rsa_pk,
+ in_ptr,
+ in_ptr_size);
if (NULL == sig)
{
GNUNET_break (0);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_internal_error (connection,
"Failed to RSA-sign");
}
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
res = TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
"rsa_blind_sig",
- TALER_json_from_rsa_signature (sig));
+ GNUNET_JSON_from_rsa_signature (sig));
GNUNET_CRYPTO_rsa_signature_free (sig);
return res;
}
@@ -541,11 +542,11 @@ TMH_TEST_handler_test_transfer (struct TMH_RequestHandler *rh,
struct TALER_EncryptedLinkSecretP secret_enc;
struct TALER_TransferPrivateKeyP trans_priv;
struct TALER_CoinSpendPublicKeyP coin_pub;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_fixed ("secret_enc", &secret_enc),
- TMH_PARSE_member_fixed ("trans_priv", &trans_priv),
- TMH_PARSE_member_fixed ("coin_pub", &coin_pub),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("secret_enc", &secret_enc),
+ GNUNET_JSON_spec_fixed_auto ("trans_priv", &trans_priv),
+ GNUNET_JSON_spec_fixed_auto ("coin_pub", &coin_pub),
+ GNUNET_JSON_spec_end ()
};
struct TALER_LinkSecretP secret;
@@ -570,7 +571,7 @@ TMH_TEST_handler_test_transfer (struct TMH_RequestHandler *rh,
&coin_pub,
&secret))
{
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_internal_error (connection,
"Failed to decrypt secret");
}
@@ -578,7 +579,7 @@ TMH_TEST_handler_test_transfer (struct TMH_RequestHandler *rh,
MHD_HTTP_OK,
"{s:o}",
"secret",
- TALER_json_from_data (&secret,
+ GNUNET_JSON_from_data (&secret,
sizeof (secret)));
}
@@ -618,4 +619,4 @@ TMH_TEST_handler_test (struct TMH_RequestHandler *rh,
}
-/* end of taler-mint-httpd_test.c */
+/* end of taler-exchange-httpd_test.c */
diff --git a/src/mint/taler-mint-httpd_test.h b/src/exchange/taler-exchange-httpd_test.h
similarity index 97%
rename from src/mint/taler-mint-httpd_test.h
rename to src/exchange/taler-exchange-httpd_test.h
index 33844aab1..30535f54f 100644
--- a/src/mint/taler-mint-httpd_test.h
+++ b/src/exchange/taler-exchange-httpd_test.h
@@ -14,16 +14,16 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_test.h
+ * @file taler-exchange-httpd_test.h
* @brief Handle /test requests
* @author Christian Grothoff
*/
-#ifndef TALER_MINT_HTTPD_TEST_H
-#define TALER_MINT_HTTPD_TEST_H
+#ifndef TALER_EXCHANGE_HTTPD_TEST_H
+#define TALER_EXCHANGE_HTTPD_TEST_H
#include
#include
-#include "taler-mint-httpd.h"
+#include "taler-exchange-httpd.h"
/**
@@ -126,7 +126,7 @@ TMH_TEST_handler_test_ecdhe (struct TMH_RequestHandler *rh,
* which must contain a "eddsa_pub" with a public key and an
*"ecdsa_sig" with the corresponding signature for a purpose
* of #TALER_SIGNATURE_CLIENT_TEST_EDDSA. If the signature is
- * valid, a reply with a #TALER_SIGNATURE_MINT_TEST_EDDSA is
+ * valid, a reply with a #TALER_SIGNATURE_EXCHANGE_TEST_EDDSA is
* returned using the same JSON format.
*
* @param rh context of the handler
diff --git a/src/mint/taler-mint-httpd_tracking.c b/src/exchange/taler-exchange-httpd_tracking.c
similarity index 87%
rename from src/mint/taler-mint-httpd_tracking.c
rename to src/exchange/taler-exchange-httpd_tracking.c
index a6b41cf86..36782332d 100644
--- a/src/mint/taler-mint-httpd_tracking.c
+++ b/src/exchange/taler-exchange-httpd_tracking.c
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_tracking.c
+ * @file taler-exchange-httpd_tracking.c
* @brief Handle wire transfer tracking-related requests
* @author Christian Grothoff
*/
@@ -24,9 +24,9 @@
#include
#include
#include "taler_signatures.h"
-#include "taler-mint-httpd_parsing.h"
-#include "taler-mint-httpd_tracking.h"
-#include "taler-mint-httpd_responses.h"
+#include "taler-exchange-httpd_parsing.h"
+#include "taler-exchange-httpd_tracking.h"
+#include "taler-exchange-httpd_responses.h"
/**
@@ -121,14 +121,14 @@ TMH_TRACKING_handler_deposit_wtid (struct TMH_RequestHandler *rh,
struct TALER_DepositTrackPS tps;
uint64_t transaction_id;
struct TALER_MerchantSignatureP merchant_sig;
- struct TMH_PARSE_FieldSpecification spec[] = {
- TMH_PARSE_member_fixed ("H_wire", &tps.h_wire),
- TMH_PARSE_member_fixed ("H_contract", &tps.h_contract),
- TMH_PARSE_member_fixed ("coin_pub", &tps.coin_pub),
- TMH_PARSE_member_uint64 ("transaction_id", &transaction_id),
- TMH_PARSE_member_fixed ("merchant_pub", &tps.merchant),
- TMH_PARSE_member_fixed ("merchant_sig", &merchant_sig),
- TMH_PARSE_MEMBER_END
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("H_wire", &tps.h_wire),
+ GNUNET_JSON_spec_fixed_auto ("H_contract", &tps.h_contract),
+ GNUNET_JSON_spec_fixed_auto ("coin_pub", &tps.coin_pub),
+ GNUNET_JSON_spec_uint64 ("transaction_id", &transaction_id),
+ GNUNET_JSON_spec_fixed_auto ("merchant_pub", &tps.merchant),
+ GNUNET_JSON_spec_fixed_auto ("merchant_sig", &merchant_sig),
+ GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
@@ -156,10 +156,10 @@ TMH_TRACKING_handler_deposit_wtid (struct TMH_RequestHandler *rh,
&tps.merchant,
&merchant_sig,
transaction_id);
- TMH_PARSE_release_data (spec);
+ GNUNET_JSON_parse_free (spec);
json_decref (json);
return res;
}
-/* end of taler-mint-httpd_tracking.c */
+/* end of taler-exchange-httpd_tracking.c */
diff --git a/src/mint/taler-mint-httpd_tracking.h b/src/exchange/taler-exchange-httpd_tracking.h
similarity index 93%
rename from src/mint/taler-mint-httpd_tracking.h
rename to src/exchange/taler-exchange-httpd_tracking.h
index 9ec4c6827..d77de460a 100644
--- a/src/mint/taler-mint-httpd_tracking.h
+++ b/src/exchange/taler-exchange-httpd_tracking.h
@@ -14,16 +14,16 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_tracking.h
+ * @file taler-exchange-httpd_tracking.h
* @brief Handle wire transfer tracking-related requests
* @author Christian Grothoff
*/
-#ifndef TALER_MINT_HTTPD_TRACKING_H
-#define TALER_MINT_HTTPD_TRACKING_H
+#ifndef TALER_EXCHANGE_HTTPD_TRACKING_H
+#define TALER_EXCHANGE_HTTPD_TRACKING_H
#include
#include
-#include "taler-mint-httpd.h"
+#include "taler-exchange-httpd.h"
/**
diff --git a/src/mint/taler-mint-httpd_validation.c b/src/exchange/taler-exchange-httpd_validation.c
similarity index 66%
rename from src/mint/taler-mint-httpd_validation.c
rename to src/exchange/taler-exchange-httpd_validation.c
index 461e88759..830120a31 100644
--- a/src/mint/taler-mint-httpd_validation.c
+++ b/src/exchange/taler-exchange-httpd_validation.c
@@ -15,14 +15,15 @@
*/
/**
- * @file taler-mint-httpd_validation.c
+ * @file taler-exchange-httpd_validation.c
* @brief helpers for calling the wire plugins to validate addresses
* @author Christian Grothoff
*/
#include "platform.h"
#include
-#include "taler-mint-httpd_validation.h"
-#include "taler_wire_plugin.h"
+#include "taler-exchange-httpd.h"
+#include "taler-exchange-httpd_validation.h"
+#include "taler_wire_lib.h"
/**
@@ -75,18 +76,17 @@ TMH_VALIDATION_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct Plugin *p;
char *wireformats;
- char *lib_name;
const char *token;
/* Find out list of supported wire formats */
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint",
+ "exchange",
"wireformat",
&wireformats))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint",
+ "exchange",
"wireformat");
return GNUNET_SYSERR;
}
@@ -96,24 +96,19 @@ TMH_VALIDATION_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
token = strtok (NULL,
" "))
{
- (void) GNUNET_asprintf (&lib_name,
- "libtaler_plugin_wire_%s",
- lib_name);
p = GNUNET_new (struct Plugin);
p->type = GNUNET_strdup (token);
- p->plugin = GNUNET_PLUGIN_load (lib_name,
- (void *) cfg);
+ p->plugin = TALER_WIRE_plugin_load (cfg,
+ token);
if (NULL == p->plugin)
{
GNUNET_free (p);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to load plugin %s\n",
- lib_name);
- GNUNET_free (lib_name);
+ token);
TMH_VALIDATION_done ();
return GNUNET_SYSERR;
}
- p->plugin->library_name = lib_name;
GNUNET_CONTAINER_DLL_insert (wire_head,
wire_tail,
p);
@@ -130,17 +125,13 @@ void
TMH_VALIDATION_done ()
{
struct Plugin *p;
- char *lib_name;
while (NULL != (p = wire_head))
{
GNUNET_CONTAINER_DLL_remove (wire_head,
wire_tail,
p);
- lib_name = p->plugin->library_name;
- GNUNET_assert (NULL == GNUNET_PLUGIN_unload (lib_name,
- p->plugin));
- GNUNET_free (lib_name);
+ TALER_WIRE_plugin_unload (p->plugin);
GNUNET_free (p->type);
GNUNET_free (p);
}
@@ -152,10 +143,12 @@ TMH_VALIDATION_done ()
* a wire address.
*
* @param wire the JSON wire format object
+ * @param ours #GNUNET_YES if the signature should match our master key
* @return #GNUNET_YES if correctly formatted; #GNUNET_NO if not
*/
int
-TMH_json_validate_wireformat (const json_t *wire)
+TMH_json_validate_wireformat (const json_t *wire,
+ int ours)
{
const char *stype;
json_error_t error;
@@ -172,7 +165,11 @@ TMH_json_validate_wireformat (const json_t *wire)
for (p=wire_head; NULL != p; p = p->next)
if (0 == strcasecmp (p->type,
stype))
- return p->plugin->wire_validate (wire);
+ return p->plugin->wire_validate (p->plugin->cls,
+ wire,
+ (GNUNET_YES == ours)
+ ? &TMH_master_public_key
+ : NULL);
return GNUNET_NO;
}
@@ -197,35 +194,51 @@ TMH_VALIDATION_test_method (const char *type)
/**
- * Obtain supported validation methods as a JSON array,
- * and as a hash.
+ * Obtain JSON of the supported wire methods for a given
+ * account name prefix.
*
- * @param[out] h set to the hash of the JSON methods
+ * @param prefix prefix for the account, the suffix will
+ * be determined by the name of the plugin
* @return JSON array with the supported validation methods
*/
json_t *
-TMH_VALIDATION_get_methods (struct GNUNET_HashCode *h)
+TMH_VALIDATION_get_wire_methods (const char *prefix)
{
json_t *methods;
- struct GNUNET_HashContext *hc;
- const char *wf;
+ json_t *method;
struct Plugin *p;
+ struct TALER_WIRE_Plugin *plugin;
+ char *account_name;
- methods = json_array ();
- hc = GNUNET_CRYPTO_hash_context_start ();
+ methods = json_object ();
for (p=wire_head;NULL != p;p = p->next)
{
- wf = p->type;
- json_array_append_new (methods,
- json_string (wf));
- GNUNET_CRYPTO_hash_context_read (hc,
- wf,
- strlen (wf) + 1);
+ plugin = p->plugin;
+ GNUNET_asprintf (&account_name,
+ "%s-%s",
+ prefix,
+ p->type);
+ method = plugin->get_wire_details (plugin->cls,
+ cfg,
+ account_name);
+ if (GNUNET_YES !=
+ TMH_json_validate_wireformat (method,
+ GNUNET_YES))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Account details for method `%s' ill-formed. Disabling method\n",
+ p->type);
+ json_decref (method);
+ method = NULL;
+ }
+ if (NULL != method)
+ json_object_set_new (methods,
+ p->type,
+ method);
+ GNUNET_free (account_name);
}
- GNUNET_CRYPTO_hash_context_finish (hc,
- h);
return methods;
}
-/* end of taler-mint-httpd_validation.c */
+/* end of taler-exchange-httpd_validation.c */
diff --git a/src/mint/taler-mint-httpd_validation.h b/src/exchange/taler-exchange-httpd_validation.h
similarity index 75%
rename from src/mint/taler-mint-httpd_validation.h
rename to src/exchange/taler-exchange-httpd_validation.h
index f5fb19003..bd04994ef 100644
--- a/src/mint/taler-mint-httpd_validation.h
+++ b/src/exchange/taler-exchange-httpd_validation.h
@@ -15,12 +15,12 @@
*/
/**
- * @file taler-mint-httpd_validation.h
+ * @file taler-exchange-httpd_validation.h
* @brief helpers for calling the wire plugins to validate addresses
* @author Christian Grothoff
*/
-#ifndef TALER_MINT_HTTPD_VALIDATION_H
-#define TALER_MINT_HTTPD_VALIDATION_H
+#ifndef TALER_EXCHANGE_HTTPD_VALIDATION_H
+#define TALER_EXCHANGE_HTTPD_VALIDATION_H
#include
#include
@@ -47,10 +47,12 @@ TMH_VALIDATION_done (void);
* a wire address.
*
* @param wire the JSON wire format object
+ * @param ours #GNUNET_YES if the signature should match our master key
* @return #GNUNET_YES if correctly formatted; #GNUNET_NO if not
*/
int
-TMH_json_validate_wireformat (const json_t *wire);
+TMH_json_validate_wireformat (const json_t *wire,
+ int ours);
/**
* Check if we support the given wire method.
@@ -63,14 +65,15 @@ TMH_VALIDATION_test_method (const char *type);
/**
- * Obtain supported validation methods as a JSON array,
- * and as a hash.
+ * Obtain JSON of the supported wire methods for a given
+ * account name prefix.
*
- * @param[out] h set to the hash of the JSON methods
+ * @param prefix prefix for the account, the suffix will
+ * be determined by the name of the plugin
* @return JSON array with the supported validation methods
*/
json_t *
-TMH_VALIDATION_get_methods (struct GNUNET_HashCode *h);
+TMH_VALIDATION_get_wire_methods (const char *prefix);
#endif
diff --git a/src/exchange/taler-exchange-httpd_wire.c b/src/exchange/taler-exchange-httpd_wire.c
new file mode 100644
index 000000000..975788b35
--- /dev/null
+++ b/src/exchange/taler-exchange-httpd_wire.c
@@ -0,0 +1,57 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2015, 2016 GNUnet e.V. and INRIA
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU Affero General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+*/
+/**
+ * @file taler-exchange-httpd_wire.c
+ * @brief Handle /wire requests
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include
+#include "taler-exchange-httpd_keystate.h"
+#include "taler-exchange-httpd_responses.h"
+#include "taler-exchange-httpd_validation.h"
+#include "taler-exchange-httpd_wire.h"
+#include
+
+/**
+ * Handle a "/wire" request.
+ *
+ * @param rh context of the handler
+ * @param connection the MHD connection to handle
+ * @param[in,out] connection_cls the connection's closure (can be updated)
+ * @param upload_data upload data
+ * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
+ * @return MHD result code
+ */
+int
+TMH_WIRE_handler_wire (struct TMH_RequestHandler *rh,
+ struct MHD_Connection *connection,
+ void **connection_cls,
+ const char *upload_data,
+ size_t *upload_data_size)
+{
+ static json_t *wire_methods;
+
+ if (NULL == wire_methods)
+ wire_methods = TMH_VALIDATION_get_wire_methods ("wire-incoming");
+
+ return TMH_RESPONSE_reply_json (connection,
+ wire_methods,
+ MHD_HTTP_OK);
+}
+
+
+/* end of taler-exchange-httpd_wire.c */
diff --git a/src/mint/taler-mint-httpd_wire.h b/src/exchange/taler-exchange-httpd_wire.h
similarity index 51%
rename from src/mint/taler-mint-httpd_wire.h
rename to src/exchange/taler-exchange-httpd_wire.h
index e77daf019..cf04f16ff 100644
--- a/src/mint/taler-mint-httpd_wire.h
+++ b/src/exchange/taler-exchange-httpd_wire.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014 GNUnet e.V.
+ Copyright (C) 2014, 2015, 2016 Inria and GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
@@ -14,16 +14,16 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file taler-mint-httpd_wire.h
+ * @file taler-exchange-httpd_wire.h
* @brief Handle /wire requests
* @author Christian Grothoff
*/
-#ifndef TALER_MINT_HTTPD_WIRE_H
-#define TALER_MINT_HTTPD_WIRE_H
+#ifndef TALER_EXCHANGE_HTTPD_WIRE_H
+#define TALER_EXCHANGE_HTTPD_WIRE_H
#include
#include
-#include "taler-mint-httpd.h"
+#include "taler-exchange-httpd.h"
/**
@@ -44,39 +44,4 @@ TMH_WIRE_handler_wire (struct TMH_RequestHandler *rh,
size_t *upload_data_size);
-/**
- * Handle a "/wire/test" request.
- *
- * @param rh context of the handler
- * @param connection the MHD connection to handle
- * @param[in,out] connection_cls the connection's closure (can be updated)
- * @param upload_data upload data
- * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
- * @return MHD result code
- */
-int
-TMH_WIRE_handler_wire_test (struct TMH_RequestHandler *rh,
- struct MHD_Connection *connection,
- void **connection_cls,
- const char *upload_data,
- size_t *upload_data_size);
-
-
-/**
- * Handle a "/wire/sepa" request.
- *
- * @param rh context of the handler
- * @param connection the MHD connection to handle
- * @param[in,out] connection_cls the connection's closure (can be updated)
- * @param upload_data upload data
- * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
- * @return MHD result code
- */
-int
-TMH_WIRE_handler_wire_sepa (struct TMH_RequestHandler *rh,
- struct MHD_Connection *connection,
- void **connection_cls,
- const char *upload_data,
- size_t *upload_data_size);
-
#endif
diff --git a/src/mintdb/test-mint-db-postgres.conf b/src/exchange/test-taler-exchange-aggregator-postgres.conf
similarity index 82%
rename from src/mintdb/test-mint-db-postgres.conf
rename to src/exchange/test-taler-exchange-aggregator-postgres.conf
index 2bdb63eb0..0822bab44 100644
--- a/src/mintdb/test-mint-db-postgres.conf
+++ b/src/exchange/test-taler-exchange-aggregator-postgres.conf
@@ -1,8 +1,8 @@
-[mint]
+[exchange]
#The DB plugin to use
DB = postgres
-[mintdb-postgres]
+[exchangedb-postgres]
#The connection string the plugin has to use for connecting to the database
DB_CONN_STR = postgres:///talercheck
diff --git a/src/exchange/test_taler_exchange_aggregator.c b/src/exchange/test_taler_exchange_aggregator.c
new file mode 100644
index 000000000..a799316f3
--- /dev/null
+++ b/src/exchange/test_taler_exchange_aggregator.c
@@ -0,0 +1,1557 @@
+/*
+ This file is part of TALER
+ (C) 2016 Inria and GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+*/
+
+/**
+ * @file exchange/test_taler_exchange_aggregator.c
+ * @brief Tests for taler-exchange-aggregator logic
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include "taler_util.h"
+#include
+#include "taler_json_lib.h"
+#include "taler_exchangedb_plugin.h"
+#include
+
+
+/**
+ * Maximum POST request size (for /admin/add/incoming)
+ */
+#define REQUEST_BUFFER_MAX (4*1024)
+
+/**
+ * Details about a transcation we (as the simulated bank) received.
+ */
+struct Transaction
+{
+
+ /**
+ * We store transactions in a DLL.
+ */
+ struct Transaction *next;
+
+ /**
+ * We store transactions in a DLL.
+ */
+ struct Transaction *prev;
+
+ /**
+ * Amount to be transferred.
+ */
+ struct TALER_Amount amount;
+
+ /**
+ * Account to debit.
+ */
+ uint64_t debit_account;
+
+ /**
+ * Account to credit.
+ */
+ uint64_t credit_account;
+
+ /**
+ * Subject of the transfer.
+ */
+ struct TALER_WireTransferIdentifierRawP wtid;
+};
+
+
+/**
+ * Commands for the interpreter.
+ */
+enum OpCode {
+
+ /**
+ * Terminate testcase with 'skipped' result.
+ */
+ OPCODE_TERMINATE_SKIP,
+
+ /**
+ * Run taler-exchange-aggregator.
+ */
+ OPCODE_RUN_AGGREGATOR,
+
+ /**
+ * Expect that we have exhaustively gone over all transactions.
+ */
+ OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+
+ /**
+ * Execute deposit operation against database.
+ */
+ OPCODE_DATABASE_DEPOSIT,
+
+ /**
+ * Wait a certain amount of time.
+ */
+ OPCODE_WAIT,
+
+ /**
+ * Expect that we have received the specified transaction.
+ */
+ OPCODE_EXPECT_TRANSACTION,
+
+ /**
+ * Finish testcase with success.
+ */
+ OPCODE_TERMINATE_SUCCESS
+};
+
+/**
+ * Command state for the interpreter.
+ */
+struct Command
+{
+
+ /**
+ * What instruction should we run?
+ */
+ enum OpCode opcode;
+
+ /**
+ * Human-readable label for the command.
+ */
+ const char *label;
+
+ union {
+
+ /**
+ * If @e opcode is #OPCODE_EXPECT_TRANSACTION, this
+ * specifies which transaction we expected. Note that
+ * the WTID will be set, not checked!
+ */
+ struct {
+
+ /**
+ * Amount to be transferred.
+ */
+ const char *amount;
+
+ /**
+ * Account to debit.
+ */
+ uint64_t debit_account;
+
+ /**
+ * Account to credit.
+ */
+ uint64_t credit_account;
+
+ /**
+ * Subject of the transfer, set by the command.
+ */
+ struct TALER_WireTransferIdentifierRawP wtid;
+
+ } expect_transaction;
+
+ /**
+ * If @e opcode is #OPCODE_DATABASE_DEPOST, this
+ * specifies which deposit operation we should fake.
+ */
+ struct {
+
+ /**
+ * Each merchant name is automatically mapped to a unique
+ * merchant public key.
+ */
+ const char *merchant_name;
+
+ /**
+ * Merchant account number, is mapped to wire details.
+ */
+ uint64_t merchant_account;
+
+ /**
+ * Merchant's transaction ID.
+ */
+ uint64_t transaction_id;
+
+ /**
+ * By when does the merchant request the funds to be wired.
+ */
+ struct GNUNET_TIME_Relative wire_deadline;
+
+ /**
+ * What is the total amount (including exchange fees).
+ */
+ const char *amount_with_fee;
+
+ /**
+ * How high are the exchange fees? Must be smaller than @e amount_with_fee.
+ */
+ const char *deposit_fee;
+
+ } deposit;
+
+ /**
+ * How long should we wait if the opcode is #OPCODE_WAIT.
+ */
+ struct GNUNET_TIME_Relative wait_delay;
+
+ } details;
+
+};
+
+
+/**
+ * State of the interpreter.
+ */
+struct State
+{
+ /**
+ * Array of commands to run.
+ */
+ struct Command* commands;
+
+ /**
+ * Offset of the next command to be run.
+ */
+ unsigned int ioff;
+};
+
+
+/**
+ * Pipe used to communicate child death via signal.
+ */
+static struct GNUNET_DISK_PipeHandle *sigpipe;
+
+/**
+ * ID of task called whenever we get a SIGCHILD.
+ */
+static struct GNUNET_SCHEDULER_Task *child_death_task;
+
+/**
+ * ID of task called whenever are shutting down.
+ */
+static struct GNUNET_SCHEDULER_Task *shutdown_task;
+
+/**
+ * Return value from main().
+ */
+static int result;
+
+/**
+ * Name of the configuration file to use.
+ */
+static char *config_filename;
+
+/**
+ * Database plugin.
+ */
+static struct TALER_EXCHANGEDB_Plugin *plugin;
+
+/**
+ * Our session with the database.
+ */
+static struct TALER_EXCHANGEDB_Session *session;
+
+/**
+ * The handle for the aggregator process that we are testing.
+ */
+static struct GNUNET_OS_Process *aggregator_proc;
+
+/**
+ * State of our interpreter while we are running the aggregator
+ * process.
+ */
+static struct State *aggregator_state;
+
+/**
+ * HTTP server we run to pretend to be the "test" bank.
+ */
+static struct MHD_Daemon *mhd_bank;
+
+/**
+ * Task running HTTP server for the "test" bank.
+ */
+static struct GNUNET_SCHEDULER_Task *mhd_task;
+
+/**
+ * Task running the interpreter().
+ */
+static struct GNUNET_SCHEDULER_Task *int_task;
+
+/**
+ * We store transactions in a DLL.
+ */
+static struct Transaction *transactions_head;
+
+/**
+ * We store transactions in a DLL.
+ */
+static struct Transaction *transactions_tail;
+
+/**
+ * Private key we use for fake coins.
+ */
+static struct GNUNET_CRYPTO_RsaPrivateKey *coin_pk;
+
+/**
+ * Public key we use for fake coins.
+ */
+static struct GNUNET_CRYPTO_RsaPublicKey *coin_pub;
+
+
+/**
+ * Interprets the commands from the test program.
+ *
+ * @param cls the `struct State` of the interpreter
+ */
+static void
+interpreter (void *cls);
+
+
+/**
+ * Task triggered whenever we are to shutdown.
+ *
+ * @param cls closure, NULL if we need to self-restart
+ */
+static void
+shutdown_action (void *cls)
+{
+ shutdown_task = NULL;
+ if (NULL != mhd_task)
+ {
+ GNUNET_SCHEDULER_cancel (mhd_task);
+ mhd_task = NULL;
+ }
+ if (NULL != int_task)
+ {
+ GNUNET_SCHEDULER_cancel (int_task);
+ int_task = NULL;
+ }
+ if (NULL != mhd_bank)
+ {
+ MHD_stop_daemon (mhd_bank);
+ mhd_bank = NULL;
+ }
+ if (NULL == aggregator_proc)
+ {
+ GNUNET_SCHEDULER_cancel (child_death_task);
+ child_death_task = NULL;
+ }
+ else
+ {
+ GNUNET_break (0 == GNUNET_OS_process_kill (aggregator_proc,
+ SIGKILL));
+ }
+ plugin->drop_temporary (plugin->cls,
+ session);
+ TALER_EXCHANGEDB_plugin_unload (plugin);
+ plugin = NULL;
+}
+
+
+/**
+ * Task triggered whenever we receive a SIGCHLD (child
+ * process died).
+ *
+ * @param cls closure, NULL if we need to self-restart
+ */
+static void
+maint_child_death (void *cls)
+{
+ const struct GNUNET_DISK_FileHandle *pr;
+ char c[16];
+ struct State *state;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+
+ child_death_task = NULL;
+ pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
+ tc = GNUNET_SCHEDULER_get_task_context ();
+ if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
+ {
+ /* shutdown scheduled us, ignore! */
+ child_death_task =
+ GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
+ pr,
+ &maint_child_death,
+ NULL);
+ return;
+ }
+ GNUNET_break (0 < GNUNET_DISK_file_read (pr, &c, sizeof (c)));
+ GNUNET_OS_process_wait (aggregator_proc);
+ GNUNET_OS_process_destroy (aggregator_proc);
+ aggregator_proc = NULL;
+ aggregator_state->ioff++;
+ state = aggregator_state;
+ aggregator_state = NULL;
+ interpreter (state);
+ if (NULL == shutdown_task)
+ return;
+ child_death_task = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
+ pr,
+ &maint_child_death, NULL);
+
+}
+
+/**
+ * Setup (fake) information about a coin used in deposit.
+ *
+ * @param[out] issue information to initialize with "valid" data
+ */
+static void
+fake_issue (struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue)
+{
+ memset (issue, 0, sizeof (struct TALER_EXCHANGEDB_DenominationKeyInformationP));
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount_nbo ("EUR:1",
+ &issue->properties.value));
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount_nbo ("EUR:0.1",
+ &issue->properties.fee_withdraw));
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount_nbo ("EUR:0.1",
+ &issue->properties.fee_deposit));
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount_nbo ("EUR:0.1",
+ &issue->properties.fee_refresh));
+}
+
+
+/**
+ * Setup (fake) information about a coin used in deposit.
+ *
+ * @param[out] coin information to initialize with "valid" data
+ */
+static void
+fake_coin (struct TALER_CoinPublicInfo *coin)
+{
+ struct GNUNET_HashCode hc;
+
+ coin->denom_pub.rsa_public_key = coin_pub;
+ GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
+ &hc);
+ coin->denom_sig.rsa_signature = GNUNET_CRYPTO_rsa_sign_fdh (coin_pk,
+ &hc);
+}
+
+
+/**
+ * Helper function to fake a deposit operation.
+ *
+ * @return #GNUNET_OK on success
+ */
+static int
+do_deposit (struct Command *cmd)
+{
+ struct TALER_EXCHANGEDB_Deposit deposit;
+ struct TALER_MerchantPrivateKeyP merchant_priv;
+ int ret;
+
+ memset (&deposit, 0, sizeof (deposit));
+ /* we derive the merchant's private key from the
+ name, to ensure that the same name always
+ results in the same key pair. */
+ GNUNET_CRYPTO_kdf (&merchant_priv,
+ sizeof (struct TALER_MerchantPrivateKeyP),
+ "merchant-priv",
+ strlen ("merchant-priv"),
+ cmd->details.deposit.merchant_name,
+ strlen (cmd->details.deposit.merchant_name),
+ NULL, 0);
+ GNUNET_CRYPTO_eddsa_key_get_public (&merchant_priv.eddsa_priv,
+ &deposit.merchant_pub.eddsa_pub);
+ /* contract is just picked at random;
+ note: we may want to write this back to 'cmd' in the future. */
+ GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
+ &deposit.h_contract);
+ if ( (GNUNET_OK !=
+ TALER_string_to_amount (cmd->details.deposit.amount_with_fee,
+ &deposit.amount_with_fee)) ||
+ (GNUNET_OK !=
+ TALER_string_to_amount (cmd->details.deposit.deposit_fee,
+ &deposit.deposit_fee)) )
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ fake_coin (&deposit.coin);
+ /* Build JSON for wire details */
+ deposit.wire = json_pack ("{s:s, s:s, s:I}",
+ "type", "test",
+ "bank_uri", "http://localhost:8082/",
+ "account_number", (json_int_t) cmd->details.deposit.merchant_account);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_JSON_hash (deposit.wire,
+ &deposit.h_wire));
+ deposit.transaction_id = cmd->details.deposit.transaction_id;
+ deposit.timestamp = GNUNET_TIME_absolute_get ();
+ deposit.wire_deadline = GNUNET_TIME_relative_to_absolute (cmd->details.deposit.wire_deadline);
+
+ /* finally, actually perform the DB operation */
+ if ( (GNUNET_OK !=
+ plugin->start (plugin->cls,
+ session)) ||
+ (GNUNET_OK !=
+ plugin->insert_deposit (plugin->cls,
+ session,
+ &deposit)) ||
+ (GNUNET_OK !=
+ plugin->commit (plugin->cls,
+ session)) )
+ ret = GNUNET_SYSERR;
+ else
+ ret = GNUNET_OK;
+ GNUNET_CRYPTO_rsa_signature_free (deposit.coin.denom_sig.rsa_signature);
+ json_decref (deposit.wire);
+ return ret;
+}
+
+
+/**
+ * Fail the testcase at the current command.
+ */
+static void
+fail (struct Command *cmd)
+{
+ fprintf (stderr,
+ "Testcase failed at command `%s'\n",
+ cmd->label);
+ result = 2;
+ GNUNET_SCHEDULER_shutdown ();
+}
+
+
+/**
+ * Interprets the commands from the test program.
+ *
+ * @param cls the `struct State` of the interpreter
+ */
+static void
+interpreter (void *cls)
+{
+ struct State *state = cls;
+
+ int_task = NULL;
+ while (1)
+ {
+ struct Command *cmd = &state->commands[state->ioff];
+
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Running command %u (%s)\n",
+ state->ioff,
+ cmd->label);
+ switch (cmd->opcode)
+ {
+ case OPCODE_TERMINATE_SKIP:
+ /* return skip: test not finished, but did not fail either */
+ result = 77;
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ case OPCODE_WAIT:
+ state->ioff++;
+ int_task = GNUNET_SCHEDULER_add_delayed (cmd->details.wait_delay,
+ &interpreter,
+ state);
+ return;
+ case OPCODE_RUN_AGGREGATOR:
+ GNUNET_assert (NULL == aggregator_state);
+ aggregator_state = state;
+ aggregator_proc
+ = GNUNET_OS_start_process (GNUNET_NO,
+ GNUNET_OS_INHERIT_STD_ALL,
+ NULL, NULL, NULL,
+ "taler-exchange-aggregator",
+ "taler-exchange-aggregator",
+ "-c", "test_taler_exchange_httpd.conf",
+ "-t", /* enable temporary tables */
+ NULL);
+ return;
+ case OPCODE_EXPECT_TRANSACTIONS_EMPTY:
+ if (NULL != transactions_head)
+ {
+ struct Transaction *t;
+
+ fprintf (stderr,
+ "Expected empty transaction set, but I have:\n");
+ for (t = transactions_head; NULL != t; t = t->next)
+ {
+ char *s;
+
+ s = TALER_amount_to_string (&t->amount);
+ fprintf (stderr,
+ "%llu -> %llu (%s)\n",
+ (unsigned long long) t->debit_account,
+ (unsigned long long) t->credit_account,
+ s);
+ GNUNET_free (s);
+ }
+ fail (cmd);
+ return;
+ }
+ state->ioff++;
+ break;
+ case OPCODE_DATABASE_DEPOSIT:
+ if (GNUNET_OK !=
+ do_deposit (cmd))
+ {
+ fail (cmd);
+ return;
+ }
+ state->ioff++;
+ break;
+ case OPCODE_EXPECT_TRANSACTION:
+ {
+ struct TALER_Amount want_amount;
+ struct Transaction *t;
+ int found;
+
+ if (GNUNET_OK !=
+ TALER_string_to_amount (cmd->details.expect_transaction.amount,
+ &want_amount))
+ {
+ GNUNET_break (0);
+ fail (cmd);
+ return;
+ }
+ found = GNUNET_NO;
+ for (t = transactions_head; NULL != t; t = t->next)
+ {
+ if ( (cmd->details.expect_transaction.debit_account == t->debit_account) &&
+ (cmd->details.expect_transaction.credit_account == t->credit_account) &&
+ (0 == TALER_amount_cmp (&want_amount,
+ &t->amount)) )
+ {
+ GNUNET_CONTAINER_DLL_remove (transactions_head,
+ transactions_tail,
+ t);
+ cmd->details.expect_transaction.wtid = t->wtid;
+ GNUNET_free (t);
+ found = GNUNET_YES;
+ break;
+ }
+ }
+ if (GNUNET_NO == found)
+ {
+ fprintf (stderr,
+ "Did not find matching transaction!\nI have:\n");
+ for (t = transactions_head; NULL != t; t = t->next)
+ {
+ char *s;
+
+ s = TALER_amount_to_string (&t->amount);
+ fprintf (stderr,
+ "%llu -> %llu (%s)\n",
+ (unsigned long long) t->debit_account,
+ (unsigned long long) t->credit_account,
+ s);
+ GNUNET_free (s);
+ }
+ fail (cmd);
+ return;
+ }
+ state->ioff++;
+ break;
+ }
+ case OPCODE_TERMINATE_SUCCESS:
+ result = 0;
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ }
+}
+
+
+/**
+ * Contains the test program. Here each step of the testcase
+ * is defined.
+ */
+static void
+run_test ()
+{
+ static struct Command commands[] = {
+ /* test running with empty DB */
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-on-empty-db"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-on-start"
+ },
+
+ /* test simple deposit */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-1",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:1",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-1"
+ },
+
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-1",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 4,
+ .details.expect_transaction.amount = "EUR:1"
+ },
+
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-on-start"
+ },
+
+ /* test idempotency: run again on transactions already done */
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-1"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-1"
+ },
+
+ /* test combining deposits */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-2a",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:1",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-2b",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:1",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-2"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-2",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 4,
+ .details.expect_transaction.amount = "EUR:2"
+ },
+
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-2"
+ },
+
+ /* test NOT combining deposits of different accounts or keys */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-3a",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:1",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-3b",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 5,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:1",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-3c",
+ .details.deposit.merchant_name = "alice",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:1",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-3"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-3a",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 4,
+ .details.expect_transaction.amount = "EUR:1"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-3b",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 4,
+ .details.expect_transaction.amount = "EUR:1"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-3c",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 5,
+ .details.expect_transaction.amount = "EUR:1"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-3"
+ },
+
+ /* test NOT running deposits instantly, but after delay */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-4a",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
+ .details.deposit.amount_with_fee = "EUR:0.01",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-4b",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
+ .details.deposit.amount_with_fee = "EUR:0.01",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-4-early"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-4-fast"
+ },
+ {
+ .opcode = OPCODE_WAIT,
+ .label = "wait (5s)",
+ .details.wait_delay = { 1000LL * 1000 * 6 } /* 6s */
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-4-delayed"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-4",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 4,
+ .details.expect_transaction.amount = "EUR:0.02"
+ },
+
+ /* test picking all deposits at earliest deadline */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-5a",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 10 }, /* 10s */
+ .details.deposit.amount_with_fee = "EUR:0.01",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-5b",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
+ .details.deposit.amount_with_fee = "EUR:0.01",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-5-early"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-5-early"
+ },
+ {
+ .opcode = OPCODE_WAIT,
+ .label = "wait (5s)",
+ .details.wait_delay = { 1000LL * 1000 * 6 } /* 6s */
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-5-delayed"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-5",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 4,
+ .details.expect_transaction.amount = "EUR:0.02"
+ },
+
+ /* Test NEVER running 'tiny' unless they make up minimum unit */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-6a",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:0.002",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-6a-tiny"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-6a-tiny"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-6b",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:0.002",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-6c",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:0.002",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-6c-tiny"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-6c-tiny"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-6d",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:0.002",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-6d-tiny"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-6d-tiny"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-6e",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:0.002",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-6e"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-6",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 4,
+ .details.expect_transaction.amount = "EUR:0.01"
+ },
+
+ /* Test profiteering if wire deadline is short */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-7a",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:0.009",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-7a-tiny"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-7a-tiny"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-7b",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:0.009",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-7-profit"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-7",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 4,
+ .details.expect_transaction.amount = "EUR:0.01"
+ },
+ /* Now check profit was actually taken */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-7c",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:0.022",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-7c-loss"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-7",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 4,
+ .details.expect_transaction.amount = "EUR:0.02"
+ },
+
+ /* Test that aggregation would happen fully if wire deadline is long */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-8a",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
+ .details.deposit.amount_with_fee = "EUR:0.009",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-8a-tiny"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-8a-tiny"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-8b",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
+ .details.deposit.amount_with_fee = "EUR:0.009",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-8b-tiny"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-8b-tiny"
+ },
+ /* now trigger aggregate with large transaction and short deadline */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-8c",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:0.022",
+ .details.deposit.deposit_fee = "EUR:0"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-8"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-8",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 4,
+ .details.expect_transaction.amount = "EUR:0.04"
+ },
+
+
+ /* Test aggregation with fees and rounding profits */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-9a",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
+ .details.deposit.amount_with_fee = "EUR:0.009",
+ .details.deposit.deposit_fee = "EUR:0.001"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-9a-tiny"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-9a-tiny"
+ },
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-9b",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
+ .details.deposit.amount_with_fee = "EUR:0.009",
+ .details.deposit.deposit_fee = "EUR:0.002"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-9b-tiny"
+ },
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
+ .label = "expect-empty-transactions-after-9b-tiny"
+ },
+ /* now trigger aggregate with large transaction and short deadline */
+ {
+ .opcode = OPCODE_DATABASE_DEPOSIT,
+ .label = "do-deposit-9c",
+ .details.deposit.merchant_name = "bob",
+ .details.deposit.merchant_account = 4,
+ .details.deposit.transaction_id = 1,
+ .details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
+ .details.deposit.amount_with_fee = "EUR:0.022",
+ .details.deposit.deposit_fee = "EUR:0.008"
+ },
+ {
+ .opcode = OPCODE_RUN_AGGREGATOR,
+ .label = "run-aggregator-deposit-9"
+ },
+ /* 0.009 + 0.009 + 0.022 - 0.001 - 0.002 - 0.008 = 0.029 => 0.02 */
+ {
+ .opcode = OPCODE_EXPECT_TRANSACTION,
+ .label = "expect-deposit-9",
+ .details.expect_transaction.debit_account = 3,
+ .details.expect_transaction.credit_account = 4,
+ .details.expect_transaction.amount = "EUR:0.02"
+ },
+
+ /* Everything tested, terminate with success */
+ {
+ .opcode = OPCODE_TERMINATE_SUCCESS,
+ .label = "testcase-complete-terminating-with-success"
+ },
+ /* note: rest not reached, this is just sample code */
+ {
+ .opcode = OPCODE_TERMINATE_SKIP,
+ .label = "testcase-incomplete-terminating-with-skip"
+ }
+ };
+ static struct State state = {
+ .commands = commands
+ };
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Launching interpreter\n");
+ int_task = GNUNET_SCHEDULER_add_now (&interpreter,
+ &state);
+}
+
+
+/**
+ * Function called whenever MHD is done with a request. If the
+ * request was a POST, we may have stored a `struct Buffer *` in the
+ * @a con_cls that might still need to be cleaned up. Call the
+ * respective function to free the memory.
+ *
+ * @param cls client-defined closure
+ * @param connection connection handle
+ * @param con_cls value as set by the last call to
+ * the #MHD_AccessHandlerCallback
+ * @param toe reason for request termination
+ * @see #MHD_OPTION_NOTIFY_COMPLETED
+ * @ingroup request
+ */
+static void
+handle_mhd_completion_callback (void *cls,
+ struct MHD_Connection *connection,
+ void **con_cls,
+ enum MHD_RequestTerminationCode toe)
+{
+ GNUNET_JSON_post_parser_cleanup (*con_cls);
+ *con_cls = NULL;
+}
+
+
+/**
+ * Handle incoming HTTP request.
+ *
+ * @param cls closure for MHD daemon (unused)
+ * @param connection the connection
+ * @param url the requested url
+ * @param method the method (POST, GET, ...)
+ * @param version HTTP version (ignored)
+ * @param upload_data request data
+ * @param upload_data_size size of @a upload_data in bytes
+ * @param con_cls closure for request (a `struct Buffer *`)
+ * @return MHD result code
+ */
+static int
+handle_mhd_request (void *cls,
+ struct MHD_Connection *connection,
+ const char *url,
+ const char *method,
+ const char *version,
+ const char *upload_data,
+ size_t *upload_data_size,
+ void **con_cls)
+{
+ enum GNUNET_JSON_PostResult pr;
+ json_t *json;
+ struct Transaction *t;
+ struct MHD_Response *resp;
+ int ret;
+
+ if (0 != strcasecmp (url,
+ "/admin/add/incoming"))
+ {
+ /* Unexpected URI path, just close the connection. */
+ /* we're rather impolite here, but it's a testcase. */
+ GNUNET_break_op (0);
+ return MHD_NO;
+ }
+ pr = GNUNET_JSON_post_parser (REQUEST_BUFFER_MAX,
+ con_cls,
+ upload_data,
+ upload_data_size,
+ &json);
+ switch (pr)
+ {
+ case GNUNET_JSON_PR_OUT_OF_MEMORY:
+ GNUNET_break (0);
+ return MHD_NO;
+ case GNUNET_JSON_PR_CONTINUE:
+ return MHD_YES;
+ case GNUNET_JSON_PR_REQUEST_TOO_LARGE:
+ GNUNET_break (0);
+ return MHD_NO;
+ case GNUNET_JSON_PR_JSON_INVALID:
+ GNUNET_break (0);
+ return MHD_NO;
+ case GNUNET_JSON_PR_SUCCESS:
+ break;
+ }
+ t = GNUNET_new (struct Transaction);
+ {
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("wtid", &t->wtid),
+ GNUNET_JSON_spec_uint64 ("debit_account", &t->debit_account),
+ GNUNET_JSON_spec_uint64 ("credit_account", &t->credit_account),
+ TALER_JSON_spec_amount ("amount", &t->amount),
+ GNUNET_JSON_spec_end ()
+ };
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
+ {
+ GNUNET_break (0);
+ json_decref (json);
+ return MHD_NO;
+ }
+ GNUNET_CONTAINER_DLL_insert (transactions_head,
+ transactions_tail,
+ t);
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Receiving incoming wire transfer: %llu->%llu\n",
+ (unsigned long long) t->debit_account,
+ (unsigned long long) t->credit_account);
+ json_decref (json);
+ resp = MHD_create_response_from_buffer (0, "", MHD_RESPMEM_PERSISTENT);
+ ret = MHD_queue_response (connection,
+ MHD_HTTP_OK,
+ resp);
+ MHD_destroy_response (resp);
+ return ret;
+}
+
+
+/**
+ * Task run whenever HTTP server operations are pending.
+ *
+ * @param cls NULL
+ */
+static void
+run_mhd (void *cls);
+
+
+/**
+ * Schedule MHD. This function should be called initially when an
+ * MHD is first getting its client socket, and will then automatically
+ * always be called later whenever there is work to be done.
+ */
+static void
+schedule_httpd ()
+{
+ fd_set rs;
+ fd_set ws;
+ fd_set es;
+ struct GNUNET_NETWORK_FDSet *wrs;
+ struct GNUNET_NETWORK_FDSet *wws;
+ int max;
+ int haveto;
+ MHD_UNSIGNED_LONG_LONG timeout;
+ struct GNUNET_TIME_Relative tv;
+
+ FD_ZERO (&rs);
+ FD_ZERO (&ws);
+ FD_ZERO (&es);
+ max = -1;
+ if (MHD_YES != MHD_get_fdset (mhd_bank, &rs, &ws, &es, &max))
+ {
+ GNUNET_assert (0);
+ return;
+ }
+ haveto = MHD_get_timeout (mhd_bank, &timeout);
+ if (MHD_YES == haveto)
+ tv.rel_value_us = (uint64_t) timeout * 1000LL;
+ else
+ tv = GNUNET_TIME_UNIT_FOREVER_REL;
+ if (-1 != max)
+ {
+ wrs = GNUNET_NETWORK_fdset_create ();
+ wws = GNUNET_NETWORK_fdset_create ();
+ GNUNET_NETWORK_fdset_copy_native (wrs, &rs, max + 1);
+ GNUNET_NETWORK_fdset_copy_native (wws, &ws, max + 1);
+ }
+ else
+ {
+ wrs = NULL;
+ wws = NULL;
+ }
+ if (NULL != mhd_task)
+ GNUNET_SCHEDULER_cancel (mhd_task);
+ mhd_task =
+ GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
+ tv,
+ wrs,
+ wws,
+ &run_mhd, NULL);
+ if (NULL != wrs)
+ GNUNET_NETWORK_fdset_destroy (wrs);
+ if (NULL != wws)
+ GNUNET_NETWORK_fdset_destroy (wws);
+}
+
+
+/**
+ * Task run whenever HTTP server operations are pending.
+ *
+ * @param cls NULL
+ */
+static void
+run_mhd (void *cls)
+{
+ mhd_task = NULL;
+ MHD_run (mhd_bank);
+ schedule_httpd ();
+}
+
+
+/**
+ * Main function that will be run by the scheduler.
+ *
+ * @param cls closure with configuration
+ */
+static void
+run (void *cls)
+{
+ struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+ struct TALER_EXCHANGEDB_DenominationKeyInformationP issue;
+ struct TALER_DenominationPublicKey dpk;
+
+ plugin = TALER_EXCHANGEDB_plugin_load (cfg);
+ if (GNUNET_OK !=
+ plugin->create_tables (plugin->cls,
+ GNUNET_YES))
+ {
+ GNUNET_break (0);
+ TALER_EXCHANGEDB_plugin_unload (plugin);
+ plugin = NULL;
+ result = 77;
+ return;
+ }
+ session = plugin->get_session (plugin->cls,
+ GNUNET_YES);
+ GNUNET_assert (NULL != session);
+ fake_issue (&issue);
+ dpk.rsa_public_key = coin_pub;
+ if ( (GNUNET_OK !=
+ plugin->start (plugin->cls,
+ session)) ||
+ (GNUNET_OK !=
+ plugin->insert_denomination_info (plugin->cls,
+ session,
+ &dpk,
+ &issue)) ||
+ (GNUNET_OK !=
+ plugin->commit (plugin->cls,
+ session)) )
+ {
+ GNUNET_break (0);
+ TALER_EXCHANGEDB_plugin_unload (plugin);
+ plugin = NULL;
+ result = 77;
+ return;
+ }
+ child_death_task =
+ GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
+ GNUNET_DISK_pipe_handle (sigpipe,
+ GNUNET_DISK_PIPE_END_READ),
+ &maint_child_death, NULL);
+ shutdown_task =
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &shutdown_action,
+ NULL);
+ result = 1; /* test failed for undefined reason */
+ mhd_bank = MHD_start_daemon (MHD_USE_DEBUG,
+ 8082,
+ NULL, NULL,
+ &handle_mhd_request, NULL,
+ MHD_OPTION_NOTIFY_COMPLETED, &handle_mhd_completion_callback, NULL,
+ MHD_OPTION_END);
+ if (NULL == mhd_bank)
+ {
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ schedule_httpd ();
+ run_test ();
+}
+
+
+/**
+ * Signal handler called for SIGCHLD. Triggers the
+ * respective handler by writing to the trigger pipe.
+ */
+static void
+sighandler_child_death ()
+{
+ static char c;
+ int old_errno = errno; /* back-up errno */
+
+ GNUNET_break (1 ==
+ GNUNET_DISK_file_write (GNUNET_DISK_pipe_handle
+ (sigpipe, GNUNET_DISK_PIPE_END_WRITE),
+ &c, sizeof (c)));
+ errno = old_errno; /* restore errno */
+}
+
+
+int
+main (int argc,
+ char *const argv[])
+{
+ const char *plugin_name;
+ char *testname;
+ struct GNUNET_CONFIGURATION_Handle *cfg;
+ struct GNUNET_SIGNAL_Context *shc_chld;
+
+ result = -1;
+ if (NULL == (plugin_name = strrchr (argv[0], (int) '-')))
+ {
+ GNUNET_break (0);
+ return -1;
+ }
+ plugin_name++;
+ (void) GNUNET_asprintf (&testname,
+ "test-taler-exchange-aggregator-%s", plugin_name);
+ (void) GNUNET_asprintf (&config_filename,
+ "%s.conf", testname);
+ /* these might get in the way */
+ unsetenv ("XDG_DATA_HOME");
+ unsetenv ("XDG_CONFIG_HOME");
+ GNUNET_log_setup ("test_taler_exchange_aggregator",
+ "WARNING",
+ NULL);
+ cfg = GNUNET_CONFIGURATION_create ();
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_parse (cfg,
+ config_filename))
+ {
+ GNUNET_break (0);
+ GNUNET_free (config_filename);
+ GNUNET_free (testname);
+ return 2;
+ }
+ sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO);
+ GNUNET_assert (NULL != sigpipe);
+ shc_chld =
+ GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death);
+ coin_pk = GNUNET_CRYPTO_rsa_private_key_create (1024);
+ coin_pub = GNUNET_CRYPTO_rsa_private_key_get_public (coin_pk);
+ GNUNET_SCHEDULER_run (&run, cfg);
+ GNUNET_CRYPTO_rsa_private_key_free (coin_pk);
+ GNUNET_CRYPTO_rsa_public_key_free (coin_pub);
+ GNUNET_SIGNAL_handler_uninstall (shc_chld);
+ shc_chld = NULL;
+ GNUNET_DISK_pipe_close (sigpipe);
+ GNUNET_CONFIGURATION_destroy (cfg);
+ GNUNET_free (config_filename);
+ GNUNET_free (testname);
+ return result;
+}
+
+/* end of test_taler_exchange_aggregator.c */
diff --git a/src/exchange/test_taler_exchange_httpd.conf b/src/exchange/test_taler_exchange_httpd.conf
new file mode 100644
index 000000000..5b49c0824
--- /dev/null
+++ b/src/exchange/test_taler_exchange_httpd.conf
@@ -0,0 +1,75 @@
+[PATHS]
+# Persistant data storage for the testcase
+TALER_TEST_HOME = test_taler_exchange_httpd_home/
+
+
+[exchange]
+# Currency supported by the exchange (can only be one)
+CURRENCY = EUR
+
+# Wire format supported by the exchange
+# We use 'test' for testing of the actual
+# coin operations.
+WIREFORMAT = test
+
+# HTTP port the exchange listens to
+PORT = 8081
+
+# Master public key used to sign the exchange's various keys
+MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
+
+# How to access our database
+DB = postgres
+
+# Is this is a testcase, use transient DB actions?
+TESTRUN = YES
+
+
+
+
+[exchangedb-postgres]
+DB_CONN_STR = "postgres:///talercheck"
+
+
+[wire-outgoing-test]
+# What is the main website of the bank?
+BANK_URI = "http://localhost:8082/"
+
+# From which account at the 'bank' should outgoing
+# wire transfers be made?
+EXCHANGE_ACCOUNT_NUMBER = 3
+
+
+# Coins for the tests.
+[coin_eur_ct_1]
+value = EUR:0.01
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.00
+fee_deposit = EUR:0.00
+fee_refresh = EUR:0.01
+rsa_keysize = 1024
+
+[coin_eur_ct_10]
+value = EUR:0.10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+rsa_keysize = 1024
+
+[coin_eur_1]
+value = EUR:1
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+rsa_keysize = 1024
diff --git a/src/mint/test_taler_mint_httpd.data b/src/exchange/test_taler_exchange_httpd.data
similarity index 97%
rename from src/mint/test_taler_mint_httpd.data
rename to src/exchange/test_taler_exchange_httpd.data
index 2d6020355..8a1d6baa9 100644
--- a/src/mint/test_taler_mint_httpd.data
+++ b/src/exchange/test_taler_exchange_httpd.data
@@ -13,7 +13,7 @@
# TALER; see the file COPYING. If not, If not, see
#
#
-# This is a resource file for test_taler_mint_httpd.sh.
+# This is a resource file for test_taler_exchange_httpd.sh.
# Lines starting with '#' (must be first character in line) are comments.
#
# Each non-comment line must contain two strings, the first being the
@@ -45,4 +45,4 @@
/withdraw/sign {"denom_pub":"51R7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30E9S6GVK2DHM8S234C236CR32C9N8RW44E9M712KAH1R60VM2CJ16RT3GGA18RR36CA575144DJ58CTK0E9M8D2M2E9S8GTKGH1Q8S0KACT174S3AD2670R4ADJ664W32C1N8N23CHA58MSK6DJ26WSMAD1P8H132CHP8GWKAG9K8RS46GJ6890M6GT28GSK4GJ66X2KCCA168RM4GA67113GDA28RR4AGA36RVK6GA460VKJDT58CVK6HA488R48E9R6D2KEH258N246HHJ850K4H9R8N0KEC9N68SM2EA48RR3JEA284SM6C9M6D130D228MSK6H1J6MSKCH1K8CR38CJ48MV36GJ38513CE9P60TM6CA56D1K8HHQ75244DA26WW4CG9M8MW3JE9M7133JGH354520818CMG26C1H60R30C935452081918G2J2G0","#oin_ev":"7DPN42W14BWWD2NWNDYP086276CFV0H8VEV43NFWQGZ3Y8WVR5R5HCN8THX43Z61TFN3CH9N6X5Q0P0T9NF2G8ZWBH8KXEQFQ973CMDDHF1FSE2G9289AB9ERHM8X222VB2WS733X36P8EMG4D3T1N2JHFP530C9RPEAPHDQXZABB6CJ63YD0581JVRY365HHF20RW3BNVKXP","reserve_sig":"VPKYWKGE6FB172XX222N1J0TAEXQE6VERN5X4ANJ0D9K1E7JAX01CPR1PT51SKK5JD72H1GRJ0S2ZQSKN22ZBEGKS77GMT6BF6DD030","reserve_pub":"FN7ARB2MJH2EDMMVT2985Y141YTCE503FS27BTNQ6JSCG3GMBJDG"}
#
# malformed coin_ev argument
-/withdraw/sign {"denom_pub":"51R7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30E9S6GVK2DHM8S234C236CR32C9N8RW44E9M712KAH1R60VM2CJ16RT3GGA18RR36CA575144DJ58CTK0E9M8D2M2E9S8GTKGH1Q8S0KACT174S3AD2670R4ADJ664W32C1N8N23CHA58MSK6DJ26WSMAD1P8H132CHP8GWKAG9K8RS46GJ6890M6GT28GSK4GJ66X2KCCA168RM4GA67113GDA28RR4AGA36RVK6GA460VKJDT58CVK6HA488R48E9R6D2KEH258N246HHJ850K4H9R8N0KEC9N68SM2EA48RR3JEA284SM6C9M6D130D228MSK6H1J6MSKCH1K8CR38CJ48MV36GJ38513CE9P60TM6CA56D1K8HHQ75244DA26WW4CG9M8MW3JE9M7133JGH354520818CMG26C1H60R30C935452081918G2J2G0","coin_ev":"'DPN42W14BWWD2NWNDYP086276CFV0H8VEV43NFWQGZ3Y8WVR5R5HCN8THX43Z61TFN3CH9N6X5Q0P0T9NF2G8ZWBH8KXEQFQ973CMDDHF1FSE2G9289AB9ERHM8X222VB2WS733X36P8EMG4D3T1N2JHFP530C9RPEAPHDQXZABB6CJ63YD0581JVRY365HHF20RW3BNVKXP","reserve_sig":"VPKYWKGE6FB172XX222N1J0TAEXQE6VERN5X4ANJ0D9K1E7JAX01CPR1PT51SKK5JD72H1GRJ0S2ZQSKN22ZBEGKS77GMT6BF6DD030","reserve_pub":"FN7ARB2MJH2EDMMVT2985Y141YTCE503FS27BTNQ6JSCG3GMBJDG"}
+/withdraw/sign {"denom_pub":"51R7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30E9S6GVK2DHM8S234C236CR32C9N8RW44E9M712KAH1R60VM2CJ16RT3GGA18RR36CA575144DJ58CTK0E9M8D2M2E9S8GTKGH1Q8S0KACT174S3AD2670R4ADJ664W32C1N8N23CHA58MSK6DJ26WSMAD1P8H132CHP8GWKAG9K8RS46GJ6890M6GT28GSK4GJ66X2KCCA168RM4GA67113GDA28RR4AGA36RVK6GA460VKJDT58CVK6HA488R48E9R6D2KEH258N246HHJ850K4H9R8N0KEC9N68SM2EA48RR3JEA284SM6C9M6D130D228MSK6H1J6MSKCH1K8CR38CJ48MV36GJ38513CE9P60TM6CA56D1K8HHQ75244DA26WW4CG9M8MW3JE9M7133JGH354520818CMG26C1H60R30C935452081918G2J2G0","coin_ev":"@DPN42W14BWWD2NWNDYP086276CFV0H8VEV43NFWQGZ3Y8WVR5R5HCN8THX43Z61TFN3CH9N6X5Q0P0T9NF2G8ZWBH8KXEQFQ973CMDDHF1FSE2G9289AB9ERHM8X222VB2WS733X36P8EMG4D3T1N2JHFP530C9RPEAPHDQXZABB6CJ63YD0581JVRY365HHF20RW3BNVKXP","reserve_sig":"VPKYWKGE6FB172XX222N1J0TAEXQE6VERN5X4ANJ0D9K1E7JAX01CPR1PT51SKK5JD72H1GRJ0S2ZQSKN22ZBEGKS77GMT6BF6DD030","reserve_pub":"FN7ARB2MJH2EDMMVT2985Y141YTCE503FS27BTNQ6JSCG3GMBJDG"}
diff --git a/src/mint/test_taler_mint_httpd.sh b/src/exchange/test_taler_exchange_httpd.sh
similarity index 61%
rename from src/mint/test_taler_mint_httpd.sh
rename to src/exchange/test_taler_exchange_httpd.sh
index 05d26620b..2b55ef5f4 100755
--- a/src/mint/test_taler_mint_httpd.sh
+++ b/src/exchange/test_taler_exchange_httpd.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
# This file is part of TALER
-# Copyright (C) 2015 GNUnet e.V.
+# Copyright (C) 2015, 2016 Inria and GNUnet e.V.
#
# TALER is free software; you can redistribute it and/or modify it under the
# terms of the GNU Affero General Public License as published by the Free Software
@@ -16,19 +16,23 @@
#
#
# This script uses 'curl' to POST various ill-formed requests to the
-# taler-mint-httpd. Basically, the goal is to make sure that the
+# taler-exchange-httpd. Basically, the goal is to make sure that the
# HTTP server survives (and produces the 'correct' error code).
#
-# We read the JSON snippets to POST from test_taler_mint_httpd.data
+#
+# Clear environment from variables that override config.
+export XDG_DATA_HOME=
+export XDG_CONFIG_HOME=
#
# Setup keys.
-taler-mint-keyup -d test-mint-home -m test-mint-home/master.priv
-# Run Mint HTTPD (in background)
-taler-mint-httpd -d test-mint-home &
+taler-exchange-keyup -c test_taler_exchange_httpd.conf
+# Run Exchange HTTPD (in background)
+taler-exchange-httpd -c test_taler_exchange_httpd.conf &
# Give HTTP time to start
-sleep 2
-# Run test...
-cat test_taler_mint_httpd.data | grep -v ^\# | awk '{ print "curl -d '\''" $2 "'\'' http://localhost:8081"$1 }' | bash
+sleep 5
+# Finally run test...
+# We read the JSON snippets to POST from test_taler_exchange_httpd.data
+cat test_taler_exchange_httpd.data | grep -v ^\# | awk '{ print "curl -d \47" $2 "\47 http://localhost:8081" $1 }' | bash
# Stop HTTP server
kill -TERM %%
# FIXME: not sure this is the 'correct' return code...
diff --git a/src/mint/test_taler_mint_httpd_afl.sh b/src/exchange/test_taler_exchange_httpd_afl.sh
old mode 100755
new mode 100644
similarity index 70%
rename from src/mint/test_taler_mint_httpd_afl.sh
rename to src/exchange/test_taler_exchange_httpd_afl.sh
index d2c40c216..48beda722
--- a/src/mint/test_taler_mint_httpd_afl.sh
+++ b/src/exchange/test_taler_exchange_httpd_afl.sh
@@ -16,7 +16,7 @@
#
#
# This script uses 'curl' to POST various ill-formed requests to the
-# taler-mint-httpd. Basically, the goal is to make sure that the
+# taler-exchange-httpd. Basically, the goal is to make sure that the
# HTTP server survives (and produces the 'correct' error code).
#
# We read the JSON snippets from afl-tests/
@@ -25,17 +25,17 @@ PREFIX=
# Uncomment this line to run with valgrind...
PREFIX="valgrind --leak-check=yes --log-file=valgrind.%p"
# Setup keys.
-taler-mint-keyup -d test-mint-home -m test-mint-home/master.priv
+taler-exchange-keyup -d test-exchange-home -m test-exchange-home/master.priv
# Setup database (just to be sure)
-taler-mint-dbinit -d test-mint-home &> /dev/null || true
+taler-exchange-dbinit -d test-exchange-home &> /dev/null || true
# Only log hard errors, we expect lots of warnings...
-export GNUNET_FORCE_LOG="taler-mint-httpd;;;;ERROR/libmicrohttpd;;;;ERROR/util;;;;ERROR/"
+export GNUNET_FORCE_LOG="taler-exchange-httpd;;;;ERROR/libmicrohttpd;;;;ERROR/util;;;;ERROR/"
# Run test...
for n in afl-tests/*
do
echo -n "Test $n "
- $PREFIX taler-mint-httpd -d test-mint-home/ -t 1 -f $n -C > /dev/null || { echo "FAIL!"; }
-# $PREFIX taler-mint-httpd -d test-mint-home/ -t 1 -f $n -C > /dev/null || { echo "FAIL!"; exit 1; }
+ $PREFIX taler-exchange-httpd -d test-exchange-home/ -t 1 -f $n -C > /dev/null || { echo "FAIL!"; }
+# $PREFIX taler-exchange-httpd -d test-exchange-home/ -t 1 -f $n -C > /dev/null || { echo "FAIL!"; exit 1; }
echo "OK"
done
exit 0
diff --git a/src/exchange/test_taler_exchange_httpd_home/.config/taler/test.json b/src/exchange/test_taler_exchange_httpd_home/.config/taler/test.json
new file mode 100644
index 000000000..be5e92c11
--- /dev/null
+++ b/src/exchange/test_taler_exchange_httpd_home/.config/taler/test.json
@@ -0,0 +1,8 @@
+{
+ "salt": "AZPRFVJ58NM6M7J5CZQPJAH3EW5DYM52AEZ9Y1C1ER3W94QV8D8TQKF6CK8MYQRA9QMSKDQTGZ306ZS9GQ0M6R01CJ20KPP49WFDZK8",
+ "name": "The exchange",
+ "account_number": 3,
+ "bank_uri": "http://localhost:8082/",
+ "type": "test",
+ "sig": "RPQXP9S4P8PQP7HEZQNRSZCT0ATNEP8GW0P5TPM34V5RX86FCD670V44R9NETSYDDKB8SZV7TKY9PAJYTY51D3VDWY9XXQ5BPFRXR28"
+}
\ No newline at end of file
diff --git a/src/mint/test-mint-home/master.priv b/src/exchange/test_taler_exchange_httpd_home/.local/share/taler/exchange/offline-keys/master.priv
similarity index 100%
rename from src/mint/test-mint-home/master.priv
rename to src/exchange/test_taler_exchange_httpd_home/.local/share/taler/exchange/offline-keys/master.priv
diff --git a/src/exchangedb/Makefile.am b/src/exchangedb/Makefile.am
new file mode 100644
index 000000000..0c6a73138
--- /dev/null
+++ b/src/exchangedb/Makefile.am
@@ -0,0 +1,123 @@
+# This Makefile.am is in the public domain
+AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/pq/ $(POSTGRESQL_CPPFLAGS)
+
+if USE_COVERAGE
+ AM_CFLAGS = --coverage -O0
+ XLIB = -lgcov
+endif
+
+pkgcfgdir = $(prefix)/share/taler/config.d/
+
+pkgcfg_DATA = \
+ exchangedb.conf \
+ exchangedb-postgres.conf
+
+EXTRA_DIST = \
+ exchangedb.conf \
+ exchangedb-postgres.conf
+
+
+plugindir = $(libdir)/taler
+
+if HAVE_POSTGRESQL
+plugin_LTLIBRARIES = \
+ libtaler_plugin_exchangedb_postgres.la
+endif
+
+EXTRA_DIST = \
+ plugin_exchangedb_common.c \
+ test-exchange-db-postgres.conf
+
+libtaler_plugin_exchangedb_postgres_la_SOURCES = \
+ plugin_exchangedb_postgres.c
+libtaler_plugin_exchangedb_postgres_la_LIBADD = \
+ $(LTLIBINTL)
+libtaler_plugin_exchangedb_postgres_la_LDFLAGS = \
+ $(TALER_PLUGIN_LDFLAGS) \
+ $(top_builddir)/src/pq/libtalerpq.la \
+ $(top_builddir)/src/util/libtalerutil.la \
+ -lpq \
+ -lgnunetpq \
+ -lgnunetutil $(XLIB)
+
+lib_LTLIBRARIES = \
+ libtalerexchangedb.la
+
+libtalerexchangedb_la_SOURCES = \
+ exchangedb_keyio.c \
+ exchangedb_plugin.c
+
+libtalerexchangedb_la_LIBADD = \
+ $(top_builddir)/src/util/libtalerutil.la \
+ -lgnunetutil $(XLIB)
+
+libtalerexchangedb_la_LDFLAGS = \
+ $(POSTGRESQL_LDFLAGS) \
+ -version-info 0:0:0 \
+ -no-undefined
+
+
+check_PROGRAMS = \
+ test-exchangedb-deposits \
+ test-exchangedb-keyio \
+ test-exchangedb-postgres \
+ test-perf-taler-exchangedb \
+ perf-exchangedb
+
+AM_TESTS_ENVIRONMENT=export TALER_PREFIX=$${TALER_PREFIX:-@libdir@};export PATH=$${TALER_PREFIX:-@prefix@}/bin:$$PATH;
+TESTS = \
+ test-exchangedb-postgres \
+ test-perf-taler-exchangedb
+
+test_exchangedb_deposits_SOURCES = \
+ test_exchangedb_deposits.c
+test_exchangedb_deposits_LDADD = \
+ libtalerexchangedb.la \
+ $(top_srcdir)/src/util/libtalerutil.la \
+ $(top_srcdir)/src/pq/libtalerpq.la \
+ -lgnunetutil \
+ -ljansson \
+ -lpq
+
+test_exchangedb_keyio_SOURCES = \
+ test_exchangedb_keyio.c
+test_exchangedb_keyio_LDADD = \
+ libtalerexchangedb.la \
+ $(top_srcdir)/src/util/libtalerutil.la \
+ $(top_srcdir)/src/pq/libtalerpq.la \
+ -lgnunetutil
+
+test_exchangedb_postgres_SOURCES = \
+ test_exchangedb.c
+test_exchangedb_postgres_LDADD = \
+ libtalerexchangedb.la \
+ $(top_builddir)/src/json/libtalerjson.la \
+ $(top_srcdir)/src/util/libtalerutil.la \
+ $(top_srcdir)/src/pq/libtalerpq.la \
+ -lgnunetutil -ljansson
+
+test_perf_taler_exchangedb_SOURCES = \
+ test_perf_taler_exchangedb.c \
+ perf_taler_exchangedb_init.c perf_taler_exchangedb_init.h \
+ perf_taler_exchangedb_interpreter.c perf_taler_exchangedb_interpreter.h
+test_perf_taler_exchangedb_LDADD = \
+ libtalerexchangedb.la \
+ $(top_srcdir)/src/util/libtalerutil.la \
+ $(top_srcdir)/src/pq/libtalerpq.la \
+ -ljansson \
+ -lgnunetutil
+
+perf_exchangedb_SOURCES = \
+ perf_taler_exchangedb.c \
+ perf_taler_exchangedb_init.c perf_taler_exchangedb_init.h \
+ perf_taler_exchangedb_interpreter.c perf_taler_exchangedb_interpreter.h
+perf_exchangedb_LDADD = \
+ libtalerexchangedb.la \
+ $(top_srcdir)/src/util/libtalerutil.la \
+ $(top_srcdir)/src/pq/libtalerpq.la \
+ -ljansson \
+ -lgnunetutil
+
+
+EXTRA_test_exchangedb_postgres_DEPENDENCIES = \
+ libtaler_plugin_exchangedb_postgres.la
diff --git a/src/exchangedb/exchangedb-postgres.conf b/src/exchangedb/exchangedb-postgres.conf
new file mode 100644
index 000000000..3de7474ff
--- /dev/null
+++ b/src/exchangedb/exchangedb-postgres.conf
@@ -0,0 +1,2 @@
+[exchangedb-postgres]
+DB_CONN_STR = "postgres:///taler"
diff --git a/src/exchangedb/exchangedb.conf b/src/exchangedb/exchangedb.conf
new file mode 100644
index 000000000..19277ed23
--- /dev/null
+++ b/src/exchangedb/exchangedb.conf
@@ -0,0 +1,7 @@
+# This file is in the public domain.
+#
+# Database-backend independent specification for the exchangedb module.
+#
+[exchangedb]
+# Where do we expect to find information about auditors?
+AUDITOR_BASE_DIR = ${TALER_DATA_HOME}/auditors/
diff --git a/src/mintdb/mintdb_keyio.c b/src/exchangedb/exchangedb_keyio.c
similarity index 70%
rename from src/mintdb/mintdb_keyio.c
rename to src/exchangedb/exchangedb_keyio.c
index 89ac9055a..9f170f645 100644
--- a/src/mintdb/mintdb_keyio.c
+++ b/src/exchangedb/exchangedb_keyio.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
+ Copyright (C) 2014, 2015, 2016 Inria & GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -14,15 +14,15 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mintdb/mintdb_keyio.c
- * @brief I/O operations for the Mint's private keys
+ * @file exchangedb/exchangedb_keyio.c
+ * @brief I/O operations for the Exchange's private keys
* @author Florian Dold
* @author Benedikt Mueller
* @author Sree Harsha Totakura
* @author Christian Grothoff
*/
#include "platform.h"
-#include "taler_mintdb_lib.h"
+#include "taler_exchangedb_lib.h"
/**
@@ -34,7 +34,7 @@ struct SignkeysIterateContext
/**
* Function to call on each signing key.
*/
- TALER_MINTDB_SigningKeyIterator it;
+ TALER_EXCHANGEDB_SigningKeyIterator it;
/**
* Closure for @e it.
@@ -59,18 +59,18 @@ signkeys_iterate_dir_iter (void *cls,
{
struct SignkeysIterateContext *skc = cls;
ssize_t nread;
- struct TALER_MINTDB_PrivateSigningKeyInformationP issue;
+ struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP issue;
nread = GNUNET_DISK_fn_read (filename,
&issue,
- sizeof (struct TALER_MINTDB_PrivateSigningKeyInformationP));
- if (nread != sizeof (struct TALER_MINTDB_PrivateSigningKeyInformationP))
+ sizeof (struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP));
+ if (nread != sizeof (struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Invalid signkey file `%s': wrong size (%d, expected %u)\n",
filename,
(int) nread,
- sizeof (struct TALER_MINTDB_PrivateSigningKeyInformationP));
+ sizeof (struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP));
return GNUNET_OK;
}
return skc->it (skc->it_cls,
@@ -80,10 +80,10 @@ signkeys_iterate_dir_iter (void *cls,
/**
- * Call @a it for each signing key found in the @a mint_base_dir.
+ * Call @a it for each signing key found in the @a exchange_base_dir.
*
- * @param mint_base_dir base directory for the mint,
- * the signing keys must be in the #TALER_MINTDB_DIR_SIGNING_KEYS
+ * @param exchange_base_dir base directory for the exchange,
+ * the signing keys must be in the #TALER_EXCHANGEDB_DIR_SIGNING_KEYS
* subdirectory
* @param it function to call on each signing key
* @param it_cls closure for @a it
@@ -92,17 +92,17 @@ signkeys_iterate_dir_iter (void *cls,
* files are simply skipped), -1 on error
*/
int
-TALER_MINTDB_signing_keys_iterate (const char *mint_base_dir,
- TALER_MINTDB_SigningKeyIterator it,
- void *it_cls)
+TALER_EXCHANGEDB_signing_keys_iterate (const char *exchange_base_dir,
+ TALER_EXCHANGEDB_SigningKeyIterator it,
+ void *it_cls)
{
char *signkey_dir;
struct SignkeysIterateContext skc;
int ret;
GNUNET_asprintf (&signkey_dir,
- "%s" DIR_SEPARATOR_STR TALER_MINTDB_DIR_SIGNING_KEYS,
- mint_base_dir);
+ "%s" DIR_SEPARATOR_STR TALER_EXCHANGEDB_DIR_SIGNING_KEYS,
+ exchange_base_dir);
skc.it = it;
skc.it_cls = it_cls;
ret = GNUNET_DISK_directory_scan (signkey_dir,
@@ -122,13 +122,13 @@ TALER_MINTDB_signing_keys_iterate (const char *mint_base_dir,
* #GNUNET_SYSERR upon failure
*/
int
-TALER_MINTDB_denomination_key_read (const char *filename,
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki)
+TALER_EXCHANGEDB_denomination_key_read (const char *filename,
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki)
{
uint64_t size;
size_t offset;
void *data;
- struct GNUNET_CRYPTO_rsa_PrivateKey *priv;
+ struct GNUNET_CRYPTO_RsaPrivateKey *priv;
if (GNUNET_OK != GNUNET_DISK_file_size (filename,
&size,
@@ -140,7 +140,7 @@ TALER_MINTDB_denomination_key_read (const char *filename,
filename);
return GNUNET_SYSERR;
}
- offset = sizeof (struct TALER_MINTDB_DenominationKeyInformationP);
+ offset = sizeof (struct TALER_EXCHANGEDB_DenominationKeyInformationP);
if (size <= offset)
{
GNUNET_break (0);
@@ -185,8 +185,8 @@ TALER_MINTDB_denomination_key_read (const char *filename,
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure.
*/
int
-TALER_MINTDB_denomination_key_write (const char *filename,
- const struct TALER_MINTDB_DenominationKeyIssueInformation *dki)
+TALER_EXCHANGEDB_denomination_key_write (const char *filename,
+ const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki)
{
char *priv_enc;
size_t priv_enc_size;
@@ -205,7 +205,7 @@ TALER_MINTDB_denomination_key_write (const char *filename,
GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE | GNUNET_DISK_OPEN_TRUNCATE,
GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE)))
goto cleanup;
- wsize = sizeof (struct TALER_MINTDB_DenominationKeyInformationP);
+ wsize = sizeof (struct TALER_EXCHANGEDB_DenominationKeyInformationP);
if (GNUNET_SYSERR == (wrote = GNUNET_DISK_file_write (fh,
&dki->issue,
wsize)))
@@ -244,7 +244,7 @@ struct DenomkeysIterateContext
/**
* Function to call on each denomination key.
*/
- TALER_MINTDB_DenominationKeyIterator it;
+ TALER_EXCHANGEDB_DenominationKeyIterator it;
/**
* Closure for @e it.
@@ -269,12 +269,12 @@ denomkeys_iterate_keydir_iter (void *cls,
const char *filename)
{
struct DenomkeysIterateContext *dic = cls;
- struct TALER_MINTDB_DenominationKeyIssueInformation issue;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation issue;
int ret;
memset (&issue, 0, sizeof (issue));
if (GNUNET_OK !=
- TALER_MINTDB_denomination_key_read (filename,
+ TALER_EXCHANGEDB_denomination_key_read (filename,
&issue))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -292,7 +292,7 @@ denomkeys_iterate_keydir_iter (void *cls,
/**
- * Function called on each subdirectory in the #TALER_MINTDB_DIR_DENOMINATION_KEYS. Will
+ * Function called on each subdirectory in the #TALER_EXCHANGEDB_DIR_DENOMINATION_KEYS. Will
* call the #denomkeys_iterate_keydir_iter() on each file in the
* subdirectory.
*
@@ -317,10 +317,10 @@ denomkeys_iterate_topdir_iter (void *cls,
/**
- * Call @a it for each denomination key found in the @a mint_base_dir.
+ * Call @a it for each denomination key found in the @a exchange_base_dir.
*
- * @param mint_base_dir base directory for the mint,
- * the signing keys must be in the #TALER_MINTDB_DIR_DENOMINATION_KEYS
+ * @param exchange_base_dir base directory for the exchange,
+ * the signing keys must be in the #TALER_EXCHANGEDB_DIR_DENOMINATION_KEYS
* subdirectory
* @param it function to call on each denomination key found
* @param it_cls closure for @a it
@@ -330,17 +330,17 @@ denomkeys_iterate_topdir_iter (void *cls,
* as maybe none of the files were well-formed)
*/
int
-TALER_MINTDB_denomination_keys_iterate (const char *mint_base_dir,
- TALER_MINTDB_DenominationKeyIterator it,
- void *it_cls)
+TALER_EXCHANGEDB_denomination_keys_iterate (const char *exchange_base_dir,
+ TALER_EXCHANGEDB_DenominationKeyIterator it,
+ void *it_cls)
{
char *dir;
struct DenomkeysIterateContext dic;
int ret;
GNUNET_asprintf (&dir,
- "%s" DIR_SEPARATOR_STR TALER_MINTDB_DIR_DENOMINATION_KEYS,
- mint_base_dir);
+ "%s" DIR_SEPARATOR_STR TALER_EXCHANGEDB_DIR_DENOMINATION_KEYS,
+ exchange_base_dir);
dic.it = it;
dic.it_cls = it_cls;
ret = GNUNET_DISK_directory_scan (dir,
@@ -360,7 +360,7 @@ struct AuditorIterateContext
/**
* Function to call with the information for each auditor.
*/
- TALER_MINTDB_AuditorIterator it;
+ TALER_EXCHANGEDB_AuditorIterator it;
/**
* Closure for @e it.
@@ -383,11 +383,16 @@ struct AuditorFileHeaderP
struct TALER_AuditorPublicKeyP apub;
/**
- * Master public key of the mint the auditor is signing
+ * Master public key of the exchange the auditor is signing
* information for.
*/
struct TALER_MasterPublicKeyP mpub;
+ /**
+ * Number of signatures and DKI entries in this file.
+ */
+ uint32_t dki_len;
+
};
GNUNET_NETWORK_STRUCT_END
@@ -412,7 +417,9 @@ auditor_iter (void *cls,
struct AuditorFileHeaderP *af;
const struct TALER_AuditorSignatureP *sigs;
const struct TALER_DenominationKeyValidityPS *dki;
- unsigned int len;
+ const char *auditor_url;
+ unsigned int dki_len;
+ size_t url_len;
int ret;
if (GNUNET_OK != GNUNET_DISK_file_size (filename,
@@ -425,10 +432,7 @@ auditor_iter (void *cls,
filename);
return GNUNET_SYSERR;
}
- if ( (size < sizeof (struct AuditorFileHeaderP)) ||
- (0 != (len = ((size - sizeof (struct AuditorFileHeaderP)) %
- (sizeof (struct TALER_DenominationKeyValidityPS) +
- sizeof (struct TALER_AuditorSignatureP))))) )
+ if (size < sizeof (struct AuditorFileHeaderP))
{
GNUNET_break (0);
return GNUNET_SYSERR;
@@ -445,12 +449,49 @@ auditor_iter (void *cls,
GNUNET_free (af);
return GNUNET_SYSERR;
}
+ dki_len = ntohl (af->dki_len);
+ if (0 == dki_len)
+ {
+ GNUNET_break_op (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "No signed keys in %s\n",
+ filename);
+ GNUNET_free (af);
+ return GNUNET_SYSERR;
+ }
+ if ( (size - sizeof (struct AuditorFileHeaderP)) / dki_len <
+ (sizeof (struct TALER_DenominationKeyValidityPS) +
+ sizeof (struct TALER_AuditorSignatureP)) )
+ {
+ GNUNET_break_op (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Malformed key file %s\n",
+ filename);
+ GNUNET_free (af);
+ return GNUNET_SYSERR;
+ }
+ url_len = size
+ - sizeof (struct AuditorFileHeaderP)
+ - dki_len * (sizeof (struct TALER_DenominationKeyValidityPS) +
+ sizeof (struct TALER_AuditorSignatureP));
sigs = (const struct TALER_AuditorSignatureP *) &af[1];
- dki = (const struct TALER_DenominationKeyValidityPS *) &sigs[len];
+ dki = (const struct TALER_DenominationKeyValidityPS *) &sigs[dki_len];
+ auditor_url = (const char *) &dki[dki_len];
+ if ( (0 == url_len) ||
+ ('\0' != auditor_url[url_len - 1]) )
+ {
+ GNUNET_break_op (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Malformed key file %s\n",
+ filename);
+ GNUNET_free (af);
+ return GNUNET_SYSERR;
+ }
ret = aic->it (aic->it_cls,
&af->apub,
+ auditor_url,
&af->mpub,
- len,
+ dki_len,
sigs,
dki);
GNUNET_free (af);
@@ -459,11 +500,9 @@ auditor_iter (void *cls,
/**
- * Call @a it with information for each auditor found in the @a mint_base_dir.
+ * Call @a it with information for each auditor found in the @a exchange_base_dir.
*
- * @param mint_base_dir base directory for the mint,
- * the signing keys must be in the #TALER_MINTDB_DIR_DENOMINATION_KEYS
- * subdirectory
+ * @param cfg configuration to use
* @param it function to call with auditor information
* @param it_cls closure for @a it
* @return -1 on error, 0 if no files were found, otherwise
@@ -472,23 +511,26 @@ auditor_iter (void *cls,
* as maybe none of the files were well-formed)
*/
int
-TALER_MINTDB_auditor_iterate (const char *mint_base_dir,
- TALER_MINTDB_AuditorIterator it,
- void *it_cls)
+TALER_EXCHANGEDB_auditor_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ TALER_EXCHANGEDB_AuditorIterator it,
+ void *it_cls)
{
- char *dir;
struct AuditorIterateContext aic;
int ret;
+ char *auditor_base_dir;
- GNUNET_asprintf (&dir,
- "%s" DIR_SEPARATOR_STR TALER_MINTDB_DIR_AUDITORS,
- mint_base_dir);
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ "exchangedb",
+ "AUDITOR_BASE_DIR",
+ &auditor_base_dir))
+ return -1;
aic.it = it;
aic.it_cls = it_cls;
- ret = GNUNET_DISK_directory_scan (dir,
+ ret = GNUNET_DISK_directory_scan (auditor_base_dir,
&auditor_iter,
&aic);
- GNUNET_free (dir);
+ GNUNET_free (auditor_base_dir);
return ret;
}
@@ -498,19 +540,21 @@ TALER_MINTDB_auditor_iterate (const char *mint_base_dir,
*
* @param filename the file where to write the auditor information to
* @param apub the auditor's public key
+ * @param auditor_url the URL of the auditor
* @param asigs the auditor's signatures, array of length @a dki_len
- * @param mpub the mint's public key (as expected by the auditor)
+ * @param mpub the exchange's public key (as expected by the auditor)
* @param dki_len length of @a dki
* @param dki array of denomination coin data signed by the auditor
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure.
*/
int
-TALER_MINTDB_auditor_write (const char *filename,
- const struct TALER_AuditorPublicKeyP *apub,
- const struct TALER_AuditorSignatureP *asigs,
- const struct TALER_MasterPublicKeyP *mpub,
- unsigned int dki_len,
- const struct TALER_DenominationKeyValidityPS *dki)
+TALER_EXCHANGEDB_auditor_write (const char *filename,
+ const struct TALER_AuditorPublicKeyP *apub,
+ const char *auditor_url,
+ const struct TALER_AuditorSignatureP *asigs,
+ const struct TALER_MasterPublicKeyP *mpub,
+ unsigned int dki_len,
+ const struct TALER_DenominationKeyValidityPS *dki)
{
struct AuditorFileHeaderP af;
struct GNUNET_DISK_FileHandle *fh;
@@ -521,6 +565,7 @@ TALER_MINTDB_auditor_write (const char *filename,
af.apub = *apub;
af.mpub = *mpub;
+ af.dki_len = htonl ((uint32_t) dki_len);
ret = GNUNET_SYSERR;
if (NULL == (fh = GNUNET_DISK_file_open
(filename,
@@ -546,6 +591,12 @@ TALER_MINTDB_auditor_write (const char *filename,
dki,
wsize))
ret = GNUNET_OK;
+ wsize = strlen (auditor_url) + 1;
+ if (wsize ==
+ GNUNET_DISK_file_write (fh,
+ auditor_url,
+ wsize))
+ ret = GNUNET_OK;
cleanup:
eno = errno;
if (NULL != fh)
@@ -555,4 +606,4 @@ TALER_MINTDB_auditor_write (const char *filename,
}
-/* end of mintdb_keyio.c */
+/* end of exchangedb_keyio.c */
diff --git a/src/mintdb/mintdb_plugin.c b/src/exchangedb/exchangedb_plugin.c
similarity index 80%
rename from src/mintdb/mintdb_plugin.c
rename to src/exchangedb/exchangedb_plugin.c
index 4a0f1dc04..ebaef9cc0 100644
--- a/src/mintdb/mintdb_plugin.c
+++ b/src/exchangedb/exchangedb_plugin.c
@@ -14,13 +14,13 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mintdb/mintdb_plugin.c
+ * @file exchangedb/exchangedb_plugin.c
* @brief Logic to load database plugin
* @author Christian Grothoff
* @author Sree Harsha Totakura
*/
#include "platform.h"
-#include "taler_mintdb_plugin.h"
+#include "taler_exchangedb_plugin.h"
#include
@@ -30,27 +30,27 @@
* @param cfg configuration to use
* @return #GNUNET_OK on success
*/
-struct TALER_MINTDB_Plugin *
-TALER_MINTDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg)
+struct TALER_EXCHANGEDB_Plugin *
+TALER_EXCHANGEDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg)
{
char *plugin_name;
char *lib_name;
struct GNUNET_CONFIGURATION_Handle *cfg_dup;
- struct TALER_MINTDB_Plugin *plugin;
+ struct TALER_EXCHANGEDB_Plugin *plugin;
if (GNUNET_SYSERR ==
GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint",
+ "exchange",
"db",
&plugin_name))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint",
+ "exchange",
"db");
return NULL;
}
(void) GNUNET_asprintf (&lib_name,
- "libtaler_plugin_mintdb_%s",
+ "libtaler_plugin_exchangedb_%s",
plugin_name);
GNUNET_free (plugin_name);
cfg_dup = GNUNET_CONFIGURATION_dup (cfg);
@@ -70,7 +70,7 @@ TALER_MINTDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg)
* @param plugin the plugin to unload
*/
void
-TALER_MINTDB_plugin_unload (struct TALER_MINTDB_Plugin *plugin)
+TALER_EXCHANGEDB_plugin_unload (struct TALER_EXCHANGEDB_Plugin *plugin)
{
char *lib_name;
@@ -84,4 +84,4 @@ TALER_MINTDB_plugin_unload (struct TALER_MINTDB_Plugin *plugin)
-/* end of mintdb_plugin.c */
+/* end of exchangedb_plugin.c */
diff --git a/src/mintdb/perf_taler_mintdb.c b/src/exchangedb/perf_taler_exchangedb.c
similarity index 58%
rename from src/mintdb/perf_taler_mintdb.c
rename to src/exchangedb/perf_taler_exchangedb.c
index fbaa2ce34..6ff7f5331 100644
--- a/src/mintdb/perf_taler_mintdb.c
+++ b/src/exchangedb/perf_taler_exchangedb.c
@@ -14,12 +14,12 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mintdb/perf_taler_mintdb.c
- * @brief Mint database performance analysis
+ * @file exchangedb/perf_taler_exchangedb.c
+ * @brief Exchange database performance analysis
* @author Nicolas Fournier
*/
#include "platform.h"
-#include "perf_taler_mintdb_interpreter.h"
+#include "perf_taler_exchangedb_interpreter.h"
#define NB_DENOMINATION_INIT 15
@@ -45,312 +45,312 @@
#define NB_MELT_SAVE SMALL
/**
- * Runs the performances tests for the mint database
+ * Runs the performances tests for the exchange database
* and logs the results using Gauger
*/
int
main (int argc, char ** argv)
{
int ret;
- struct PERF_TALER_MINTDB_Cmd benchmark[] =
+ struct PERF_TALER_EXCHANGEDB_Cmd benchmark[] =
{
/* Denomination used to create coins */
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("Initializing database"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("Initializing database"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("01 - denomination loop",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("01 - denomination loop",
NB_DENOMINATION_INIT),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_DENOMINATION ("01 - denomination"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("01 - insert",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_DENOMINATION ("01 - denomination"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_DENOMINATION ("01 - insert",
"01 - denomination"),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination",
"01 - denomination loop",
"01 - denomination",
NB_DENOMINATION_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("01 - end",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("01 - end",
"01 - denomination loop"),
/* End of initialization */
/* Reserve initialization */
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("02 - init reserve loop",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("02 - init reserve loop",
NB_RESERVE_INIT),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_RESERVE ("02 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("02 - insert",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_RESERVE ("02 - reserve"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_RESERVE ("02 - insert",
"02 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve",
"02 - init reserve loop",
"02 - reserve",
NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("02 - end",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("02 - end",
"02 - init reserve loop"),
/* End reserve init */
/* Withdrawal initialization */
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("03 - init withdraw loop",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("03 - init withdraw loop",
NB_WITHDRAW_INIT),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("03 - denomination load",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("03 - denomination load",
"03 - init withdraw loop",
"01 - save denomination"),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("03 - reserve load",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("03 - reserve load",
"03 - init withdraw loop",
"02 - save reserve"),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_WITHDRAW ("03 - withdraw",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_WITHDRAW ("03 - withdraw",
"03 - denomination load",
"03 - reserve load"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW ("03 - insert",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_WITHDRAW ("03 - insert",
"03 - withdraw"),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("03 - save coin",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("03 - save coin",
"03 - init withdraw loop",
"03 - withdraw",
NB_WITHDRAW_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("03 - end",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("03 - end",
"03 - init withdraw loop"),
/*End of withdrawal initialization */
/*Deposit initialization */
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("04 - deposit init loop",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("04 - deposit init loop",
NB_DEPOSIT_INIT),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("04 - coin load",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("04 - coin load",
"04 - deposit init loop",
"03 - save coin"),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_DEPOSIT ("04 - deposit",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_DEPOSIT ("04 - deposit",
"04 - coin load"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("04 - insert",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_DEPOSIT ("04 - insert",
"04 - deposit"),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("04 - deposit array",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("04 - deposit array",
"04 - deposit init loop",
"04 - deposit",
NB_DEPOSIT_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"04 - deposit init loop"),
/* End of deposit initialization */
/* Session initialization */
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("05 - refresh session init loop",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("05 - refresh session init loop",
NB_REFRESH_INIT),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_REFRESH_SESSION ("05 - refresh session"),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("05 - session array",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_REFRESH_SESSION ("05 - refresh session"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("05 - session array",
"05 - refresh session init loop",
"05 - refresh session",
NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("05 - end",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("05 - end",
"05 - refresh session init loop"),
/* End of refresh session initialization */
/* Refresh melt initialization */
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("06 - refresh melt init loop",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("06 - refresh melt init loop",
NB_MELT_INIT),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
/* TODO: initialize using coins & sessions created localy
* in order to make sure the same coin are not melted twice*/
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("06 - session hash",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("06 - session hash",
"06 - refresh melt init loop",
"05 - session array"),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("06 - coin",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("06 - coin",
"06 - refresh melt init loop",
"03 - save coin"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_REFRESH_MELT ("06 - refresh melt",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_REFRESH_MELT ("06 - refresh melt",
"06 - session hash",
"06 - coin"),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("06 - end",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("06 - end",
"06 - refresh melt init loop"),
/* End of refresh melt initialization */
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("End of initialization"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of initialization"),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("Start of performances measuring"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("21 - start"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("21 - reserve insert measure",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("Start of performances measuring"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("21 - start"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("21 - reserve insert measure",
NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_RESERVE ("21 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("21 - insert",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_RESERVE ("21 - reserve"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_RESERVE ("21 - insert",
"21 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"21 - reserve insert measure"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("21 - stop"),
- PERF_TALER_MINTDB_INIT_CMD_GAUGER ("21 - gauger",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("21 - stop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("21 - gauger",
"21 - start",
"21 - stop",
"POSTGRES",
"Number of reserve inserted per second",
"item/sec",
NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("End of reserve insertion"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of reserve insertion"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("22 - start"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("22 - reserve load measure",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("22 - start"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("22 - reserve load measure",
NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("22 - reserve",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("22 - reserve",
"22 - reserve load measure",
"02 - save reserve"),
- PERF_TALER_MINTDB_INIT_CMD_GET_RESERVE ("22 - get",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_RESERVE ("22 - get",
"22 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"22 - reserve load measure"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("22 - stop"),
- PERF_TALER_MINTDB_INIT_CMD_GAUGER ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("22 - stop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
"22 - start",
"22 - stop",
"POSTGRES",
"Number of reserve loaded per second",
"item/sec",
NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("End of reserve retreival"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of reserve retreival"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("23 - start"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("23 - reserve history measure",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("23 - start"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("23 - reserve history measure",
NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("23 - reserve",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("23 - reserve",
"23 - reserve history measure",
"02 - save reserve"),
- PERF_TALER_MINTDB_INIT_CMD_GET_RESERVE_HISTORY ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_RESERVE_HISTORY ("",
"23 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"23 - reserve history measure"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("23 - stop"),
- PERF_TALER_MINTDB_INIT_CMD_GAUGER ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("23 - stop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
"23 - start",
"23 - stop",
"POSTGRES",
"Number of reserve history loaded per second",
"item/sec",
NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("End of reserve history access"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of reserve history access"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("24 - start"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("24 - withdraw insert measure",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("24 - start"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("24 - withdraw insert measure",
NB_WITHDRAW_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("24 - reserve",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("24 - reserve",
"24 - withdraw insert measure",
"02 - save reserve"),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("24 - denomination",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("24 - denomination",
"24 - withdraw insert measure",
"01 - save denomination"),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_WITHDRAW ("24 - withdraw",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_WITHDRAW ("24 - withdraw",
"24 - denomination",
"24 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW ("24 - insert",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_WITHDRAW ("24 - insert",
"24 - withdraw"),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"24 - withdraw insert measure"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("24 - stop"),
- PERF_TALER_MINTDB_INIT_CMD_GAUGER ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("24 - stop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
"24 - start",
"24 - stop",
"POSTGRES",
"Number of withdraw insert per second",
"item/sec",
NB_WITHDRAW_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("End of withdraw insertion"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of withdraw insertion"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("25 - start"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("25 - withdraw insert measure",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("25 - start"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("25 - withdraw insert measure",
NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("25 - coin",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("25 - coin",
"25 - withdraw insert measure",
"03 - save coin"),
- PERF_TALER_MINTDB_INIT_CMD_GET_WITHDRAW ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_WITHDRAW ("",
"25 - coin"),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"25 - withdraw insert measure"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("25 - stop"),
- PERF_TALER_MINTDB_INIT_CMD_GAUGER ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("25 - stop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
"25 - start",
"25 - stop",
"POSTGRES",
"Number of withdraw loaded per second",
"item/sec",
NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("End of withdraw loading"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of withdraw loading"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("26 - start"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("26 - get coin transaction",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("26 - start"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("26 - get coin transaction",
NB_WITHDRAW_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("26 - coin",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("26 - coin",
"26 - get coin transaction",
"03 - save coin"),
- PERF_TALER_MINTDB_INIT_CMD_GET_COIN_TRANSACTION("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_COIN_TRANSACTION("",
"26 - coin"),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"26 - get coin transaction"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("26 - end"),
- PERF_TALER_MINTDB_INIT_CMD_GAUGER ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("26 - end"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
"26 - start",
"26 - end",
"POSTGRES",
"Number of coin transaction history loaded per second",
"item/sec",
NB_WITHDRAW_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("End of transaction loading"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of transaction loading"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("27 - start"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("27 - /reserve/withdraw",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("27 - start"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("27 - /reserve/withdraw",
NB_WITHDRAW_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("27 - reserve",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("27 - reserve",
"27 - /reserve/withdraw",
"02 - save reserve"),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("27 - dki",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("27 - dki",
"27 - /reserve/withdraw",
"01 - save denomination"),
- PERF_TALER_MINTDB_INIT_CMD_WITHDRAW_SIGN ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_WITHDRAW_SIGN ("",
"27 - dki",
"27 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"27 - /reserve/withdraw"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("27 - end"),
- PERF_TALER_MINTDB_INIT_CMD_GAUGER ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("27 - end"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
"27 - start",
"27 - end",
"POSTGRES",
"Number of /reserve/withdraw per second",
"item/sec",
NB_WITHDRAW_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("End of /reserve/withdraw"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of /reserve/withdraw"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("28 - start"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("28 - /deposit",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("28 - start"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("28 - /deposit",
NB_DEPOSIT_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("28 - coin",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("28 - coin",
"28 - /deposit",
"03 - save coin"),
- PERF_TALER_MINTDB_INIT_CMD_DEPOSIT ("28 - deposit",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEPOSIT ("28 - deposit",
"28 - coin"),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"28 - /deposit"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("28 - stop"),
- PERF_TALER_MINTDB_INIT_CMD_GAUGER ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("28 - stop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
"28 - start",
"28 - stop",
"POSTGRES",
"Number of /deposit per second",
"item/sec",
NB_DEPOSIT_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("29 - start"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("29 - insert refresh session",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("29 - start"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("29 - insert refresh session",
NB_REFRESH_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_REFRESH_SESSION (""),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_REFRESH_SESSION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"29 - insert refresh session"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("29 - stop"),
- PERF_TALER_MINTDB_INIT_CMD_GAUGER ("",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("29 - stop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
"29 - start",
"29 - stop",
"POSTGRES",
"Number of refresh session inserted per second",
"item/sec",
NB_REFRESH_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END (""),
};
- ret = PERF_TALER_MINTDB_run_benchmark (
- "perf-taler-mintdb",
- "./test-mint-db-postgres.conf",
- (struct PERF_TALER_MINTDB_Cmd []) {PERF_TALER_MINTDB_INIT_CMD_END("")},
+ ret = PERF_TALER_EXCHANGEDB_run_benchmark (
+ "perf-taler-exchangedb",
+ "./test-exchange-db-postgres.conf",
+ (struct PERF_TALER_EXCHANGEDB_Cmd []) {PERF_TALER_EXCHANGEDB_INIT_CMD_END("")},
benchmark);
if (GNUNET_SYSERR == ret)
return 1;
diff --git a/src/mintdb/perf_taler_mintdb_init.c b/src/exchangedb/perf_taler_exchangedb_init.c
similarity index 76%
rename from src/mintdb/perf_taler_mintdb_init.c
rename to src/exchangedb/perf_taler_exchangedb_init.c
index ccfc6a05a..516f3ea58 100644
--- a/src/mintdb/perf_taler_mintdb_init.c
+++ b/src/exchangedb/perf_taler_exchangedb_init.c
@@ -14,40 +14,40 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mintdb/perf_taler_mintdb_init.c
- * @brief Interpreter library for mint database performance analysis
+ * @file exchangedb/perf_taler_exchangedb_init.c
+ * @brief Interpreter library for exchange database performance analysis
* @author Nicolas Fournier
*/
#include "platform.h"
-#include "perf_taler_mintdb_init.h"
+#include "perf_taler_exchangedb_init.h"
#include
#include "taler_signatures.h"
#include "taler_amount_lib.h"
#define CURRENCY "EUR"
-#define PERF_TALER_MINTDB_RSA_SIZE 512
+#define PERF_TALER_EXCHANGEDB_RSA_SIZE 512
/**
* Generate a dummy DenominationKeyInformation for testing purposes
* @return a dummy denomination key
*/
-struct TALER_MINTDB_DenominationKeyIssueInformation *
-PERF_TALER_MINTDB_denomination_init ()
+struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *
+PERF_TALER_EXCHANGEDB_denomination_init ()
{
struct GNUNET_CRYPTO_EddsaPrivateKey *master_prvt;
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
struct TALER_DenominationPrivateKey denom_priv;
struct TALER_DenominationPublicKey denom_pub;
- struct TALER_MINTDB_DenominationKeyInformationP issue;
+ struct TALER_EXCHANGEDB_DenominationKeyInformationP issue;
master_prvt = GNUNET_CRYPTO_eddsa_key_create();
- dki = GNUNET_new (struct TALER_MINTDB_DenominationKeyIssueInformation);
+ dki = GNUNET_new (struct TALER_EXCHANGEDB_DenominationKeyIssueInformation);
GNUNET_assert (NULL != dki);
denom_priv.rsa_private_key
- = GNUNET_CRYPTO_rsa_private_key_create (PERF_TALER_MINTDB_RSA_SIZE);
+ = GNUNET_CRYPTO_rsa_private_key_create (PERF_TALER_EXCHANGEDB_RSA_SIZE);
GNUNET_assert (NULL != denom_priv.rsa_private_key);
denom_pub.rsa_public_key =
GNUNET_CRYPTO_rsa_private_key_get_public (denom_priv.rsa_private_key);
@@ -99,13 +99,13 @@ PERF_TALER_MINTDB_denomination_init ()
* @param reserve the deposit copy
* @return a copy of @a deposit; NULL if error
*/
-struct TALER_MINTDB_DenominationKeyIssueInformation *
-PERF_TALER_MINTDB_denomination_copy (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki)
+struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *
+PERF_TALER_EXCHANGEDB_denomination_copy (const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki)
{
- struct TALER_MINTDB_DenominationKeyIssueInformation *copy;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *copy;
GNUNET_assert (NULL !=
- (copy = GNUNET_new (struct TALER_MINTDB_DenominationKeyIssueInformation)));
+ (copy = GNUNET_new (struct TALER_EXCHANGEDB_DenominationKeyIssueInformation)));
{/* denom_priv */
copy->denom_priv.rsa_private_key =
GNUNET_CRYPTO_rsa_private_key_dup ( dki->denom_priv.rsa_private_key);
@@ -127,7 +127,7 @@ PERF_TALER_MINTDB_denomination_copy (const struct TALER_MINTDB_DenominationKeyIs
* @param dki pointer to the struct to free
*/
int
-PERF_TALER_MINTDB_denomination_free (struct TALER_MINTDB_DenominationKeyIssueInformation *dki)
+PERF_TALER_EXCHANGEDB_denomination_free (struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki)
{
if (NULL == dki)
return GNUNET_OK;
@@ -143,13 +143,13 @@ PERF_TALER_MINTDB_denomination_free (struct TALER_MINTDB_DenominationKeyIssueInf
* Generate a dummy reserve for testing
* @return a reserve with 1000 EUR in it
*/
-struct PERF_TALER_MINTDB_Reserve *
-PERF_TALER_MINTDB_reserve_init ()
+struct PERF_TALER_EXCHANGEDB_Reserve *
+PERF_TALER_EXCHANGEDB_reserve_init ()
{
- struct PERF_TALER_MINTDB_Reserve *reserve;
+ struct PERF_TALER_EXCHANGEDB_Reserve *reserve;
GNUNET_assert (NULL !=
- (reserve = GNUNET_new (struct PERF_TALER_MINTDB_Reserve)));
+ (reserve = GNUNET_new (struct PERF_TALER_EXCHANGEDB_Reserve)));
{/* private */
struct GNUNET_CRYPTO_EddsaPrivateKey *private;
private = GNUNET_CRYPTO_eddsa_key_create ();
@@ -172,12 +172,12 @@ PERF_TALER_MINTDB_reserve_init ()
* @param reserve the reserve to copy
* @return a copy of @a reserve; NULL if error
*/
-struct PERF_TALER_MINTDB_Reserve *
-PERF_TALER_MINTDB_reserve_copy (const struct PERF_TALER_MINTDB_Reserve *reserve)
+struct PERF_TALER_EXCHANGEDB_Reserve *
+PERF_TALER_EXCHANGEDB_reserve_copy (const struct PERF_TALER_EXCHANGEDB_Reserve *reserve)
{
- struct PERF_TALER_MINTDB_Reserve *copy;
+ struct PERF_TALER_EXCHANGEDB_Reserve *copy;
GNUNET_assert (NULL !=
- (copy = GNUNET_new (struct PERF_TALER_MINTDB_Reserve)));
+ (copy = GNUNET_new (struct PERF_TALER_EXCHANGEDB_Reserve)));
*copy = *reserve;
return copy;
}
@@ -188,7 +188,7 @@ PERF_TALER_MINTDB_reserve_copy (const struct PERF_TALER_MINTDB_Reserve *reserve)
* @param reserve pointer to the structure to be freed
*/
int
-PERF_TALER_MINTDB_reserve_free (struct PERF_TALER_MINTDB_Reserve *reserve)
+PERF_TALER_EXCHANGEDB_reserve_free (struct PERF_TALER_EXCHANGEDB_Reserve *reserve)
{
if (NULL == reserve)
return GNUNET_OK;
@@ -201,10 +201,10 @@ PERF_TALER_MINTDB_reserve_free (struct PERF_TALER_MINTDB_Reserve *reserve)
* Generate a dummy deposit for testing purposes
* @param dki the denomination key used to sign the key
*/
-struct TALER_MINTDB_Deposit *
-PERF_TALER_MINTDB_deposit_init (const struct PERF_TALER_MINTDB_Coin *coin)
+struct TALER_EXCHANGEDB_Deposit *
+PERF_TALER_EXCHANGEDB_deposit_init (const struct PERF_TALER_EXCHANGEDB_Coin *coin)
{
- struct TALER_MINTDB_Deposit *deposit;
+ struct TALER_EXCHANGEDB_Deposit *deposit;
struct TALER_CoinSpendSignatureP csig;
struct TALER_MerchantPublicKeyP merchant_pub;
struct GNUNET_HashCode h_contract;
@@ -222,7 +222,7 @@ PERF_TALER_MINTDB_deposit_init (const struct PERF_TALER_MINTDB_Coin *coin)
struct TALER_Amount deposit_fee;
GNUNET_assert (NULL !=
- (deposit = GNUNET_malloc (sizeof (struct TALER_MINTDB_Deposit) + sizeof (wire))));
+ (deposit = GNUNET_malloc (sizeof (struct TALER_EXCHANGEDB_Deposit) + sizeof (wire))));
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
&h_contract);
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
@@ -289,12 +289,12 @@ PERF_TALER_MINTDB_deposit_init (const struct PERF_TALER_MINTDB_Coin *coin)
* @param reserve the deposit copy
* @return a copy of @a deposit; NULL if error
*/
-struct TALER_MINTDB_Deposit *
-PERF_TALER_MINTDB_deposit_copy (const struct TALER_MINTDB_Deposit *deposit)
+struct TALER_EXCHANGEDB_Deposit *
+PERF_TALER_EXCHANGEDB_deposit_copy (const struct TALER_EXCHANGEDB_Deposit *deposit)
{
- struct TALER_MINTDB_Deposit *copy;
+ struct TALER_EXCHANGEDB_Deposit *copy;
- copy = GNUNET_new (struct TALER_MINTDB_Deposit);
+ copy = GNUNET_new (struct TALER_EXCHANGEDB_Deposit);
*copy = *deposit;
json_incref (copy->wire);
copy->coin.denom_pub.rsa_public_key =
@@ -310,7 +310,7 @@ PERF_TALER_MINTDB_deposit_copy (const struct TALER_MINTDB_Deposit *deposit)
* @param deposit pointer to the structure to free
*/
int
-PERF_TALER_MINTDB_deposit_free (struct TALER_MINTDB_Deposit *deposit)
+PERF_TALER_EXCHANGEDB_deposit_free (struct TALER_EXCHANGEDB_Deposit *deposit)
{
if (NULL == deposit)
return GNUNET_OK;
@@ -328,15 +328,16 @@ PERF_TALER_MINTDB_deposit_free (struct TALER_MINTDB_Deposit *deposit)
* @param reserve reserve providing the money for the coin
* @return a randomly generated CollectableBlindcoin
*/
-struct PERF_TALER_MINTDB_Coin *
-PERF_TALER_MINTDB_coin_init (
- const struct TALER_MINTDB_DenominationKeyIssueInformation *dki,
- const struct PERF_TALER_MINTDB_Reserve *reserve)
+struct PERF_TALER_EXCHANGEDB_Coin *
+PERF_TALER_EXCHANGEDB_coin_init (
+ const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki,
+ const struct PERF_TALER_EXCHANGEDB_Reserve *reserve)
{
- struct PERF_TALER_MINTDB_Coin *coin;
+ struct PERF_TALER_EXCHANGEDB_Coin *coin;
struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
+ struct GNUNET_HashCode hc;
- coin = GNUNET_new (struct PERF_TALER_MINTDB_Coin);
+ coin = GNUNET_new (struct PERF_TALER_EXCHANGEDB_Coin);
GNUNET_assert (NULL != coin);
/* priv */
@@ -350,10 +351,12 @@ PERF_TALER_MINTDB_coin_init (
&coin->public_info.coin_pub.eddsa_pub);
coin->public_info.denom_pub.rsa_public_key =
GNUNET_CRYPTO_rsa_public_key_dup (dki->denom_pub.rsa_public_key);
+ GNUNET_CRYPTO_hash (&coin->public_info.coin_pub,
+ sizeof (struct TALER_CoinSpendPublicKeyP),
+ &hc);
coin->public_info.denom_sig.rsa_signature =
- GNUNET_CRYPTO_rsa_sign (dki->denom_priv.rsa_private_key,
- &coin->public_info.coin_pub,
- sizeof (struct TALER_CoinSpendPublicKeyP));
+ GNUNET_CRYPTO_rsa_sign_fdh (dki->denom_priv.rsa_private_key,
+ &hc);
GNUNET_assert (NULL != coin->public_info.denom_pub.rsa_public_key);
GNUNET_assert (NULL != coin->public_info.denom_sig.rsa_signature);
@@ -382,12 +385,12 @@ PERF_TALER_MINTDB_coin_init (
* @param coin the coin to copy
* @return a copy of coin; NULL if error
*/
-struct PERF_TALER_MINTDB_Coin *
-PERF_TALER_MINTDB_coin_copy (const struct PERF_TALER_MINTDB_Coin *coin)
+struct PERF_TALER_EXCHANGEDB_Coin *
+PERF_TALER_EXCHANGEDB_coin_copy (const struct PERF_TALER_EXCHANGEDB_Coin *coin)
{
- struct PERF_TALER_MINTDB_Coin *copy;
+ struct PERF_TALER_EXCHANGEDB_Coin *copy;
- copy = GNUNET_new (struct PERF_TALER_MINTDB_Coin);
+ copy = GNUNET_new (struct PERF_TALER_EXCHANGEDB_Coin);
/* priv */
copy->priv = coin->priv;
/* public_info */
@@ -418,7 +421,7 @@ PERF_TALER_MINTDB_coin_copy (const struct PERF_TALER_MINTDB_Coin *coin)
* @param coin pointer to the structure to free
*/
int
-PERF_TALER_MINTDB_coin_free (struct PERF_TALER_MINTDB_Coin *coin)
+PERF_TALER_EXCHANGEDB_coin_free (struct PERF_TALER_EXCHANGEDB_Coin *coin)
{
if (NULL == coin)
return GNUNET_OK;
@@ -434,13 +437,13 @@ PERF_TALER_MINTDB_coin_free (struct PERF_TALER_MINTDB_Coin *coin)
/**
* @return a randomly generated refresh session
*/
-struct TALER_MINTDB_RefreshSession *
-PERF_TALER_MINTDB_refresh_session_init ()
+struct TALER_EXCHANGEDB_RefreshSession *
+PERF_TALER_EXCHANGEDB_refresh_session_init ()
{
- struct TALER_MINTDB_RefreshSession *refresh_session;
+ struct TALER_EXCHANGEDB_RefreshSession *refresh_session;
GNUNET_assert (NULL !=
- (refresh_session = GNUNET_new (struct TALER_MINTDB_RefreshSession)));
+ (refresh_session = GNUNET_new (struct TALER_EXCHANGEDB_RefreshSession)));
refresh_session->noreveal_index = 1;
refresh_session->num_oldcoins = 1;
refresh_session->num_newcoins = 1;
@@ -453,8 +456,8 @@ PERF_TALER_MINTDB_refresh_session_init ()
* @return #GNUNET_OK if the copy was successful, #GNUNET_SYSERR if it wasn't
*/
int
-PERF_TALER_MINTDB_refresh_session_copy (struct TALER_MINTDB_RefreshSession *session,
- struct TALER_MINTDB_RefreshSession *copy)
+PERF_TALER_EXCHANGEDB_refresh_session_copy (struct TALER_EXCHANGEDB_RefreshSession *session,
+ struct TALER_EXCHANGEDB_RefreshSession *copy)
{
*copy = *session;
return GNUNET_OK;
@@ -465,7 +468,7 @@ PERF_TALER_MINTDB_refresh_session_copy (struct TALER_MINTDB_RefreshSession *sess
* Free a refresh session
*/
int
-PERF_TALER_MINTDB_refresh_session_free (struct TALER_MINTDB_RefreshSession *refresh_session)
+PERF_TALER_EXCHANGEDB_refresh_session_free (struct TALER_EXCHANGEDB_RefreshSession *refresh_session)
{
if (NULL == refresh_session)
return GNUNET_OK;
@@ -479,13 +482,13 @@ PERF_TALER_MINTDB_refresh_session_free (struct TALER_MINTDB_RefreshSession *refr
*
* @param session the refresh session
* @param dki the denomination the melted coin uses
- * @return a pointer to a #TALER_MINTDB_RefreshMelt
+ * @return a pointer to a #TALER_EXCHANGEDB_RefreshMelt
*/
-struct TALER_MINTDB_RefreshMelt *
-PERF_TALER_MINTDB_refresh_melt_init (struct GNUNET_HashCode *session,
- struct PERF_TALER_MINTDB_Coin *coin)
+struct TALER_EXCHANGEDB_RefreshMelt *
+PERF_TALER_EXCHANGEDB_refresh_melt_init (struct GNUNET_HashCode *session,
+ struct PERF_TALER_EXCHANGEDB_Coin *coin)
{
- struct TALER_MINTDB_RefreshMelt *melt;
+ struct TALER_EXCHANGEDB_RefreshMelt *melt;
struct TALER_CoinSpendSignatureP coin_sig;
struct TALER_Amount amount;
struct TALER_Amount amount_with_fee;
@@ -510,7 +513,7 @@ PERF_TALER_MINTDB_refresh_melt_init (struct GNUNET_HashCode *session,
GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount (CURRENCY ":0.1",
&amount_with_fee));
- melt = GNUNET_new (struct TALER_MINTDB_RefreshMelt);
+ melt = GNUNET_new (struct TALER_EXCHANGEDB_RefreshMelt);
melt->coin.coin_pub = coin->public_info.coin_pub;
melt->coin.denom_sig.rsa_signature =
GNUNET_CRYPTO_rsa_signature_dup (coin->public_info.denom_sig.rsa_signature);
@@ -527,17 +530,17 @@ PERF_TALER_MINTDB_refresh_melt_init (struct GNUNET_HashCode *session,
/**
- * Copies the internals of a #TALER_MINTDB_RefreshMelt
+ * Copies the internals of a #TALER_EXCHANGEDB_RefreshMelt
*
* @param melt the refresh melt to copy
* @return an copy of @ melt
*/
-struct TALER_MINTDB_RefreshMelt *
-PERF_TALER_MINTDB_refresh_melt_copy (const struct TALER_MINTDB_RefreshMelt *melt)
+struct TALER_EXCHANGEDB_RefreshMelt *
+PERF_TALER_EXCHANGEDB_refresh_melt_copy (const struct TALER_EXCHANGEDB_RefreshMelt *melt)
{
- struct TALER_MINTDB_RefreshMelt *copy;
+ struct TALER_EXCHANGEDB_RefreshMelt *copy;
- copy = GNUNET_new (struct TALER_MINTDB_RefreshMelt);
+ copy = GNUNET_new (struct TALER_EXCHANGEDB_RefreshMelt);
*copy = *melt;
copy->coin.denom_sig.rsa_signature =
GNUNET_CRYPTO_rsa_signature_dup (melt->coin.denom_sig.rsa_signature);
@@ -548,13 +551,13 @@ PERF_TALER_MINTDB_refresh_melt_copy (const struct TALER_MINTDB_RefreshMelt *melt
/**
- * Free the internal memory of a #TALER_MINTDB_RefreshMelt
+ * Free the internal memory of a #TALER_EXCHANGEDB_RefreshMelt
*
- * @param melt the #TALER_MINTDB_RefreshMelt to free
+ * @param melt the #TALER_EXCHANGEDB_RefreshMelt to free
* @return #GNUNET_OK if the operation was successful, #GNUNET_SYSERROR
*/
int
-PERF_TALER_MINTDB_refresh_melt_free (struct TALER_MINTDB_RefreshMelt *melt)
+PERF_TALER_EXCHANGEDB_refresh_melt_free (struct TALER_EXCHANGEDB_RefreshMelt *melt)
{
GNUNET_CRYPTO_rsa_signature_free (melt->coin.denom_sig.rsa_signature);
GNUNET_free (melt);
@@ -563,15 +566,15 @@ PERF_TALER_MINTDB_refresh_melt_free (struct TALER_MINTDB_RefreshMelt *melt)
/**
- * Create a #TALER_MINTDB_RefreshCommitCoin
+ * Create a #TALER_EXCHANGEDB_RefreshCommitCoin
*/
-struct TALER_MINTDB_RefreshCommitCoin *
-PERF_TALER_MINTDB_refresh_commit_coin_init ()
+struct TALER_EXCHANGEDB_RefreshCommitCoin *
+PERF_TALER_EXCHANGEDB_refresh_commit_coin_init ()
{
- struct TALER_MINTDB_RefreshCommitCoin *commit_coin;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coin;
struct TALER_RefreshLinkEncrypted refresh_link;
- commit_coin = GNUNET_new (struct TALER_MINTDB_RefreshCommitCoin);
+ commit_coin = GNUNET_new (struct TALER_EXCHANGEDB_RefreshCommitCoin);
GNUNET_assert (NULL != commit_coin);
{/* refresh_link */
refresh_link = (struct TALER_RefreshLinkEncrypted)
@@ -592,17 +595,17 @@ PERF_TALER_MINTDB_refresh_commit_coin_init ()
/**
- * Copies a #TALER_MINTDB_RefreshCommitCoin
+ * Copies a #TALER_EXCHANGEDB_RefreshCommitCoin
*
* @param commit_coin the commit to copy
* @return a copy of @a commit_coin
*/
-struct TALER_MINTDB_RefreshCommitCoin *
-PERF_TALER_MINTDB_refresh_commit_coin_copy (struct TALER_MINTDB_RefreshCommitCoin *commit_coin)
+struct TALER_EXCHANGEDB_RefreshCommitCoin *
+PERF_TALER_EXCHANGEDB_refresh_commit_coin_copy (struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coin)
{
- struct TALER_MINTDB_RefreshCommitCoin *copy;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *copy;
- copy = GNUNET_new (struct TALER_MINTDB_RefreshCommitCoin);
+ copy = GNUNET_new (struct TALER_EXCHANGEDB_RefreshCommitCoin);
copy->refresh_link = GNUNET_new (struct TALER_RefreshLinkEncrypted);
*copy->refresh_link = *commit_coin->refresh_link;
return copy;
@@ -610,12 +613,12 @@ PERF_TALER_MINTDB_refresh_commit_coin_copy (struct TALER_MINTDB_RefreshCommitCoi
/**
- * Free a #TALER_MINTDB_RefreshCommitCoin
+ * Free a #TALER_EXCHANGEDB_RefreshCommitCoin
*
* @param commit_coin the coin to free
*/
void
-PERF_TALER_MINTDB_refresh_commit_coin_free (struct TALER_MINTDB_RefreshCommitCoin *commit_coin)
+PERF_TALER_EXCHANGEDB_refresh_commit_coin_free (struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coin)
{
GNUNET_free (commit_coin->refresh_link);
GNUNET_free (commit_coin);
diff --git a/src/exchangedb/perf_taler_exchangedb_init.h b/src/exchangedb/perf_taler_exchangedb_init.h
new file mode 100644
index 000000000..0ff074108
--- /dev/null
+++ b/src/exchangedb/perf_taler_exchangedb_init.h
@@ -0,0 +1,257 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2014, 2015 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+ */
+/**
+ * @file exchangedb/perf_taler_exchangedb_init.h
+ * @brief Heler function for creating dummy inputs for the exchange database
+ * @author Nicolas Fournier
+ */
+#ifndef __PERF_TALER_EXCHANGEDB_INIT_H___
+#define __PERF_TALER_EXCHANGEDB_INIT_H___
+
+#include "taler_exchangedb_plugin.h"
+
+
+#define CURRENCY "EUR"
+
+/**
+ * All information about a reserve
+ */
+struct PERF_TALER_EXCHANGEDB_Reserve
+{
+ /**
+ * Information about a rserve available to the Exchange
+ */
+ struct TALER_EXCHANGEDB_Reserve reserve;
+
+ /**
+ * Private key of a reserve
+ */
+ struct GNUNET_CRYPTO_EddsaPrivateKey private;
+};
+
+
+/**
+ * All informations about a coin
+ */
+struct PERF_TALER_EXCHANGEDB_Coin
+{
+ /**
+ * Blinded coin, known by the exchange
+ */
+ struct TALER_EXCHANGEDB_CollectableBlindcoin blind;
+
+ /**
+ * Public key of the coin and othes informations
+ */
+ struct TALER_CoinPublicInfo public_info;
+
+ /**
+ * Private key of the coin
+ */
+ struct GNUNET_CRYPTO_EddsaPrivateKey priv;
+};
+
+
+/**
+ * Generate a dummy DenominationKeyInformation for testing purposes
+ * @return a dummy denomination key
+ */
+struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *
+PERF_TALER_EXCHANGEDB_denomination_init (void);
+
+
+/**
+ * Copies the given denomination
+ * @param reserve the deposit copy
+ * @return a copy of @a deposit; NULL if error
+ */
+struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *
+PERF_TALER_EXCHANGEDB_denomination_copy (
+ const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki);
+
+
+/**
+ * Free memory of a DenominationKeyIssueInformation
+ * @param dki pointer to the struct to free
+ */
+int
+PERF_TALER_EXCHANGEDB_denomination_free (
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki);
+
+
+/**
+ * Generate a dummy reserve for testing
+ * @return a reserve with 1000 EUR in it
+ */
+struct PERF_TALER_EXCHANGEDB_Reserve *
+PERF_TALER_EXCHANGEDB_reserve_init (void);
+
+
+/**
+ * Copies the given reserve
+ * @param reserve the reserve to copy
+ * @return a copy of @a reserve; NULL if error
+ */
+struct PERF_TALER_EXCHANGEDB_Reserve *
+PERF_TALER_EXCHANGEDB_reserve_copy (const struct PERF_TALER_EXCHANGEDB_Reserve *reserve);
+
+
+/**
+ * Free memory of a reserve
+ * @param reserve pointer to the structure to be freed
+ */
+int
+PERF_TALER_EXCHANGEDB_reserve_free (struct PERF_TALER_EXCHANGEDB_Reserve *reserve);
+
+
+/**
+ * Generate a dummy deposit for testing purposes
+ * @param dki the denomination key used to sign the key
+ */
+struct TALER_EXCHANGEDB_Deposit *
+PERF_TALER_EXCHANGEDB_deposit_init (
+ const struct PERF_TALER_EXCHANGEDB_Coin *coin);
+
+
+/**
+ * Copies the given deposit
+ * @param reserve the deposit copy
+ * @return a copy of @a deposit; NULL if error
+ */
+struct TALER_EXCHANGEDB_Deposit *
+PERF_TALER_EXCHANGEDB_deposit_copy (const struct TALER_EXCHANGEDB_Deposit *deposit);
+
+
+/**
+ * Free memory of a deposit
+ * @param deposit pointer to the structure to free
+ */
+int
+PERF_TALER_EXCHANGEDB_deposit_free (struct TALER_EXCHANGEDB_Deposit *deposit);
+
+
+/**
+ * Generate a coin for testing purpuses
+ * @param dki denomination key used to sign the coin
+ * @param reserve reserve providing the money for the coin
+ * @return a randomly generated CollectableBlindcoin
+ */
+struct PERF_TALER_EXCHANGEDB_Coin *
+PERF_TALER_EXCHANGEDB_coin_init (
+ const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki,
+ const struct PERF_TALER_EXCHANGEDB_Reserve *reserve);
+
+
+/**
+ * Copies the given coin
+ * @param coin the coin to copy
+ * @return a copy of coin; NULL if error
+ */
+struct PERF_TALER_EXCHANGEDB_Coin *
+PERF_TALER_EXCHANGEDB_coin_copy (
+ const struct PERF_TALER_EXCHANGEDB_Coin *coin);
+
+
+/**
+ * Liberate memory of @a coin
+ * @param coin pointer to the structure to free
+ */
+int
+PERF_TALER_EXCHANGEDB_coin_free (
+ struct PERF_TALER_EXCHANGEDB_Coin *coin);
+
+
+/**
+ * @return a randomly generated refresh session
+ */
+struct TALER_EXCHANGEDB_RefreshSession *
+PERF_TALER_EXCHANGEDB_refresh_session_init (void);
+
+
+/**
+ * @return #GNUNET_OK if the copy was successful, #GNUNET_SYSERR if it wasn't
+ */
+int
+PERF_TALER_EXCHANGEDB_refresh_session_copy (struct TALER_EXCHANGEDB_RefreshSession *session,
+ struct TALER_EXCHANGEDB_RefreshSession *copy);
+
+
+/**
+ * Frees memory of a refresh_session
+ */
+int
+PERF_TALER_EXCHANGEDB_refresh_session_free (
+ struct TALER_EXCHANGEDB_RefreshSession *refresh_session);
+
+
+/**
+ * Create a melt operation
+ *
+ * @param session the refresh session
+ * @param dki the denomination the melted coin uses
+ * @return a pointer to a #TALER_EXCHANGEDB_RefreshMelt
+ */
+struct TALER_EXCHANGEDB_RefreshMelt *
+PERF_TALER_EXCHANGEDB_refresh_melt_init (struct GNUNET_HashCode *session,
+ struct PERF_TALER_EXCHANGEDB_Coin *coin);
+
+
+/**
+ * Copies the internals of a #TALER_EXCHANGEDB_RefreshMelt
+ *
+ * @param melt the refresh melt to copy
+ * @return an copy of @ melt
+ */
+struct TALER_EXCHANGEDB_RefreshMelt *
+PERF_TALER_EXCHANGEDB_refresh_melt_copy (const struct TALER_EXCHANGEDB_RefreshMelt *melt);
+
+
+/**
+ * Free the internal memory of a #TALER_EXCHANGEDB_RefreshMelt
+ *
+ * @param melt the #TALER_EXCHANGEDB_RefreshMelt to free
+ * @return #GNUNET_OK if the operation was successful, #GNUNET_SYSERROR
+ */
+int
+PERF_TALER_EXCHANGEDB_refresh_melt_free (struct TALER_EXCHANGEDB_RefreshMelt *melt);
+
+
+/**
+ * Create a #TALER_EXCHANGEDB_RefreshCommitCoin
+ */
+struct TALER_EXCHANGEDB_RefreshCommitCoin *
+PERF_TALER_EXCHANGEDB_refresh_commit_coin_init (void);
+
+
+/**
+ * Copies a #TALER_EXCHANGEDB_RefreshCommitCoin
+ *
+ * @param commit_coin the commit to copy
+ * @return a copy of @a commit_coin
+ */
+struct TALER_EXCHANGEDB_RefreshCommitCoin *
+PERF_TALER_EXCHANGEDB_refresh_commit_coin_copy (struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coin);
+
+
+/**
+ * Free a #TALER_EXCHANGEDB_RefreshCommitCoin
+ *
+ * @param commit_coin the coin to free
+ */
+void
+PERF_TALER_EXCHANGEDB_refresh_commit_coin_free (struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coin);
+
+#endif
diff --git a/src/mintdb/perf_taler_mintdb_interpreter.c b/src/exchangedb/perf_taler_exchangedb_interpreter.c
similarity index 76%
rename from src/mintdb/perf_taler_mintdb_interpreter.c
rename to src/exchangedb/perf_taler_exchangedb_interpreter.c
index 293d5f35f..78b58a5ae 100644
--- a/src/mintdb/perf_taler_mintdb_interpreter.c
+++ b/src/exchangedb/perf_taler_exchangedb_interpreter.c
@@ -14,35 +14,35 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mintdb/perf_taler_mintdb_interpreter.c
- * @brief Interpreter library for mint database performance analysis
+ * @file exchangedb/perf_taler_exchangedb_interpreter.c
+ * @brief Interpreter library for exchange database performance analysis
* @author Nicolas Fournier
*/
#include "platform.h"
-#include "perf_taler_mintdb_interpreter.h"
-#include "perf_taler_mintdb_init.h"
+#include "perf_taler_exchangedb_interpreter.h"
+#include "perf_taler_exchangedb_init.h"
#include "gauger.h"
/**
* Represents the state of the interpreter
*/
-struct PERF_TALER_MINTDB_interpreter_state
+struct PERF_TALER_EXCHANGEDB_interpreter_state
{
/**
* State of the commands
*/
- struct PERF_TALER_MINTDB_Cmd *cmd;
+ struct PERF_TALER_EXCHANGEDB_Cmd *cmd;
/**
* Database plugin
*/
- struct TALER_MINTDB_Plugin *plugin;
+ struct TALER_EXCHANGEDB_Plugin *plugin;
/**
* Current database session
*/
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
/**
* The current index of the interpreter
@@ -55,60 +55,60 @@ struct PERF_TALER_MINTDB_interpreter_state
* Free the memory of @a data
*/
static void
-data_free (struct PERF_TALER_MINTDB_Data *data)
+data_free (struct PERF_TALER_EXCHANGEDB_Data *data)
{
switch (data->type)
{
- case PERF_TALER_MINTDB_TIME:
+ case PERF_TALER_EXCHANGEDB_TIME:
if (NULL == data->data.time)
break;
GNUNET_free (data->data.time);
data->data.time = NULL;
break;
- case PERF_TALER_MINTDB_DEPOSIT:
+ case PERF_TALER_EXCHANGEDB_DEPOSIT:
if (NULL == data->data.deposit)
break;
- PERF_TALER_MINTDB_deposit_free (data->data.deposit);
+ PERF_TALER_EXCHANGEDB_deposit_free (data->data.deposit);
data->data.deposit = NULL;
break;
- case PERF_TALER_MINTDB_COIN:
+ case PERF_TALER_EXCHANGEDB_COIN:
if (NULL == data->data.coin)
break;
- PERF_TALER_MINTDB_coin_free (data->data.coin);
+ PERF_TALER_EXCHANGEDB_coin_free (data->data.coin);
data->data.coin = NULL;
break;
- case PERF_TALER_MINTDB_RESERVE:
+ case PERF_TALER_EXCHANGEDB_RESERVE:
if (NULL == data->data.reserve)
break;
- PERF_TALER_MINTDB_reserve_free (data->data.reserve);
+ PERF_TALER_EXCHANGEDB_reserve_free (data->data.reserve);
data->data.reserve = NULL;
break;
- case PERF_TALER_MINTDB_DENOMINATION_INFO:
+ case PERF_TALER_EXCHANGEDB_DENOMINATION_INFO:
if (NULL == data->data.dki)
break;
- PERF_TALER_MINTDB_denomination_free (data->data.dki);
+ PERF_TALER_EXCHANGEDB_denomination_free (data->data.dki);
data->data.dki = NULL;
break;
- case PERF_TALER_MINTDB_REFRESH_HASH:
+ case PERF_TALER_EXCHANGEDB_REFRESH_HASH:
if (NULL == data->data.session_hash)
break;
GNUNET_free (data->data.session_hash);
data->data.session_hash = NULL;
break;
- case PERF_TALER_MINTDB_REFRESH_MELT:
+ case PERF_TALER_EXCHANGEDB_REFRESH_MELT:
if (NULL == data->data.refresh_melt)
break;
- PERF_TALER_MINTDB_refresh_melt_free (data->data.refresh_melt);
+ PERF_TALER_EXCHANGEDB_refresh_melt_free (data->data.refresh_melt);
data->data.refresh_melt = NULL;
break;
- case PERF_TALER_MINTDB_NONE:
+ case PERF_TALER_EXCHANGEDB_NONE:
break;
}
}
@@ -121,49 +121,49 @@ data_free (struct PERF_TALER_MINTDB_Data *data)
* @param[out] copy the copy made
*/
static void
-data_copy (const struct PERF_TALER_MINTDB_Data *data,
- struct PERF_TALER_MINTDB_Data *copy)
+data_copy (const struct PERF_TALER_EXCHANGEDB_Data *data,
+ struct PERF_TALER_EXCHANGEDB_Data *copy)
{
copy->type = data->type;
switch (data->type)
{
- case PERF_TALER_MINTDB_TIME:
+ case PERF_TALER_EXCHANGEDB_TIME:
copy->data.time = GNUNET_new (struct GNUNET_TIME_Absolute);
*copy->data.time = *data->data.time;
return;
- case PERF_TALER_MINTDB_DEPOSIT:
+ case PERF_TALER_EXCHANGEDB_DEPOSIT:
copy->data.deposit
- = PERF_TALER_MINTDB_deposit_copy (data->data.deposit);
+ = PERF_TALER_EXCHANGEDB_deposit_copy (data->data.deposit);
return;
- case PERF_TALER_MINTDB_COIN:
+ case PERF_TALER_EXCHANGEDB_COIN:
copy->data.coin
- = PERF_TALER_MINTDB_coin_copy (data->data.coin);
+ = PERF_TALER_EXCHANGEDB_coin_copy (data->data.coin);
return;
- case PERF_TALER_MINTDB_RESERVE:
+ case PERF_TALER_EXCHANGEDB_RESERVE:
copy->data.reserve
- = PERF_TALER_MINTDB_reserve_copy (data->data.reserve);
+ = PERF_TALER_EXCHANGEDB_reserve_copy (data->data.reserve);
return;
- case PERF_TALER_MINTDB_DENOMINATION_INFO:
+ case PERF_TALER_EXCHANGEDB_DENOMINATION_INFO:
copy->data.dki
- = PERF_TALER_MINTDB_denomination_copy (data->data.dki);
+ = PERF_TALER_EXCHANGEDB_denomination_copy (data->data.dki);
return;
- case PERF_TALER_MINTDB_REFRESH_HASH:
+ case PERF_TALER_EXCHANGEDB_REFRESH_HASH:
copy-> data.session_hash = GNUNET_new (struct GNUNET_HashCode);
*copy->data.session_hash
= *data->data.session_hash;
break;
- case PERF_TALER_MINTDB_REFRESH_MELT:
+ case PERF_TALER_EXCHANGEDB_REFRESH_MELT:
copy->data.refresh_melt
- = PERF_TALER_MINTDB_refresh_melt_copy (data->data.refresh_melt);
+ = PERF_TALER_EXCHANGEDB_refresh_melt_copy (data->data.refresh_melt);
break;
- case PERF_TALER_MINTDB_NONE:
+ case PERF_TALER_EXCHANGEDB_NONE:
break;
}
}
@@ -176,12 +176,12 @@ data_copy (const struct PERF_TALER_MINTDB_Data *data,
* #GNUNET_SYSERR if none found
*/
static int
-cmd_find (const struct PERF_TALER_MINTDB_Cmd *cmd,
+cmd_find (const struct PERF_TALER_EXCHANGEDB_Cmd *cmd,
const char *search)
{
unsigned int i;
- for (i=0; PERF_TALER_MINTDB_CMD_END != cmd[i].command; i++)
+ for (i=0; PERF_TALER_EXCHANGEDB_CMD_END != cmd[i].command; i++)
if (0 == strcmp (cmd[i].label, search))
return i;
return GNUNET_SYSERR;
@@ -197,15 +197,15 @@ cmd_find (const struct PERF_TALER_MINTDB_Cmd *cmd,
* #GNUNET_SYSERR if there was a probleb. See the log for details
*/
static int
-cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
+cmd_init (struct PERF_TALER_EXCHANGEDB_Cmd cmd[])
{
unsigned int i;
- for (i=0; PERF_TALER_MINTDB_CMD_END != cmd[i].command; i++)
+ for (i=0; PERF_TALER_EXCHANGEDB_CMD_END != cmd[i].command; i++)
{
switch (cmd[i].command)
{
- case PERF_TALER_MINTDB_CMD_END_LOOP:
+ case PERF_TALER_EXCHANGEDB_CMD_END_LOOP:
{
int ret;
@@ -219,7 +219,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.end_loop.label_loop);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_CMD_LOOP != cmd[ret].command)
+ if (PERF_TALER_EXCHANGEDB_CMD_LOOP != cmd[ret].command)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -231,7 +231,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_SAVE_ARRAY:
+ case PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY:
{
int ret;
@@ -245,7 +245,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.save_array.label_save);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_NONE == cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_NONE == cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -265,7 +265,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.save_array.label_loop);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_CMD_LOOP != cmd[ret].command)
+ if (PERF_TALER_EXCHANGEDB_CMD_LOOP != cmd[ret].command)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -278,13 +278,13 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
GNUNET_assert (NULL == cmd[i].details.save_array.data_saved);
cmd[i].details.save_array.data_saved =
GNUNET_new_array (cmd[i].details.save_array.nb_saved,
- struct PERF_TALER_MINTDB_Data);
+ struct PERF_TALER_EXCHANGEDB_Data);
cmd[i].details.save_array.type_saved =
cmd[cmd[i].details.save_array.index_save].exposed.type;
}
break;
- case PERF_TALER_MINTDB_CMD_LOAD_ARRAY:
+ case PERF_TALER_EXCHANGEDB_CMD_LOAD_ARRAY:
{
int ret;
@@ -298,7 +298,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.load_array.label_save);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_CMD_SAVE_ARRAY != cmd[ret].command)
+ if (PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY != cmd[ret].command)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -318,7 +318,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.load_array.label_loop);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_CMD_LOOP != cmd[ret].command)
+ if (PERF_TALER_EXCHANGEDB_CMD_LOOP != cmd[ret].command)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -338,7 +338,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_LOAD_RANDOM:
+ case PERF_TALER_EXCHANGEDB_CMD_LOAD_RANDOM:
{
int ret;
@@ -352,7 +352,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.load_random.label_save);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_CMD_SAVE_ARRAY != cmd[ret].command)
+ if (PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY != cmd[ret].command)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -364,7 +364,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_GAUGER:
+ case PERF_TALER_EXCHANGEDB_CMD_GAUGER:
{
int ret;
@@ -378,7 +378,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.gauger.label_start);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_TIME != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_TIME != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -398,7 +398,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.gauger.label_stop);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_TIME != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_TIME != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -410,7 +410,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_DENOMINATION:
{
int ret;
@@ -424,7 +424,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_denomination.label_denom);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_DENOMINATION_INFO != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_DENOMINATION_INFO != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -436,7 +436,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_GET_DENOMINATION:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_DENOMINATION:
{
int ret;
@@ -450,7 +450,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_denomination.label_denom);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_DENOMINATION_INFO != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_DENOMINATION_INFO != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -462,7 +462,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_RESERVE:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_RESERVE:
{
int ret;
@@ -476,7 +476,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_reserve.label_reserve);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_RESERVE != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_RESERVE != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -488,7 +488,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_GET_RESERVE:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_RESERVE:
{
int ret;
@@ -502,7 +502,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_reserve.label_reserve);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_RESERVE != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_RESERVE != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -514,7 +514,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_GET_RESERVE_HISTORY:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_RESERVE_HISTORY:
{
int ret;
@@ -528,7 +528,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_reserve_history.label_reserve);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_RESERVE != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_RESERVE != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -540,7 +540,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_CREATE_WITHDRAW:
+ case PERF_TALER_EXCHANGEDB_CMD_CREATE_WITHDRAW:
{
int ret;
@@ -555,7 +555,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.create_withdraw.label_dki);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_DENOMINATION_INFO != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_DENOMINATION_INFO != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -576,7 +576,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.create_withdraw.label_reserve);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_RESERVE != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_RESERVE != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -589,7 +589,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_WITHDRAW:
{
int ret;
@@ -603,7 +603,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_withdraw.label_coin);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_COIN != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_COIN != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -615,7 +615,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_GET_WITHDRAW:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_WITHDRAW:
{
int ret;
@@ -629,7 +629,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_withdraw.label_coin);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_COIN != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_COIN != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -641,7 +641,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_GET_COIN_TRANSACTION:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_COIN_TRANSACTION:
{
int ret;
ret = cmd_find (cmd,
@@ -654,7 +654,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_coin_transaction.label_coin);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_COIN != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_COIN != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -666,7 +666,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_CREATE_DEPOSIT:
+ case PERF_TALER_EXCHANGEDB_CMD_CREATE_DEPOSIT:
{
int ret;
@@ -680,7 +680,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.create_deposit.label_coin);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_COIN != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_COIN != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -692,7 +692,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_DEPOSIT:
{
int ret;
@@ -706,7 +706,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_deposit.label_deposit);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_DEPOSIT != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_DEPOSIT != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -718,7 +718,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_GET_DEPOSIT:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_DEPOSIT:
{
int ret;
@@ -732,7 +732,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_deposit.label_deposit);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_DEPOSIT != cmd[ret].exposed.type)
+ if (PERF_TALER_EXCHANGEDB_DEPOSIT != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
@@ -744,7 +744,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_GET_REFRESH_SESSION:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_SESSION:
{
int ret;
@@ -758,8 +758,8 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_refresh_session.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
@@ -770,7 +770,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_REFRESH_MELT:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_MELT:
{
int ret;
@@ -784,8 +784,8 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_refresh_melt.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
@@ -803,8 +803,8 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_refresh_melt.label_coin);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_COIN != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_COIN != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
@@ -814,7 +814,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_refresh_melt.index_coin = ret; }
break;
- case PERF_TALER_MINTDB_CMD_GET_REFRESH_MELT:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_MELT:
{
int ret;
ret = cmd_find (cmd,
@@ -827,8 +827,8 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_refresh_melt.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
@@ -839,7 +839,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_REFRESH_ORDER:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_ORDER:
{
int ret;
ret = cmd_find (cmd,
@@ -852,8 +852,8 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_refresh_order.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
@@ -872,8 +872,8 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_refresh_order.label_denom);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_DENOMINATION_INFO != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_DENOMINATION_INFO != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
@@ -884,7 +884,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_GET_REFRESH_ORDER:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_ORDER:
{
int ret;
ret = cmd_find (cmd,
@@ -897,19 +897,19 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_refresh_order.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.get_refresh_order.label_hash);
return GNUNET_SYSERR;
}
- cmd[i].details.get_refresh_order.index_hash = ret;
+ cmd[i].details.get_refresh_order.index_hash = ret;
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_REFRESH_COMMIT_COIN:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_COMMIT_COIN:
{
int ret;
ret = cmd_find (cmd,
@@ -922,19 +922,19 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_refresh_commit_coin.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.insert_refresh_commit_coin.label_hash);
return GNUNET_SYSERR;
}
- cmd[i].details.insert_refresh_commit_coin.index_hash = ret;
- }
+ cmd[i].details.insert_refresh_commit_coin.index_hash = ret;
+ }
break;
- case PERF_TALER_MINTDB_CMD_GET_REFRESH_COMMIT_COIN:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_COMMIT_COIN:
{
int ret;
ret = cmd_find (cmd,
@@ -947,19 +947,19 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_refresh_commit_coin.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.get_refresh_commit_coin.label_hash);
return GNUNET_SYSERR;
}
- cmd[i].details.get_refresh_commit_coin.index_hash = ret;
+ cmd[i].details.get_refresh_commit_coin.index_hash = ret;
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_REFRESH_COMMIT_LINK:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_COMMIT_LINK:
{
int ret;
ret = cmd_find (cmd,
@@ -972,19 +972,19 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_refresh_commit_link.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.insert_refresh_commit_link.label_hash);
return GNUNET_SYSERR;
}
- cmd[i].details.insert_refresh_commit_link.index_hash = ret;
+ cmd[i].details.insert_refresh_commit_link.index_hash = ret;
}
break;
- case PERF_TALER_MINTDB_CMD_GET_REFRESH_COMMIT_LINK:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_COMMIT_LINK:
{
int ret;
ret = cmd_find (cmd,
@@ -997,19 +997,19 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_refresh_commit_link.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.get_refresh_commit_link.label_hash);
return GNUNET_SYSERR;
}
- cmd[i].details.get_refresh_commit_link.index_hash = ret;
+ cmd[i].details.get_refresh_commit_link.index_hash = ret;
}
break;
- case PERF_TALER_MINTDB_CMD_GET_MELT_COMMITMENT:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_MELT_COMMITMENT:
{
int ret;
ret = cmd_find (cmd,
@@ -1022,19 +1022,19 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_melt_commitment.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.get_melt_commitment.label_hash);
return GNUNET_SYSERR;
}
- cmd[i].details.get_melt_commitment.index_hash = ret;
+ cmd[i].details.get_melt_commitment.index_hash = ret;
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_REFRESH_OUT:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_OUT:
{
int ret;
ret = cmd_find (cmd,
@@ -1047,19 +1047,19 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.insert_refresh_out.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.insert_refresh_out.label_hash);
return GNUNET_SYSERR;
}
- cmd[i].details.insert_refresh_out.index_hash = ret;
+ cmd[i].details.insert_refresh_out.index_hash = ret;
}
break;
- case PERF_TALER_MINTDB_CMD_GET_LINK_DATA_LIST:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_LINK_DATA_LIST:
{
int ret;
ret = cmd_find (cmd,
@@ -1072,19 +1072,19 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_link_data_list.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.get_link_data_list.label_hash);
return GNUNET_SYSERR;
}
- cmd[i].details.get_link_data_list.index_hash = ret;
+ cmd[i].details.get_link_data_list.index_hash = ret;
}
break;
- case PERF_TALER_MINTDB_CMD_GET_TRANSFER:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_TRANSFER:
{
int ret;
ret = cmd_find (cmd,
@@ -1097,29 +1097,29 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
cmd[i].details.get_transfer.label_hash);
return GNUNET_SYSERR;
}
- if (PERF_TALER_MINTDB_REFRESH_HASH != cmd[ret].exposed.type)
- {
+ if (PERF_TALER_EXCHANGEDB_REFRESH_HASH != cmd[ret].exposed.type)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.get_transfer.label_hash);
return GNUNET_SYSERR;
}
- cmd[i].details.get_transfer.index_hash = ret;
+ cmd[i].details.get_transfer.index_hash = ret;
}
break;
- case PERF_TALER_MINTDB_CMD_END:
- case PERF_TALER_MINTDB_CMD_DEBUG:
- case PERF_TALER_MINTDB_CMD_LOOP:
- case PERF_TALER_MINTDB_CMD_NEW_SESSION:
- case PERF_TALER_MINTDB_CMD_START_TRANSACTION:
- case PERF_TALER_MINTDB_CMD_COMMIT_TRANSACTION:
- case PERF_TALER_MINTDB_CMD_ABORT_TRANSACTION:
- case PERF_TALER_MINTDB_CMD_GET_TIME:
- case PERF_TALER_MINTDB_CMD_CREATE_DENOMINATION:
- case PERF_TALER_MINTDB_CMD_CREATE_RESERVE:
- case PERF_TALER_MINTDB_CMD_CREATE_REFRESH_SESSION:
+ case PERF_TALER_EXCHANGEDB_CMD_END:
+ case PERF_TALER_EXCHANGEDB_CMD_DEBUG:
+ case PERF_TALER_EXCHANGEDB_CMD_LOOP:
+ case PERF_TALER_EXCHANGEDB_CMD_NEW_SESSION:
+ case PERF_TALER_EXCHANGEDB_CMD_START_TRANSACTION:
+ case PERF_TALER_EXCHANGEDB_CMD_COMMIT_TRANSACTION:
+ case PERF_TALER_EXCHANGEDB_CMD_ABORT_TRANSACTION:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_TIME:
+ case PERF_TALER_EXCHANGEDB_CMD_CREATE_DENOMINATION:
+ case PERF_TALER_EXCHANGEDB_CMD_CREATE_RESERVE:
+ case PERF_TALER_EXCHANGEDB_CMD_CREATE_REFRESH_SESSION:
break;
}
}
@@ -1131,15 +1131,15 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
* Free the memory of the command chain
*/
static int
-cmd_clean (struct PERF_TALER_MINTDB_Cmd cmd[])
+cmd_clean (struct PERF_TALER_EXCHANGEDB_Cmd cmd[])
{
unsigned int i;
- for (i=0; PERF_TALER_MINTDB_CMD_END != cmd[i].command; i++)
+ for (i=0; PERF_TALER_EXCHANGEDB_CMD_END != cmd[i].command; i++)
{
switch (cmd[i].command)
{
- case PERF_TALER_MINTDB_CMD_SAVE_ARRAY:
+ case PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY:
{
unsigned int j;
@@ -1152,7 +1152,7 @@ cmd_clean (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
- case PERF_TALER_MINTDB_CMD_LOAD_ARRAY:
+ case PERF_TALER_EXCHANGEDB_CMD_LOAD_ARRAY:
GNUNET_free (cmd[i].details.load_array.permutation);
cmd[i].details.load_array.permutation = NULL;
break;
@@ -1167,11 +1167,11 @@ cmd_clean (struct PERF_TALER_MINTDB_Cmd cmd[])
/**
- * Handles the command #PERF_TALER_MINTDB_CMD_END_LOOP for the interpreter
+ * Handles the command #PERF_TALER_EXCHANGEDB_CMD_END_LOOP for the interpreter
* Cleans the memory at the end of the loop
*/
static void
-interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state)
+interpret_end_loop (struct PERF_TALER_EXCHANGEDB_interpreter_state *state)
{
unsigned int i;
int jump;
@@ -1199,16 +1199,16 @@ interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state)
/**
* Part of the interpreter specific to
- * #PERF_TALER_MINTDB_CMD_SAVE_ARRAY
+ * #PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY
* Saves the data exposed by another command into
* an array in the command specific struct.
*/
static void
-interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state)
+interpret_save_array (struct PERF_TALER_EXCHANGEDB_interpreter_state *state)
{
- struct PERF_TALER_MINTDB_Cmd *cmd = &state->cmd[state->i];
- struct PERF_TALER_MINTDB_Cmd *save_ref;
- struct PERF_TALER_MINTDB_Cmd *loop_ref;
+ struct PERF_TALER_EXCHANGEDB_Cmd *cmd = &state->cmd[state->i];
+ struct PERF_TALER_EXCHANGEDB_Cmd *save_ref;
+ struct PERF_TALER_EXCHANGEDB_Cmd *loop_ref;
int loop_index;
int save_index;
unsigned int selection_chance;
@@ -1242,8 +1242,8 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state)
(0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
selection_chance)) ) )
{
- struct PERF_TALER_MINTDB_Data *save_location;
- struct PERF_TALER_MINTDB_Data *item_saved;
+ struct PERF_TALER_EXCHANGEDB_Data *save_location;
+ struct PERF_TALER_EXCHANGEDB_Data *item_saved;
save_location = &cmd->details.save_array.data_saved[cmd->details.save_array.index];
item_saved = &save_ref->exposed;
@@ -1255,17 +1255,17 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state)
/**
* Part of the interpreter specific to
- * #PERF_TALER_MINTDB_CMD_LOAD_ARRAY
- * Gets data from a #PERF_TALER_MINTDB_CMD_SAVE_ARRAY and exposes a copy
+ * #PERF_TALER_EXCHANGEDB_CMD_LOAD_ARRAY
+ * Gets data from a #PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY and exposes a copy
*/
static void
-interpret_load_array (struct PERF_TALER_MINTDB_interpreter_state *state)
+interpret_load_array (struct PERF_TALER_EXCHANGEDB_interpreter_state *state)
{
- struct PERF_TALER_MINTDB_Cmd *cmd = &state->cmd[state->i];
+ struct PERF_TALER_EXCHANGEDB_Cmd *cmd = &state->cmd[state->i];
unsigned int loop_iter;
int loop_index;
int save_index;
- struct PERF_TALER_MINTDB_Data *loaded_data;
+ struct PERF_TALER_EXCHANGEDB_Data *loaded_data;
loop_index = cmd->details.load_array.index_loop;
save_index = cmd->details.load_array.index_save;
@@ -1292,13 +1292,13 @@ interpret_load_array (struct PERF_TALER_MINTDB_interpreter_state *state)
/**
* Part of the interpreter specific to
- * #PERF_TALER_MINTDB_CMD_LOAD_RANDOM
- * Get a random element from a #PERF_TALER_MINTDB_CMD_SAVE_ARRAY and exposes it
+ * #PERF_TALER_EXCHANGEDB_CMD_LOAD_RANDOM
+ * Get a random element from a #PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY and exposes it
*/
static void
-interprete_load_random (struct PERF_TALER_MINTDB_interpreter_state *state)
+interprete_load_random (struct PERF_TALER_EXCHANGEDB_interpreter_state *state)
{
- struct PERF_TALER_MINTDB_Cmd *cmd = &state->cmd[state->i];
+ struct PERF_TALER_EXCHANGEDB_Cmd *cmd = &state->cmd[state->i];
unsigned int index;
int save_index;
@@ -1316,36 +1316,36 @@ interprete_load_random (struct PERF_TALER_MINTDB_interpreter_state *state)
* @param state the current state of the interpreter
*/
static int
-interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
+interpret (struct PERF_TALER_EXCHANGEDB_interpreter_state *state)
{
- for (state->i=0; PERF_TALER_MINTDB_CMD_END != state->cmd[state->i].command; state->i++)
+ for (state->i=0; PERF_TALER_EXCHANGEDB_CMD_END != state->cmd[state->i].command; state->i++)
{
switch (state->cmd[state->i].command)
{
- case PERF_TALER_MINTDB_CMD_END:
+ case PERF_TALER_EXCHANGEDB_CMD_END:
return GNUNET_YES;
- case PERF_TALER_MINTDB_CMD_DEBUG:
+ case PERF_TALER_EXCHANGEDB_CMD_DEBUG:
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"%s\n",
state->cmd[state->i].label);
break;
- case PERF_TALER_MINTDB_CMD_LOOP:
+ case PERF_TALER_EXCHANGEDB_CMD_LOOP:
break;
- case PERF_TALER_MINTDB_CMD_END_LOOP:
+ case PERF_TALER_EXCHANGEDB_CMD_END_LOOP:
interpret_end_loop (state);
break;
- case PERF_TALER_MINTDB_CMD_GET_TIME:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_TIME:
state->cmd[state->i].exposed.data.time =
GNUNET_new (struct GNUNET_TIME_Absolute);
*state->cmd[state->i].exposed.data.time =
GNUNET_TIME_absolute_get ();
break;
- case PERF_TALER_MINTDB_CMD_GAUGER:
+ case PERF_TALER_EXCHANGEDB_CMD_GAUGER:
{
unsigned int start_index;
unsigned int stop_index;
@@ -1368,52 +1368,52 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_NEW_SESSION:
+ case PERF_TALER_EXCHANGEDB_CMD_NEW_SESSION:
state->session = state->plugin->get_session (state->plugin->cls, GNUNET_YES);
break;
- case PERF_TALER_MINTDB_CMD_START_TRANSACTION:
+ case PERF_TALER_EXCHANGEDB_CMD_START_TRANSACTION:
state->plugin->start (state->plugin->cls, state->session);
break;
- case PERF_TALER_MINTDB_CMD_COMMIT_TRANSACTION:
+ case PERF_TALER_EXCHANGEDB_CMD_COMMIT_TRANSACTION:
state->plugin->commit (state->plugin->cls, state->session);
break;
- case PERF_TALER_MINTDB_CMD_ABORT_TRANSACTION:
+ case PERF_TALER_EXCHANGEDB_CMD_ABORT_TRANSACTION:
state->plugin->rollback (state->plugin->cls,
state->session);
break;
- case PERF_TALER_MINTDB_CMD_SAVE_ARRAY:
+ case PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY:
interpret_save_array (state);
break;
- case PERF_TALER_MINTDB_CMD_LOAD_ARRAY:
+ case PERF_TALER_EXCHANGEDB_CMD_LOAD_ARRAY:
interpret_load_array (state);
break;
- case PERF_TALER_MINTDB_CMD_LOAD_RANDOM:
+ case PERF_TALER_EXCHANGEDB_CMD_LOAD_RANDOM:
interprete_load_random (state);
break;
- case PERF_TALER_MINTDB_CMD_CREATE_DEPOSIT:
+ case PERF_TALER_EXCHANGEDB_CMD_CREATE_DEPOSIT:
{
int coin_index;
- struct TALER_MINTDB_Deposit *deposit;
+ struct TALER_EXCHANGEDB_Deposit *deposit;
coin_index = state->cmd[state->i].details.create_deposit.index_coin;
- deposit = PERF_TALER_MINTDB_deposit_init (state->cmd[coin_index].exposed.data.coin);
+ deposit = PERF_TALER_EXCHANGEDB_deposit_init (state->cmd[coin_index].exposed.data.coin);
GNUNET_assert (NULL != deposit);
state->cmd[state->i].exposed.data.deposit = deposit;
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_DEPOSIT:
{
int deposit_index;
int ret;
- struct TALER_MINTDB_Deposit *deposit;
+ struct TALER_EXCHANGEDB_Deposit *deposit;
deposit_index = state->cmd[state->i].details.insert_deposit.index_deposit;
deposit = state->cmd[deposit_index].exposed.data.deposit;
@@ -1425,11 +1425,11 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_GET_DEPOSIT:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_DEPOSIT:
{
unsigned int source_index;
int ret;
- struct PERF_TALER_MINTDB_Data *data;
+ struct PERF_TALER_EXCHANGEDB_Data *data;
source_index = state->cmd[state->i].details.get_deposit.index_deposit;
data = &state->cmd[source_index].exposed;
@@ -1440,20 +1440,20 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_CREATE_RESERVE:
+ case PERF_TALER_EXCHANGEDB_CMD_CREATE_RESERVE:
{
- struct PERF_TALER_MINTDB_Reserve *reserve;
+ struct PERF_TALER_EXCHANGEDB_Reserve *reserve;
- reserve = PERF_TALER_MINTDB_reserve_init ();
+ reserve = PERF_TALER_EXCHANGEDB_reserve_init ();
state->cmd[state->i].exposed.data.reserve = reserve;
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_RESERVE:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_RESERVE:
{
unsigned int reserve_index;
int ret;
- struct PERF_TALER_MINTDB_Reserve *reserve;
+ struct PERF_TALER_EXCHANGEDB_Reserve *reserve;
json_t *details = NULL;
reserve_index = state->cmd[state->i].details.insert_reserve.index_reserve;
@@ -1474,11 +1474,11 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_GET_RESERVE:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_RESERVE:
{
unsigned int reserve_index;
int ret;
- struct PERF_TALER_MINTDB_Data *data;
+ struct PERF_TALER_EXCHANGEDB_Data *data;
reserve_index = state->cmd[state->i].details.get_reserve.index_reserve;
@@ -1490,11 +1490,11 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_GET_RESERVE_HISTORY:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_RESERVE_HISTORY:
{
unsigned int reserve_index;
- struct TALER_MINTDB_ReserveHistory *history;
- struct PERF_TALER_MINTDB_Data *data;
+ struct TALER_EXCHANGEDB_ReserveHistory *history;
+ struct PERF_TALER_EXCHANGEDB_Data *data;
reserve_index = state->cmd[state->i].details.get_reserve_history.index_reserve;
data = &state->cmd[reserve_index].exposed;
@@ -1507,20 +1507,20 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_CREATE_DENOMINATION:
+ case PERF_TALER_EXCHANGEDB_CMD_CREATE_DENOMINATION:
{
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki =
- PERF_TALER_MINTDB_denomination_init ();
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki =
+ PERF_TALER_EXCHANGEDB_denomination_init ();
GNUNET_assert (NULL != dki);
state->cmd[state->i].exposed.data.dki = dki;
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_DENOMINATION:
{
unsigned int denom_index;
int ret;
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki ;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki ;
denom_index = state->cmd[state->i].details.insert_denomination.index_denom;
dki = state->cmd[denom_index].exposed.data.dki;
@@ -1532,13 +1532,13 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_GET_DENOMINATION:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_DENOMINATION:
{
unsigned int denom_index;
int ret;
- struct PERF_TALER_MINTDB_Data *data;
+ struct PERF_TALER_EXCHANGEDB_Data *data;
- denom_index = state->cmd[state->i].details.get_denomination.index_denom;
+ denom_index = state->cmd[state->i].details.get_denomination.index_denom;
data = &state->cmd[denom_index].exposed;
ret = state->plugin->get_denomination_info (state->plugin->cls,
state->session,
@@ -1548,26 +1548,26 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_CREATE_WITHDRAW:
+ case PERF_TALER_EXCHANGEDB_CMD_CREATE_WITHDRAW:
{
unsigned int dki_index;
unsigned int reserve_index;
- struct PERF_TALER_MINTDB_Coin *coin ;
+ struct PERF_TALER_EXCHANGEDB_Coin *coin ;
dki_index = state->cmd[state->i].details.create_withdraw.index_dki;
reserve_index = state->cmd[state->i].details.create_withdraw.index_reserve;
- coin = PERF_TALER_MINTDB_coin_init (state->cmd[dki_index].exposed.data.dki,
+ coin = PERF_TALER_EXCHANGEDB_coin_init (state->cmd[dki_index].exposed.data.dki,
state->cmd[reserve_index].exposed.data.reserve);
GNUNET_assert (NULL != coin);
state->cmd[state->i].exposed.data.coin = coin;
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_WITHDRAW:
{
unsigned int coin_index;
int ret;
- struct PERF_TALER_MINTDB_Coin *coin ;
+ struct PERF_TALER_EXCHANGEDB_Coin *coin ;
coin_index = state->cmd[state->i].details.insert_withdraw.index_coin;
coin = state->cmd[coin_index].exposed.data.coin;
@@ -1578,11 +1578,11 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_GET_WITHDRAW:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_WITHDRAW:
{
unsigned int source_index;
int ret;
- struct PERF_TALER_MINTDB_Data *data;
+ struct PERF_TALER_EXCHANGEDB_Data *data;
source_index = state->cmd[state->i].details.get_denomination.index_denom;
data = &state->cmd[source_index].exposed;
@@ -1594,11 +1594,11 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_GET_COIN_TRANSACTION:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_COIN_TRANSACTION:
{
unsigned int coin_index;
- struct PERF_TALER_MINTDB_Coin *coin;
- struct TALER_MINTDB_TransactionList *transactions;
+ struct PERF_TALER_EXCHANGEDB_Coin *coin;
+ struct TALER_EXCHANGEDB_TransactionList *transactions;
coin_index = state->cmd[state->i].details.get_coin_transaction.index_coin;
coin = state->cmd[coin_index].exposed.data.coin;
@@ -1611,13 +1611,13 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_CREATE_REFRESH_SESSION:
+ case PERF_TALER_EXCHANGEDB_CMD_CREATE_REFRESH_SESSION:
{
struct GNUNET_HashCode *hash;
- struct TALER_MINTDB_RefreshSession *refresh_session;
+ struct TALER_EXCHANGEDB_RefreshSession *refresh_session;
hash = GNUNET_new (struct GNUNET_HashCode);
- refresh_session = PERF_TALER_MINTDB_refresh_session_init ();
+ refresh_session = PERF_TALER_EXCHANGEDB_refresh_session_init ();
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
hash);
state->plugin->create_refresh_session (state->session,
@@ -1625,16 +1625,16 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
hash,
refresh_session);
state->cmd[state->i].exposed.data.session_hash = hash;
- PERF_TALER_MINTDB_refresh_session_free (refresh_session);
+ PERF_TALER_EXCHANGEDB_refresh_session_free (refresh_session);
GNUNET_free (refresh_session);
}
break;
- case PERF_TALER_MINTDB_CMD_GET_REFRESH_SESSION:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_SESSION:
{
unsigned int hash_index;
struct GNUNET_HashCode *hash;
- struct TALER_MINTDB_RefreshSession refresh;
+ struct TALER_EXCHANGEDB_RefreshSession refresh;
hash_index = state->cmd[state->i].details.get_refresh_session.index_hash;
hash = state->cmd[hash_index].exposed.data.session_hash;
@@ -1645,19 +1645,19 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_REFRESH_MELT:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_MELT:
{
unsigned int hash_index;
unsigned int coin_index;
struct GNUNET_HashCode *hash;
- struct TALER_MINTDB_RefreshMelt *melt;
- struct PERF_TALER_MINTDB_Coin *coin;
+ struct TALER_EXCHANGEDB_RefreshMelt *melt;
+ struct PERF_TALER_EXCHANGEDB_Coin *coin;
hash_index = state->cmd[state->i].details.insert_refresh_melt.index_hash;
coin_index = state->cmd[state->i].details.insert_refresh_melt.index_coin;
hash = state->cmd[hash_index].exposed.data.session_hash;
coin = state->cmd[coin_index].exposed.data.coin;
- melt = PERF_TALER_MINTDB_refresh_melt_init (hash,
+ melt = PERF_TALER_EXCHANGEDB_refresh_melt_init (hash,
coin);
state->plugin->insert_refresh_melt (state->plugin->cls,
state->session,
@@ -1666,12 +1666,12 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_GET_REFRESH_MELT:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_MELT:
{
int ret;
unsigned int hash_index;
struct GNUNET_HashCode *hash;
- struct TALER_MINTDB_RefreshMelt melt;
+ struct TALER_EXCHANGEDB_RefreshMelt melt;
hash_index = cmd_find (state->cmd,
state->cmd[state->i].details.get_refresh_melt.label_hash);
@@ -1685,12 +1685,12 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_REFRESH_ORDER:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_ORDER:
{
unsigned int hash_index;
unsigned int denom_index;
struct GNUNET_HashCode *session_hash;
- struct TALER_MINTDB_DenominationKeyIssueInformation *denom;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *denom;
hash_index = state->cmd[state->i].details.insert_refresh_order.index_hash;
denom_index = state->cmd[state->i].details.insert_refresh_order.index_denom;
@@ -1705,7 +1705,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_GET_REFRESH_ORDER:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_ORDER:
{
int hash_index;
struct GNUNET_HashCode *hash;
@@ -1721,29 +1721,29 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_REFRESH_COMMIT_COIN:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_COMMIT_COIN:
{
int ret;
unsigned int hash_index;
- struct TALER_MINTDB_RefreshCommitCoin *refresh_commit;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *refresh_commit;
hash_index = state->cmd[state->i].details.insert_refresh_commit_coin.index_hash;
- refresh_commit = PERF_TALER_MINTDB_refresh_commit_coin_init ();
+ refresh_commit = PERF_TALER_EXCHANGEDB_refresh_commit_coin_init ();
ret = state->plugin->insert_refresh_commit_coins (state->plugin->cls,
state->session,
state->cmd[hash_index].exposed.data.session_hash,
1,
1,
refresh_commit);
- GNUNET_assert (GNUNET_OK == ret);
+ GNUNET_assert (GNUNET_OK == ret);
}
break;
- case PERF_TALER_MINTDB_CMD_GET_REFRESH_COMMIT_COIN:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_COMMIT_COIN:
{
unsigned int hash_index;
- struct TALER_MINTDB_RefreshCommitCoin refresh_commit;
-
+ struct TALER_EXCHANGEDB_RefreshCommitCoin refresh_commit;
+
hash_index = state->cmd[state->i].details.insert_refresh_commit_coin.index_hash;
state->plugin->get_refresh_commit_coins (state->plugin->cls,
state->session,
@@ -1755,7 +1755,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_INSERT_REFRESH_COMMIT_LINK:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_COMMIT_LINK:
{
// unsigned int hash_index;
//
@@ -1763,11 +1763,11 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_GET_REFRESH_COMMIT_LINK:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_COMMIT_LINK:
{
int ret;
unsigned int hash_index;
- struct TALER_MINTDB_RefreshCommitCoin commit_coin;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin commit_coin;
hash_index = state->cmd[state->i].details.get_refresh_commit_link.index_hash;
ret = state->plugin->get_refresh_commit_coins(state->plugin->cls,
@@ -1780,16 +1780,16 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
- case PERF_TALER_MINTDB_CMD_GET_MELT_COMMITMENT:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_MELT_COMMITMENT:
break;
- case PERF_TALER_MINTDB_CMD_INSERT_REFRESH_OUT:
+ case PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_OUT:
break;
- case PERF_TALER_MINTDB_CMD_GET_LINK_DATA_LIST:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_LINK_DATA_LIST:
break;
- case PERF_TALER_MINTDB_CMD_GET_TRANSFER:
+ case PERF_TALER_EXCHANGEDB_CMD_GET_TRANSFER:
break;
}
@@ -1806,11 +1806,11 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
* @param cmd the commands to run
*/
int
-PERF_TALER_MINTDB_interpret (struct TALER_MINTDB_Plugin *db_plugin,
- struct PERF_TALER_MINTDB_Cmd cmd[])
+PERF_TALER_EXCHANGEDB_interpret (struct TALER_EXCHANGEDB_Plugin *db_plugin,
+ struct PERF_TALER_EXCHANGEDB_Cmd cmd[])
{
int ret;
- struct PERF_TALER_MINTDB_interpreter_state state =
+ struct PERF_TALER_EXCHANGEDB_interpreter_state state =
{.i = 0, .cmd = cmd, .plugin = db_plugin};
ret = cmd_init (cmd);
@@ -1836,107 +1836,106 @@ PERF_TALER_MINTDB_interpret (struct TALER_MINTDB_Plugin *db_plugin,
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
*/
int
-PERF_TALER_MINTDB_run_benchmark (const char *benchmark_name,
- const char *configuration_file,
- struct PERF_TALER_MINTDB_Cmd *init,
- struct PERF_TALER_MINTDB_Cmd *benchmark)
+PERF_TALER_EXCHANGEDB_run_benchmark (const char *benchmark_name,
+ const char *configuration_file,
+ struct PERF_TALER_EXCHANGEDB_Cmd *init,
+ struct PERF_TALER_EXCHANGEDB_Cmd *benchmark)
{
- struct TALER_MINTDB_Plugin *plugin;
+ struct TALER_EXCHANGEDB_Plugin *plugin;
struct GNUNET_CONFIGURATION_Handle *config;
int ret = 0;
- struct PERF_TALER_MINTDB_Cmd init_def[] =
+ struct PERF_TALER_EXCHANGEDB_Cmd init_def[] =
{
// Denomination used to create coins
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("00 - Start of interpreter"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("00 - Start of interpreter"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("01 - denomination loop",
- PERF_TALER_MINTDB_NB_DENOMINATION_INIT),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_DENOMINATION ("01 - denomination"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("01 - insert",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("01 - denomination loop",
+ PERF_TALER_EXCHANGEDB_NB_DENOMINATION_INIT),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_DENOMINATION ("01 - denomination"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_DENOMINATION ("01 - insert",
"01 - denomination"),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination",
"01 - denomination loop",
"01 - denomination",
- PERF_TALER_MINTDB_NB_DENOMINATION_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_NB_DENOMINATION_SAVE),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"01 - denomination loop"),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("01 - init denomination complete"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("01 - init denomination complete"),
// End of initialization
// Reserve initialization
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("02 - init reserve loop",
- PERF_TALER_MINTDB_NB_RESERVE_INIT),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_RESERVE ("02 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("02 - insert",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("02 - init reserve loop",
+ PERF_TALER_EXCHANGEDB_NB_RESERVE_INIT),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_RESERVE ("02 - reserve"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_RESERVE ("02 - insert",
"02 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve",
"02 - init reserve loop",
"02 - reserve",
- PERF_TALER_MINTDB_NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_NB_RESERVE_SAVE),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"02 - init reserve loop"),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("02 - reserve init complete"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("02 - reserve init complete"),
// End reserve init
// Withdrawal initialization
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("03 - init withdraw loop",
- PERF_TALER_MINTDB_NB_WITHDRAW_INIT),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("03 - denomination load",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("03 - init withdraw loop",
+ PERF_TALER_EXCHANGEDB_NB_WITHDRAW_INIT),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("03 - denomination load",
"03 - init withdraw loop",
"01 - save denomination"),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("03 - reserve load",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("03 - reserve load",
"03 - init withdraw loop",
"02 - save reserve"),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_WITHDRAW ("03 - withdraw",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_WITHDRAW ("03 - withdraw",
"03 - denomination load",
"03 - reserve load"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW ("03 - insert",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_WITHDRAW ("03 - insert",
"03 - withdraw"),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("03 - save coin",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("03 - save coin",
"03 - init withdraw loop",
"03 - withdraw",
- PERF_TALER_MINTDB_NB_WITHDRAW_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
+ PERF_TALER_EXCHANGEDB_NB_WITHDRAW_SAVE),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
"03 - init withdraw loop"),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("03 - withdraw init complete"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("03 - withdraw init complete"),
//End of withdrawal initialization
//Deposit initialization
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("04 - deposit init loop",
- PERF_TALER_MINTDB_NB_DEPOSIT_INIT),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("04 - start transaction"),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("04 - denomination load",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("04 - deposit init loop",
+ PERF_TALER_EXCHANGEDB_NB_DEPOSIT_INIT),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION ("04 - start transaction"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("04 - denomination load",
"04 - deposit init loop",
"03 - save coin"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("04 - deposit",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_DEPOSIT ("04 - deposit",
"04 - denomination load"),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("04 - commit transaction"),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("04 - deposit array",
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION ("04 - commit transaction"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("04 - deposit array",
"04 - deposit init loop",
"04 - deposit",
- PERF_TALER_MINTDB_NB_DEPOSIT_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("04 - deposit init loop end",
+ PERF_TALER_EXCHANGEDB_NB_DEPOSIT_SAVE),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("04 - deposit init loop end",
"04 - deposit init loop"),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("04 - deposit init complete"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("04 - deposit init complete"),
// End of deposit initialization
- PERF_TALER_MINTDB_INIT_CMD_END ("end")
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END ("end")
};
GNUNET_log_setup (benchmark_name,
"INFO",
NULL);
config = GNUNET_CONFIGURATION_create ();
-
- ret = GNUNET_CONFIGURATION_load (config,
- configuration_file);
+ ret = GNUNET_CONFIGURATION_parse (config,
+ configuration_file);
if (GNUNET_OK != ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Error parsing configuration file\n");
return GNUNET_SYSERR;
}
- plugin = TALER_MINTDB_plugin_load (config);
+ plugin = TALER_EXCHANGEDB_plugin_load (config);
if (NULL == plugin)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -1958,7 +1957,7 @@ PERF_TALER_MINTDB_run_benchmark (const char *benchmark_name,
{
init = init_def;
}
- ret = PERF_TALER_MINTDB_interpret (plugin,
+ ret = PERF_TALER_EXCHANGEDB_interpret (plugin,
init);
if (GNUNET_OK != ret)
{
@@ -1969,7 +1968,7 @@ PERF_TALER_MINTDB_run_benchmark (const char *benchmark_name,
/*
* Running the benchmark
*/
- ret = PERF_TALER_MINTDB_interpret (plugin,
+ ret = PERF_TALER_EXCHANGEDB_interpret (plugin,
benchmark);
if (GNUNET_OK != ret)
{
@@ -1979,7 +1978,7 @@ PERF_TALER_MINTDB_run_benchmark (const char *benchmark_name,
}
/* Drop tables */
{
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
session = plugin->get_session (plugin->cls,
GNUNET_YES);
@@ -1992,7 +1991,7 @@ PERF_TALER_MINTDB_run_benchmark (const char *benchmark_name,
return ret;
}
}
- TALER_MINTDB_plugin_unload (plugin);
+ TALER_EXCHANGEDB_plugin_unload (plugin);
GNUNET_CONFIGURATION_destroy (config);
return ret;
}
diff --git a/src/mintdb/perf_taler_mintdb_interpreter.h b/src/exchangedb/perf_taler_exchangedb_interpreter.h
similarity index 56%
rename from src/mintdb/perf_taler_mintdb_interpreter.h
rename to src/exchangedb/perf_taler_exchangedb_interpreter.h
index 3510e3dd4..a83251c60 100644
--- a/src/mintdb/perf_taler_mintdb_interpreter.h
+++ b/src/exchangedb/perf_taler_exchangedb_interpreter.h
@@ -14,37 +14,37 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mintdb/perf_taler_mintdb_interpreter.h
+ * @file exchangedb/perf_taler_exchangedb_interpreter.h
* @brief Library for performance analysis of the Taler database
* @author Nicolas Fournier
*
* This library contains functions and macro alowing Taler performance analysis
* to be written with ease.
- * To do so, create a #PERF_TALER_MINTDB_Cmd array and fill it with the commands
+ * To do so, create a #PERF_TALER_EXCHANGEDB_Cmd array and fill it with the commands
* to execute in chronological order. Some command have an exposed variable wich
* can be reused in other commands.
* Macros are available to make the use much easier so feel free to use them
* to initialize your own command array.
*/
-#ifndef __PERF_TALER_MINTDB_INTERPRETER_H__
-#define __PERF_TALER_MINTDB_INTERPRETER_H__
+#ifndef __PERF_TALER_EXCHANGEDB_INTERPRETER_H__
+#define __PERF_TALER_EXCHANGEDB_INTERPRETER_H__
#include
-#include "taler_mintdb_plugin.h"
+#include "taler_exchangedb_plugin.h"
-#define PERF_TALER_MINTDB_NB_DENOMINATION_INIT 10
-#define PERF_TALER_MINTDB_NB_DENOMINATION_SAVE 10
+#define PERF_TALER_EXCHANGEDB_NB_DENOMINATION_INIT 10
+#define PERF_TALER_EXCHANGEDB_NB_DENOMINATION_SAVE 10
-#define PERF_TALER_MINTDB_NB_RESERVE_INIT 100
-#define PERF_TALER_MINTDB_NB_RESERVE_SAVE 10
+#define PERF_TALER_EXCHANGEDB_NB_RESERVE_INIT 100
+#define PERF_TALER_EXCHANGEDB_NB_RESERVE_SAVE 10
-#define PERF_TALER_MINTDB_NB_DEPOSIT_INIT 100
-#define PERF_TALER_MINTDB_NB_DEPOSIT_SAVE 10
+#define PERF_TALER_EXCHANGEDB_NB_DEPOSIT_INIT 100
+#define PERF_TALER_EXCHANGEDB_NB_DEPOSIT_SAVE 10
-#define PERF_TALER_MINTDB_NB_WITHDRAW_INIT 100
-#define PERF_TALER_MINTDB_NB_WITHDRAW_SAVE 10
+#define PERF_TALER_EXCHANGEDB_NB_WITHDRAW_INIT 100
+#define PERF_TALER_EXCHANGEDB_NB_WITHDRAW_SAVE 10
/**
@@ -52,11 +52,11 @@
*
* @param _label The label of the command
*/
-#define PERF_TALER_MINTDB_INIT_CMD_END(_label) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_END(_label) \
{ \
- .command = PERF_TALER_MINTDB_CMD_END, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_END, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE \
}
@@ -66,11 +66,11 @@
* @param _label The label of the command,
* will be logged each time the command runs
*/
-#define PERF_TALER_MINTDB_INIT_CMD_DEBUG(_label) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG(_label) \
{ \
- .command = PERF_TALER_MINTDB_CMD_DEBUG, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_DEBUG, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE \
}
/**
@@ -79,11 +79,11 @@
* @param _label the label of the loop
* @param _iter the number of iterations of the loop
*/
-#define PERF_TALER_MINTDB_INIT_CMD_LOOP(_label, _iter) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP(_label, _iter) \
{ \
- .command = PERF_TALER_MINTDB_CMD_LOOP , \
+ .command = PERF_TALER_EXCHANGEDB_CMD_LOOP , \
.label = _label , \
- .exposed.type = PERF_TALER_MINTDB_NONE , \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE , \
.details.loop = { \
.max_iterations = _iter , \
.curr_iteration = 0 } \
@@ -95,11 +95,11 @@
* @param _label the label of the command
* @param _label_loop the label of the loop closed by this command
*/
-#define PERF_TALER_MINTDB_INIT_CMD_END_LOOP(_label, _label_loop) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP(_label, _label_loop) \
{\
- .command = PERF_TALER_MINTDB_CMD_END_LOOP , \
+ .command = PERF_TALER_EXCHANGEDB_CMD_END_LOOP , \
.label = _label , \
- .exposed.type = PERF_TALER_MINTDB_NONE , \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE , \
.details.end_loop.label_loop = _label_loop \
}
@@ -108,11 +108,11 @@
*
* @param _label the label of the command
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_TIME(_label) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME(_label) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_TIME, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_GET_TIME, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_TIME \
+ .exposed.type = PERF_TALER_EXCHANGEDB_TIME \
}
/**
@@ -126,11 +126,11 @@
* @param _unit the unit of the data measured, typicly something/sec
* @param _divide number of measurments in the interval
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GAUGER(_label, _label_start, _label_stop, _category, _description, _unit, _divide) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER(_label, _label_start, _label_stop, _category, _description, _unit, _divide) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GAUGER, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_GAUGER, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.gauger = { \
.label_start = _label_start, \
.label_stop = _label_stop, \
@@ -146,11 +146,11 @@
*
* @param _label the label of the command
*/
-#define PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION(_label) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION(_label) \
{ \
- .command = PERF_TALER_MINTDB_CMD_START_TRANSACTION, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_START_TRANSACTION, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
}
/**
@@ -158,11 +158,11 @@
*
* @param _label the label of the command
*/
-#define PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION(_label) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION(_label) \
{ \
- .command = PERF_TALER_MINTDB_CMD_COMMIT_TRANSACTION, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_COMMIT_TRANSACTION, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
}
/**
@@ -170,25 +170,25 @@
*
* @param _label the label of the command
*/
-#define PERF_TALER_MINTDB_INIT_CMD_ABORT_TRANSACTION(_label) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_ABORT_TRANSACTION(_label) \
{ \
- .command = PERF_TALER_MINTDB_CMD_ABORT_TRANSACTION, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_ABORT_TRANSACTION, \
.label = _label,
/**
* Saves randomly selected items from @a _label_save
- * Saved items can latter be access using #PERF_TALER_MINTDB_CMD_LOAD_ARRAY
+ * Saved items can latter be access using #PERF_TALER_EXCHANGEDB_CMD_LOAD_ARRAY
*
* @param _label the label of the command, used by other commands to reference it
* @param _label_loop the label of the loop the array iterates over
* @param _label_save the label of the command which outout is saved by this command
* @param _nb_saved the total number of items to be saved
*/
-#define PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY(_label, _label_loop, _label_save, _nb_saved) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY(_label, _label_loop, _label_save, _nb_saved) \
{ \
- .command = PERF_TALER_MINTDB_CMD_SAVE_ARRAY, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.save_array = { \
.label_loop = _label_loop, \
.label_save = _label_save, \
@@ -197,18 +197,18 @@
}
/**
- * Loads data from a #PERF_TALER_MINTDB_CMD_SAVE_ARRAY to allow other
+ * Loads data from a #PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY to allow other
* commands to access it
*
* @param _label the label of this command, referenced by commands to access it's outpout
* @param _label_loop the label of the loop to iterate over
- * @param _label_save the label of the #PERF_TALER_MINTDB_CMD_SAVE_ARRAY providing data
+ * @param _label_save the label of the #PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY providing data
*/
-#define PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY(_label, _label_loop, _label_save) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY(_label, _label_loop, _label_save) \
{ \
- .command = PERF_TALER_MINTDB_CMD_LOAD_ARRAY, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_LOAD_ARRAY, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.load_array = { \
.label_loop = _label_loop, \
.label_save = _label_save \
@@ -217,16 +217,16 @@
/**
* Create a denomination key to use
- * Exposes a #PERF_TALER_MINTDB_DENOMINATION_INFO to be used by other commands
- * @exposed #PERF_TALER_MINTDB_DENOMINATION_INFO
+ * Exposes a #PERF_TALER_EXCHANGEDB_DENOMINATION_INFO to be used by other commands
+ * @exposed #PERF_TALER_EXCHANGEDB_DENOMINATION_INFO
*
* @param _label the label of this command
*/
-#define PERF_TALER_MINTDB_INIT_CMD_CREATE_DENOMINATION(_label) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_DENOMINATION(_label) \
{ \
- .command = PERF_TALER_MINTDB_CMD_CREATE_DENOMINATION, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_CREATE_DENOMINATION, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_DENOMINATION_INFO, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_DENOMINATION_INFO, \
}
/**
@@ -235,11 +235,11 @@
* @param _label the label of this command
* @param _label_denom the label of the denomination to insert
*/
-#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION(_label, _label_denom) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_DENOMINATION(_label, _label_denom) \
{ \
- .command = PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_INSERT_DENOMINATION, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.insert_denomination.label_denom = _label_denom, \
}
@@ -249,25 +249,25 @@
* @param _label the label of this command
* @param _label_denom the label of the command providing information about the denomination key
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_DENOMINATION(_label, _label_denom) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_GET_DENOMINATION(_label, _label_denom) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_DENOMINATION, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_GET_DENOMINATION, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.get_denomination.label_denom = _label_denom \
}
/**
* Create a reserve to be used later
- * Exposes a #PERF_TALER_MINTDB_RESERVE
+ * Exposes a #PERF_TALER_EXCHANGEDB_RESERVE
*
* @param _label the label of the command
*/
-#define PERF_TALER_MINTDB_INIT_CMD_CREATE_RESERVE(_label) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_RESERVE(_label) \
{ \
- .command = PERF_TALER_MINTDB_CMD_CREATE_RESERVE, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_CREATE_RESERVE, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_RESERVE \
+ .exposed.type = PERF_TALER_EXCHANGEDB_RESERVE \
}
/**
@@ -276,11 +276,11 @@
* @param _label the name of this command
* @param _label_reserve the label of the reserve to insert
*/
-#define PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE(_label, _label_reserve) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_RESERVE(_label, _label_reserve) \
{ \
- .command = PERF_TALER_MINTDB_CMD_INSERT_RESERVE, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_INSERT_RESERVE, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.insert_reserve.label_reserve = _label_reserve \
}
@@ -290,11 +290,11 @@
* @param _label the label of this command
* @param _label_reserve the reserve to poll
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_RESERVE(_label, _label_reserve) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_GET_RESERVE(_label, _label_reserve) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_RESERVE, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_GET_RESERVE, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.get_reserve.label_reserve = _label_reserve \
}
@@ -304,11 +304,11 @@
* @param _label the label of the command
* @param _label_reserve the reserve to examine
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_RESERVE_HISTORY(_label, _label_reserve) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_GET_RESERVE_HISTORY(_label, _label_reserve) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_RESERVE_HISTORY, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_GET_RESERVE_HISTORY, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.get_reserve_history.label_reserve = _label_reserve \
}
@@ -319,11 +319,11 @@
* @param _label_dki denomination key used to sign the coin
* @param _label_reserve reserve used to emmit the coin
*/
-#define PERF_TALER_MINTDB_INIT_CMD_CREATE_WITHDRAW(_label, _label_dki, _label_reserve) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_WITHDRAW(_label, _label_dki, _label_reserve) \
{ \
- .command = PERF_TALER_MINTDB_CMD_CREATE_WITHDRAW, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_CREATE_WITHDRAW, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_COIN, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_COIN, \
.details.create_withdraw = {\
.label_dki = _label_dki, \
.label_reserve = _label_reserve, \
@@ -333,16 +333,16 @@
/**
* Inserts informations about a withdrawal in the database
*
- * @exposes #PERF_TALER_MINTDB_COIN
+ * @exposes #PERF_TALER_EXCHANGEDB_COIN
*
* @param _label the label of this command
* @param _label_coin the coin to insert
*/
-#define PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW(_label, _label_coin) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_WITHDRAW(_label, _label_coin) \
{ \
- .command = PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_INSERT_WITHDRAW, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.insert_withdraw.label_coin = _label_coin\
}
@@ -353,11 +353,11 @@
* @param _label the label of this command
* @param _label_coin the coin to check
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_WITHDRAW(_label, _label_coin) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_GET_WITHDRAW(_label, _label_coin) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_WITHDRAW, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_GET_WITHDRAW, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.get_withdraw.label_coin = _label_coin, \
}
@@ -365,35 +365,35 @@
/**
* The /reserve/withdraw api call
*
- * Exposes #PERF_TALER_MINTDB_COIN
+ * Exposes #PERF_TALER_EXCHANGEDB_COIN
*
* @param _label the label of this command
* @param _label_dki the denomination of the created coin
* @param _label_reserve the reserve used to provide currency
*/
-#define PERF_TALER_MINTDB_INIT_CMD_WITHDRAW_SIGN(_label, _label_dki, _label_reserve) \
- PERF_TALER_MINTDB_INIT_CMD_CREATE_WITHDRAW (_label "withdraw", \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_WITHDRAW_SIGN(_label, _label_dki, _label_reserve) \
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_WITHDRAW (_label "withdraw", \
_label_dki, \
_label_reserve), \
- PERF_TALER_MINTDB_INIT_CMD_GET_DENOMINATION(_label "withdraw info", \
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_DENOMINATION(_label "withdraw info", \
_label_dki), \
- PERF_TALER_MINTDB_INIT_CMD_GET_RESERVE_HISTORY(_label "reserve_history", \
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_RESERVE_HISTORY(_label "reserve_history", \
_label_reserve), \
- PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW(_label "insert withdraw", \
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_WITHDRAW(_label "insert withdraw", \
_label "withdraw")
/**
* Create a deposit for use later
- * @exposes #PERF_TALER_MINTDB_DEPOSIT
+ * @exposes #PERF_TALER_EXCHANGEDB_DEPOSIT
*
* @param _label the label of this command
* @param _label_coin the coin used to pay
*/
-#define PERF_TALER_MINTDB_INIT_CMD_CREATE_DEPOSIT(_label, _label_coin) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_DEPOSIT(_label, _label_coin) \
{ \
- .command = PERF_TALER_MINTDB_CMD_CREATE_DEPOSIT, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_CREATE_DEPOSIT, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_DEPOSIT, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_DEPOSIT, \
.details.create_deposit.label_coin = _label_coin, \
}
@@ -403,11 +403,11 @@
* @param _label the label of this command
* @param _label_deposit the deposit inseerted
*/
-#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT(_label, _label_deposit) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_DEPOSIT(_label, _label_deposit) \
{ \
- .command = PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT,\
+ .command = PERF_TALER_EXCHANGEDB_CMD_INSERT_DEPOSIT,\
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.insert_deposit.label_deposit = _label_deposit, \
}
@@ -417,11 +417,11 @@
* @param _label the label of this command
* @param _label_deposit the deposit to use
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT(_label, _label_deposit) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_GET_DEPOSIT(_label, _label_deposit) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_DEPOSIT, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_GET_DEPOSIT, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.get_deposit.label_deposit = _label_deposit \
}
@@ -431,11 +431,11 @@
* @param _label the label of the command
* @param _label_coin the coin which history is checked
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_COIN_TRANSACTION(_label, _label_coin) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_GET_COIN_TRANSACTION(_label, _label_coin) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_COIN_TRANSACTION, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_GET_COIN_TRANSACTION, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE, \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE, \
.details.get_coin_transaction.label_coin = _label_coin \
}
@@ -445,12 +445,12 @@
* @param _label the label of the command
* @param _label_coin the coin used for the deposit
*/
-#define PERF_TALER_MINTDB_INIT_CMD_DEPOSIT(_label, _label_coin) \
- PERF_TALER_MINTDB_INIT_CMD_GET_COIN_TRANSACTION (_label "coin history", \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_DEPOSIT(_label, _label_coin) \
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_COIN_TRANSACTION (_label "coin history", \
_label_coin), \
- PERF_TALER_MINTDB_INIT_CMD_CREATE_DEPOSIT (_label "deposit", \
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_DEPOSIT (_label "deposit", \
_label_coin), \
- PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT (_label "insert", \
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_DEPOSIT (_label "insert", \
_label "deposit")
/**
* Insert informations about a refresh session
@@ -458,11 +458,11 @@
*
* @param _label the label of the command
*/
-#define PERF_TALER_MINTDB_INIT_CMD_CREATE_REFRESH_SESSION(_label) \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_REFRESH_SESSION(_label) \
{ \
- .command = PERF_TALER_MINTDB_CMD_CREATE_REFRESH_SESSION, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_CREATE_REFRESH_SESSION, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_REFRESH_HASH \
+ .exposed.type = PERF_TALER_EXCHANGEDB_REFRESH_HASH \
}
/**
@@ -471,12 +471,12 @@
* @param _label the label of the command
* @param _label_hash the label of the hash to search
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_REFRESH_SESSION(_label, \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_GET_REFRESH_SESSION(_label, \
_label_hash) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_REFRESH_SESSION, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_SESSION, \
.label = _label, \
- .exposed.type = PERF_TALER_MINTDB_NONE \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE \
}
/**
@@ -486,15 +486,15 @@
* @param _label_hash the label of the hash of the session
* @param _label_coin the label of the coin to melt
*/
-#define PERF_TALER_MINTDB_INIT_CMD_INSERT_REFRESH_MELT(_label, \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_REFRESH_MELT(_label, \
_label_hash, \
_label_coin) \
{ \
- .command = PERF_TALER_MINTDB_CMD_INSERT_REFRESH_MELT, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_MELT, \
.label = _label, \
.details.insert_refresh_melt.label_hash = _label_hash, \
.details.insert_refresh_melt.label_coin = _label_coin, \
- .exposed.type = PERF_TALER_MINTDB_NONE \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE \
}
/**
@@ -503,58 +503,58 @@
* @param _label the label of the command
* @param _label_hash the label of the hash of the refresh session
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_REFRESH_MELT(_label, \
+#define PERF_TALER_EXCHANGEDB_INIT_CMD_GET_REFRESH_MELT(_label, \
_label_hash) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_REFRESH_MELT, \
+ .command = PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_MELT, \
.label = _label, \
.detail.get_refresh_melt.label_hash = _label_hash, \
- .exposed.type = PERF_TALER_MINTDB_NONE \
+ .exposed.type = PERF_TALER_EXCHANGEDB_NONE \
}
/**
- * The type of data stored in #PERF_TALER_MINTDB_Memory
+ * The type of data stored in #PERF_TALER_EXCHANGEDB_Memory
*/
-enum PERF_TALER_MINTDB_Type
+enum PERF_TALER_EXCHANGEDB_Type
{
- PERF_TALER_MINTDB_NONE,
- PERF_TALER_MINTDB_TIME,
- PERF_TALER_MINTDB_DENOMINATION_INFO,
- PERF_TALER_MINTDB_RESERVE,
- PERF_TALER_MINTDB_COIN,
- PERF_TALER_MINTDB_DEPOSIT,
- PERF_TALER_MINTDB_REFRESH_HASH,
- PERF_TALER_MINTDB_REFRESH_MELT
+ PERF_TALER_EXCHANGEDB_NONE,
+ PERF_TALER_EXCHANGEDB_TIME,
+ PERF_TALER_EXCHANGEDB_DENOMINATION_INFO,
+ PERF_TALER_EXCHANGEDB_RESERVE,
+ PERF_TALER_EXCHANGEDB_COIN,
+ PERF_TALER_EXCHANGEDB_DEPOSIT,
+ PERF_TALER_EXCHANGEDB_REFRESH_HASH,
+ PERF_TALER_EXCHANGEDB_REFRESH_MELT
};
/**
* Structure used to handle several data type
*/
-struct PERF_TALER_MINTDB_Data
+struct PERF_TALER_EXCHANGEDB_Data
{
- enum PERF_TALER_MINTDB_Type type;
+ enum PERF_TALER_EXCHANGEDB_Type type;
/**
* Storage for a variety of data type
* The data saved should match #type
*/
- union PERF_TALER_MINTDB_Memory
+ union PERF_TALER_EXCHANGEDB_Memory
{
- /** #PERF_TALER_MINTDB_TIME */
+ /** #PERF_TALER_EXCHANGEDB_TIME */
struct GNUNET_TIME_Absolute *time;
- /** #PERF_TALER_MINTDB_DEPOSIT */
- struct TALER_MINTDB_Deposit *deposit;
- /** #PERF_TALER_MINTDB_COIN */
- struct PERF_TALER_MINTDB_Coin *coin;
- /** #PERF_TALER_MINTDB_RESERVE */
- struct PERF_TALER_MINTDB_Reserve *reserve;
- /** #PERF_TALER_MINTDB_DENOMINATION_INFO */
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki;
- /** #PERF_TALER_MINTDB_REFRESH_HASH */
+ /** #PERF_TALER_EXCHANGEDB_DEPOSIT */
+ struct TALER_EXCHANGEDB_Deposit *deposit;
+ /** #PERF_TALER_EXCHANGEDB_COIN */
+ struct PERF_TALER_EXCHANGEDB_Coin *coin;
+ /** #PERF_TALER_EXCHANGEDB_RESERVE */
+ struct PERF_TALER_EXCHANGEDB_Reserve *reserve;
+ /** #PERF_TALER_EXCHANGEDB_DENOMINATION_INFO */
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
+ /** #PERF_TALER_EXCHANGEDB_REFRESH_HASH */
struct GNUNET_HashCode *session_hash;
- /** #PERF_TALER_MINTDB_REFRESH_MELT */
- struct TALER_MINTDB_RefreshMelt *refresh_melt;
+ /** #PERF_TALER_EXCHANGEDB_REFRESH_MELT */
+ struct TALER_EXCHANGEDB_RefreshMelt *refresh_melt;
} data;
};
@@ -562,216 +562,216 @@ struct PERF_TALER_MINTDB_Data
/**
* Name of the command
*/
-enum PERF_TALER_MINTDB_CMD_Name
+enum PERF_TALER_EXCHANGEDB_CMD_Name
{
/**
* All comand chain must hace this as their last command
*/
- PERF_TALER_MINTDB_CMD_END,
+ PERF_TALER_EXCHANGEDB_CMD_END,
/**
* Prints it's label
*/
- PERF_TALER_MINTDB_CMD_DEBUG,
+ PERF_TALER_EXCHANGEDB_CMD_DEBUG,
/**
* Define the start of al command chain loop
*/
- PERF_TALER_MINTDB_CMD_LOOP,
+ PERF_TALER_EXCHANGEDB_CMD_LOOP,
/**
* Define the end of a command chain loop
*/
- PERF_TALER_MINTDB_CMD_END_LOOP,
+ PERF_TALER_EXCHANGEDB_CMD_END_LOOP,
/**
* Save the time at which the command was executed
*/
- PERF_TALER_MINTDB_CMD_GET_TIME,
+ PERF_TALER_EXCHANGEDB_CMD_GET_TIME,
/**
* Upload performance to Gauger
*/
- PERF_TALER_MINTDB_CMD_GAUGER,
+ PERF_TALER_EXCHANGEDB_CMD_GAUGER,
/**
* Start a new session
*/
- PERF_TALER_MINTDB_CMD_NEW_SESSION,
+ PERF_TALER_EXCHANGEDB_CMD_NEW_SESSION,
/**
* Start a database transaction
*/
- PERF_TALER_MINTDB_CMD_START_TRANSACTION,
+ PERF_TALER_EXCHANGEDB_CMD_START_TRANSACTION,
/**
* End a database transaction
*/
- PERF_TALER_MINTDB_CMD_COMMIT_TRANSACTION,
+ PERF_TALER_EXCHANGEDB_CMD_COMMIT_TRANSACTION,
/**
- * Abort a transaction started with #PERF_TALER_MINTDB_CMD_START_TRANSACTION
+ * Abort a transaction started with #PERF_TALER_EXCHANGEDB_CMD_START_TRANSACTION
*/
- PERF_TALER_MINTDB_CMD_ABORT_TRANSACTION,
+ PERF_TALER_EXCHANGEDB_CMD_ABORT_TRANSACTION,
/**
* Saves random deposits from a loop
*/
- PERF_TALER_MINTDB_CMD_SAVE_ARRAY,
+ PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY,
/**
- * Load items saved earlier in a #PERF_TALER_MINTDB_CMD_SAVE_ARRAY
+ * Load items saved earlier in a #PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY
* The items are loaded in a random order, but all of them will be loaded
*/
- PERF_TALER_MINTDB_CMD_LOAD_ARRAY,
+ PERF_TALER_EXCHANGEDB_CMD_LOAD_ARRAY,
/**
- * Loads a random item from a #PERF_TALER_MINTDB_CMD_SAVE_ARRAY
+ * Loads a random item from a #PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY
* A random item is loaded each time the command is run
*/
- PERF_TALER_MINTDB_CMD_LOAD_RANDOM,
+ PERF_TALER_EXCHANGEDB_CMD_LOAD_RANDOM,
/**
* Create a denomination to be used later
*/
- PERF_TALER_MINTDB_CMD_CREATE_DENOMINATION,
+ PERF_TALER_EXCHANGEDB_CMD_CREATE_DENOMINATION,
/**
* Insert informations about a denomination key in the database
*/
- PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION,
+ PERF_TALER_EXCHANGEDB_CMD_INSERT_DENOMINATION,
/**
* Polls the database for informations about a specific denomination key
*/
- PERF_TALER_MINTDB_CMD_GET_DENOMINATION,
+ PERF_TALER_EXCHANGEDB_CMD_GET_DENOMINATION,
/**
* Create a reserve to be used later
*/
- PERF_TALER_MINTDB_CMD_CREATE_RESERVE,
+ PERF_TALER_EXCHANGEDB_CMD_CREATE_RESERVE,
/**
* Insert currency in a reserve / Create a reserve
*/
- PERF_TALER_MINTDB_CMD_INSERT_RESERVE,
+ PERF_TALER_EXCHANGEDB_CMD_INSERT_RESERVE,
/**
* Get Informations about a reserve
*/
- PERF_TALER_MINTDB_CMD_GET_RESERVE,
+ PERF_TALER_EXCHANGEDB_CMD_GET_RESERVE,
/**
* Get the history of a reserve
*/
- PERF_TALER_MINTDB_CMD_GET_RESERVE_HISTORY,
+ PERF_TALER_EXCHANGEDB_CMD_GET_RESERVE_HISTORY,
/**
* Create a withdrawal to be used later
*/
- PERF_TALER_MINTDB_CMD_CREATE_WITHDRAW,
+ PERF_TALER_EXCHANGEDB_CMD_CREATE_WITHDRAW,
/**
* Insert informations about a withdrawal in the database
*/
- PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW,
+ PERF_TALER_EXCHANGEDB_CMD_INSERT_WITHDRAW,
/**
* Pulls informations about a withdrawal from the database
*/
- PERF_TALER_MINTDB_CMD_GET_WITHDRAW,
+ PERF_TALER_EXCHANGEDB_CMD_GET_WITHDRAW,
/**
* Get the list of all transactions the coin has been in
*/
- PERF_TALER_MINTDB_CMD_GET_COIN_TRANSACTION,
+ PERF_TALER_EXCHANGEDB_CMD_GET_COIN_TRANSACTION,
/**
* Create a deposit to be used later
*/
- PERF_TALER_MINTDB_CMD_CREATE_DEPOSIT,
+ PERF_TALER_EXCHANGEDB_CMD_CREATE_DEPOSIT,
/**
* Insert a deposit into the database
*/
- PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT,
+ PERF_TALER_EXCHANGEDB_CMD_INSERT_DEPOSIT,
/**
* Check if a deposit is in the database
*/
- PERF_TALER_MINTDB_CMD_GET_DEPOSIT,
+ PERF_TALER_EXCHANGEDB_CMD_GET_DEPOSIT,
/**
* Create a refresh session
* The number of melted coins is 1,
- * The number of minted coins is 1
+ * The number of exchangeed coins is 1
*/
- PERF_TALER_MINTDB_CMD_CREATE_REFRESH_SESSION,
+ PERF_TALER_EXCHANGEDB_CMD_CREATE_REFRESH_SESSION,
/**
* Get a refresh session informations
*/
- PERF_TALER_MINTDB_CMD_GET_REFRESH_SESSION,
+ PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_SESSION,
/**
* Insert a refresh melt
*/
- PERF_TALER_MINTDB_CMD_INSERT_REFRESH_MELT,
+ PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_MELT,
/**
* Get informations about a refresh melt operation
*/
- PERF_TALER_MINTDB_CMD_GET_REFRESH_MELT,
+ PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_MELT,
/**
* Insert a melt refresh order
*/
- PERF_TALER_MINTDB_CMD_INSERT_REFRESH_ORDER,
+ PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_ORDER,
/**
* Get informations about a refresh order
*/
- PERF_TALER_MINTDB_CMD_GET_REFRESH_ORDER,
+ PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_ORDER,
/**
* Insert refresh commit coin
*/
- PERF_TALER_MINTDB_CMD_INSERT_REFRESH_COMMIT_COIN,
+ PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_COMMIT_COIN,
/**
* Get refresh commit coin
*/
- PERF_TALER_MINTDB_CMD_GET_REFRESH_COMMIT_COIN,
+ PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_COMMIT_COIN,
/**
* Insert refresh commit link
*/
- PERF_TALER_MINTDB_CMD_INSERT_REFRESH_COMMIT_LINK,
+ PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_COMMIT_LINK,
/**
* Get refresh commit link
*/
- PERF_TALER_MINTDB_CMD_GET_REFRESH_COMMIT_LINK,
+ PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_COMMIT_LINK,
/**
* Get information avout the melt commit
*/
- PERF_TALER_MINTDB_CMD_GET_MELT_COMMITMENT,
+ PERF_TALER_EXCHANGEDB_CMD_GET_MELT_COMMITMENT,
/**
* Insert a new coin into the database after a melt operation
*/
- PERF_TALER_MINTDB_CMD_INSERT_REFRESH_OUT,
+ PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_OUT,
/**
* Get the link data list of a coin
*/
- PERF_TALER_MINTDB_CMD_GET_LINK_DATA_LIST,
+ PERF_TALER_EXCHANGEDB_CMD_GET_LINK_DATA_LIST,
/**
* Get the shared secret and the transfere public key
*/
- PERF_TALER_MINTDB_CMD_GET_TRANSFER
+ PERF_TALER_EXCHANGEDB_CMD_GET_TRANSFER
};
@@ -779,12 +779,12 @@ enum PERF_TALER_MINTDB_CMD_Name
/**
* Contains extra data required for any command
*/
-union PERF_TALER_MINTDB_CMD_Details
+union PERF_TALER_EXCHANGEDB_CMD_Details
{
/**
- * Extra data requiered for the #PERF_TALER_MINTDB_CMD_LOOP command
+ * Extra data requiered for the #PERF_TALER_EXCHANGEDB_CMD_LOOP command
*/
- struct PERF_TALER_MINTDB_CMD_loopDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_loopDetails
{
/**
* Maximum number of iteration in the loop
@@ -798,9 +798,9 @@ union PERF_TALER_MINTDB_CMD_Details
} loop;
/**
- * Extra data requiered by the #PERF_TALER_MINTDB_CMD_END_LOOP command
+ * Extra data requiered by the #PERF_TALER_EXCHANGEDB_CMD_END_LOOP command
*/
- struct PERF_TALER_MINTDB_CMD_endLoopDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_endLoopDetails
{
/**
* Label of the loop closed by the command
@@ -810,9 +810,9 @@ union PERF_TALER_MINTDB_CMD_Details
} end_loop;
/**
- * Details about the #PERF_TALER_MINTDB_CMD_GAUGER command
+ * Details about the #PERF_TALER_EXCHANGEDB_CMD_GAUGER command
*/
- struct PERF_TALER_MINTDB_CMD_gaugerDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_gaugerDetails
{
/**
* Label of the starting timestamp
@@ -849,9 +849,9 @@ union PERF_TALER_MINTDB_CMD_Details
} gauger;
/**
- * Contains extra data requiered by the #PERF_TALER_MINTDB_CMD_SAVE_ARRAY command
+ * Contains extra data requiered by the #PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY command
*/
- struct PERF_TALER_MINTDB_CMD_saveArrayDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_saveArrayDetails
{
/**
* Number of items to save
@@ -878,20 +878,20 @@ union PERF_TALER_MINTDB_CMD_Details
/**
* Array of data saved
*/
- struct PERF_TALER_MINTDB_Data *data_saved;
+ struct PERF_TALER_EXCHANGEDB_Data *data_saved;
/**
* Type of the data that will be stored in @a data_saved, for
* 'static' type checking.
*/
- enum PERF_TALER_MINTDB_Type type_saved;
+ enum PERF_TALER_EXCHANGEDB_Type type_saved;
} save_array;
/**
- * Extra data required for the #PERF_TALER_MINTDB_CMD_LOAD_ARRAY command
+ * Extra data required for the #PERF_TALER_EXCHANGEDB_CMD_LOAD_ARRAY command
*/
- struct PERF_TALER_MINTDB_CMD_loadArrayDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_loadArrayDetails
{
/**
* The loop in which the command is located
@@ -912,21 +912,21 @@ union PERF_TALER_MINTDB_CMD_Details
} load_array;
/**
- * Contains data for the #PERF_TALER_MINTDB_CMD_LOAD_RANDOM command
+ * Contains data for the #PERF_TALER_EXCHANGEDB_CMD_LOAD_RANDOM command
*/
- struct PERF_TALER_MINTDB_CMD_loadRandomDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_loadRandomDetails
{
/**
- * The label of the #PERF_TALER_MINTDB_CMD_SAVE_ARRAY the items will be extracted from
+ * The label of the #PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY the items will be extracted from
*/
const char *label_save;
unsigned int index_save;
} load_random;
/**
- * Extra data requiered by the #PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION command
+ * Extra data requiered by the #PERF_TALER_EXCHANGEDB_CMD_INSERT_DENOMINATION command
*/
- struct PERF_TALER_MINTDB_CMD_insertDenominationDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_insertDenominationDetails
{
/**
* The label of the source of the denomination to insert
@@ -936,9 +936,9 @@ union PERF_TALER_MINTDB_CMD_Details
} insert_denomination;
/**
- * Extra data requiered by the #PERF_TALER_MINTDB_CMD_GET_DENOMINATION command
+ * Extra data requiered by the #PERF_TALER_EXCHANGEDB_CMD_GET_DENOMINATION command
*/
- struct PERF_TALER_MINTDB_CMD_getDenominationDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getDenominationDetails
{
/**
* The label of the source of the denomination to check
@@ -948,9 +948,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_denomination;
/**
- * Extra data requiered for the #PERF_TALER_MINTDB_CMD_INSERT_RESERVE command
+ * Extra data requiered for the #PERF_TALER_EXCHANGEDB_CMD_INSERT_RESERVE command
*/
- struct PERF_TALER_MINTDB_CMD_insertReserveDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_insertReserveDetails
{
/**
* The label of the source of the reserve to insert
@@ -960,9 +960,9 @@ union PERF_TALER_MINTDB_CMD_Details
} insert_reserve;
/**
- * Extra data requiered for the #PERF_TALER_MINTDB_CMD_GET_RESERVE command
+ * Extra data requiered for the #PERF_TALER_EXCHANGEDB_CMD_GET_RESERVE command
*/
- struct PERF_TALER_MINTDB_CMD_getReserveDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getReserveDetails
{
/**
* The label of the source of the reserve to check
@@ -972,9 +972,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_reserve;
/**
- * Extra data requiered for the #PERF_TALER_MINTDB_CMD_GET_RESERVE_HISTORY command
+ * Extra data requiered for the #PERF_TALER_EXCHANGEDB_CMD_GET_RESERVE_HISTORY command
*/
- struct PERF_TALER_MINTDB_CMD_getReserveHistoryDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getReserveHistoryDetails
{
/**
* The label of the source of the reserve to check
@@ -984,9 +984,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_reserve_history;
/**
- * Extra data related to the #PERF_TALER_MINTDB_CMD_CREATE_WITHDRAW command
+ * Extra data related to the #PERF_TALER_EXCHANGEDB_CMD_CREATE_WITHDRAW command
*/
- struct PERF_TALER_MINTDB_CMD_createWithdrawDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_createWithdrawDetails
{
/**
* label of the denomination key used to sign the coin
@@ -995,16 +995,16 @@ union PERF_TALER_MINTDB_CMD_Details
unsigned int index_dki;
/**
- * label of the reserve the money to mint the coin comes from
+ * label of the reserve the money to exchange the coin comes from
*/
const char *label_reserve;
unsigned int index_reserve;
} create_withdraw;
/**
- * data requiered for the #PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW
+ * data requiered for the #PERF_TALER_EXCHANGEDB_CMD_INSERT_WITHDRAW
*/
- struct PERF_TALER_MINTDB_CMD_insertWithdrawDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_insertWithdrawDetails
{
/**
* label of the source for the coin information
@@ -1014,9 +1014,9 @@ union PERF_TALER_MINTDB_CMD_Details
} insert_withdraw;
/**
- * data requiered for the #PERF_TALER_MINTDB_CMD_GET_WITHDRAW
+ * data requiered for the #PERF_TALER_EXCHANGEDB_CMD_GET_WITHDRAW
*/
- struct PERF_TALER_MINTDB_CMD_getWithdraw
+ struct PERF_TALER_EXCHANGEDB_CMD_getWithdraw
{
/**
* label of the source for the coin information
@@ -1026,9 +1026,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_withdraw;
/**
- * Data requiered for the #PERF_TALER_MINTDB_CMD_GET_COIN_TRANSACTION command
+ * Data requiered for the #PERF_TALER_EXCHANGEDB_CMD_GET_COIN_TRANSACTION command
*/
- struct PERF_TALER_MINTDB_CMD_getCoinTransactionDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getCoinTransactionDetails
{
/**
* The coin which history is checked
@@ -1038,9 +1038,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_coin_transaction;
/**
- * Data used by the #PERF_TALER_MINTDB_CMD_CREATE_DEPOSIT command
+ * Data used by the #PERF_TALER_EXCHANGEDB_CMD_CREATE_DEPOSIT command
*/
- struct PERF_TALER_MINTDB_CMD_createDepositDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_createDepositDetails
{
/**
* Label of the source where the reserve used to create the coin is
@@ -1050,9 +1050,9 @@ union PERF_TALER_MINTDB_CMD_Details
} create_deposit;
/**
- * Extra data requiered for the #PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT command
+ * Extra data requiered for the #PERF_TALER_EXCHANGEDB_CMD_INSERT_DEPOSIT command
*/
- struct PERF_TALER_MINTDB_CMD_insertDepositDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_insertDepositDetails
{
/**
* The label of the source of the deposit to check
@@ -1062,9 +1062,9 @@ union PERF_TALER_MINTDB_CMD_Details
} insert_deposit;
/**
- * Extra data requiered for the #PERF_TALER_MINTDB_CMD_GET_DEPOSIT command
+ * Extra data requiered for the #PERF_TALER_EXCHANGEDB_CMD_GET_DEPOSIT command
*/
- struct PERF_TALER_MINTDB_CMD_getDepositDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getDepositDetails
{
/**
* The label of the source of the deposit to check
@@ -1074,9 +1074,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_deposit;
/**
- * Data requiered for the #PERF_TALER_MINTDB_CMD_GET_REFRESH_SESSION command
+ * Data requiered for the #PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_SESSION command
*/
- struct PERF_TALER_MINTDB_CMD_getRefreshSessionDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getRefreshSessionDetails
{
/**
* label of the source of the hash of the session
@@ -1086,9 +1086,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_refresh_session;
/**
- * Data requiered for the #PERF_TALER_MINTDB_CMD_INSERT_REFRESH_MELT command
+ * Data requiered for the #PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_MELT command
*/
- struct PERF_TALER_MINTDB_CMD_insertRefreshMeltDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_insertRefreshMeltDetails
{
/**
* The label of the hash of the refresh session
@@ -1104,9 +1104,9 @@ union PERF_TALER_MINTDB_CMD_Details
} insert_refresh_melt;
/**
- * Data requiered for the #PERF_TALER_MINTDB_CMD_GET_REFRESH_MELT command
+ * Data requiered for the #PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_MELT command
*/
- struct PERF_TALER_MINTDB_CMD_getRefreshMeltDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getRefreshMeltDetails
{
/**
* The label of the hash of the session
@@ -1116,9 +1116,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_refresh_melt;
/**
- * Data requiered for the #PERF_TALER_MINTDB_CMD_INSERT_REFRESH_ORDER command
+ * Data requiered for the #PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_ORDER command
*/
- struct PERF_TALER_MINTDB_CMD_insertRefreshOrderDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_insertRefreshOrderDetails
{
/**
* The refresh session hash
@@ -1134,9 +1134,9 @@ union PERF_TALER_MINTDB_CMD_Details
} insert_refresh_order;
/**
- * Data requiered for the #PERF_TALER_MINTDB_CMD_GET_REFRESH_ORDER command
+ * Data requiered for the #PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_ORDER command
*/
- struct PERF_TALER_MINTDB_CMD_getRefreshOrderDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getRefreshOrderDetails
{
/**
* The session hash
@@ -1147,9 +1147,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_refresh_order;
/**
- * Data requiered for the #PERF_TALER_MINTDB_CMD_INSERT_REFRESH_COMMIT_COIN command
+ * Data requiered for the #PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_COMMIT_COIN command
*/
- struct PERF_TALER_MINTDB_CMD_insertRefreshCommitCoinDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_insertRefreshCommitCoinDetails
{
/**
* The refresh session hash
@@ -1160,9 +1160,9 @@ union PERF_TALER_MINTDB_CMD_Details
} insert_refresh_commit_coin;
/**
- * Data requiered for the #PERF_TALER_MINTDB_CMD_GET_REFRESH_COMMIT_COIN command
+ * Data requiered for the #PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_COMMIT_COIN command
*/
- struct PERF_TALER_MINTDB_CMD_getRefreshCommitCoinDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getRefreshCommitCoinDetails
{
/**
* The refresh session hash
@@ -1173,9 +1173,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_refresh_commit_coin;
/**
- * Data requiered for the #PERF_TALER_MINTDB_CMD_INSERT_REFRESH_COMMIT_LINK command
+ * Data requiered for the #PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_COMMIT_LINK command
*/
- struct PERF_TALER_MINTDB_CMD_insertRefreshCommitLinkDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_insertRefreshCommitLinkDetails
{
/**
* The refresh session hash
@@ -1186,9 +1186,9 @@ union PERF_TALER_MINTDB_CMD_Details
} insert_refresh_commit_link;
/**
- * Data requiered by the #PERF_TALER_MINTDB_CMD_GET_REFRESH_COMMIT_LINK command
+ * Data requiered by the #PERF_TALER_EXCHANGEDB_CMD_GET_REFRESH_COMMIT_LINK command
*/
- struct PERF_TALER_MINTDB_CMD_getRefreshCommitLinkDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getRefreshCommitLinkDetails
{
/**
* The refresh session hash
@@ -1198,9 +1198,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_refresh_commit_link;
/**
- * Data requiered for the #PERF_TALER_MINTDB_CMD_GET_MELT_COMMITMENT command
+ * Data requiered for the #PERF_TALER_EXCHANGEDB_CMD_GET_MELT_COMMITMENT command
*/
- struct PERF_TALER_MINTDB_CMD_getMeltCommitmentDaetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getMeltCommitmentDaetails
{
/**
* The refresh session hash
@@ -1210,9 +1210,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_melt_commitment;
/**
- * Data requiered by the #PERF_TALER_MINTDB_CMD_INSERT_REFRESH_OUT command
+ * Data requiered by the #PERF_TALER_EXCHANGEDB_CMD_INSERT_REFRESH_OUT command
*/
- struct PERF_TALER_MINTDB_CMD_insertRefreshOutDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_insertRefreshOutDetails
{
/**
* The refresh session hash
@@ -1222,9 +1222,9 @@ union PERF_TALER_MINTDB_CMD_Details
} insert_refresh_out;
/**
- * Data requiered by the #PERF_TALER_MINTDB_CMD_GET_LINK_DATA_LIST command
+ * Data requiered by the #PERF_TALER_EXCHANGEDB_CMD_GET_LINK_DATA_LIST command
*/
- struct PERF_TALER_MINTDB_CMD_getLinkDataListDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getLinkDataListDetails
{
/**
* The refresh session hash
@@ -1234,9 +1234,9 @@ union PERF_TALER_MINTDB_CMD_Details
} get_link_data_list;
/**
- * Data requiered by the #PERF_TALER_MINTDB_CMD_GET_TRANSFER command
+ * Data requiered by the #PERF_TALER_EXCHANGEDB_CMD_GET_TRANSFER command
*/
- struct PERF_TALER_MINTDB_CMD_getTransferDetails
+ struct PERF_TALER_EXCHANGEDB_CMD_getTransferDetails
{
/**
* The refresh session hash
@@ -1251,12 +1251,12 @@ union PERF_TALER_MINTDB_CMD_Details
/**
* Command to be interpreted.
*/
-struct PERF_TALER_MINTDB_Cmd
+struct PERF_TALER_EXCHANGEDB_Cmd
{
/**
* Type of the command
*/
- enum PERF_TALER_MINTDB_CMD_Name command;
+ enum PERF_TALER_EXCHANGEDB_CMD_Name command;
/**
* Label to refer to the command
@@ -1266,12 +1266,12 @@ struct PERF_TALER_MINTDB_Cmd
/**
* Command specific data
*/
- union PERF_TALER_MINTDB_CMD_Details details;
+ union PERF_TALER_EXCHANGEDB_CMD_Details details;
/**
* Data easily accessible
*/
- struct PERF_TALER_MINTDB_Data exposed;
+ struct PERF_TALER_EXCHANGEDB_Data exposed;
};
@@ -1286,10 +1286,10 @@ struct PERF_TALER_MINTDB_Cmd
* @return GNUNET_OK upon success; GNUNET_SYSERR upon failure
*/
int
-PERF_TALER_MINTDB_run_benchmark (const char *benchmark_name,
+PERF_TALER_EXCHANGEDB_run_benchmark (const char *benchmark_name,
const char *configuration_file,
- struct PERF_TALER_MINTDB_Cmd *init,
- struct PERF_TALER_MINTDB_Cmd *benchmark);
+ struct PERF_TALER_EXCHANGEDB_Cmd *init,
+ struct PERF_TALER_EXCHANGEDB_Cmd *benchmark);
/**
@@ -1300,9 +1300,9 @@ PERF_TALER_MINTDB_run_benchmark (const char *benchmark_name,
* @param cmd the commands to run
*/
int
-PERF_TALER_MINTDB_interpret(
- struct TALER_MINTDB_Plugin *db_plugin,
- struct PERF_TALER_MINTDB_Cmd cmd[]);
+PERF_TALER_EXCHANGEDB_interpret(
+ struct TALER_EXCHANGEDB_Plugin *db_plugin,
+ struct PERF_TALER_EXCHANGEDB_Cmd cmd[]);
/**
@@ -1314,6 +1314,6 @@ PERF_TALER_MINTDB_interpret(
* @return #GNUNET_OK is @a cmd is correct; #GNUNET_SYSERR if it is'nt
*/
int
-PERF_TALER_MINTDB_check (const struct PERF_TALER_MINTDB_Cmd *cmd);
+PERF_TALER_EXCHANGEDB_check (const struct PERF_TALER_EXCHANGEDB_Cmd *cmd);
#endif
diff --git a/src/mintdb/perf_taler_mintdb_values.h b/src/exchangedb/perf_taler_exchangedb_values.h
similarity index 85%
rename from src/mintdb/perf_taler_mintdb_values.h
rename to src/exchangedb/perf_taler_exchangedb_values.h
index 35f87f5b0..c3b50fea2 100644
--- a/src/mintdb/perf_taler_mintdb_values.h
+++ b/src/exchangedb/perf_taler_exchangedb_values.h
@@ -14,12 +14,12 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mintdb/perf_taler_mintdb_values.h
+ * @file exchangedb/perf_taler_exchangedb_values.h
* @brief Values for tweaking the performance analysis
* @author Nicolas Fournier
*/
-#ifndef __PERF_TALER_MINTDB__VALUES_H__
-#define __PERF_TALER_MINTDB__VALUES_H__
+#ifndef __PERF_TALER_EXCHANGEDB__VALUES_H__
+#define __PERF_TALER_EXCHANGEDB__VALUES_H__
#endif
diff --git a/src/mintdb/plugin_mintdb_common.c b/src/exchangedb/plugin_exchangedb_common.c
similarity index 82%
rename from src/mintdb/plugin_mintdb_common.c
rename to src/exchangedb/plugin_exchangedb_common.c
index 1f2fdc58b..c8e689cfd 100644
--- a/src/mintdb/plugin_mintdb_common.c
+++ b/src/exchangedb/plugin_exchangedb_common.c
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mintdb/plugin_mintdb_common.c
+ * @file exchangedb/plugin_exchangedb_common.c
* @brief Functions shared across plugins, this file is meant to be
* included in each plugin.
* @author Christian Grothoff
@@ -28,23 +28,23 @@
*/
static void
common_free_reserve_history (void *cls,
- struct TALER_MINTDB_ReserveHistory *rh)
+ struct TALER_EXCHANGEDB_ReserveHistory *rh)
{
- struct TALER_MINTDB_BankTransfer *bt;
- struct TALER_MINTDB_CollectableBlindcoin *cbc;
- struct TALER_MINTDB_ReserveHistory *backref;
+ struct TALER_EXCHANGEDB_BankTransfer *bt;
+ struct TALER_EXCHANGEDB_CollectableBlindcoin *cbc;
+ struct TALER_EXCHANGEDB_ReserveHistory *backref;
while (NULL != rh)
{
switch(rh->type)
{
- case TALER_MINTDB_RO_BANK_TO_MINT:
+ case TALER_EXCHANGEDB_RO_BANK_TO_EXCHANGE:
bt = rh->details.bank;
if (NULL != bt->wire)
json_decref (bt->wire);
GNUNET_free (bt);
break;
- case TALER_MINTDB_RO_WITHDRAW_COIN:
+ case TALER_EXCHANGEDB_RO_WITHDRAW_COIN:
cbc = rh->details.withdraw;
GNUNET_CRYPTO_rsa_signature_free (cbc->sig.rsa_signature);
GNUNET_CRYPTO_rsa_public_key_free (cbc->denom_pub.rsa_public_key);
@@ -66,9 +66,9 @@ common_free_reserve_history (void *cls,
*/
static void
common_free_link_data_list (void *cls,
- struct TALER_MINTDB_LinkDataList *ldl)
+ struct TALER_EXCHANGEDB_LinkDataList *ldl)
{
- struct TALER_MINTDB_LinkDataList *next;
+ struct TALER_EXCHANGEDB_LinkDataList *next;
while (NULL != ldl)
{
@@ -88,9 +88,9 @@ common_free_link_data_list (void *cls,
*/
static void
common_free_coin_transaction_list (void *cls,
- struct TALER_MINTDB_TransactionList *list)
+ struct TALER_EXCHANGEDB_TransactionList *list)
{
- struct TALER_MINTDB_TransactionList *next;
+ struct TALER_EXCHANGEDB_TransactionList *next;
while (NULL != list)
{
@@ -98,13 +98,13 @@ common_free_coin_transaction_list (void *cls,
switch (list->type)
{
- case TALER_MINTDB_TT_DEPOSIT:
+ case TALER_EXCHANGEDB_TT_DEPOSIT:
json_decref (list->details.deposit->wire);
GNUNET_CRYPTO_rsa_public_key_free (list->details.deposit->coin.denom_pub.rsa_public_key);
GNUNET_CRYPTO_rsa_signature_free (list->details.deposit->coin.denom_sig.rsa_signature);
GNUNET_free (list->details.deposit);
break;
- case TALER_MINTDB_TT_REFRESH_MELT:
+ case TALER_EXCHANGEDB_TT_REFRESH_MELT:
GNUNET_free (list->details.melt);
break;
}
@@ -122,7 +122,7 @@ common_free_coin_transaction_list (void *cls,
*/
static void
common_free_melt_commitment (void *cls,
- struct TALER_MINTDB_MeltCommitment *mc)
+ struct TALER_EXCHANGEDB_MeltCommitment *mc)
{
unsigned int i;
unsigned int k;
@@ -159,4 +159,4 @@ common_free_melt_commitment (void *cls,
GNUNET_free (mc);
}
-/* end of plugin_mintdb_common.c */
+/* end of plugin_exchangedb_common.c */
diff --git a/src/mintdb/plugin_mintdb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
similarity index 93%
rename from src/mintdb/plugin_mintdb_postgres.c
rename to src/exchangedb/plugin_exchangedb_postgres.c
index 772b86e83..092aebc48 100644
--- a/src/mintdb/plugin_mintdb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -15,19 +15,19 @@
*/
/**
- * @file plugin_mintdb_postgres.c
- * @brief Low-level (statement-level) Postgres database access for the mint
+ * @file plugin_exchangedb_postgres.c
+ * @brief Low-level (statement-level) Postgres database access for the exchange
* @author Florian Dold
* @author Christian Grothoff
* @author Sree Harsha Totakura
*/
#include "platform.h"
#include "taler_pq_lib.h"
-#include "taler_mintdb_plugin.h"
+#include "taler_exchangedb_plugin.h"
#include
#include
-#include "plugin_mintdb_common.c"
+#include "plugin_exchangedb_common.c"
/**
* For testing / experiments, we set the Postgres schema to
@@ -107,7 +107,7 @@
/**
* Handle for a database session (per-thread, for transactions).
*/
-struct TALER_MINTDB_Session
+struct TALER_EXCHANGEDB_Session
{
/**
* Postgres connection handle.
@@ -165,7 +165,7 @@ set_temporary_schema (PGconn *db)
*/
static int
postgres_drop_temporary (void *cls,
- struct TALER_MINTDB_Session *session)
+ struct TALER_EXCHANGEDB_Session *session)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Dropping temporary tables\n");
@@ -277,7 +277,7 @@ postgres_create_tables (void *cls,
funds are added and existing funds are withdrawn. The 'expiration_date'
can be used to eventually get rid of reserves that have not been used
for a very long time (either by refunding the owner or by greedily
- grabbing the money, depending on the Mint's terms of service) */
+ grabbing the money, depending on the Exchange's terms of service) */
SQLEXEC ("CREATE TABLE IF NOT EXISTS reserves"
"(reserve_pub BYTEA PRIMARY KEY"
",current_balance_val INT8 NOT NULL"
@@ -422,7 +422,7 @@ postgres_create_tables (void *cls,
",newcoin_index INT2 NOT NULL"
",ev_sig BYTEA NOT NULL"
")");
- /* This table contains the wire transfers the mint is supposed to
+ /* This table contains the wire transfers the exchange is supposed to
execute to transmit funds to the merchants (and manage refunds). */
SQLEXEC("CREATE TABLE IF NOT EXISTS deposits "
"(serial_id BIGSERIAL PRIMARY KEY"
@@ -475,7 +475,7 @@ postgres_create_tables (void *cls,
"ON aggregation_tracking(coin_pub,h_contract,h_wire,transaction_id,merchant_pub)");
/* This table contains the pre-commit data for
- wire transfers the mint is about to execute. */
+ wire transfers the exchange is about to execute. */
SQLEXEC("CREATE TABLE IF NOT EXISTS prewire "
"(serial_id BIGSERIAL PRIMARY KEY"
",type TEXT NOT NULL"
@@ -726,7 +726,7 @@ postgres_prepare (PGconn *db_conn)
/* Used in #postgres_get_known_coin() to fetch
the denomination public key and signature for
- a coin known to the mint. */
+ a coin known to the exchange. */
PREPARE ("get_known_coin",
"SELECT"
" denom_pub"
@@ -737,7 +737,7 @@ postgres_prepare (PGconn *db_conn)
/* Used in #postgres_insert_known_coin() to store
the denomination public key and signature for
- a coin known to the mint. */
+ a coin known to the exchange. */
PREPARE ("insert_known_coin",
"INSERT INTO known_coins "
"(coin_pub"
@@ -863,7 +863,7 @@ postgres_prepare (PGconn *db_conn)
" WHERE session_hash=$1 AND cnc_index=$2 AND newcoin_index=$3",
3, NULL);
- /* Store information about a /deposit the mint is to execute.
+ /* Store information about a /deposit the exchange is to execute.
Used in #postgres_insert_deposit(). */
PREPARE ("insert_deposit",
"INSERT INTO deposits "
@@ -950,10 +950,11 @@ postgres_prepare (PGconn *db_conn)
" FROM deposits"
" WHERE"
" tiny=false AND"
- " done=false"
+ " done=false AND"
+ " wire_deadline<$1"
" ORDER BY wire_deadline ASC"
- " LIMIT 1;",
- 0, NULL);
+ " LIMIT 1",
+ 1, NULL);
/* Used in #postgres_iterate_matching_deposits() */
PREPARE ("deposits_iterate_matching",
@@ -975,8 +976,8 @@ postgres_prepare (PGconn *db_conn)
" h_wire=$2 AND"
" done=false"
" ORDER BY wire_deadline ASC"
- " LIMIT $3",
- 3, NULL);
+ " LIMIT " TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT_STR,
+ 2, NULL);
/* Used in #postgres_mark_deposit_tiny() */
PREPARE ("mark_deposit_tiny",
@@ -1038,7 +1039,7 @@ postgres_prepare (PGconn *db_conn)
have another constraint to ensure we get each triplet with
matching "newcoin_index" values. NOTE: This may return many
results, both for different sessions and for the different coins
- being minted in the refresh ops. NOTE: There may be more
+ being exchangeed in the refresh ops. NOTE: There may be more
efficient ways to express the same query. */
PREPARE ("get_link",
"SELECT link_vector_enc,ev_sig,ro.denom_pub"
@@ -1175,7 +1176,7 @@ postgres_prepare (PGconn *db_conn)
static void
db_conn_destroy (void *cls)
{
- struct TALER_MINTDB_Session *session = cls;
+ struct TALER_EXCHANGEDB_Session *session = cls;
PGconn *db_conn = session->conn;
if (NULL != db_conn)
@@ -1193,13 +1194,13 @@ db_conn_destroy (void *cls)
* database default one
* @return the database connection, or NULL on error
*/
-static struct TALER_MINTDB_Session *
+static struct TALER_EXCHANGEDB_Session *
postgres_get_session (void *cls,
int temporary)
{
struct PostgresClosure *pc = cls;
PGconn *db_conn;
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
if (NULL != (session = pthread_getspecific (pc->db_conn_threadlocal)))
return session;
@@ -1230,7 +1231,7 @@ postgres_get_session (void *cls,
GNUNET_break (0);
return NULL;
}
- session = GNUNET_new (struct TALER_MINTDB_Session);
+ session = GNUNET_new (struct TALER_EXCHANGEDB_Session);
session->conn = db_conn;
if (0 != pthread_setspecific (pc->db_conn_threadlocal,
session))
@@ -1253,7 +1254,7 @@ postgres_get_session (void *cls,
*/
static int
postgres_start (void *cls,
- struct TALER_MINTDB_Session *session)
+ struct TALER_EXCHANGEDB_Session *session)
{
PGresult *result;
@@ -1283,7 +1284,7 @@ postgres_start (void *cls,
*/
static void
postgres_rollback (void *cls,
- struct TALER_MINTDB_Session *session)
+ struct TALER_EXCHANGEDB_Session *session)
{
PGresult *result;
@@ -1304,7 +1305,7 @@ postgres_rollback (void *cls,
*/
static int
postgres_commit (void *cls,
- struct TALER_MINTDB_Session *session)
+ struct TALER_EXCHANGEDB_Session *session)
{
PGresult *result;
@@ -1358,9 +1359,9 @@ postgres_commit (void *cls,
*/
static int
postgres_insert_denomination_info (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_DenominationPublicKey *denom_pub,
- const struct TALER_MINTDB_DenominationKeyInformationP *issue)
+ const struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue)
{
PGresult *result;
int ret;
@@ -1418,9 +1419,9 @@ postgres_insert_denomination_info (void *cls,
*/
static int
postgres_get_denomination_info (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_DenominationPublicKey *denom_pub,
- struct TALER_MINTDB_DenominationKeyInformationP *issue)
+ struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue)
{
PGresult *result;
struct GNUNET_PQ_QueryParam params[] = {
@@ -1480,8 +1481,8 @@ postgres_get_denomination_info (void *cls,
EXITIF (GNUNET_OK !=
GNUNET_PQ_extract_result (result,
- rs,
- 0));
+ rs,
+ 0));
}
PQclear (result);
return GNUNET_OK;
@@ -1504,8 +1505,8 @@ postgres_get_denomination_info (void *cls,
*/
static int
postgres_reserve_get (void *cls,
- struct TALER_MINTDB_Session *session,
- struct TALER_MINTDB_Reserve *reserve)
+ struct TALER_EXCHANGEDB_Session *session,
+ struct TALER_EXCHANGEDB_Reserve *reserve)
{
PGresult *result;
struct GNUNET_PQ_QueryParam params[] = {
@@ -1559,8 +1560,8 @@ postgres_reserve_get (void *cls,
*/
static int
reserves_update (void *cls,
- struct TALER_MINTDB_Session *session,
- const struct TALER_MINTDB_Reserve *reserve)
+ struct TALER_EXCHANGEDB_Session *session,
+ const struct TALER_EXCHANGEDB_Reserve *reserve)
{
PGresult *result;
int ret;
@@ -1608,7 +1609,7 @@ reserves_update (void *cls,
*/
static int
postgres_reserves_in_insert (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *balance,
struct GNUNET_TIME_Absolute execution_time,
@@ -1616,7 +1617,7 @@ postgres_reserves_in_insert (void *cls,
{
PGresult *result;
int reserve_exists;
- struct TALER_MINTDB_Reserve reserve;
+ struct TALER_EXCHANGEDB_Reserve reserve;
struct GNUNET_TIME_Absolute expiry;
if (GNUNET_OK != postgres_start (cls,
@@ -1711,7 +1712,7 @@ postgres_reserves_in_insert (void *cls,
otherwise we might have to actually pay the cost to roll this
back for duplicate transactions; like this, we should virtually
never actually have to rollback anything. */
- struct TALER_MINTDB_Reserve updated_reserve;
+ struct TALER_EXCHANGEDB_Reserve updated_reserve;
updated_reserve.pub = reserve.pub;
if (GNUNET_OK !=
@@ -1759,9 +1760,9 @@ postgres_reserves_in_insert (void *cls,
*/
static int
postgres_get_withdraw_info (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_blind,
- struct TALER_MINTDB_CollectableBlindcoin *collectable)
+ struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable)
{
PGresult *result;
struct GNUNET_PQ_QueryParam params[] = {
@@ -1832,11 +1833,11 @@ postgres_get_withdraw_info (void *cls,
*/
static int
postgres_insert_withdraw_info (void *cls,
- struct TALER_MINTDB_Session *session,
- const struct TALER_MINTDB_CollectableBlindcoin *collectable)
+ struct TALER_EXCHANGEDB_Session *session,
+ const struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable)
{
PGresult *result;
- struct TALER_MINTDB_Reserve reserve;
+ struct TALER_EXCHANGEDB_Reserve reserve;
int ret = GNUNET_SYSERR;
struct GNUNET_TIME_Absolute now;
struct GNUNET_TIME_Absolute expiry;
@@ -1906,14 +1907,14 @@ postgres_insert_withdraw_info (void *cls,
* @param reserve_pub public key of the reserve
* @return known transaction history (NULL if reserve is unknown)
*/
-static struct TALER_MINTDB_ReserveHistory *
+static struct TALER_EXCHANGEDB_ReserveHistory *
postgres_get_reserve_history (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_ReservePublicKeyP *reserve_pub)
{
PGresult *result;
- struct TALER_MINTDB_ReserveHistory *rh;
- struct TALER_MINTDB_ReserveHistory *rh_tail;
+ struct TALER_EXCHANGEDB_ReserveHistory *rh;
+ struct TALER_EXCHANGEDB_ReserveHistory *rh_tail;
int rows;
int ret;
@@ -1921,7 +1922,7 @@ postgres_get_reserve_history (void *cls,
rh_tail = NULL;
ret = GNUNET_SYSERR;
{
- struct TALER_MINTDB_BankTransfer *bt;
+ struct TALER_EXCHANGEDB_BankTransfer *bt;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
GNUNET_PQ_query_param_end
@@ -1943,7 +1944,7 @@ postgres_get_reserve_history (void *cls,
}
while (0 < rows)
{
- bt = GNUNET_new (struct TALER_MINTDB_BankTransfer);
+ bt = GNUNET_new (struct TALER_EXCHANGEDB_BankTransfer);
{
struct GNUNET_PQ_ResultSpec rs[] = {
TALER_PQ_result_spec_amount ("balance",
@@ -1954,7 +1955,7 @@ postgres_get_reserve_history (void *cls,
&bt->wire),
GNUNET_PQ_result_spec_end
};
- if (GNUNET_YES !=
+ if (GNUNET_OK !=
GNUNET_PQ_extract_result (result, rs, --rows))
{
GNUNET_break (0);
@@ -1966,15 +1967,15 @@ postgres_get_reserve_history (void *cls,
bt->reserve_pub = *reserve_pub;
if (NULL != rh_tail)
{
- rh_tail->next = GNUNET_new (struct TALER_MINTDB_ReserveHistory);
+ rh_tail->next = GNUNET_new (struct TALER_EXCHANGEDB_ReserveHistory);
rh_tail = rh_tail->next;
}
else
{
- rh_tail = GNUNET_new (struct TALER_MINTDB_ReserveHistory);
+ rh_tail = GNUNET_new (struct TALER_EXCHANGEDB_ReserveHistory);
rh = rh_tail;
}
- rh_tail->type = TALER_MINTDB_RO_BANK_TO_MINT;
+ rh_tail->type = TALER_EXCHANGEDB_RO_BANK_TO_EXCHANGE;
rh_tail->details.bank = bt;
}
PQclear (result);
@@ -2000,9 +2001,9 @@ postgres_get_reserve_history (void *cls,
rows = PQntuples (result);
while (0 < rows)
{
- struct TALER_MINTDB_CollectableBlindcoin *cbc;
+ struct TALER_EXCHANGEDB_CollectableBlindcoin *cbc;
- cbc = GNUNET_new (struct TALER_MINTDB_CollectableBlindcoin);
+ cbc = GNUNET_new (struct TALER_EXCHANGEDB_CollectableBlindcoin);
{
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_auto_from_type ("h_blind_ev",
@@ -2019,7 +2020,7 @@ postgres_get_reserve_history (void *cls,
&cbc->withdraw_fee),
GNUNET_PQ_result_spec_end
};
- if (GNUNET_YES !=
+ if (GNUNET_OK !=
GNUNET_PQ_extract_result (result, rs, --rows))
{
GNUNET_break (0);
@@ -2029,9 +2030,9 @@ postgres_get_reserve_history (void *cls,
}
cbc->reserve_pub = *reserve_pub;
}
- rh_tail->next = GNUNET_new (struct TALER_MINTDB_ReserveHistory);
+ rh_tail->next = GNUNET_new (struct TALER_EXCHANGEDB_ReserveHistory);
rh_tail = rh_tail->next;
- rh_tail->type = TALER_MINTDB_RO_WITHDRAW_COIN;
+ rh_tail->type = TALER_EXCHANGEDB_RO_WITHDRAW_COIN;
rh_tail->details.withdraw = cbc;
}
ret = GNUNET_OK;
@@ -2060,8 +2061,8 @@ postgres_get_reserve_history (void *cls,
*/
static int
postgres_have_deposit (void *cls,
- struct TALER_MINTDB_Session *session,
- const struct TALER_MINTDB_Deposit *deposit)
+ struct TALER_EXCHANGEDB_Session *session,
+ const struct TALER_EXCHANGEDB_Deposit *deposit)
{
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (&deposit->coin.coin_pub),
@@ -2090,7 +2091,7 @@ postgres_have_deposit (void *cls,
/* Now we check that the other information in @a deposit
also matches, and if not report inconsistencies. */
{
- struct TALER_MINTDB_Deposit deposit2;
+ struct TALER_EXCHANGEDB_Deposit deposit2;
struct GNUNET_PQ_ResultSpec rs[] = {
TALER_PQ_result_spec_amount ("amount_with_fee",
&deposit2.amount_with_fee),
@@ -2151,7 +2152,7 @@ postgres_have_deposit (void *cls,
*/
static int
postgres_mark_deposit_tiny (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
unsigned long long rowid)
{
uint64_t serial_id = rowid;
@@ -2188,7 +2189,7 @@ postgres_mark_deposit_tiny (void *cls,
*/
static int
postgres_mark_deposit_done (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
unsigned long long rowid)
{
uint64_t serial_id = rowid;
@@ -2227,11 +2228,13 @@ postgres_mark_deposit_done (void *cls,
*/
static int
postgres_get_ready_deposit (void *cls,
- struct TALER_MINTDB_Session *session,
- TALER_MINTDB_DepositIterator deposit_cb,
+ struct TALER_EXCHANGEDB_Session *session,
+ TALER_EXCHANGEDB_DepositIterator deposit_cb,
void *deposit_cb_cls)
{
+ struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
struct GNUNET_PQ_QueryParam params[] = {
+ GNUNET_PQ_query_param_absolute_time (&now),
GNUNET_PQ_query_param_end
};
PGresult *result;
@@ -2285,6 +2288,7 @@ postgres_get_ready_deposit (void *cls,
&wire),
GNUNET_PQ_result_spec_end
};
+
if (GNUNET_OK !=
GNUNET_PQ_extract_result (result, rs, 0))
{
@@ -2325,17 +2329,16 @@ postgres_get_ready_deposit (void *cls,
*/
static int
postgres_iterate_matching_deposits (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_wire,
const struct TALER_MerchantPublicKeyP *merchant_pub,
- TALER_MINTDB_DepositIterator deposit_cb,
+ TALER_EXCHANGEDB_DepositIterator deposit_cb,
void *deposit_cb_cls,
uint32_t limit)
{
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (merchant_pub),
GNUNET_PQ_query_param_auto_from_type (h_wire),
- GNUNET_PQ_query_param_uint32 (&limit),
GNUNET_PQ_query_param_end
};
PGresult *result;
@@ -2343,8 +2346,8 @@ postgres_iterate_matching_deposits (void *cls,
unsigned int n;
result = GNUNET_PQ_exec_prepared (session->conn,
- "deposits_iterate_matching",
- params);
+ "deposits_iterate_matching",
+ params);
if (PGRES_TUPLES_OK !=
PQresultStatus (result))
{
@@ -2365,28 +2368,25 @@ postgres_iterate_matching_deposits (void *cls,
struct TALER_Amount deposit_fee;
struct GNUNET_TIME_Absolute wire_deadline;
struct GNUNET_HashCode h_contract;
- struct TALER_MerchantPublicKeyP merchant_pub;
struct TALER_CoinSpendPublicKeyP coin_pub;
uint64_t transaction_id;
uint64_t serial_id;
int ret;
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_uint64 ("serial_id",
- &serial_id),
+ &serial_id),
GNUNET_PQ_result_spec_uint64 ("transaction_id",
- &transaction_id),
+ &transaction_id),
TALER_PQ_result_spec_amount ("amount_with_fee",
&amount_with_fee),
TALER_PQ_result_spec_amount ("deposit_fee",
&deposit_fee),
GNUNET_PQ_result_spec_absolute_time ("wire_deadline",
- &wire_deadline),
+ &wire_deadline),
GNUNET_PQ_result_spec_auto_from_type ("h_contract",
- &h_contract),
- GNUNET_PQ_result_spec_auto_from_type ("merchant_pub",
- &merchant_pub),
+ &h_contract),
GNUNET_PQ_result_spec_auto_from_type ("coin_pub",
- &coin_pub),
+ &coin_pub),
GNUNET_PQ_result_spec_end
};
if (GNUNET_OK !=
@@ -2398,7 +2398,7 @@ postgres_iterate_matching_deposits (void *cls,
}
ret = deposit_cb (deposit_cb_cls,
serial_id,
- &merchant_pub,
+ merchant_pub,
&coin_pub,
&amount_with_fee,
&deposit_fee,
@@ -2407,10 +2407,10 @@ postgres_iterate_matching_deposits (void *cls,
wire_deadline,
NULL);
GNUNET_PQ_cleanup_result (rs);
- PQclear (result);
if (GNUNET_OK != ret)
break;
}
+ PQclear (result);
return i;
}
@@ -2425,8 +2425,8 @@ postgres_iterate_matching_deposits (void *cls,
*/
static int
postgres_insert_deposit (void *cls,
- struct TALER_MINTDB_Session *session,
- const struct TALER_MINTDB_Deposit *deposit)
+ struct TALER_EXCHANGEDB_Session *session,
+ const struct TALER_EXCHANGEDB_Deposit *deposit)
{
PGresult *result;
int ret;
@@ -2481,9 +2481,9 @@ postgres_insert_deposit (void *cls,
*/
static int
postgres_get_refresh_session (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
- struct TALER_MINTDB_RefreshSession *refresh_session)
+ struct TALER_EXCHANGEDB_RefreshSession *refresh_session)
{
PGresult *result;
struct GNUNET_PQ_QueryParam params[] = {
@@ -2515,7 +2515,7 @@ postgres_get_refresh_session (void *cls,
}
memset (refresh_session,
0,
- sizeof (struct TALER_MINTDB_RefreshSession));
+ sizeof (struct TALER_EXCHANGEDB_RefreshSession));
{
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_uint16 ("num_oldcoins",
@@ -2551,9 +2551,9 @@ postgres_get_refresh_session (void *cls,
*/
static int
postgres_create_refresh_session (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
- const struct TALER_MINTDB_RefreshSession *refresh_session)
+ const struct TALER_EXCHANGEDB_RefreshSession *refresh_session)
{
PGresult *result;
struct GNUNET_PQ_QueryParam params[] = {
@@ -2589,7 +2589,7 @@ postgres_create_refresh_session (void *cls,
*/
static int
insert_known_coin (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_CoinPublicInfo *coin_info)
{
PGresult *result;
@@ -2626,7 +2626,7 @@ insert_known_coin (void *cls,
*/
static int
get_known_coin (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_CoinPublicInfo *coin_info)
{
@@ -2691,9 +2691,9 @@ get_known_coin (void *cls,
*/
static int
postgres_insert_refresh_melt (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
uint16_t oldcoin_index,
- const struct TALER_MINTDB_RefreshMelt *melt)
+ const struct TALER_EXCHANGEDB_RefreshMelt *melt)
{
PGresult *result;
struct GNUNET_PQ_QueryParam params[] = {
@@ -2756,10 +2756,10 @@ postgres_insert_refresh_melt (void *cls,
*/
static int
postgres_get_refresh_melt (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t oldcoin_index,
- struct TALER_MINTDB_RefreshMelt *melt)
+ struct TALER_EXCHANGEDB_RefreshMelt *melt)
{
PGresult *result;
struct TALER_CoinPublicInfo coin;
@@ -2843,7 +2843,7 @@ postgres_get_refresh_melt (void *cls,
*/
static int
postgres_insert_refresh_order (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t num_newcoins,
const struct TALER_DenominationPublicKey *denom_pubs)
@@ -2918,7 +2918,7 @@ free_dpk_result (struct TALER_DenominationPublicKey *denom_pubs,
*/
static int
postgres_get_refresh_order (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t num_newcoins,
struct TALER_DenominationPublicKey *denom_pubs)
@@ -2992,11 +2992,11 @@ postgres_get_refresh_order (void *cls,
*/
static int
postgres_insert_refresh_commit_coins (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t cnc_index,
uint16_t num_newcoins,
- const struct TALER_MINTDB_RefreshCommitCoin *commit_coins)
+ const struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins)
{
char *rle;
size_t rle_size;
@@ -3056,7 +3056,7 @@ postgres_insert_refresh_commit_coins (void *cls,
* @param commit_coins_len length of @a commit_coins array
*/
static void
-free_cc_result (struct TALER_MINTDB_RefreshCommitCoin *commit_coins,
+free_cc_result (struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins,
unsigned int commit_coins_len)
{
unsigned int i;
@@ -3088,11 +3088,11 @@ free_cc_result (struct TALER_MINTDB_RefreshCommitCoin *commit_coins,
*/
static int
postgres_get_refresh_commit_coins (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t cnc_index,
uint16_t num_newcoins,
- struct TALER_MINTDB_RefreshCommitCoin *commit_coins)
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins)
{
unsigned int i;
@@ -3180,7 +3180,7 @@ postgres_get_refresh_commit_coins (void *cls,
*/
static int
postgres_insert_refresh_commit_links (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t cnc_index,
uint16_t num_links,
@@ -3236,7 +3236,7 @@ postgres_insert_refresh_commit_links (void *cls,
*/
static int
postgres_get_refresh_commit_links (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t cnc_index,
uint16_t num_links,
@@ -3299,13 +3299,13 @@ postgres_get_refresh_commit_links (void *cls,
* @return NULL if the @a session_hash does not correspond to any known melt
* operation
*/
-static struct TALER_MINTDB_MeltCommitment *
+static struct TALER_EXCHANGEDB_MeltCommitment *
postgres_get_melt_commitment (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash)
{
- struct TALER_MINTDB_RefreshSession rs;
- struct TALER_MINTDB_MeltCommitment *mc;
+ struct TALER_EXCHANGEDB_RefreshSession rs;
+ struct TALER_EXCHANGEDB_MeltCommitment *mc;
uint16_t cnc_index;
unsigned int i;
@@ -3315,11 +3315,11 @@ postgres_get_melt_commitment (void *cls,
session_hash,
&rs))
return NULL;
- mc = GNUNET_new (struct TALER_MINTDB_MeltCommitment);
+ mc = GNUNET_new (struct TALER_EXCHANGEDB_MeltCommitment);
mc->num_newcoins = rs.num_newcoins;
mc->num_oldcoins = rs.num_oldcoins;
mc->melts = GNUNET_malloc (mc->num_oldcoins *
- sizeof (struct TALER_MINTDB_RefreshMelt));
+ sizeof (struct TALER_EXCHANGEDB_RefreshMelt));
for (i=0;inum_oldcoins;i++)
if (GNUNET_OK !=
postgres_get_refresh_melt (cls,
@@ -3341,7 +3341,7 @@ postgres_get_melt_commitment (void *cls,
{
mc->commit_coins[cnc_index]
= GNUNET_malloc (mc->num_newcoins *
- sizeof (struct TALER_MINTDB_RefreshCommitCoin));
+ sizeof (struct TALER_EXCHANGEDB_RefreshCommitCoin));
if (GNUNET_OK !=
postgres_get_refresh_commit_coins (cls,
session,
@@ -3385,7 +3385,7 @@ postgres_get_melt_commitment (void *cls,
*/
static int
postgres_insert_refresh_out (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t newcoin_index,
const struct TALER_DenominationSignature *ev_sig)
@@ -3421,13 +3421,13 @@ postgres_insert_refresh_out (void *cls,
* @param session_hash refresh session to get linkage data for
* @return all known link data for the session
*/
-static struct TALER_MINTDB_LinkDataList *
+static struct TALER_EXCHANGEDB_LinkDataList *
postgres_get_link_data_list (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash)
{
- struct TALER_MINTDB_LinkDataList *ldl;
- struct TALER_MINTDB_LinkDataList *pos;
+ struct TALER_EXCHANGEDB_LinkDataList *ldl;
+ struct TALER_EXCHANGEDB_LinkDataList *pos;
int i;
int nrows;
struct GNUNET_PQ_QueryParam params[] = {
@@ -3457,8 +3457,8 @@ postgres_get_link_data_list (void *cls,
for (i = 0; i < nrows; i++)
{
struct TALER_RefreshLinkEncrypted *link_enc;
- struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub;
- struct GNUNET_CRYPTO_rsa_Signature *sig;
+ struct GNUNET_CRYPTO_RsaPublicKey *denom_pub;
+ struct GNUNET_CRYPTO_RsaSignature *sig;
void *ld_buf;
size_t ld_buf_size;
struct GNUNET_PQ_ResultSpec rs[] = {
@@ -3492,7 +3492,7 @@ postgres_get_link_data_list (void *cls,
link_enc = TALER_refresh_link_encrypted_decode (ld_buf,
ld_buf_size);
GNUNET_free (ld_buf);
- pos = GNUNET_new (struct TALER_MINTDB_LinkDataList);
+ pos = GNUNET_new (struct TALER_EXCHANGEDB_LinkDataList);
pos->next = ldl;
pos->link_data_enc = link_enc;
pos->denom_pub.rsa_public_key = denom_pub;
@@ -3520,9 +3520,9 @@ postgres_get_link_data_list (void *cls,
*/
static int
postgres_get_transfer (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
- TALER_MINTDB_TransferDataCallback tdc,
+ TALER_EXCHANGEDB_TransferDataCallback tdc,
void *tdc_cls)
{
struct GNUNET_PQ_QueryParam params[] = {
@@ -3588,12 +3588,12 @@ postgres_get_transfer (void *cls,
* @param coin_pub coin to investigate
* @return list of transactions, NULL if coin is fresh
*/
-static struct TALER_MINTDB_TransactionList *
+static struct TALER_EXCHANGEDB_TransactionList *
postgres_get_coin_transactions (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_CoinSpendPublicKeyP *coin_pub)
{
- struct TALER_MINTDB_TransactionList *head;
+ struct TALER_EXCHANGEDB_TransactionList *head;
head = NULL;
/* check deposits */
@@ -3605,7 +3605,7 @@ postgres_get_coin_transactions (void *cls,
int nrows;
int i;
PGresult *result;
- struct TALER_MINTDB_TransactionList *tl;
+ struct TALER_EXCHANGEDB_TransactionList *tl;
result = GNUNET_PQ_exec_prepared (session->conn,
"get_deposit_with_coin_pub",
@@ -3619,9 +3619,9 @@ postgres_get_coin_transactions (void *cls,
nrows = PQntuples (result);
for (i = 0; i < nrows; i++)
{
- struct TALER_MINTDB_Deposit *deposit;
+ struct TALER_EXCHANGEDB_Deposit *deposit;
- deposit = GNUNET_new (struct TALER_MINTDB_Deposit);
+ deposit = GNUNET_new (struct TALER_EXCHANGEDB_Deposit);
{
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_rsa_public_key ("denom_pub",
@@ -3661,9 +3661,9 @@ postgres_get_coin_transactions (void *cls,
}
deposit->coin.coin_pub = *coin_pub;
}
- tl = GNUNET_new (struct TALER_MINTDB_TransactionList);
+ tl = GNUNET_new (struct TALER_EXCHANGEDB_TransactionList);
tl->next = head;
- tl->type = TALER_MINTDB_TT_DEPOSIT;
+ tl->type = TALER_EXCHANGEDB_TT_DEPOSIT;
tl->details.deposit = deposit;
head = tl;
continue;
@@ -3679,7 +3679,7 @@ postgres_get_coin_transactions (void *cls,
int nrows;
int i;
PGresult *result;
- struct TALER_MINTDB_TransactionList *tl;
+ struct TALER_EXCHANGEDB_TransactionList *tl;
/* check if the melt record exists and get it */
result = GNUNET_PQ_exec_prepared (session->conn,
@@ -3694,9 +3694,9 @@ postgres_get_coin_transactions (void *cls,
nrows = PQntuples (result);
for (i=0;icoin.coin_pub = *coin_pub;
}
- tl = GNUNET_new (struct TALER_MINTDB_TransactionList);
+ tl = GNUNET_new (struct TALER_EXCHANGEDB_TransactionList);
tl->next = head;
- tl->type = TALER_MINTDB_TT_REFRESH_MELT;
+ tl->type = TALER_EXCHANGEDB_TT_REFRESH_MELT;
tl->details.melt = melt;
head = tl;
continue;
@@ -3752,9 +3752,9 @@ postgres_get_coin_transactions (void *cls,
*/
static int
postgres_lookup_wire_transfer (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_WireTransferIdentifierRawP *wtid,
- TALER_MINTDB_WireTransferDataCallback cb,
+ TALER_EXCHANGEDB_WireTransferDataCallback cb,
void *cb_cls)
{
PGresult *result;
@@ -3843,13 +3843,13 @@ postgres_lookup_wire_transfer (void *cls,
*/
static int
postgres_wire_lookup_deposit_wtid (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_contract,
const struct GNUNET_HashCode *h_wire,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_MerchantPublicKeyP *merchant_pub,
uint64_t transaction_id,
- TALER_MINTDB_DepositWtidCallback cb,
+ TALER_EXCHANGEDB_DepositWtidCallback cb,
void *cb_cls)
{
PGresult *result;
@@ -3987,12 +3987,12 @@ postgres_wire_lookup_deposit_wtid (void *cls,
* @param transaction_id merchant's transaction ID for the payment
* @param coin_pub which public key was this payment about
* @param coin_value amount contributed by this coin in total
- * @param coin_fee deposit fee charged by mint for this coin
+ * @param coin_fee deposit fee charged by exchange for this coin
* @return #GNUNET_OK on success, #GNUNET_SYSERR on DB errors
*/
static int
postgres_insert_aggregation_tracking (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_WireTransferIdentifierRawP *wtid,
const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct GNUNET_HashCode *h_wire,
@@ -4049,14 +4049,14 @@ postgres_insert_aggregation_tracking (void *cls,
*/
static int
postgres_wire_prepare_data_insert (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const char *type,
const char *buf,
size_t buf_size)
{
PGresult *result;
struct GNUNET_PQ_QueryParam params[] = {
- GNUNET_PQ_query_param_fixed_size (type, strlen (type) + 1),
+ GNUNET_PQ_query_param_string (type),
GNUNET_PQ_query_param_fixed_size (buf, buf_size),
GNUNET_PQ_query_param_end
};
@@ -4085,7 +4085,7 @@ postgres_wire_prepare_data_insert (void *cls,
*/
static int
postgres_wire_prepare_data_mark_finished (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
unsigned long long rowid)
{
uint64_t serial_id = rowid;
@@ -4125,14 +4125,14 @@ postgres_wire_prepare_data_mark_finished (void *cls,
*/
static int
postgres_wire_prepare_data_get (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const char *type,
- TALER_MINTDB_WirePreparationCallback cb,
+ TALER_EXCHANGEDB_WirePreparationCallback cb,
void *cb_cls)
{
PGresult *result;
struct GNUNET_PQ_QueryParam params[] = {
- GNUNET_PQ_query_param_fixed_size (type, strlen (type) + 1),
+ GNUNET_PQ_query_param_string (type),
GNUNET_PQ_query_param_end
};
@@ -4194,14 +4194,14 @@ postgres_wire_prepare_data_get (void *cls,
* Initialize Postgres database subsystem.
*
* @param cls a configuration instance
- * @return NULL on error, otherwise a `struct TALER_MINTDB_Plugin`
+ * @return NULL on error, otherwise a `struct TALER_EXCHANGEDB_Plugin`
*/
void *
-libtaler_plugin_mintdb_postgres_init (void *cls)
+libtaler_plugin_exchangedb_postgres_init (void *cls)
{
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
struct PostgresClosure *pg;
- struct TALER_MINTDB_Plugin *plugin;
+ struct TALER_EXCHANGEDB_Plugin *plugin;
pg = GNUNET_new (struct PostgresClosure);
@@ -4214,17 +4214,17 @@ libtaler_plugin_mintdb_postgres_init (void *cls)
}
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
- "mintdb-postgres",
+ "exchangedb-postgres",
"db_conn_str",
&pg->connection_cfg_str))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mintdb-postgres",
+ "exchangedb-postgres",
"db_conn_str");
GNUNET_free (pg);
return NULL;
}
- plugin = GNUNET_new (struct TALER_MINTDB_Plugin);
+ plugin = GNUNET_new (struct TALER_EXCHANGEDB_Plugin);
plugin->cls = pg;
plugin->get_session = &postgres_get_session;
plugin->drop_temporary = &postgres_drop_temporary;
@@ -4277,13 +4277,13 @@ libtaler_plugin_mintdb_postgres_init (void *cls)
/**
* Shutdown Postgres database subsystem.
*
- * @param cls a `struct TALER_MINTDB_Plugin`
+ * @param cls a `struct TALER_EXCHANGEDB_Plugin`
* @return NULL (always)
*/
void *
-libtaler_plugin_mintdb_postgres_done (void *cls)
+libtaler_plugin_exchangedb_postgres_done (void *cls)
{
- struct TALER_MINTDB_Plugin *plugin = cls;
+ struct TALER_EXCHANGEDB_Plugin *plugin = cls;
struct PostgresClosure *pg = plugin->cls;
GNUNET_free (pg->connection_cfg_str);
@@ -4292,4 +4292,4 @@ libtaler_plugin_mintdb_postgres_done (void *cls)
return NULL;
}
-/* end of plugin_mintdb_postgres.c */
+/* end of plugin_exchangedb_postgres.c */
diff --git a/src/exchangedb/test-exchange-db-postgres.conf b/src/exchangedb/test-exchange-db-postgres.conf
new file mode 100644
index 000000000..0822bab44
--- /dev/null
+++ b/src/exchangedb/test-exchange-db-postgres.conf
@@ -0,0 +1,8 @@
+[exchange]
+#The DB plugin to use
+DB = postgres
+
+[exchangedb-postgres]
+
+#The connection string the plugin has to use for connecting to the database
+DB_CONN_STR = postgres:///talercheck
diff --git a/src/mintdb/test_mintdb.c b/src/exchangedb/test_exchangedb.c
similarity index 82%
rename from src/mintdb/test_mintdb.c
rename to src/exchangedb/test_exchangedb.c
index 0938f8fab..f2c473fd9 100644
--- a/src/mintdb/test_mintdb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -14,13 +14,14 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mintdb/test_mintdb.c
+ * @file exchangedb/test_exchangedb.c
* @brief test cases for DB interaction functions
* @author Sree Harsha Totakura
*/
#include "platform.h"
-#include "taler_mintdb_lib.h"
-#include "taler_mintdb_plugin.h"
+#include "taler_exchangedb_lib.h"
+#include "taler_json_lib.h"
+#include "taler_exchangedb_plugin.h"
static int result;
@@ -41,7 +42,7 @@ static int result;
#define CURRENCY "EUR"
-static struct TALER_MINTDB_Plugin *plugin;
+static struct TALER_EXCHANGEDB_Plugin *plugin;
/**
* Checks if the given reserve has the given amount of balance and expiry
@@ -55,13 +56,13 @@ static struct TALER_MINTDB_Plugin *plugin;
* as the given parameters; #GNUNET_SYSERR if not
*/
static int
-check_reserve (struct TALER_MINTDB_Session *session,
+check_reserve (struct TALER_EXCHANGEDB_Session *session,
const struct TALER_ReservePublicKeyP *pub,
uint64_t value,
uint32_t fraction,
const char *currency)
{
- struct TALER_MINTDB_Reserve reserve;
+ struct TALER_EXCHANGEDB_Reserve reserve;
reserve.pub = *pub;
@@ -109,14 +110,14 @@ destroy_denom_key_pair (struct DenomKeyPair *dkp)
*/
static struct DenomKeyPair *
create_denom_key_pair (unsigned int size,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_Amount *value,
const struct TALER_Amount *fee_withdraw,
const struct TALER_Amount *fee_deposit,
const struct TALER_Amount *fee_refresh)
{
struct DenomKeyPair *dkp;
- struct TALER_MINTDB_DenominationKeyIssueInformation dki;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation dki;
dkp = GNUNET_new (struct DenomKeyPair);
dkp->priv.rsa_private_key = GNUNET_CRYPTO_rsa_private_key_create (size);
@@ -128,7 +129,7 @@ create_denom_key_pair (unsigned int size,
are not properly initialized for this test. */
memset (&dki,
0,
- sizeof (struct TALER_MINTDB_DenominationKeyIssueInformation));
+ sizeof (struct TALER_EXCHANGEDB_DenominationKeyIssueInformation));
dki.denom_pub = dkp->pub;
dki.issue.properties.start = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
dki.issue.properties.expire_withdraw = GNUNET_TIME_absolute_hton
@@ -168,12 +169,12 @@ static struct TALER_Amount fee_refresh;
static struct TALER_Amount amount_with_fee;
static void
-free_refresh_commit_coins_array(struct TALER_MINTDB_RefreshCommitCoin
+free_refresh_commit_coins_array(struct TALER_EXCHANGEDB_RefreshCommitCoin
*commit_coins,
unsigned int size)
{
unsigned int cnt;
- struct TALER_MINTDB_RefreshCommitCoin *ccoin;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *ccoin;
struct TALER_RefreshLinkEncrypted *rlink;
for (cnt = 0; cnt < size; cnt++)
@@ -189,15 +190,15 @@ free_refresh_commit_coins_array(struct TALER_MINTDB_RefreshCommitCoin
#define MELT_NEW_COINS 5
static int
-test_refresh_commit_coins (struct TALER_MINTDB_Session *session,
- struct TALER_MINTDB_RefreshSession *refresh_session,
+test_refresh_commit_coins (struct TALER_EXCHANGEDB_Session *session,
+ struct TALER_EXCHANGEDB_RefreshSession *refresh_session,
const struct GNUNET_HashCode *session_hash)
{
- struct TALER_MINTDB_RefreshCommitCoin *commit_coins;
- struct TALER_MINTDB_RefreshCommitCoin *ret_commit_coins;
- struct TALER_MINTDB_RefreshCommitCoin *a_ccoin;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *ret_commit_coins;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *a_ccoin;
struct TALER_RefreshLinkEncrypted *a_rlink;
- struct TALER_MINTDB_RefreshCommitCoin *b_ccoin;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *b_ccoin;
struct TALER_RefreshLinkEncrypted *b_rlink;
size_t size;
unsigned int cnt;
@@ -208,12 +209,12 @@ test_refresh_commit_coins (struct TALER_MINTDB_Session *session,
ret = GNUNET_SYSERR;
ret_commit_coins = NULL;
commit_coins = GNUNET_new_array (MELT_NEW_COINS,
- struct TALER_MINTDB_RefreshCommitCoin);
+ struct TALER_EXCHANGEDB_RefreshCommitCoin);
cnc_index = (uint16_t) GNUNET_CRYPTO_random_u32
(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_MIN (MELT_NEW_COINS, UINT16_MAX));
for (cnt=0; cnt < MELT_NEW_COINS; cnt++)
{
- struct TALER_MINTDB_RefreshCommitCoin *ccoin;
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *ccoin;
struct TALER_RefreshLinkEncrypted *rlink;
ccoin = &commit_coins[cnt];
size = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
@@ -241,7 +242,7 @@ test_refresh_commit_coins (struct TALER_MINTDB_Session *session,
MELT_NEW_COINS,
commit_coins));
ret_commit_coins = GNUNET_new_array (MELT_NEW_COINS,
- struct TALER_MINTDB_RefreshCommitCoin);
+ struct TALER_EXCHANGEDB_RefreshCommitCoin);
FAILIF (GNUNET_OK !=
plugin->get_refresh_commit_coins (plugin->cls,
session,
@@ -286,16 +287,16 @@ test_refresh_commit_coins (struct TALER_MINTDB_Session *session,
* @return #GNUNET_OK if everything went well; #GNUNET_SYSERR if not
*/
static int
-test_melting (struct TALER_MINTDB_Session *session)
+test_melting (struct TALER_EXCHANGEDB_Session *session)
{
#define MELT_OLD_COINS 10
- struct TALER_MINTDB_RefreshSession refresh_session;
- struct TALER_MINTDB_RefreshSession ret_refresh_session;
+ struct TALER_EXCHANGEDB_RefreshSession refresh_session;
+ struct TALER_EXCHANGEDB_RefreshSession ret_refresh_session;
struct GNUNET_HashCode session_hash;
struct DenomKeyPair *dkp;
struct DenomKeyPair **new_dkp;
/* struct TALER_CoinPublicInfo *coins; */
- struct TALER_MINTDB_RefreshMelt *melts;
+ struct TALER_EXCHANGEDB_RefreshMelt *melts;
struct TALER_DenominationPublicKey *new_denom_pubs;
struct TALER_DenominationPublicKey *ret_denom_pubs;
unsigned int cnt;
@@ -332,14 +333,18 @@ test_melting (struct TALER_MINTDB_Session *session)
&fee_deposit,
&fee_refresh);
/* create MELT_OLD_COINS number of refresh melts */
- melts = GNUNET_new_array (MELT_OLD_COINS, struct TALER_MINTDB_RefreshMelt);
+ melts = GNUNET_new_array (MELT_OLD_COINS, struct TALER_EXCHANGEDB_RefreshMelt);
for (cnt=0; cnt < MELT_OLD_COINS; cnt++)
{
+ struct GNUNET_HashCode hc;
+
RND_BLK (&melts[cnt].coin.coin_pub);
+ GNUNET_CRYPTO_hash (&melts[cnt].coin.coin_pub,
+ sizeof (melts[cnt].coin.coin_pub),
+ &hc);
melts[cnt].coin.denom_sig.rsa_signature =
- GNUNET_CRYPTO_rsa_sign (dkp->priv.rsa_private_key,
- &melts[cnt].coin.coin_pub,
- sizeof (melts[cnt].coin.coin_pub));
+ GNUNET_CRYPTO_rsa_sign_fdh (dkp->priv.rsa_private_key,
+ &hc);
melts[cnt].coin.denom_pub = dkp->pub;
RND_BLK (&melts[cnt].coin_sig);
melts[cnt].session_hash = session_hash;
@@ -352,7 +357,7 @@ test_melting (struct TALER_MINTDB_Session *session)
}
for (cnt = 0; cnt < MELT_OLD_COINS; cnt++)
{
- struct TALER_MINTDB_RefreshMelt ret_melt;
+ struct TALER_EXCHANGEDB_RefreshMelt ret_melt;
FAILIF (GNUNET_OK != plugin->get_refresh_melt (plugin->cls,
session,
&session_hash,
@@ -542,31 +547,90 @@ cb_wtid_check (void *cls,
}
+/**
+ * Function called with details about deposits that
+ * have been made. Called in the test on the
+ * deposit given in @a cls.
+ *
+ * @param cls closure a `struct TALER_EXCHANGEDB_Deposit *`
+ * @param rowid unique ID for the deposit in our DB, used for marking
+ * it as 'tiny' or 'done'
+ * @param merchant_pub public key of the merchant
+ * @param coin_pub public key of the coin
+ * @param amount_with_fee amount that was deposited including fee
+ * @param deposit_fee amount the exchange gets to keep as transaction fees
+ * @param transaction_id unique transaction ID chosen by the merchant
+ * @param h_contract hash of the contract between merchant and customer
+ * @param wire_deadline by which the merchant adviced that he would like the
+ * wire transfer to be executed
+ * @param wire wire details for the merchant, NULL from iterate_matching_deposits()
+ * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR if deposit does
+ * not match our expectations
+ */
+static int
+deposit_cb (void *cls,
+ unsigned long long rowid,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_Amount *amount_with_fee,
+ const struct TALER_Amount *deposit_fee,
+ uint64_t transaction_id,
+ const struct GNUNET_HashCode *h_contract,
+ struct GNUNET_TIME_Absolute wire_deadline,
+ const json_t *wire)
+{
+ struct TALER_EXCHANGEDB_Deposit *deposit = cls;
+ struct GNUNET_HashCode h_wire;
+
+ if (NULL != wire)
+ TALER_JSON_hash (wire, &h_wire);
+ if ( (0 != memcmp (merchant_pub,
+ &deposit->merchant_pub,
+ sizeof (struct TALER_MerchantPublicKeyP))) ||
+ (0 != TALER_amount_cmp (amount_with_fee,
+ &deposit->amount_with_fee)) ||
+ (0 != TALER_amount_cmp (deposit_fee,
+ &deposit->deposit_fee)) ||
+ (0 != memcmp (h_contract,
+ &deposit->h_contract,
+ sizeof (struct GNUNET_HashCode))) ||
+ (0 != memcmp (coin_pub,
+ &deposit->coin.coin_pub,
+ sizeof (struct TALER_CoinSpendPublicKeyP))) ||
+ (transaction_id != deposit->transaction_id) ||
+ ( (NULL != wire) &&
+ (0 != memcmp (&h_wire,
+ &deposit->h_wire,
+ sizeof (struct GNUNET_HashCode))) ) )
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+
+ return GNUNET_OK;
+}
+
+
/**
* Main function that will be run by the scheduler.
*
- * @param cls closure
- * @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used (for saving, can be NULL!)
- * @param cfg configuration
+ * @param cls closure with config
*/
static void
-run (void *cls,
- char *const *args,
- const char *cfgfile,
- const struct GNUNET_CONFIGURATION_Handle *cfg)
+run (void *cls)
{
- struct TALER_MINTDB_Session *session;
+ struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+ struct TALER_EXCHANGEDB_Session *session;
struct TALER_ReservePublicKeyP reserve_pub;
struct DenomKeyPair *dkp;
- struct TALER_MINTDB_CollectableBlindcoin cbc;
- struct TALER_MINTDB_CollectableBlindcoin cbc2;
- struct TALER_MINTDB_ReserveHistory *rh;
- struct TALER_MINTDB_ReserveHistory *rh_head;
- struct TALER_MINTDB_BankTransfer *bt;
- struct TALER_MINTDB_CollectableBlindcoin *withdraw;
- struct TALER_MINTDB_Deposit deposit;
- struct TALER_MINTDB_Deposit deposit2;
+ struct TALER_EXCHANGEDB_CollectableBlindcoin cbc;
+ struct TALER_EXCHANGEDB_CollectableBlindcoin cbc2;
+ struct TALER_EXCHANGEDB_ReserveHistory *rh;
+ struct TALER_EXCHANGEDB_ReserveHistory *rh_head;
+ struct TALER_EXCHANGEDB_BankTransfer *bt;
+ struct TALER_EXCHANGEDB_CollectableBlindcoin *withdraw;
+ struct TALER_EXCHANGEDB_Deposit deposit;
+ struct TALER_EXCHANGEDB_Deposit deposit2;
struct TALER_WireTransferIdentifierRawP wtid;
json_t *wire;
json_t *just;
@@ -587,7 +651,7 @@ run (void *cls,
ZR_BLK (&cbc);
ZR_BLK (&cbc2);
if (NULL ==
- (plugin = TALER_MINTDB_plugin_load (cfg)))
+ (plugin = TALER_EXCHANGEDB_plugin_load (cfg)))
{
result = 1;
return;
@@ -654,6 +718,7 @@ run (void *cls,
value.value * 2,
value.fraction * 2,
value.currency));
+ result = 5;
dkp = create_denom_key_pair (1024, session,
&value,
&fee_withdraw,
@@ -663,9 +728,8 @@ run (void *cls,
RND_BLK(&cbc.reserve_sig);
cbc.denom_pub = dkp->pub;
cbc.sig.rsa_signature
- = GNUNET_CRYPTO_rsa_sign (dkp->priv.rsa_private_key,
- &cbc.h_coin_envelope,
- sizeof (cbc.h_coin_envelope));
+ = GNUNET_CRYPTO_rsa_sign_fdh (dkp->priv.rsa_private_key,
+ &cbc.h_coin_envelope);
cbc.reserve_pub = reserve_pub;
cbc.amount_with_fee = value;
GNUNET_assert (GNUNET_OK ==
@@ -692,10 +756,12 @@ run (void *cls,
FAILIF (0 != memcmp (&cbc2.reserve_pub,
&cbc.reserve_pub,
sizeof (cbc2.reserve_pub)));
+ result = 6;
FAILIF (GNUNET_OK !=
GNUNET_CRYPTO_rsa_verify (&cbc.h_coin_envelope,
cbc2.sig.rsa_signature,
dkp->pub.rsa_public_key));
+ result = 7;
rh = plugin->get_reserve_history (plugin->cls,
session,
&reserve_pub);
@@ -705,7 +771,7 @@ run (void *cls,
{
switch (rh_head->type)
{
- case TALER_MINTDB_RO_BANK_TO_MINT:
+ case TALER_EXCHANGEDB_RO_BANK_TO_EXCHANGE:
bt = rh_head->details.bank;
FAILIF (0 != memcmp (&bt->reserve_pub,
&reserve_pub,
@@ -716,7 +782,7 @@ run (void *cls,
FAILIF (0 != strcmp (CURRENCY, bt->amount.currency));
FAILIF (NULL == bt->wire);
break;
- case TALER_MINTDB_RO_WITHDRAW_COIN:
+ case TALER_EXCHANGEDB_RO_WITHDRAW_COIN:
withdraw = rh_head->details.withdraw;
FAILIF (0 != memcmp (&withdraw->reserve_pub,
&reserve_pub,
@@ -736,14 +802,16 @@ run (void *cls,
RND_BLK (&deposit.csig);
RND_BLK (&deposit.merchant_pub);
RND_BLK (&deposit.h_contract);
- RND_BLK (&deposit.h_wire);
wire = json_loads (json_wire_str, 0, NULL);
+ TALER_JSON_hash (wire,
+ &deposit.h_wire);
deposit.wire = wire;
deposit.transaction_id =
GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX);
deposit.amount_with_fee = value;
GNUNET_assert (GNUNET_OK ==
TALER_amount_get_zero (CURRENCY, &deposit.deposit_fee));
+ result = 8;
FAILIF (GNUNET_OK !=
plugin->insert_deposit (plugin->cls,
session, &deposit));
@@ -751,6 +819,15 @@ run (void *cls,
plugin->have_deposit (plugin->cls,
session,
&deposit));
+ result = 9;
+ FAILIF (1 !=
+ plugin->iterate_matching_deposits (plugin->cls,
+ session,
+ &deposit.h_wire,
+ &deposit.merchant_pub,
+ &deposit_cb, &deposit,
+ 2));
+ result = 10;
deposit2 = deposit;
deposit2.transaction_id++; /* should fail if transaction id is different */
FAILIF (GNUNET_NO !=
@@ -857,7 +934,7 @@ run (void *cls,
if (NULL != cbc2.sig.rsa_signature)
GNUNET_CRYPTO_rsa_signature_free (cbc2.sig.rsa_signature);
dkp = NULL;
- TALER_MINTDB_plugin_unload (plugin);
+ TALER_EXCHANGEDB_plugin_unload (plugin);
plugin = NULL;
}
@@ -866,41 +943,37 @@ int
main (int argc,
char *const argv[])
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- GNUNET_GETOPT_OPTION_END
- };
- char *argv2[] = {
- "test-mint-db-", /* will be replaced later */
- "-c", "test-mint-db-.conf", /* will be replaced later */
- NULL,
- };
- const char *plugin_name;
- char *config_filename;
- char *testname;
+ const char *plugin_name;
+ char *config_filename;
+ char *testname;
+ struct GNUNET_CONFIGURATION_Handle *cfg;
- result = -1;
- if (NULL == (plugin_name = strrchr (argv[0], (int) '-')))
- {
- GNUNET_break (0);
- return -1;
- }
- plugin_name++;
- (void) GNUNET_asprintf (&testname,
- "test-mint-db-%s", plugin_name);
- (void) GNUNET_asprintf (&config_filename,
- "%s.conf", testname);
- argv2[0] = argv[0];
- argv2[2] = config_filename;
- if (GNUNET_OK !=
- GNUNET_PROGRAM_run ((sizeof (argv2)/sizeof (char *)) - 1, argv2,
- testname,
- "Test cases for mint database helper functions.",
- options, &run, NULL))
+ result = -1;
+ if (NULL == (plugin_name = strrchr (argv[0], (int) '-')))
{
+ GNUNET_break (0);
+ return -1;
+ }
+ GNUNET_log_setup (argv[0],
+ "WARNING",
+ NULL);
+ plugin_name++;
+ (void) GNUNET_asprintf (&testname,
+ "test-exchange-db-%s", plugin_name);
+ (void) GNUNET_asprintf (&config_filename,
+ "%s.conf", testname);
+ cfg = GNUNET_CONFIGURATION_create ();
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_parse (cfg,
+ config_filename))
+ {
+ GNUNET_break (0);
GNUNET_free (config_filename);
GNUNET_free (testname);
- return 3;
+ return 2;
}
+ GNUNET_SCHEDULER_run (&run, cfg);
+ GNUNET_CONFIGURATION_destroy (cfg);
GNUNET_free (config_filename);
GNUNET_free (testname);
return result;
diff --git a/src/mintdb/test_mintdb_deposits.c b/src/exchangedb/test_exchangedb_deposits.c
similarity index 82%
rename from src/mintdb/test_mintdb_deposits.c
rename to src/exchangedb/test_exchangedb_deposits.c
index 3ce0a35a5..09c65b2b2 100644
--- a/src/mintdb/test_mintdb_deposits.c
+++ b/src/exchangedb/test_exchangedb_deposits.c
@@ -14,18 +14,18 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mint/test_mint_deposits.c
- * @brief testcase for mint deposits
+ * @file exchange/test_exchange_deposits.c
+ * @brief testcase for exchange deposits
* @author Sree Harsha Totakura
*/
#include "platform.h"
#include
#include
#include "taler_pq_lib.h"
-#include "taler_mintdb_lib.h"
-#include "taler_mintdb_plugin.h"
+#include "taler_exchangedb_lib.h"
+#include "taler_exchangedb_plugin.h"
-#define MINT_CURRENCY "EUR"
+#define EXCHANGE_CURRENCY "EUR"
#define DB_URI "postgres:///taler"
@@ -56,7 +56,7 @@ static int result;
/**
* The plugin.
*/
-static struct TALER_MINTDB_Plugin *plugin;
+static struct TALER_EXCHANGEDB_Plugin *plugin;
/**
* Main function that will be run by the scheduler.
@@ -78,23 +78,23 @@ run (void *cls,
"\"NAME\":\"GNUNET E.V\","
"\"BIC\":\"GENODEF1SRL\""
"}";
- struct TALER_MINTDB_Deposit *deposit;
+ struct TALER_EXCHANGEDB_Deposit *deposit;
uint64_t transaction_id;
- struct TALER_MINTDB_Session *session;
+ struct TALER_EXCHANGEDB_Session *session;
deposit = NULL;
- EXITIF (NULL == (plugin = TALER_MINTDB_plugin_load (cfg)));
+ EXITIF (NULL == (plugin = TALER_EXCHANGEDB_plugin_load (cfg)));
EXITIF (GNUNET_OK !=
plugin->create_tables (plugin->cls,
! persistent));
session = plugin->get_session (plugin->cls,
! persistent);
EXITIF (NULL == session);
- deposit = GNUNET_malloc (sizeof (struct TALER_MINTDB_Deposit) + sizeof (wire));
+ deposit = GNUNET_malloc (sizeof (struct TALER_EXCHANGEDB_Deposit) + sizeof (wire));
/* Makeup a random coin public key */
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
deposit,
- sizeof (struct TALER_MINTDB_Deposit));
+ sizeof (struct TALER_EXCHANGEDB_Deposit));
/* Makeup a random 64bit transaction ID */
transaction_id = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
UINT64_MAX);
@@ -104,8 +104,8 @@ run (void *cls,
htonl (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX));
deposit->amount_with_fee.fraction =
htonl (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX));
- GNUNET_assert (strlen (MINT_CURRENCY) < sizeof (deposit->amount_with_fee.currency));
- strcpy (deposit->amount_with_fee.currency, MINT_CURRENCY);
+ GNUNET_assert (strlen (EXCHANGE_CURRENCY) < sizeof (deposit->amount_with_fee.currency));
+ strcpy (deposit->amount_with_fee.currency, EXCHANGE_CURRENCY);
/* Copy wireformat */
deposit->wire = json_loads (wire, 0, NULL);
EXITIF (GNUNET_OK !=
@@ -122,7 +122,7 @@ run (void *cls,
GNUNET_free_non_null (deposit);
if (NULL != plugin)
{
- TALER_MINTDB_plugin_unload (plugin);
+ TALER_EXCHANGEDB_plugin_unload (plugin);
plugin = NULL;
}
}
@@ -144,8 +144,8 @@ main (int argc,
result = GNUNET_SYSERR;
if (GNUNET_OK !=
GNUNET_PROGRAM_run (argc, argv,
- "test-mint-deposits",
- "testcase for mint deposits",
+ "test-exchange-deposits",
+ "testcase for exchange deposits",
options, &run, NULL))
return 3;
return (GNUNET_OK == result) ? 0 : 1;
diff --git a/src/mintdb/test_mintdb_keyio.c b/src/exchangedb/test_exchangedb_keyio.c
similarity index 83%
rename from src/mintdb/test_mintdb_keyio.c
rename to src/exchangedb/test_exchangedb_keyio.c
index aa1ba2f20..2485da8ae 100644
--- a/src/mintdb/test_mintdb_keyio.c
+++ b/src/exchangedb/test_exchangedb_keyio.c
@@ -14,14 +14,14 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file mint/test_mint_common.c
- * @brief test cases for some functions in mint/mint_common.c
+ * @file exchange/test_exchange_common.c
+ * @brief test cases for some functions in exchange/exchange_common.c
* @author Sree Harsha Totakura
*/
#include "platform.h"
#include "gnunet/gnunet_util_lib.h"
#include "taler_signatures.h"
-#include "taler_mintdb_lib.h"
+#include "taler_exchangedb_lib.h"
#define RSA_KEY_SIZE 1024
@@ -36,10 +36,10 @@ int
main (int argc,
const char *const argv[])
{
- struct TALER_MINTDB_DenominationKeyIssueInformation dki;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation dki;
char *enc;
size_t enc_size;
- struct TALER_MINTDB_DenominationKeyIssueInformation dki_read;
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation dki_read;
char *enc_read;
size_t enc_read_size;
char *tmpfile;
@@ -58,9 +58,9 @@ main (int argc,
= GNUNET_CRYPTO_rsa_private_key_create (RSA_KEY_SIZE);
enc_size = GNUNET_CRYPTO_rsa_private_key_encode (dki.denom_priv.rsa_private_key,
&enc);
- EXITIF (NULL == (tmpfile = GNUNET_DISK_mktemp ("test_mint_common")));
- EXITIF (GNUNET_OK != TALER_MINTDB_denomination_key_write (tmpfile, &dki));
- EXITIF (GNUNET_OK != TALER_MINTDB_denomination_key_read (tmpfile, &dki_read));
+ EXITIF (NULL == (tmpfile = GNUNET_DISK_mktemp ("test_exchange_common")));
+ EXITIF (GNUNET_OK != TALER_EXCHANGEDB_denomination_key_write (tmpfile, &dki));
+ EXITIF (GNUNET_OK != TALER_EXCHANGEDB_denomination_key_read (tmpfile, &dki_read));
enc_read_size = GNUNET_CRYPTO_rsa_private_key_encode (dki_read.denom_priv.rsa_private_key,
&enc_read);
EXITIF (enc_size != enc_read_size);
diff --git a/src/exchangedb/test_perf_taler_exchangedb.c b/src/exchangedb/test_perf_taler_exchangedb.c
new file mode 100644
index 000000000..a4ec9591d
--- /dev/null
+++ b/src/exchangedb/test_perf_taler_exchangedb.c
@@ -0,0 +1,182 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2014, 2015 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+ */
+/**
+ * @file exchangedb/test_perf_taler_exchangedb.c
+ * @brief Exchange database performance analysis
+ * @author Nicolas Fournier
+ */
+#include "platform.h"
+#include "perf_taler_exchangedb_interpreter.h"
+#include "perf_taler_exchangedb_init.h"
+
+
+#define NB_DENOMINATION_INIT 2
+#define NB_DENOMINATION_SAVE 2
+
+#define NB_RESERVE_INIT 4
+#define NB_RESERVE_SAVE 1
+
+#define NB_DEPOSIT_INIT 1
+#define NB_DEPOSIT_SAVE 1
+
+#define NB_WITHDRAW_INIT 1
+#define NB_WITHDRAW_SAVE 1
+
+/**
+ * Allocate, copies and free all the data used in the interpreter
+ * Used to check for memory leaks
+ */
+static void
+test_allocate ()
+{
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki, *dki_copy;
+ struct PERF_TALER_EXCHANGEDB_Reserve *reserve, *reserve_copy;
+ struct PERF_TALER_EXCHANGEDB_Coin *coin, *coin_copy;
+ struct TALER_EXCHANGEDB_Deposit *deposit, *deposit_copy;
+
+ dki = PERF_TALER_EXCHANGEDB_denomination_init ();
+ reserve = PERF_TALER_EXCHANGEDB_reserve_init ();
+ coin = PERF_TALER_EXCHANGEDB_coin_init (dki,
+ reserve);
+ deposit = PERF_TALER_EXCHANGEDB_deposit_init (coin);
+
+ dki_copy = PERF_TALER_EXCHANGEDB_denomination_copy (dki);
+ reserve_copy = PERF_TALER_EXCHANGEDB_reserve_copy (reserve);
+ coin_copy = PERF_TALER_EXCHANGEDB_coin_copy (coin);
+ deposit_copy = PERF_TALER_EXCHANGEDB_deposit_copy (deposit);
+
+ PERF_TALER_EXCHANGEDB_denomination_free (dki);
+ PERF_TALER_EXCHANGEDB_denomination_free (dki_copy);
+ PERF_TALER_EXCHANGEDB_reserve_free (reserve);
+ PERF_TALER_EXCHANGEDB_reserve_free (reserve_copy);
+ PERF_TALER_EXCHANGEDB_coin_free (coin);
+ PERF_TALER_EXCHANGEDB_coin_free (coin_copy);
+ PERF_TALER_EXCHANGEDB_deposit_free (deposit);
+ PERF_TALER_EXCHANGEDB_deposit_free (deposit_copy);
+}
+
+/**
+ * Runs the performances tests for the exchange database
+ * and logs the results using Gauger
+ */
+int
+main (int argc, char ** argv)
+{
+ int ret = 0;
+ struct PERF_TALER_EXCHANGEDB_Cmd init[] =
+ {
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END ("init")
+ };
+ struct PERF_TALER_EXCHANGEDB_Cmd benchmark[] =
+ {
+ // Denomination used to create coins
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("00 - Start of interpreter"),
+
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("01 - denomination loop",
+ NB_DENOMINATION_INIT),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION ("01 - start transaction"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_DENOMINATION ("01 - denomination"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_DENOMINATION ("01 - insert",
+ "01 - denomination"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION ("01 - commit transaction"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination",
+ "01 - denomination loop",
+ "01 - denomination",
+ NB_DENOMINATION_SAVE),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("01 - denomination loop end",
+ "01 - denomination loop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("01 - init denomination complete"),
+ // End of initialization
+ // Reserve initialization
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("02 - init reserve loop",
+ NB_RESERVE_INIT),
+
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_RESERVE ("02 - reserve"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_RESERVE ("02 - insert",
+ "02 - reserve"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve",
+ "02 - init reserve loop",
+ "02 - reserve",
+ NB_RESERVE_SAVE),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("02 - init reserve end loop",
+ "02 - init reserve loop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("02 - reserve init complete"),
+ // End reserve init
+ // Withdrawal initialization
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("03 - init withdraw loop",
+ NB_WITHDRAW_INIT),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION ("03 - start transaction"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("03 - denomination load",
+ "03 - init withdraw loop",
+ "01 - save denomination"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("03 - reserve load",
+ "03 - init withdraw loop",
+ "02 - save reserve"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_WITHDRAW ("03 - withdraw",
+ "03 - denomination load",
+ "03 - reserve load"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_WITHDRAW ("03 - insert withdraw",
+ "03 - withdraw"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION ("03 - commit transaction"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("03 - coin array",
+ "03 - init withdraw loop",
+ "03 - withdraw",
+ NB_WITHDRAW_SAVE),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("03 - withdraw init end loop",
+ "03 - init withdraw loop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("03 - withdraw init complete"),
+ //End of withdrawal initialization
+ //Deposit initialization
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("04 - time start"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("04 - deposit init loop",
+ NB_DEPOSIT_INIT),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION ("04 - start transaction"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("04 - coin load",
+ "04 - deposit init loop",
+ "03 - coin array"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_DEPOSIT ("04 - deposit",
+ "04 - coin load"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_DEPOSIT ("04 - insert deposit",
+ "04 - deposit"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION ("04 - commit transaction"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("04 - deposit array",
+ "04 - deposit init loop",
+ "04 - deposit",
+ NB_DEPOSIT_SAVE),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("04 - deposit init loop end",
+ "04 - deposit init loop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("04 - time stop"),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("04 - gauger",
+ "04 - time start",
+ "04 - time stop",
+ "TEST",
+ "time to insert a deposit",
+ "deposit/sec",
+ NB_DEPOSIT_SAVE),
+ PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("04 - deposit init complete"),
+ // End of deposit initialization
+ PERF_TALER_EXCHANGEDB_INIT_CMD_END ("end"),
+ };
+
+ test_allocate ();
+ ret = PERF_TALER_EXCHANGEDB_run_benchmark ("test-perf-taler-exchangedb",
+ "./test-exchange-db-postgres.conf",
+ init,
+ benchmark);
+ if (GNUNET_SYSERR == ret)
+ return 1;
+ return 0;
+}
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 4d7ae3cb2..310263f0b 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -13,12 +13,13 @@ else
talerinclude_HEADERS = \
platform.h \
taler_amount_lib.h \
+ taler_bank_service.h \
taler_crypto_lib.h \
taler_json_lib.h \
taler_util.h \
- taler_mint_service.h \
- taler_mintdb_lib.h \
- taler_mintdb_plugin.h \
+ taler_exchange_service.h \
+ taler_exchangedb_lib.h \
+ taler_exchangedb_plugin.h \
taler_pq_lib.h \
taler_signatures.h \
taler_wire_lib.h \
diff --git a/src/include/taler_amount_lib.h b/src/include/taler_amount_lib.h
index 094b96f7f..2fd547196 100644
--- a/src/include/taler_amount_lib.h
+++ b/src/include/taler_amount_lib.h
@@ -127,6 +127,19 @@ TALER_string_to_amount (const char *str,
struct TALER_Amount *denom);
+/**
+ * Parse denomination description, in the format "T:V.F".
+ *
+ * @param str denomination description
+ * @param denom denomination to write the result to, in NBO
+ * @return #GNUNET_OK if the string is a valid denomination specification,
+ * #GNUNET_SYSERR if it is invalid.
+ */
+int
+TALER_string_to_amount_nbo (const char *str,
+ struct TALER_AmountNBO *denom);
+
+
/**
* Get the value of "zero" in a particular currency.
*
diff --git a/src/include/taler_bank_service.h b/src/include/taler_bank_service.h
index a4f33fc97..920ae47fd 100644
--- a/src/include/taler_bank_service.h
+++ b/src/include/taler_bank_service.h
@@ -22,6 +22,7 @@
#ifndef _TALER_BANK_SERVICE_H
#define _TALER_BANK_SERVICE_H
+#include
#include "taler_util.h"
/* ********************* event loop *********************** */
@@ -117,10 +118,12 @@ struct TALER_BANK_AdminAddIncomingHandle;
* @param cls closure
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
* 0 if the bank's reply is bogus (fails to follow the protocol)
+ * @param json detailed response from the HTTPD, or NULL if reply was not in JSON
*/
typedef void
(*TALER_BANK_AdminAddIncomingResultCallback) (void *cls,
- unsigned int http_status);
+ unsigned int http_status,
+ json_t *json);
/**
@@ -133,7 +136,8 @@ typedef void
* @param reserve_pub public key of the reserve
* @param amount amount that was deposited
* @param execution_date when did we receive the amount
- * @param account_no account number (53 bits at most)
+ * @param debit_account_no account number to withdraw from (53 bits at most)
+ * @param credit_account_no account number to deposit into (53 bits at most)
* @param res_cb the callback to call when the final result for this request is available
* @param res_cb_cls closure for the above callback
* @return NULL
@@ -144,7 +148,8 @@ struct TALER_BANK_AdminAddIncomingHandle *
TALER_BANK_admin_add_incoming (struct TALER_BANK_Context *bank,
const struct TALER_WireTransferIdentifierRawP *wtid,
const struct TALER_Amount *amount,
- uint64_t account_no,
+ uint64_t debit_account_no,
+ uint64_t credit_account_no,
TALER_BANK_AdminAddIncomingResultCallback res_cb,
void *res_cb_cls);
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 6056270fa..a3275b74d 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -140,23 +140,23 @@ struct TALER_TransferPrivateKeyP
/**
- * @brief Type of online public keys used by the mint to sign
+ * @brief Type of online public keys used by the exchange to sign
* messages.
*/
-struct TALER_MintPublicKeyP
+struct TALER_ExchangePublicKeyP
{
/**
- * Taler uses EdDSA for online mint message signing.
+ * Taler uses EdDSA for online exchange message signing.
*/
struct GNUNET_CRYPTO_EddsaPublicKey eddsa_pub;
};
/**
- * @brief Type of online public keys used by the mint to
+ * @brief Type of online public keys used by the exchange to
* sign messages.
*/
-struct TALER_MintPrivateKeyP
+struct TALER_ExchangePrivateKeyP
{
/**
* Taler uses EdDSA for online signatures sessions.
@@ -166,9 +166,9 @@ struct TALER_MintPrivateKeyP
/**
- * @brief Type of signatures used by the mint to sign messages online.
+ * @brief Type of signatures used by the exchange to sign messages online.
*/
-struct TALER_MintSignatureP
+struct TALER_ExchangeSignatureP
{
/**
* Taler uses EdDSA for online signatures sessions.
@@ -178,7 +178,7 @@ struct TALER_MintSignatureP
/**
- * @brief Type of the offline master public key used by the mint.
+ * @brief Type of the offline master public key used by the exchange.
*/
struct TALER_MasterPublicKeyP
{
@@ -214,7 +214,7 @@ struct TALER_AuditorSignatureP
/**
- * @brief Type of the offline master public keys used by the mint.
+ * @brief Type of the offline master public keys used by the exchange.
*/
struct TALER_MasterPrivateKeyP
{
@@ -226,7 +226,7 @@ struct TALER_MasterPrivateKeyP
/**
- * @brief Type of signatures by the offline master public key used by the mint.
+ * @brief Type of signatures by the offline master public key used by the exchange.
*/
struct TALER_MasterSignatureP
{
@@ -299,7 +299,7 @@ struct TALER_DenominationSignature
/**
* Taler uses RSA for blinding.
*/
- struct GNUNET_CRYPTO_rsa_Signature *rsa_signature;
+ struct GNUNET_CRYPTO_RsaSignature *rsa_signature;
};
@@ -311,7 +311,7 @@ struct TALER_DenominationPublicKey
/**
* Taler uses RSA for signing coins.
*/
- struct GNUNET_CRYPTO_rsa_PublicKey *rsa_public_key;
+ struct GNUNET_CRYPTO_RsaPublicKey *rsa_public_key;
};
@@ -323,7 +323,7 @@ struct TALER_DenominationPrivateKey
/**
* Taler uses RSA for signing coins.
*/
- struct GNUNET_CRYPTO_rsa_PrivateKey *rsa_private_key;
+ struct GNUNET_CRYPTO_RsaPrivateKey *rsa_private_key;
};
@@ -464,8 +464,8 @@ struct TALER_WireTransferIdentifierRawP
/**
* Binary information encoded in Crockford's Base32 in wire transfer
* subjects of transfers from Taler to a merchant. The actual value
- * is chosen by the mint and has no particular semantics, other than
- * being unique so that the mint can lookup details about the wire
+ * is chosen by the exchange and has no particular semantics, other than
+ * being unique so that the exchange can lookup details about the wire
* transfer when needed.
*/
struct TALER_WireTransferIdentifierP
diff --git a/src/include/taler_mint_service.h b/src/include/taler_exchange_service.h
similarity index 54%
rename from src/include/taler_mint_service.h
rename to src/include/taler_exchange_service.h
index 1502edfbc..4a1592cf2 100644
--- a/src/include/taler_mint_service.h
+++ b/src/include/taler_exchange_service.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
+ Copyright (C) 2014, 2015, 2016 GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
@@ -14,14 +14,15 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file include/taler_mint_service.h
- * @brief C interface of libtalermint, a C library to use mint's HTTP API
+ * @file include/taler_exchange_service.h
+ * @brief C interface of libtalerexchange, a C library to use exchange's HTTP API
* @author Sree Harsha Totakura
* @author Christian Grothoff
*/
-#ifndef _TALER_MINT_SERVICE_H
-#define _TALER_MINT_SERVICE_H
+#ifndef _TALER_EXCHANGE_SERVICE_H
+#define _TALER_EXCHANGE_SERVICE_H
+#include
#include "taler_util.h"
/* ********************* event loop *********************** */
@@ -30,7 +31,7 @@
* @brief Handle to this library context. This is where the
* main event loop logic lives.
*/
-struct TALER_MINT_Context;
+struct TALER_EXCHANGE_Context;
/**
@@ -39,18 +40,18 @@ struct TALER_MINT_Context;
*
* @return the context, NULL on error (failure to initialize)
*/
-struct TALER_MINT_Context *
-TALER_MINT_init (void);
+struct TALER_EXCHANGE_Context *
+TALER_EXCHANGE_init (void);
/**
* Obtain the information for a select() call to wait until
- * #TALER_MINT_perform() is ready again. Note that calling
- * any other TALER_MINT-API may also imply that the library
- * is again ready for #TALER_MINT_perform().
+ * #TALER_EXCHANGE_perform() is ready again. Note that calling
+ * any other TALER_EXCHANGE-API may also imply that the library
+ * is again ready for #TALER_EXCHANGE_perform().
*
* Basically, a client should use this API to prepare for select(),
- * then block on select(), then call #TALER_MINT_perform() and then
+ * then block on select(), then call #TALER_EXCHANGE_perform() and then
* start again until the work with the context is done.
*
* This function will NOT zero out the sets and assumes that @a max_fd
@@ -69,15 +70,15 @@ TALER_MINT_init (void);
* to be passed to select().)
* @param timeout set to the timeout in milliseconds (!); -1 means
* no timeout (NULL, blocking forever is OK), 0 means to
- * proceed immediately with #TALER_MINT_perform().
+ * proceed immediately with #TALER_EXCHANGE_perform().
*/
void
-TALER_MINT_get_select_info (struct TALER_MINT_Context *ctx,
- fd_set *read_fd_set,
- fd_set *write_fd_set,
- fd_set *except_fd_set,
- int *max_fd,
- long *timeout);
+TALER_EXCHANGE_get_select_info (struct TALER_EXCHANGE_Context *ctx,
+ fd_set *read_fd_set,
+ fd_set *write_fd_set,
+ fd_set *except_fd_set,
+ int *max_fd,
+ long *timeout);
/**
@@ -86,7 +87,7 @@ TALER_MINT_get_select_info (struct TALER_MINT_Context *ctx,
* @param ctx the library context
*/
void
-TALER_MINT_perform (struct TALER_MINT_Context *ctx);
+TALER_EXCHANGE_perform (struct TALER_EXCHANGE_Context *ctx);
/**
@@ -97,7 +98,7 @@ TALER_MINT_perform (struct TALER_MINT_Context *ctx);
* @param ctx the library context
*/
void
-TALER_MINT_fini (struct TALER_MINT_Context *ctx);
+TALER_EXCHANGE_fini (struct TALER_EXCHANGE_Context *ctx);
/* ********************* /keys *********************** */
@@ -105,27 +106,27 @@ TALER_MINT_fini (struct TALER_MINT_Context *ctx);
/**
* List of possible options to be passed to
- * #TALER_MINT_connect().
+ * #TALER_EXCHANGE_connect().
*/
-enum TALER_MINT_Option
+enum TALER_EXCHANGE_Option
{
/**
* Terminator (end of option list).
*/
- TALER_MINT_OPTION_END = 0
+ TALER_EXCHANGE_OPTION_END = 0
};
/**
- * @brief Mint's signature key
+ * @brief Exchange's signature key
*/
-struct TALER_MINT_SigningPublicKey
+struct TALER_EXCHANGE_SigningPublicKey
{
/**
* The signing public key
*/
- struct TALER_MintPublicKeyP key;
+ struct TALER_ExchangePublicKeyP key;
/**
* Validity start time
@@ -140,9 +141,9 @@ struct TALER_MINT_SigningPublicKey
/**
- * @brief Public information about a mint's denomination key
+ * @brief Public information about a exchange's denomination key
*/
-struct TALER_MINT_DenomPublicKey
+struct TALER_EXCHANGE_DenomPublicKey
{
/**
* The public key
@@ -173,7 +174,7 @@ struct TALER_MINT_DenomPublicKey
/**
* When do signatures with this denomination key become invalid?
* After this point, these signatures cannot be used in (legal)
- * disputes anymore, as the Mint is then allowed to destroy its side
+ * disputes anymore, as the Exchange is then allowed to destroy its side
* of the evidence. @e expire_legal is expected to be significantly
* larger than @e expire_spend (by a year or more).
*/
@@ -202,24 +203,24 @@ struct TALER_MINT_DenomPublicKey
/**
- * @brief Information we get from the mint about auditors.
+ * @brief Information we get from the exchange about auditors.
*/
-struct TALER_MINT_AuditorInformation
+struct TALER_EXCHANGE_AuditorInformation
{
/**
- * Public key of the auditing institution.
+ * Public key of the auditing institution. Wallets and merchants
+ * are expected to be configured with a set of public keys of
+ * auditors that they deem acceptable. These public keys are
+ * the roots of the Taler PKI.
*/
struct TALER_AuditorPublicKeyP auditor_pub;
/**
- * URL of the auditing institution. The application must check that
- * this is an acceptable auditor for its purpose and also verify
- * that the @a auditor_pub matches the auditor's public key given at
- * that website. We expect that in practice software is going to
- * often ship with an initial list of accepted auditors, just like
- * browsers ship with a CA root store.
- *
- * This field may be NULL. (#3987).
+ * URL of the auditing institution. Signed by the auditor's public
+ * key, this URL is a place where applications can direct users for
+ * additional information about the auditor. In the future, there
+ * should also be an auditor API for automated submission about
+ * claims of misbehaving exchange providers.
*/
const char *auditor_url;
@@ -229,40 +230,40 @@ struct TALER_MINT_AuditorInformation
unsigned int num_denom_keys;
/**
- * Array of length @a denom_keys with the denomination
+ * Array of length @a num_denom_keys with the denomination
* keys audited by this auditor. Note that the array
* elements point to the same locations as the entries
* in the key's main `denom_keys` array.
*/
- const struct TALER_MINT_DenomPublicKey **denom_keys;
+ const struct TALER_EXCHANGE_DenomPublicKey **denom_keys;
};
/**
- * @brief Information about keys from the mint.
+ * @brief Information about keys from the exchange.
*/
-struct TALER_MINT_Keys
+struct TALER_EXCHANGE_Keys
{
/**
- * Long-term offline signing key of the mint.
+ * Long-term offline signing key of the exchange.
*/
struct TALER_MasterPublicKeyP master_pub;
/**
- * Array of the mint's online signing keys.
+ * Array of the exchange's online signing keys.
*/
- struct TALER_MINT_SigningPublicKey *sign_keys;
+ struct TALER_EXCHANGE_SigningPublicKey *sign_keys;
/**
- * Array of the mint's denomination keys.
+ * Array of the exchange's denomination keys.
*/
- struct TALER_MINT_DenomPublicKey *denom_keys;
+ struct TALER_EXCHANGE_DenomPublicKey *denom_keys;
/**
- * Array of the keys of the auditors of the mint.
+ * Array of the keys of the auditors of the exchange.
*/
- struct TALER_MINT_AuditorInformation *auditors;
+ struct TALER_EXCHANGE_AuditorInformation *auditors;
/**
* Length of the @e sign_keys array.
@@ -284,102 +285,102 @@ struct TALER_MINT_Keys
/**
* Function called with information about who is auditing
- * a particular mint and what key the mint is using.
+ * a particular exchange and what key the exchange is using.
*
* @param cls closure
* @param keys information about the various keys used
- * by the mint
+ * by the exchange
*/
typedef void
-(*TALER_MINT_CertificationCallback) (void *cls,
- const struct TALER_MINT_Keys *keys);
+(*TALER_EXCHANGE_CertificationCallback) (void *cls,
+ const struct TALER_EXCHANGE_Keys *keys);
/**
- * @brief Handle to the mint. This is where we interact with
- * a particular mint and keep the per-mint information.
+ * @brief Handle to the exchange. This is where we interact with
+ * a particular exchange and keep the per-exchange information.
*/
-struct TALER_MINT_Handle;
+struct TALER_EXCHANGE_Handle;
/**
- * Initialise a connection to the mint. Will connect to the
- * mint and obtain information about the mint's master public
- * key and the mint's auditor. The respective information will
+ * Initialise a connection to the exchange. Will connect to the
+ * exchange and obtain information about the exchange's master public
+ * key and the exchange's auditor. The respective information will
* be passed to the @a cert_cb once available, and all future
- * interactions with the mint will be checked to be signed
+ * interactions with the exchange will be checked to be signed
* (where appropriate) by the respective master key.
*
* @param ctx the context
- * @param url HTTP base URL for the mint
- * @param cert_cb function to call with the mint's certification information
+ * @param url HTTP base URL for the exchange
+ * @param cert_cb function to call with the exchange's certification information
* @param cert_cb_cls closure for @a cert_cb
- * @param ... list of additional arguments, terminated by #TALER_MINT_OPTION_END.
- * @return the mint handle; NULL upon error
+ * @param ... list of additional arguments, terminated by #TALER_EXCHANGE_OPTION_END.
+ * @return the exchange handle; NULL upon error
*/
-struct TALER_MINT_Handle *
-TALER_MINT_connect (struct TALER_MINT_Context *ctx,
- const char *url,
- TALER_MINT_CertificationCallback cert_cb,
- void *cert_cb_cls,
- ...);
+struct TALER_EXCHANGE_Handle *
+TALER_EXCHANGE_connect (struct TALER_EXCHANGE_Context *ctx,
+ const char *url,
+ TALER_EXCHANGE_CertificationCallback cert_cb,
+ void *cert_cb_cls,
+ ...);
/**
- * Disconnect from the mint.
+ * Disconnect from the exchange.
*
- * @param mint the mint handle
+ * @param exchange the exchange handle
*/
void
-TALER_MINT_disconnect (struct TALER_MINT_Handle *mint);
+TALER_EXCHANGE_disconnect (struct TALER_EXCHANGE_Handle *exchange);
/**
- * Obtain the keys from the mint.
+ * Obtain the keys from the exchange.
*
- * @param mint the mint handle
- * @return the mint's key set
+ * @param exchange the exchange handle
+ * @return the exchange's key set
*/
-const struct TALER_MINT_Keys *
-TALER_MINT_get_keys (const struct TALER_MINT_Handle *mint);
+const struct TALER_EXCHANGE_Keys *
+TALER_EXCHANGE_get_keys (const struct TALER_EXCHANGE_Handle *exchange);
/**
- * Test if the given @a pub is a the current signing key from the mint
+ * Test if the given @a pub is a the current signing key from the exchange
* according to @a keys.
*
- * @param keys the mint's key set
- * @param pub claimed current online signing key for the mint
+ * @param keys the exchange's key set
+ * @param pub claimed current online signing key for the exchange
* @return #GNUNET_OK if @a pub is (according to /keys) a current signing key
*/
int
-TALER_MINT_test_signing_key (const struct TALER_MINT_Keys *keys,
- const struct TALER_MintPublicKeyP *pub);
+TALER_EXCHANGE_test_signing_key (const struct TALER_EXCHANGE_Keys *keys,
+ const struct TALER_ExchangePublicKeyP *pub);
/**
- * Obtain the denomination key details from the mint.
+ * Obtain the denomination key details from the exchange.
*
- * @param keys the mint's key set
+ * @param keys the exchange's key set
* @param pk public key of the denomination to lookup
* @return details about the given denomination key, NULL if the key is not
* found
*/
-const struct TALER_MINT_DenomPublicKey *
-TALER_MINT_get_denomination_key (const struct TALER_MINT_Keys *keys,
- const struct TALER_DenominationPublicKey *pk);
+const struct TALER_EXCHANGE_DenomPublicKey *
+TALER_EXCHANGE_get_denomination_key (const struct TALER_EXCHANGE_Keys *keys,
+ const struct TALER_DenominationPublicKey *pk);
/**
- * Obtain the denomination key details from the mint.
+ * Obtain the denomination key details from the exchange.
*
- * @param keys the mint's key set
+ * @param keys the exchange's key set
* @param hc hash of the public key of the denomination to lookup
* @return details about the given denomination key
*/
-const struct TALER_MINT_DenomPublicKey *
-TALER_MINT_get_denomination_key_by_hash (const struct TALER_MINT_Keys *keys,
- const struct GNUNET_HashCode *hc);
+const struct TALER_EXCHANGE_DenomPublicKey *
+TALER_EXCHANGE_get_denomination_key_by_hash (const struct TALER_EXCHANGE_Keys *keys,
+ const struct GNUNET_HashCode *hc);
/* ********************* /wire *********************** */
@@ -388,70 +389,52 @@ TALER_MINT_get_denomination_key_by_hash (const struct TALER_MINT_Keys *keys,
/**
* @brief A Wire format inquiry handle
*/
-struct TALER_MINT_WireHandle;
+struct TALER_EXCHANGE_WireHandle;
/**
* Callbacks of this type are used to serve the result of submitting a
- * wire format inquiry request to a mint.
+ * wire format inquiry request to a exchange.
*
- * The callback is invoked multiple times, once for each supported @a
- * method. Finally, it is invoked one more time with cls/0/NULL/NULL
- * to indicate the end of the iteration. If any request fails to
- * generate a valid response from the mint, @a http_status will also
- * be zero and the iteration will also end. Thus, the iteration
- * always ends with a final call with an @a http_status of 0. If the
- * @a http_status is already 0 on the first call, then the response to
- * the /wire request was invalid. Later, clients can tell the
- * difference between @a http_status of 0 indicating a failed
- * /wire/method request and a regular end of the iteration by @a
- * method being non-NULL. If the mint simply correctly asserts that
- * it does not support any methods, @a method will be NULL but the @a
- * http_status will be #MHD_HTTP_OK for the first call (followed by a
- * cls/0/NULL/NULL call to signal the end of the iteration).
+ * If the request fails to generate a valid response from the
+ * exchange, @a http_status will also be zero.
*
* @param cls closure
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful request;
- * 0 if the mint's reply is bogus (fails to follow the protocol)
- * @param method wire format method supported, i.e. "test" or "sepa", or NULL
- * if already the /wire request failed.
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param obj the received JSON reply, if successful this should be the wire
- * format details as provided by /wire/METHOD/, or NULL if the
- * reply was not in JSON format (in this case, the client might
- * want to do an HTTP request to /wire/METHOD/ with a browser to
- * provide more information to the user about the @a method).
+ * format details as provided by /wire, or NULL if the
+ * reply was not in JSON format.
*/
typedef void
-(*TALER_MINT_WireResultCallback) (void *cls,
- unsigned int http_status,
- const char *method,
- json_t *obj);
+(*TALER_EXCHANGE_WireResultCallback) (void *cls,
+ unsigned int http_status,
+ json_t *obj);
/**
- * Obtain information about a mint's wire instructions.
- * A mint may provide wire instructions for creating
- * a reserve. The wire instructions also indicate
- * which wire formats merchants may use with the mint.
- * This API is typically used by a wallet for wiring
- * funds, and possibly by a merchant to determine
- * supported wire formats.
+ * Obtain information about a exchange's wire instructions. A
+ * exchange may provide wire instructions for creating a reserve. The
+ * wire instructions also indicate which wire formats merchants may
+ * use with the exchange. This API is typically used by a wallet for
+ * wiring funds, and possibly by a merchant to determine supported
+ * wire formats.
*
* Note that while we return the (main) response verbatim to the
* caller for further processing, we do already verify that the
* response is well-formed (i.e. that signatures included in the
- * response are all valid). If the mint's reply is not well-formed,
- * we return an HTTP status code of zero to @a cb.
+ * response are all valid). If the exchange's reply is not
+ * well-formed, we return an HTTP status code of zero to @a cb.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param wire_cb the callback to call when a reply for this request is available
* @param wire_cb_cls closure for the above callback
* @return a handle for this request
*/
-struct TALER_MINT_WireHandle *
-TALER_MINT_wire (struct TALER_MINT_Handle *mint,
- TALER_MINT_WireResultCallback wire_cb,
- void *wire_cb_cls);
+struct TALER_EXCHANGE_WireHandle *
+TALER_EXCHANGE_wire (struct TALER_EXCHANGE_Handle *exchange,
+ TALER_EXCHANGE_WireResultCallback wire_cb,
+ void *wire_cb_cls);
/**
@@ -461,7 +444,7 @@ TALER_MINT_wire (struct TALER_MINT_Handle *mint,
* @param wh the wire information request handle
*/
void
-TALER_MINT_wire_cancel (struct TALER_MINT_WireHandle *wh);
+TALER_EXCHANGE_wire_cancel (struct TALER_EXCHANGE_WireHandle *wh);
/* ********************* /deposit *********************** */
@@ -470,75 +453,75 @@ TALER_MINT_wire_cancel (struct TALER_MINT_WireHandle *wh);
/**
* @brief A Deposit Handle
*/
-struct TALER_MINT_DepositHandle;
+struct TALER_EXCHANGE_DepositHandle;
/**
* Callbacks of this type are used to serve the result of submitting a
- * deposit permission request to a mint.
+ * deposit permission request to a exchange.
*
* @param cls closure
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful deposit;
- * 0 if the mint's reply is bogus (fails to follow the protocol)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param obj the received JSON reply, should be kept as proof (and, in case of errors,
* be forwarded to the customer)
*/
typedef void
-(*TALER_MINT_DepositResultCallback) (void *cls,
- unsigned int http_status,
- json_t *obj);
+(*TALER_EXCHANGE_DepositResultCallback) (void *cls,
+ unsigned int http_status,
+ json_t *obj);
/**
- * Submit a deposit permission to the mint and get the mint's
+ * Submit a deposit permission to the exchange and get the exchange's
* response. This API is typically used by a merchant. Note that
* while we return the response verbatim to the caller for further
* processing, we do already verify that the response is well-formed
* (i.e. that signatures included in the response are all valid). If
- * the mint's reply is not well-formed, we return an HTTP status code
+ * the exchange's reply is not well-formed, we return an HTTP status code
* of zero to @a cb.
*
* We also verify that the @a coin_sig is valid for this deposit
* request, and that the @a ub_sig is a valid signature for @a
- * coin_pub. Also, the @a mint must be ready to operate (i.e. have
+ * coin_pub. Also, the @a exchange must be ready to operate (i.e. have
* finished processing the /keys reply). If either check fails, we do
- * NOT initiate the transaction with the mint and instead return NULL.
+ * NOT initiate the transaction with the exchange and instead return NULL.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param amount the amount to be deposited
- * @param wire_deadline execution date, until which the merchant would like the mint to settle the balance (advisory, the mint cannot be
- * forced to settle in the past or upon very short notice, but of course a well-behaved mint will limit aggregation based on the advice received)
- * @param wire_details the merchant’s account details, in a format supported by the mint
- * @param h_contract hash of the contact of the merchant with the customer (further details are never disclosed to the mint)
+ * @param wire_deadline execution date, until which the merchant would like the exchange to settle the balance (advisory, the exchange cannot be
+ * forced to settle in the past or upon very short notice, but of course a well-behaved exchange will limit aggregation based on the advice received)
+ * @param wire_details the merchant’s account details, in a format supported by the exchange
+ * @param h_contract hash of the contact of the merchant with the customer (further details are never disclosed to the exchange)
* @param coin_pub coin’s public key
* @param denom_pub denomination key with which the coin is signed
- * @param denom_sig mint’s unblinded signature of the coin
- * @param timestamp timestamp when the contract was finalized, must match approximately the current time of the mint
+ * @param denom_sig exchange’s unblinded signature of the coin
+ * @param timestamp timestamp when the contract was finalized, must match approximately the current time of the exchange
* @param transaction_id transaction id for the transaction between merchant and customer
* @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests)
- * @param refund_deadline date until which the merchant can issue a refund to the customer via the mint (can be zero if refunds are not allowed)
+ * @param refund_deadline date until which the merchant can issue a refund to the customer via the exchange (can be zero if refunds are not allowed)
* @param coin_sig the signature made with purpose #TALER_SIGNATURE_WALLET_COIN_DEPOSIT made by the customer with the coin’s private key.
* @param cb the callback to call when a reply for this request is available
* @param cb_cls closure for the above callback
* @return a handle for this request; NULL if the inputs are invalid (i.e.
* signatures fail to verify). In this case, the callback is not called.
*/
-struct TALER_MINT_DepositHandle *
-TALER_MINT_deposit (struct TALER_MINT_Handle *mint,
- const struct TALER_Amount *amount,
- struct GNUNET_TIME_Absolute wire_deadline,
- json_t *wire_details,
- const struct GNUNET_HashCode *h_contract,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- const struct TALER_DenominationSignature *denom_sig,
- const struct TALER_DenominationPublicKey *denom_pub,
- struct GNUNET_TIME_Absolute timestamp,
- uint64_t transaction_id,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- struct GNUNET_TIME_Absolute refund_deadline,
- const struct TALER_CoinSpendSignatureP *coin_sig,
- TALER_MINT_DepositResultCallback cb,
- void *cb_cls);
+struct TALER_EXCHANGE_DepositHandle *
+TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
+ const struct TALER_Amount *amount,
+ struct GNUNET_TIME_Absolute wire_deadline,
+ json_t *wire_details,
+ const struct GNUNET_HashCode *h_contract,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_DenominationSignature *denom_sig,
+ const struct TALER_DenominationPublicKey *denom_pub,
+ struct GNUNET_TIME_Absolute timestamp,
+ uint64_t transaction_id,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ struct GNUNET_TIME_Absolute refund_deadline,
+ const struct TALER_CoinSpendSignatureP *coin_sig,
+ TALER_EXCHANGE_DepositResultCallback cb,
+ void *cb_cls);
/**
@@ -548,7 +531,7 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint,
* @param deposit the deposit permission request handle
*/
void
-TALER_MINT_deposit_cancel (struct TALER_MINT_DepositHandle *deposit);
+TALER_EXCHANGE_deposit_cancel (struct TALER_EXCHANGE_DepositHandle *deposit);
/* ********************* /reserve/status *********************** */
@@ -557,23 +540,23 @@ TALER_MINT_deposit_cancel (struct TALER_MINT_DepositHandle *deposit);
/**
* @brief A /reserve/status Handle
*/
-struct TALER_MINT_ReserveStatusHandle;
+struct TALER_EXCHANGE_ReserveStatusHandle;
/**
* Ways how a reserve's balance may change.
*/
-enum TALER_MINT_ReserveTransactionType {
+enum TALER_EXCHANGE_ReserveTransactionType {
/**
* Deposit into the reserve.
*/
- TALER_MINT_RTT_DEPOSIT,
+ TALER_EXCHANGE_RTT_DEPOSIT,
/**
* Withdrawal from the reserve.
*/
- TALER_MINT_RTT_WITHDRAWAL
+ TALER_EXCHANGE_RTT_WITHDRAWAL
};
@@ -581,13 +564,13 @@ enum TALER_MINT_ReserveTransactionType {
/**
* @brief Entry in the reserve's transaction history.
*/
-struct TALER_MINT_ReserveHistory
+struct TALER_EXCHANGE_ReserveHistory
{
/**
* Type of the transaction.
*/
- enum TALER_MINT_ReserveTransactionType type;
+ enum TALER_EXCHANGE_ReserveTransactionType type;
/**
* Amount transferred (in or out).
@@ -616,46 +599,46 @@ struct TALER_MINT_ReserveHistory
/**
* Callbacks of this type are used to serve the result of submitting a
- * deposit permission request to a mint.
+ * reserve status request to a exchange.
*
* @param cls closure
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
- * 0 if the mint's reply is bogus (fails to follow the protocol)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param[in] json original response in JSON format (useful only for diagnostics)
* @param balance current balance in the reserve, NULL on error
* @param history_length number of entries in the transaction history, 0 on error
* @param history detailed transaction history, NULL on error
*/
typedef void
-(*TALER_MINT_ReserveStatusResultCallback) (void *cls,
- unsigned int http_status,
- json_t *json,
- const struct TALER_Amount *balance,
- unsigned int history_length,
- const struct TALER_MINT_ReserveHistory *history);
+(*TALER_EXCHANGE_ReserveStatusResultCallback) (void *cls,
+ unsigned int http_status,
+ json_t *json,
+ const struct TALER_Amount *balance,
+ unsigned int history_length,
+ const struct TALER_EXCHANGE_ReserveHistory *history);
/**
* Submit a request to obtain the transaction history of a reserve
- * from the mint. Note that while we return the full response to the
+ * from the exchange. Note that while we return the full response to the
* caller for further processing, we do already verify that the
* response is well-formed (i.e. that signatures included in the
- * response are all valid and add up to the balance). If the mint's
+ * response are all valid and add up to the balance). If the exchange's
* reply is not well-formed, we return an HTTP status code of zero to
* @a cb.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param reserve_pub public key of the reserve to inspect
* @param cb the callback to call when a reply for this request is available
* @param cb_cls closure for the above callback
* @return a handle for this request; NULL if the inputs are invalid (i.e.
* signatures fail to verify). In this case, the callback is not called.
*/
-struct TALER_MINT_ReserveStatusHandle *
-TALER_MINT_reserve_status (struct TALER_MINT_Handle *mint,
- const struct TALER_ReservePublicKeyP *reserve_pub,
- TALER_MINT_ReserveStatusResultCallback cb,
- void *cb_cls);
+struct TALER_EXCHANGE_ReserveStatusHandle *
+TALER_EXCHANGE_reserve_status (struct TALER_EXCHANGE_Handle *exchange,
+ const struct TALER_ReservePublicKeyP *reserve_pub,
+ TALER_EXCHANGE_ReserveStatusResultCallback cb,
+ void *cb_cls);
/**
@@ -665,7 +648,7 @@ TALER_MINT_reserve_status (struct TALER_MINT_Handle *mint,
* @param wsh the withdraw status request handle
*/
void
-TALER_MINT_reserve_status_cancel (struct TALER_MINT_ReserveStatusHandle *wsh);
+TALER_EXCHANGE_reserve_status_cancel (struct TALER_EXCHANGE_ReserveStatusHandle *wsh);
/* ********************* /reserve/withdraw *********************** */
@@ -674,35 +657,35 @@ TALER_MINT_reserve_status_cancel (struct TALER_MINT_ReserveStatusHandle *wsh);
/**
* @brief A /reserve/withdraw Handle
*/
-struct TALER_MINT_ReserveWithdrawHandle;
+struct TALER_EXCHANGE_ReserveWithdrawHandle;
/**
* Callbacks of this type are used to serve the result of submitting a
- * deposit permission request to a mint.
+ * withdraw request to a exchange.
*
* @param cls closure
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
- * 0 if the mint's reply is bogus (fails to follow the protocol)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param sig signature over the coin, NULL on error
- * @param full_response full response from the mint (for logging, in case of errors)
+ * @param full_response full response from the exchange (for logging, in case of errors)
*/
typedef void
-(*TALER_MINT_ReserveWithdrawResultCallback) (void *cls,
- unsigned int http_status,
- const struct TALER_DenominationSignature *sig,
- json_t *full_response);
+(*TALER_EXCHANGE_ReserveWithdrawResultCallback) (void *cls,
+ unsigned int http_status,
+ const struct TALER_DenominationSignature *sig,
+ json_t *full_response);
/**
- * Withdraw a coin from the mint using a /reserve/withdraw request. This
+ * Withdraw a coin from the exchange using a /reserve/withdraw request. This
* API is typically used by a wallet. Note that to ensure that no
* money is lost in case of hardware failures, the caller must have
* committed (most of) the arguments to disk before calling, and be
* ready to repeat the request with the same arguments in case of
* failures.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param pk kind of coin to create
* @param reserve_priv private key of the reserve to withdraw from
* @param coin_priv where to store the coin's private key,
@@ -712,16 +695,16 @@ typedef void
* @param res_cb the callback to call when the final result for this request is available
* @param res_cb_cls closure for @a res_cb
* @return NULL
- * if the inputs are invalid (i.e. denomination key not with this mint).
+ * if the inputs are invalid (i.e. denomination key not with this exchange).
* In this case, the callback is not called.
*/
-struct TALER_MINT_ReserveWithdrawHandle *
-TALER_MINT_reserve_withdraw (struct TALER_MINT_Handle *mint,
- const struct TALER_MINT_DenomPublicKey *pk,
+struct TALER_EXCHANGE_ReserveWithdrawHandle *
+TALER_EXCHANGE_reserve_withdraw (struct TALER_EXCHANGE_Handle *exchange,
+ const struct TALER_EXCHANGE_DenomPublicKey *pk,
const struct TALER_ReservePrivateKeyP *reserve_priv,
const struct TALER_CoinSpendPrivateKeyP *coin_priv,
const struct TALER_DenominationBlindingKey *blinding_key,
- TALER_MINT_ReserveWithdrawResultCallback res_cb,
+ TALER_EXCHANGE_ReserveWithdrawResultCallback res_cb,
void *res_cb_cls);
@@ -732,7 +715,7 @@ TALER_MINT_reserve_withdraw (struct TALER_MINT_Handle *mint,
* @param sign the withdraw sign request handle
*/
void
-TALER_MINT_reserve_withdraw_cancel (struct TALER_MINT_ReserveWithdrawHandle *sign);
+TALER_EXCHANGE_reserve_withdraw_cancel (struct TALER_EXCHANGE_ReserveWithdrawHandle *sign);
/* ********************* /refresh/melt+reveal ***************************** */
@@ -748,7 +731,7 @@ TALER_MINT_reserve_withdraw_cancel (struct TALER_MINT_ReserveWithdrawHandle *sig
* no money is lost in case of hardware failures, is operation does
* not actually initiate the request. Instead, it generates a buffer
* which the caller must store before proceeding with the actual call
- * to #TALER_MINT_refresh_melt() that will generate the request.
+ * to #TALER_EXCHANGE_refresh_melt() that will generate the request.
*
* This function does verify that the given request data is internally
* consistent. However, the @a melts_sigs are only verified if @a
@@ -775,21 +758,21 @@ TALER_MINT_reserve_withdraw_cancel (struct TALER_MINT_ReserveWithdrawHandle *sig
* @param fresh_pks array of @a pks_len denominations of fresh coins to create
* @param[out] res_size set to the size of the return value, or 0 on error
* @return NULL
- * if the inputs are invalid (i.e. denomination key not with this mint).
+ * if the inputs are invalid (i.e. denomination key not with this exchange).
* Otherwise, pointer to a buffer of @a res_size to store persistently
- * before proceeding to #TALER_MINT_refresh_melt().
+ * before proceeding to #TALER_EXCHANGE_refresh_melt().
* Non-null results should be freed using #GNUNET_free().
*/
char *
-TALER_MINT_refresh_prepare (unsigned int num_melts,
- const struct TALER_CoinSpendPrivateKeyP *melt_privs,
- const struct TALER_Amount *melt_amounts,
- const struct TALER_DenominationSignature *melt_sigs,
- const struct TALER_MINT_DenomPublicKey *melt_pks,
- int check_sigs,
- unsigned int fresh_pks_len,
- const struct TALER_MINT_DenomPublicKey *fresh_pks,
- size_t *res_size);
+TALER_EXCHANGE_refresh_prepare (unsigned int num_melts,
+ const struct TALER_CoinSpendPrivateKeyP *melt_privs,
+ const struct TALER_Amount *melt_amounts,
+ const struct TALER_DenominationSignature *melt_sigs,
+ const struct TALER_EXCHANGE_DenomPublicKey *melt_pks,
+ int check_sigs,
+ unsigned int fresh_pks_len,
+ const struct TALER_EXCHANGE_DenomPublicKey *fresh_pks,
+ size_t *res_size);
/* ********************* /refresh/melt ***************************** */
@@ -797,54 +780,54 @@ TALER_MINT_refresh_prepare (unsigned int num_melts,
/**
* @brief A /refresh/melt Handle
*/
-struct TALER_MINT_RefreshMeltHandle;
+struct TALER_EXCHANGE_RefreshMeltHandle;
/**
* Callbacks of this type are used to notify the application about the
* result of the /refresh/melt stage. If successful, the @a noreveal_index
- * should be committed to disk prior to proceeding #TALER_MINT_refresh_reveal().
+ * should be committed to disk prior to proceeding #TALER_EXCHANGE_refresh_reveal().
*
* @param cls closure
* @param http_status HTTP response code, never #MHD_HTTP_OK (200) as for successful intermediate response this callback is skipped.
- * 0 if the mint's reply is bogus (fails to follow the protocol)
- * @param noreveal_index choice by the mint in the cut-and-choose protocol,
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
+ * @param noreveal_index choice by the exchange in the cut-and-choose protocol,
* UINT16_MAX on error
- * @param full_response full response from the mint (for logging, in case of errors)
+ * @param full_response full response from the exchange (for logging, in case of errors)
*/
typedef void
-(*TALER_MINT_RefreshMeltCallback) (void *cls,
+(*TALER_EXCHANGE_RefreshMeltCallback) (void *cls,
unsigned int http_status,
uint16_t noreveal_index,
json_t *full_response);
/**
- * Submit a melt request to the mint and get the mint's
+ * Submit a refresh melt request to the exchange and get the exchange's
* response.
*
* This API is typically used by a wallet. Note that to ensure that
* no money is lost in case of hardware failures, the provided
* argument should have been constructed using
- * #TALER_MINT_refresh_prepare and committed to persistent storage
+ * #TALER_EXCHANGE_refresh_prepare and committed to persistent storage
* prior to calling this function.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param refresh_data_length size of the @a refresh_data (returned
- * in the `res_size` argument from #TALER_MINT_refresh_prepare())
+ * in the `res_size` argument from #TALER_EXCHANGE_refresh_prepare())
* @param refresh_data the refresh data as returned from
- #TALER_MINT_refresh_prepare())
+ #TALER_EXCHANGE_refresh_prepare())
* @param melt_cb the callback to call with the result
* @param melt_cb_cls closure for @a melt_cb
* @return a handle for this request; NULL if the argument was invalid.
* In this case, neither callback will be called.
*/
-struct TALER_MINT_RefreshMeltHandle *
-TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
- size_t refresh_data_length,
- const char *refresh_data,
- TALER_MINT_RefreshMeltCallback melt_cb,
- void *melt_cb_cls);
+struct TALER_EXCHANGE_RefreshMeltHandle *
+TALER_EXCHANGE_refresh_melt (struct TALER_EXCHANGE_Handle *exchange,
+ size_t refresh_data_length,
+ const char *refresh_data,
+ TALER_EXCHANGE_RefreshMeltCallback melt_cb,
+ void *melt_cb_cls);
/**
@@ -854,7 +837,7 @@ TALER_MINT_refresh_melt (struct TALER_MINT_Handle *mint,
* @param rmh the refresh handle
*/
void
-TALER_MINT_refresh_melt_cancel (struct TALER_MINT_RefreshMeltHandle *rmh);
+TALER_EXCHANGE_refresh_melt_cancel (struct TALER_EXCHANGE_RefreshMeltHandle *rmh);
/* ********************* /refresh/reveal ***************************** */
@@ -862,7 +845,7 @@ TALER_MINT_refresh_melt_cancel (struct TALER_MINT_RefreshMeltHandle *rmh);
/**
* Callbacks of this type are used to return the final result of
- * submitting a refresh request to a mint. If the operation was
+ * submitting a refresh request to a exchange. If the operation was
* successful, this function returns the signatures over the coins
* that were remelted. The @a coin_privs and @a sigs arrays give the
* coins in the same order (and should have the same length) in which
@@ -870,30 +853,30 @@ TALER_MINT_refresh_melt_cancel (struct TALER_MINT_RefreshMeltHandle *rmh);
*
* @param cls closure
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
- * 0 if the mint's reply is bogus (fails to follow the protocol)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param num_coins number of fresh coins created, length of the @a sigs and @a coin_privs arrays, 0 if the operation failed
* @param coin_privs array of @a num_coins private keys for the coins that were created, NULL on error
* @param sigs array of signature over @a num_coins coins, NULL on error
- * @param full_response full response from the mint (for logging, in case of errors)
+ * @param full_response full response from the exchange (for logging, in case of errors)
*/
typedef void
-(*TALER_MINT_RefreshRevealCallback) (void *cls,
- unsigned int http_status,
+(*TALER_EXCHANGE_RefreshRevealCallback) (void *cls,
+ unsigned int http_status,
- unsigned int num_coins,
- const struct TALER_CoinSpendPrivateKeyP *coin_privs,
- const struct TALER_DenominationSignature *sigs,
- json_t *full_response);
+ unsigned int num_coins,
+ const struct TALER_CoinSpendPrivateKeyP *coin_privs,
+ const struct TALER_DenominationSignature *sigs,
+ json_t *full_response);
/**
* @brief A /refresh/reveal Handle
*/
-struct TALER_MINT_RefreshRevealHandle;
+struct TALER_EXCHANGE_RefreshRevealHandle;
/**
- * Submit a /refresh/reval request to the mint and get the mint's
+ * Submit a /refresh/reval request to the exchange and get the exchange's
* response.
*
* This API is typically used by a wallet. Note that to ensure that
@@ -901,26 +884,26 @@ struct TALER_MINT_RefreshRevealHandle;
* arguments should have been committed to persistent storage
* prior to calling this function.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param refresh_data_length size of the @a refresh_data (returned
- * in the `res_size` argument from #TALER_MINT_refresh_prepare())
+ * in the `res_size` argument from #TALER_EXCHANGE_refresh_prepare())
* @param refresh_data the refresh data as returned from
- #TALER_MINT_refresh_prepare())
- * @param noreveal_index response from the mint to the
- * #TALER_MINT_refresh_melt() invocation
+ #TALER_EXCHANGE_refresh_prepare())
+ * @param noreveal_index response from the exchange to the
+ * #TALER_EXCHANGE_refresh_melt() invocation
* @param reveal_cb the callback to call with the final result of the
* refresh operation
* @param reveal_cb_cls closure for the above callback
* @return a handle for this request; NULL if the argument was invalid.
* In this case, neither callback will be called.
*/
-struct TALER_MINT_RefreshRevealHandle *
-TALER_MINT_refresh_reveal (struct TALER_MINT_Handle *mint,
- size_t refresh_data_length,
- const char *refresh_data,
- uint16_t noreveal_index,
- TALER_MINT_RefreshRevealCallback reveal_cb,
- void *reveal_cb_cls);
+struct TALER_EXCHANGE_RefreshRevealHandle *
+TALER_EXCHANGE_refresh_reveal (struct TALER_EXCHANGE_Handle *exchange,
+ size_t refresh_data_length,
+ const char *refresh_data,
+ uint16_t noreveal_index,
+ TALER_EXCHANGE_RefreshRevealCallback reveal_cb,
+ void *reveal_cb_cls);
/**
@@ -930,7 +913,7 @@ TALER_MINT_refresh_reveal (struct TALER_MINT_Handle *mint,
* @param rrh the refresh reval handle
*/
void
-TALER_MINT_refresh_reveal_cancel (struct TALER_MINT_RefreshRevealHandle *rrh);
+TALER_EXCHANGE_refresh_reveal_cancel (struct TALER_EXCHANGE_RefreshRevealHandle *rrh);
/* ********************* /refresh/link ***************************** */
@@ -939,53 +922,54 @@ TALER_MINT_refresh_reveal_cancel (struct TALER_MINT_RefreshRevealHandle *rrh);
/**
* @brief A /refresh/link Handle
*/
-struct TALER_MINT_RefreshLinkHandle;
+struct TALER_EXCHANGE_RefreshLinkHandle;
/**
* Callbacks of this type are used to return the final result of
- * submitting a /refresh/link request to a mint. If the operation was
+ * submitting a /refresh/link request to a exchange. If the operation was
* successful, this function returns the signatures over the coins
* that were created when the original coin was melted.
*
* @param cls closure
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
- * 0 if the mint's reply is bogus (fails to follow the protocol)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param num_coins number of fresh coins created, length of the @a sigs and @a coin_privs arrays, 0 if the operation failed
* @param coin_privs array of @a num_coins private keys for the coins that were created, NULL on error
* @param sigs array of signature over @a num_coins coins, NULL on error
* @param pubs array of public keys for the @a sigs, NULL on error
- * @param full_response full response from the mint (for logging, in case of errors)
+ * @param full_response full response from the exchange (for logging, in case of errors)
*/
typedef void
-(*TALER_MINT_RefreshLinkCallback) (void *cls,
- unsigned int http_status,
- unsigned int num_coins,
- const struct TALER_CoinSpendPrivateKeyP *coin_privs,
- const struct TALER_DenominationSignature *sigs,
- const struct TALER_DenominationPublicKey *pubs,
- json_t *full_response);
+(*TALER_EXCHANGE_RefreshLinkCallback) (void *cls,
+ unsigned int http_status,
+ unsigned int num_coins,
+ const struct TALER_CoinSpendPrivateKeyP *coin_privs,
+ const struct TALER_DenominationSignature *sigs,
+ const struct TALER_DenominationPublicKey *pubs,
+ json_t *full_response);
/**
- * Submit a link request to the mint and get the mint's response.
+ * Submit a refresh link request to the exchange and get the
+ * exchange's response.
*
* This API is typically not used by anyone, it is more a threat
* against those trying to receive a funds transfer by abusing the
* /refresh protocol.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param coin_priv private key to request link data for
* @param link_cb the callback to call with the useful result of the
* refresh operation the @a coin_priv was involved in (if any)
* @param link_cb_cls closure for @a link_cb
* @return a handle for this request
*/
-struct TALER_MINT_RefreshLinkHandle *
-TALER_MINT_refresh_link (struct TALER_MINT_Handle *mint,
- const struct TALER_CoinSpendPrivateKeyP *coin_priv,
- TALER_MINT_RefreshLinkCallback link_cb,
- void *link_cb_cls);
+struct TALER_EXCHANGE_RefreshLinkHandle *
+TALER_EXCHANGE_refresh_link (struct TALER_EXCHANGE_Handle *exchange,
+ const struct TALER_CoinSpendPrivateKeyP *coin_priv,
+ TALER_EXCHANGE_RefreshLinkCallback link_cb,
+ void *link_cb_cls);
/**
@@ -995,7 +979,7 @@ TALER_MINT_refresh_link (struct TALER_MINT_Handle *mint,
* @param rlh the refresh link handle
*/
void
-TALER_MINT_refresh_link_cancel (struct TALER_MINT_RefreshLinkHandle *rlh);
+TALER_EXCHANGE_refresh_link_cancel (struct TALER_EXCHANGE_RefreshLinkHandle *rlh);
/* ********************* /admin/add/incoming *********************** */
@@ -1004,31 +988,31 @@ TALER_MINT_refresh_link_cancel (struct TALER_MINT_RefreshLinkHandle *rlh);
/**
* @brief A /admin/add/incoming Handle
*/
-struct TALER_MINT_AdminAddIncomingHandle;
+struct TALER_EXCHANGE_AdminAddIncomingHandle;
/**
* Callbacks of this type are used to serve the result of submitting
- * information about an incoming transaction to a mint.
+ * information about an incoming transaction to a exchange.
*
* @param cls closure
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
- * 0 if the mint's reply is bogus (fails to follow the protocol)
- * @param full_response full response from the mint (for logging, in case of errors)
+ * 0 if the exchange's reply is bogus (fails to follow the protocol)
+ * @param full_response full response from the exchange (for logging, in case of errors)
*/
typedef void
-(*TALER_MINT_AdminAddIncomingResultCallback) (void *cls,
- unsigned int http_status,
- json_t *full_response);
+(*TALER_EXCHANGE_AdminAddIncomingResultCallback) (void *cls,
+ unsigned int http_status,
+ json_t *full_response);
/**
- * Notify the mint that we have received an incoming transaction
+ * Notify the exchange that we have received an incoming transaction
* which fills a reserve. Note that this API is an administrative
- * API and thus not accessible to typical mint clients, but only
- * to the operators of the mint.
+ * API and thus not accessible to typical exchange clients, but only
+ * to the operators of the exchange.
*
- * @param mint the mint handle; the mint must be ready to operate
+ * @param exchange the exchange handle; the exchange must be ready to operate
* @param reserve_pub public key of the reserve
* @param amount amount that was deposited
* @param execution_date when did we receive the amount
@@ -1039,14 +1023,14 @@ typedef void
* if the inputs are invalid (i.e. invalid amount).
* In this case, the callback is not called.
*/
-struct TALER_MINT_AdminAddIncomingHandle *
-TALER_MINT_admin_add_incoming (struct TALER_MINT_Handle *mint,
- const struct TALER_ReservePublicKeyP *reserve_pub,
- const struct TALER_Amount *amount,
- struct GNUNET_TIME_Absolute execution_date,
- const json_t *wire,
- TALER_MINT_AdminAddIncomingResultCallback res_cb,
- void *res_cb_cls);
+struct TALER_EXCHANGE_AdminAddIncomingHandle *
+TALER_EXCHANGE_admin_add_incoming (struct TALER_EXCHANGE_Handle *exchange,
+ const struct TALER_ReservePublicKeyP *reserve_pub,
+ const struct TALER_Amount *amount,
+ struct GNUNET_TIME_Absolute execution_date,
+ const json_t *wire,
+ TALER_EXCHANGE_AdminAddIncomingResultCallback res_cb,
+ void *res_cb_cls);
/**
@@ -1056,7 +1040,7 @@ TALER_MINT_admin_add_incoming (struct TALER_MINT_Handle *mint,
* @param aai the admin add incoming request handle
*/
void
-TALER_MINT_admin_add_incoming_cancel (struct TALER_MINT_AdminAddIncomingHandle *aai);
+TALER_EXCHANGE_admin_add_incoming_cancel (struct TALER_EXCHANGE_AdminAddIncomingHandle *aai);
/* ********************* /wire/deposits *********************** */
@@ -1064,12 +1048,12 @@ TALER_MINT_admin_add_incoming_cancel (struct TALER_MINT_AdminAddIncomingHandle *
/**
* @brief A /wire/deposits Handle
*/
-struct TALER_MINT_WireDepositsHandle;
+struct TALER_EXCHANGE_WireDepositsHandle;
/**
* Details for one of the /deposit operations that the
- * mint combined into a single wire transfer.
+ * exchange combined into a single wire transfer.
*/
struct TALER_WireDepositDetails
{
@@ -1089,7 +1073,7 @@ struct TALER_WireDepositDetails
struct TALER_Amount coin_value;
/**
- * Fee charged by the mint for the deposit.
+ * Fee charged by the exchange for the deposit.
*/
struct TALER_Amount coin_fee;
@@ -1106,41 +1090,41 @@ struct TALER_WireDepositDetails
* of the coin transactions that were combined into the wire transfer.
*
* @param cls closure
- * @param http_status HTTP status code we got, 0 on mint protocol violation
+ * @param http_status HTTP status code we got, 0 on exchange protocol violation
* @param json original json reply (may include signatures, those have then been
* validated already)
- * @param wtid extracted wire transfer identifier, or NULL if the mint could
+ * @param wtid extracted wire transfer identifier, or NULL if the exchange could
* not provide any (set only if @a http_status is #MHD_HTTP_OK)
- * @param total_amount total amount of the wire transfer, or NULL if the mint could
+ * @param total_amount total amount of the wire transfer, or NULL if the exchange could
* not provide any @a wtid (set only if @a http_status is #MHD_HTTP_OK)
* @param details_length length of the @a details array
* @param details array with details about the combined transactions
*/
typedef void
-(*TALER_MINT_WireDepositsCallback)(void *cls,
- unsigned int http_status,
- json_t *json,
- const struct GNUNET_HashCode *h_wire,
- const struct TALER_Amount *total_amount,
- unsigned int details_length,
- const struct TALER_WireDepositDetails *details);
+(*TALER_EXCHANGE_WireDepositsCallback)(void *cls,
+ unsigned int http_status,
+ json_t *json,
+ const struct GNUNET_HashCode *h_wire,
+ const struct TALER_Amount *total_amount,
+ unsigned int details_length,
+ const struct TALER_WireDepositDetails *details);
/**
- * Query the mint about which transactions were combined
+ * Query the exchange about which transactions were combined
* to create a wire transfer.
*
- * @param mint mint to query
+ * @param exchange exchange to query
* @param wtid raw wire transfer identifier to get information about
* @param cb callback to call
* @param cb_cls closure for @a cb
* @return handle to cancel operation
*/
-struct TALER_MINT_WireDepositsHandle *
-TALER_MINT_wire_deposits (struct TALER_MINT_Handle *mint,
- const struct TALER_WireTransferIdentifierRawP *wtid,
- TALER_MINT_WireDepositsCallback cb,
- void *cb_cls);
+struct TALER_EXCHANGE_WireDepositsHandle *
+TALER_EXCHANGE_wire_deposits (struct TALER_EXCHANGE_Handle *exchange,
+ const struct TALER_WireTransferIdentifierRawP *wtid,
+ TALER_EXCHANGE_WireDepositsCallback cb,
+ void *cb_cls);
/**
@@ -1150,7 +1134,7 @@ TALER_MINT_wire_deposits (struct TALER_MINT_Handle *mint,
* @param wdh the wire deposits request handle
*/
void
-TALER_MINT_wire_deposits_cancel (struct TALER_MINT_WireDepositsHandle *wdh);
+TALER_EXCHANGE_wire_deposits_cancel (struct TALER_EXCHANGE_WireDepositsHandle *wdh);
/* ********************* /deposit/wtid *********************** */
@@ -1159,34 +1143,34 @@ TALER_MINT_wire_deposits_cancel (struct TALER_MINT_WireDepositsHandle *wdh);
/**
* @brief A /deposit/wtid Handle
*/
-struct TALER_MINT_DepositWtidHandle;
+struct TALER_EXCHANGE_DepositWtidHandle;
/**
* Function called with detailed wire transfer data.
*
* @param cls closure
- * @param http_status HTTP status code we got, 0 on mint protocol violation
+ * @param http_status HTTP status code we got, 0 on exchange protocol violation
* @param json original json reply (may include signatures, those have then been
* validated already)
- * @param wtid wire transfer identifier used by the mint, NULL if mint did not
+ * @param wtid wire transfer identifier used by the exchange, NULL if exchange did not
* yet execute the transaction
* @param execution_time actual or planned execution time for the wire transfer
* @param coin_contribution contribution to the @a total_amount of the deposited coin (may be NULL)
*/
typedef void
-(*TALER_MINT_DepositWtidCallback)(void *cls,
- unsigned int http_status,
- json_t *json,
- const struct TALER_WireTransferIdentifierRawP *wtid,
- struct GNUNET_TIME_Absolute execution_time,
- const struct TALER_Amount *coin_contribution);
+(*TALER_EXCHANGE_DepositWtidCallback)(void *cls,
+ unsigned int http_status,
+ json_t *json,
+ const struct TALER_WireTransferIdentifierRawP *wtid,
+ struct GNUNET_TIME_Absolute execution_time,
+ const struct TALER_Amount *coin_contribution);
/**
* Obtain the wire transfer details for a given deposit.
*
- * @param mint the mint to query
+ * @param exchange the exchange to query
* @param merchant_priv the merchant's private key
* @param h_wire hash of merchant's wire transfer details
* @param h_contract hash of the contract
@@ -1196,15 +1180,15 @@ typedef void
* @param cb_cls closure for @a cb
* @return handle to abort request
*/
-struct TALER_MINT_DepositWtidHandle *
-TALER_MINT_deposit_wtid (struct TALER_MINT_Handle *mint,
- const struct TALER_MerchantPrivateKeyP *merchant_priv,
- const struct GNUNET_HashCode *h_wire,
- const struct GNUNET_HashCode *h_contract,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- uint64_t transaction_id,
- TALER_MINT_DepositWtidCallback cb,
- void *cb_cls);
+struct TALER_EXCHANGE_DepositWtidHandle *
+TALER_EXCHANGE_deposit_wtid (struct TALER_EXCHANGE_Handle *exchange,
+ const struct TALER_MerchantPrivateKeyP *merchant_priv,
+ const struct GNUNET_HashCode *h_wire,
+ const struct GNUNET_HashCode *h_contract,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ uint64_t transaction_id,
+ TALER_EXCHANGE_DepositWtidCallback cb,
+ void *cb_cls);
/**
@@ -1214,7 +1198,7 @@ TALER_MINT_deposit_wtid (struct TALER_MINT_Handle *mint,
* @param dwh the wire deposits request handle
*/
void
-TALER_MINT_deposit_wtid_cancel (struct TALER_MINT_DepositWtidHandle *dwh);
+TALER_EXCHANGE_deposit_wtid_cancel (struct TALER_EXCHANGE_DepositWtidHandle *dwh);
-#endif /* _TALER_MINT_SERVICE_H */
+#endif /* _TALER_EXCHANGE_SERVICE_H */
diff --git a/src/include/taler_mintdb_lib.h b/src/include/taler_exchangedb_lib.h
similarity index 58%
rename from src/include/taler_mintdb_lib.h
rename to src/include/taler_exchangedb_lib.h
index 70e314d9a..1f6445212 100644
--- a/src/include/taler_mintdb_lib.h
+++ b/src/include/taler_exchangedb_lib.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
+ Copyright (C) 2014, 2015, 2016 Inria & GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -14,62 +14,56 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file include/taler_mintdb_lib.h
- * @brief IO operations for the mint's private keys
+ * @file include/taler_exchangedb_lib.h
+ * @brief IO operations for the exchange's private keys
* @author Florian Dold
* @author Benedikt Mueller
* @author Christian Grothoff
*/
-#ifndef TALER_MINTDB_LIB_H
-#define TALER_MINTDB_LIB_H
+#ifndef TALER_EXCHANGEDB_LIB_H
+#define TALER_EXCHANGEDB_LIB_H
#include "taler_signatures.h"
/**
- * Subdirectroy under the mint's base directory which contains
- * the mint's signing keys.
+ * Subdirectroy under the exchange's base directory which contains
+ * the exchange's signing keys.
*/
-#define TALER_MINTDB_DIR_SIGNING_KEYS "signkeys"
+#define TALER_EXCHANGEDB_DIR_SIGNING_KEYS "signkeys"
/**
- * Subdirectory under the mint's base directory which contains
- * the mint's denomination keys.
+ * Subdirectory under the exchange's base directory which contains
+ * the exchange's denomination keys.
*/
-#define TALER_MINTDB_DIR_DENOMINATION_KEYS "denomkeys"
-
-/**
- * Subdirectory under the mint's base directory which contains
- * the mint's auditing information.
- */
-#define TALER_MINTDB_DIR_AUDITORS "auditors"
+#define TALER_EXCHANGEDB_DIR_DENOMINATION_KEYS "denomkeys"
GNUNET_NETWORK_STRUCT_BEGIN
/**
- * @brief On disk format used for a mint signing key. Signing keys are used
- * by the mint to affirm its messages, but not to create coins.
+ * @brief On disk format used for a exchange signing key. Signing keys are used
+ * by the exchange to affirm its messages, but not to create coins.
* Includes the private key followed by the public information about
* the signing key.
*/
-struct TALER_MINTDB_PrivateSigningKeyInformationP
+struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP
{
/**
- * Private key part of the mint's signing key.
+ * Private key part of the exchange's signing key.
*/
- struct TALER_MintPrivateKeyP signkey_priv;
+ struct TALER_ExchangePrivateKeyP signkey_priv;
/**
- * Public information about a mint signing key.
+ * Public information about a exchange signing key.
*/
- struct TALER_MintSigningKeyValidityPS issue;
+ struct TALER_ExchangeSigningKeyValidityPS issue;
};
/**
* Information about a denomination key.
*/
-struct TALER_MINTDB_DenominationKeyInformationP
+struct TALER_EXCHANGEDB_DenominationKeyInformationP
{
/**
@@ -91,7 +85,7 @@ GNUNET_NETWORK_STRUCT_END
* @brief All information about a denomination key (which is used to
* sign coins into existence).
*/
-struct TALER_MINTDB_DenominationKeyIssueInformation
+struct TALER_EXCHANGEDB_DenominationKeyIssueInformation
{
/**
* The private key of the denomination. Will be NULL if the private
@@ -109,7 +103,7 @@ struct TALER_MINTDB_DenominationKeyIssueInformation
/**
* Signed public information about a denomination key.
*/
- struct TALER_MINTDB_DenominationKeyInformationP issue;
+ struct TALER_EXCHANGEDB_DenominationKeyInformationP issue;
};
@@ -124,16 +118,16 @@ struct TALER_MINTDB_DenominationKeyIssueInformation
* #GNUNET_SYSERR to abort iteration with error!
*/
typedef int
-(*TALER_MINTDB_SigningKeyIterator)(void *cls,
- const char *filename,
- const struct TALER_MINTDB_PrivateSigningKeyInformationP *ski);
+(*TALER_EXCHANGEDB_SigningKeyIterator)(void *cls,
+ const char *filename,
+ const struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP *ski);
/**
- * Call @a it for each signing key found in the @a mint_base_dir.
+ * Call @a it for each signing key found in the @a exchange_base_dir.
*
- * @param mint_base_dir base directory for the mint,
- * the signing keys must be in the #TALER_MINTDB_DIR_SIGNING_KEYS
+ * @param exchange_base_dir base directory for the exchange,
+ * the signing keys must be in the #TALER_EXCHANGEDB_DIR_SIGNING_KEYS
* subdirectory
* @param it function to call on each signing key
* @param it_cls closure for @a it
@@ -142,9 +136,9 @@ typedef int
* files are simply skipped), -1 on error
*/
int
-TALER_MINTDB_signing_keys_iterate (const char *mint_base_dir,
- TALER_MINTDB_SigningKeyIterator it,
- void *it_cls);
+TALER_EXCHANGEDB_signing_keys_iterate (const char *exchange_base_dir,
+ TALER_EXCHANGEDB_SigningKeyIterator it,
+ void *it_cls);
@@ -159,16 +153,16 @@ TALER_MINTDB_signing_keys_iterate (const char *mint_base_dir,
* #GNUNET_SYSERR to abort iteration with error!
*/
typedef int
-(*TALER_MINTDB_DenominationKeyIterator)(void *cls,
- const char *alias,
- const struct TALER_MINTDB_DenominationKeyIssueInformation *dki);
+(*TALER_EXCHANGEDB_DenominationKeyIterator)(void *cls,
+ const char *alias,
+ const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki);
/**
- * Call @a it for each denomination key found in the @a mint_base_dir.
+ * Call @a it for each denomination key found in the @a exchange_base_dir.
*
- * @param mint_base_dir base directory for the mint,
- * the signing keys must be in the #TALER_MINTDB_DIR_DENOMINATION_KEYS
+ * @param exchange_base_dir base directory for the exchange,
+ * the signing keys must be in the #TALER_EXCHANGEDB_DIR_DENOMINATION_KEYS
* subdirectory
* @param it function to call on each denomination key found
* @param it_cls closure for @a it
@@ -178,9 +172,9 @@ typedef int
* as maybe none of the files were well-formed)
*/
int
-TALER_MINTDB_denomination_keys_iterate (const char *mint_base_dir,
- TALER_MINTDB_DenominationKeyIterator it,
- void *it_cls);
+TALER_EXCHANGEDB_denomination_keys_iterate (const char *exchange_base_dir,
+ TALER_EXCHANGEDB_DenominationKeyIterator it,
+ void *it_cls);
/**
@@ -191,8 +185,8 @@ TALER_MINTDB_denomination_keys_iterate (const char *mint_base_dir,
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure.
*/
int
-TALER_MINTDB_denomination_key_write (const char *filename,
- const struct TALER_MINTDB_DenominationKeyIssueInformation *dki);
+TALER_EXCHANGEDB_denomination_key_write (const char *filename,
+ const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki);
/**
@@ -203,8 +197,8 @@ TALER_MINTDB_denomination_key_write (const char *filename,
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
*/
int
-TALER_MINTDB_denomination_key_read (const char *filename,
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki);
+TALER_EXCHANGEDB_denomination_key_read (const char *filename,
+ struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki);
/**
@@ -212,7 +206,8 @@ TALER_MINTDB_denomination_key_read (const char *filename,
*
* @param cls closure
* @param apub the auditor's public key
- * @param mpub the mint's public key (as expected by the auditor)
+ * @param auditor_url URL of the auditor
+ * @param mpub the exchange's public key (as expected by the auditor)
* @param dki_len length of @a asig and @a dki arrays
* @param asigs array of the auditor's signatures over the @a dks, of length @a dki_len
* @param dki array of denomination coin data signed by the auditor, of length @a dki_len
@@ -221,20 +216,19 @@ TALER_MINTDB_denomination_key_read (const char *filename,
* #GNUNET_SYSERR to abort iteration with error!
*/
typedef int
-(*TALER_MINTDB_AuditorIterator)(void *cls,
- const struct TALER_AuditorPublicKeyP *apub,
- const struct TALER_MasterPublicKeyP *mpub,
- unsigned int dki_len,
- const struct TALER_AuditorSignatureP *asigs,
- const struct TALER_DenominationKeyValidityPS *dki);
+(*TALER_EXCHANGEDB_AuditorIterator)(void *cls,
+ const struct TALER_AuditorPublicKeyP *apub,
+ const char *auditor_url,
+ const struct TALER_MasterPublicKeyP *mpub,
+ unsigned int dki_len,
+ const struct TALER_AuditorSignatureP *asigs,
+ const struct TALER_DenominationKeyValidityPS *dki);
/**
- * Call @a it with information for each auditor found in the @a mint_base_dir.
+ * Call @a it with information for each auditor found in the @a exchange_base_dir.
*
- * @param mint_base_dir base directory for the mint,
- * the signing keys must be in the #TALER_MINTDB_DIR_DENOMINATION_KEYS
- * subdirectory
+ * @param cfg configuration to use
* @param it function to call with auditor information
* @param it_cls closure for @a it
* @return -1 on error, 0 if no files were found, otherwise
@@ -243,9 +237,9 @@ typedef int
* as maybe none of the files were well-formed)
*/
int
-TALER_MINTDB_auditor_iterate (const char *mint_base_dir,
- TALER_MINTDB_AuditorIterator it,
- void *it_cls);
+TALER_EXCHANGEDB_auditor_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ TALER_EXCHANGEDB_AuditorIterator it,
+ void *it_cls);
/**
@@ -253,19 +247,21 @@ TALER_MINTDB_auditor_iterate (const char *mint_base_dir,
*
* @param filename the file where to write the auditor information to
* @param apub the auditor's public key
+ * @param auditor_url the URL of the auditor
* @param asigs the auditor's signatures, array of length @a dki_len
- * @param mpub the mint's public key (as expected by the auditor)
+ * @param mpub the exchange's public key (as expected by the auditor)
* @param dki_len length of @a dki and @a asigs arrays
* @param dki array of denomination coin data signed by the auditor
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure.
*/
int
-TALER_MINTDB_auditor_write (const char *filename,
- const struct TALER_AuditorPublicKeyP *apub,
- const struct TALER_AuditorSignatureP *asigs,
- const struct TALER_MasterPublicKeyP *mpub,
- unsigned int dki_len,
- const struct TALER_DenominationKeyValidityPS *dki);
+TALER_EXCHANGEDB_auditor_write (const char *filename,
+ const struct TALER_AuditorPublicKeyP *apub,
+ const char *auditor_url,
+ const struct TALER_AuditorSignatureP *asigs,
+ const struct TALER_MasterPublicKeyP *mpub,
+ unsigned int dki_len,
+ const struct TALER_DenominationKeyValidityPS *dki);
/**
@@ -274,8 +270,8 @@ TALER_MINTDB_auditor_write (const char *filename,
* @param cfg configuration to use
* @return NULL on failure
*/
-struct TALER_MINTDB_Plugin *
-TALER_MINTDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg);
+struct TALER_EXCHANGEDB_Plugin *
+TALER_EXCHANGEDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
@@ -284,8 +280,7 @@ TALER_MINTDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg);
* @param plugin plugin to unload
*/
void
-TALER_MINTDB_plugin_unload (struct TALER_MINTDB_Plugin *plugin);
-
+TALER_EXCHANGEDB_plugin_unload (struct TALER_EXCHANGEDB_Plugin *plugin);
#endif
diff --git a/src/include/taler_mintdb_plugin.h b/src/include/taler_exchangedb_plugin.h
similarity index 79%
rename from src/include/taler_mintdb_plugin.h
rename to src/include/taler_exchangedb_plugin.h
index b65b3e4f7..3646981cd 100644
--- a/src/include/taler_mintdb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -14,22 +14,23 @@
TALER; see the file COPYING. If not, If not, see
*/
/**
- * @file include/taler_mintdb_plugin.h
- * @brief Low-level (statement-level) database access for the mint
+ * @file include/taler_exchangedb_plugin.h
+ * @brief Low-level (statement-level) database access for the exchange
* @author Florian Dold
* @author Christian Grothoff
*/
-#ifndef TALER_MINTDB_PLUGIN_H
-#define TALER_MINTDB_PLUGIN_H
+#ifndef TALER_EXCHANGEDB_PLUGIN_H
+#define TALER_EXCHANGEDB_PLUGIN_H
+#include
#include
-#include "taler_mintdb_lib.h"
+#include "taler_exchangedb_lib.h"
/**
* @brief Information we keep on bank transfer(s) that established a reserve.
*/
-struct TALER_MINTDB_BankTransfer
+struct TALER_EXCHANGEDB_BankTransfer
{
/**
@@ -38,13 +39,13 @@ struct TALER_MINTDB_BankTransfer
struct TALER_ReservePublicKeyP reserve_pub;
/**
- * Amount that was transferred to the mint.
+ * Amount that was transferred to the exchange.
*/
struct TALER_Amount amount;
/**
- * When did the mint receive the incoming transaction?
- * (This is the execution date of the mint's database,
+ * When did the exchange receive the incoming transaction?
+ * (This is the execution date of the exchange's database,
* the execution date of the bank should be in @e wire).
*/
struct GNUNET_TIME_Absolute execution_date;
@@ -60,7 +61,7 @@ struct TALER_MINTDB_BankTransfer
/**
* @brief A summary of a Reserve
*/
-struct TALER_MINTDB_Reserve
+struct TALER_EXCHANGEDB_Reserve
{
/**
* The reserve's public key. This uniquely identifies the reserve
@@ -84,7 +85,7 @@ struct TALER_MINTDB_Reserve
* the /withdraw operation if needed, and to have proof
* that a reserve was drained by this amount.
*/
-struct TALER_MINTDB_CollectableBlindcoin
+struct TALER_EXCHANGEDB_CollectableBlindcoin
{
/**
@@ -98,7 +99,7 @@ struct TALER_MINTDB_CollectableBlindcoin
struct TALER_DenominationPublicKey denom_pub;
/**
- * Value of the coin being minted (matching the denomination key)
+ * Value of the coin being exchangeed (matching the denomination key)
* plus the transaction fee. We include this in what is being
* signed so that we can verify a reserve's remaining total balance
* without needing to access the respective denomination key
@@ -107,14 +108,14 @@ struct TALER_MINTDB_CollectableBlindcoin
struct TALER_Amount amount_with_fee;
/**
- * Withdrawl fee charged by the mint. This must match the Mint's
+ * Withdrawl fee charged by the exchange. This must match the Exchange's
* denomination key's withdrawl fee. If the client puts in an
* invalid withdrawl fee (too high or too low) that does not match
- * the Mint's denomination key, the withdraw operation is invalid
- * and will be rejected by the mint. The @e amount_with_fee minus
+ * the Exchange's denomination key, the withdraw operation is invalid
+ * and will be rejected by the exchange. The @e amount_with_fee minus
* the @e withdraw_fee is must match the value of the generated
* coin. We include this in what is being signed so that we can
- * verify a mint's accounting without needing to access the
+ * verify a exchange's accounting without needing to access the
* respective denomination key information each time.
*/
struct TALER_Amount withdraw_fee;
@@ -142,17 +143,17 @@ struct TALER_MINTDB_CollectableBlindcoin
/**
* @brief Types of operations on a reserved.
*/
-enum TALER_MINTDB_ReserveOperation
+enum TALER_EXCHANGEDB_ReserveOperation
{
/**
* Money was deposited into the reserve via a bank transfer.
*/
- TALER_MINTDB_RO_BANK_TO_MINT = 0,
+ TALER_EXCHANGEDB_RO_BANK_TO_EXCHANGE = 0,
/**
* A Coin was withdrawn from the reserve using /withdraw.
*/
- TALER_MINTDB_RO_WITHDRAW_COIN = 1
+ TALER_EXCHANGEDB_RO_WITHDRAW_COIN = 1
};
@@ -162,18 +163,18 @@ enum TALER_MINTDB_ReserveOperation
* established the reserve and all /withdraw operations we have done
* since).
*/
-struct TALER_MINTDB_ReserveHistory
+struct TALER_EXCHANGEDB_ReserveHistory
{
/**
* Next entry in the reserve history.
*/
- struct TALER_MINTDB_ReserveHistory *next;
+ struct TALER_EXCHANGEDB_ReserveHistory *next;
/**
* Type of the event, determins @e details.
*/
- enum TALER_MINTDB_ReserveOperation type;
+ enum TALER_EXCHANGEDB_ReserveOperation type;
/**
* Details of the operation, depending on @e type.
@@ -182,14 +183,14 @@ struct TALER_MINTDB_ReserveHistory
{
/**
- * Details about a bank transfer to the mint.
+ * Details about a bank transfer to the exchange.
*/
- struct TALER_MINTDB_BankTransfer *bank;
+ struct TALER_EXCHANGEDB_BankTransfer *bank;
/**
* Details about a /withdraw operation.
*/
- struct TALER_MINTDB_CollectableBlindcoin *withdraw;
+ struct TALER_EXCHANGEDB_CollectableBlindcoin *withdraw;
} details;
@@ -207,7 +208,7 @@ struct TALER_MINTDB_ReserveHistory
* (as determined by transaction ID). (Note: we might want to
* fix #3819 and include at least h_contract as well.)
*/
-struct TALER_MINTDB_Deposit
+struct TALER_EXCHANGEDB_Deposit
{
/**
* Information about the coin that is being deposited.
@@ -230,14 +231,14 @@ struct TALER_MINTDB_Deposit
/**
* Hash over the contract between merchant and customer
- * (remains unknown to the Mint).
+ * (remains unknown to the Exchange).
*/
struct GNUNET_HashCode h_contract;
/**
* Hash of the (canonical) representation of @e wire, used
* to check the signature on the request. Generated by
- * the mint from the detailed wire data provided by the
+ * the exchange from the detailed wire data provided by the
* merchant.
*/
struct GNUNET_HashCode h_wire;
@@ -256,12 +257,12 @@ struct TALER_MINTDB_Deposit
/**
* Time when this request was generated. Used, for example, to
* assess when (roughly) the income was achieved for tax purposes.
- * Note that the Mint will only check that the timestamp is not "too
+ * Note that the Exchange will only check that the timestamp is not "too
* far" into the future (i.e. several days). The fact that the
* timestamp falls within the validity period of the coin's
* denomination key is irrelevant for the validity of the deposit
* request, as obviously the customer and merchant could conspire to
- * set any timestamp. Also, the Mint must accept very old deposit
+ * set any timestamp. Also, the Exchange must accept very old deposit
* requests, as the merchant might have been unable to transmit the
* deposit request in a timely fashion (so back-dating is not
* prevented).
@@ -302,7 +303,7 @@ struct TALER_MINTDB_Deposit
* dimensions of the operation, security parameters and
* client signatures from "/refresh/melt" and "/refresh/commit".
*/
-struct TALER_MINTDB_RefreshSession
+struct TALER_EXCHANGEDB_RefreshSession
{
/**
@@ -316,7 +317,7 @@ struct TALER_MINTDB_RefreshSession
uint16_t num_newcoins;
/**
- * Index (smaller #TALER_CNC_KAPPA) which the mint has chosen to not
+ * Index (smaller #TALER_CNC_KAPPA) which the exchange has chosen to not
* have revealed during cut and choose.
*/
uint16_t noreveal_index;
@@ -327,7 +328,7 @@ struct TALER_MINTDB_RefreshSession
/**
* @brief Specification for coin in a /refresh/melt operation.
*/
-struct TALER_MINTDB_RefreshMelt
+struct TALER_EXCHANGEDB_RefreshMelt
{
/**
* Information about the coin that is being melted.
@@ -355,11 +356,11 @@ struct TALER_MINTDB_RefreshMelt
struct TALER_Amount amount_with_fee;
/**
- * Melting fee charged by the mint. This must match the Mint's
+ * Melting fee charged by the exchange. This must match the Exchange's
* denomination key's melting fee. If the client puts in an invalid
- * melting fee (too high or too low) that does not match the Mint's
+ * melting fee (too high or too low) that does not match the Exchange's
* denomination key, the melting operation is invalid and will be
- * rejected by the mint. The @e amount_with_fee minus the @e
+ * rejected by the exchange. The @e amount_with_fee minus the @e
* melt_fee is the amount that will be credited to the melting
* session.
*/
@@ -369,12 +370,12 @@ struct TALER_MINTDB_RefreshMelt
/**
- * @brief We have as many `struct TALER_MINTDB_RefreshCommitCoin` as there are new
+ * @brief We have as many `struct TALER_EXCHANGEDB_RefreshCommitCoin` as there are new
* coins being created by the refresh (for each of the #TALER_CNC_KAPPA
- * sets). These are the coins we ask the mint to sign if the
+ * sets). These are the coins we ask the exchange to sign if the
* respective set is selected.
*/
-struct TALER_MINTDB_RefreshCommitCoin
+struct TALER_EXCHANGEDB_RefreshCommitCoin
{
/**
@@ -399,12 +400,12 @@ struct TALER_MINTDB_RefreshCommitCoin
/**
* @brief Linked list of refresh information linked to a coin.
*/
-struct TALER_MINTDB_LinkDataList
+struct TALER_EXCHANGEDB_LinkDataList
{
/**
* Information is stored in a NULL-terminated linked list.
*/
- struct TALER_MINTDB_LinkDataList *next;
+ struct TALER_EXCHANGEDB_LinkDataList *next;
/**
* Link data, used to recover the private key of the coin
@@ -428,17 +429,17 @@ struct TALER_MINTDB_LinkDataList
* @brief Enumeration to classify the different types of transactions
* that can be done with a coin.
*/
-enum TALER_MINTDB_TransactionType
+enum TALER_EXCHANGEDB_TransactionType
{
/**
* /deposit operation.
*/
- TALER_MINTDB_TT_DEPOSIT = 0,
+ TALER_EXCHANGEDB_TT_DEPOSIT = 0,
/**
* /refresh/melt operation.
*/
- TALER_MINTDB_TT_REFRESH_MELT = 1
+ TALER_EXCHANGEDB_TT_REFRESH_MELT = 1
};
@@ -446,18 +447,18 @@ enum TALER_MINTDB_TransactionType
/**
* @brief List of transactions we performed for a particular coin.
*/
-struct TALER_MINTDB_TransactionList
+struct TALER_EXCHANGEDB_TransactionList
{
/**
* Next pointer in the NULL-terminated linked list.
*/
- struct TALER_MINTDB_TransactionList *next;
+ struct TALER_EXCHANGEDB_TransactionList *next;
/**
* Type of the transaction, determines what is stored in @e details.
*/
- enum TALER_MINTDB_TransactionType type;
+ enum TALER_EXCHANGEDB_TransactionType type;
/**
* Details about the transaction, depending on @e type.
@@ -468,12 +469,12 @@ struct TALER_MINTDB_TransactionList
/**
* Details if transaction was a /deposit operation.
*/
- struct TALER_MINTDB_Deposit *deposit;
+ struct TALER_EXCHANGEDB_Deposit *deposit;
/**
* Details if transaction was a /refresh/melt operation.
*/
- struct TALER_MINTDB_RefreshMelt *melt;
+ struct TALER_EXCHANGEDB_RefreshMelt *melt;
} details;
@@ -483,7 +484,7 @@ struct TALER_MINTDB_TransactionList
/**
* @brief All of the information from a /refresh/melt commitment.
*/
-struct TALER_MINTDB_MeltCommitment
+struct TALER_EXCHANGEDB_MeltCommitment
{
/**
@@ -499,7 +500,7 @@ struct TALER_MINTDB_MeltCommitment
/**
* Array of @e num_oldcoins melt operation details.
*/
- struct TALER_MINTDB_RefreshMelt *melts;
+ struct TALER_EXCHANGEDB_RefreshMelt *melts;
/**
* Array of @e num_newcoins denomination keys
@@ -509,7 +510,7 @@ struct TALER_MINTDB_MeltCommitment
/**
* 2D-Array of #TALER_CNC_KAPPA and @e num_newcoins commitments.
*/
- struct TALER_MINTDB_RefreshCommitCoin *commit_coins[TALER_CNC_KAPPA];
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins[TALER_CNC_KAPPA];
/**
* 2D-Array of #TALER_CNC_KAPPA and @e new_oldcoins links.
@@ -521,7 +522,7 @@ struct TALER_MINTDB_MeltCommitment
/**
* @brief Handle for a database session (per-thread, for transactions).
*/
-struct TALER_MINTDB_Session;
+struct TALER_EXCHANGEDB_Session;
/**
@@ -535,7 +536,7 @@ struct TALER_MINTDB_Session;
* @param merchant_pub public key of the merchant
* @param coin_pub public key of the coin
* @param amount_with_fee amount that was deposited including fee
- * @param deposit_fee amount the mint gets to keep as transaction fees
+ * @param deposit_fee amount the exchange gets to keep as transaction fees
* @param transaction_id unique transaction ID chosen by the merchant
* @param h_contract hash of the contract between merchant and customer
* @param wire_deadline by which the merchant adviced that he would like the
@@ -544,16 +545,16 @@ struct TALER_MINTDB_Session;
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/
typedef int
-(*TALER_MINTDB_DepositIterator)(void *cls,
- unsigned long long rowid,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- const struct TALER_Amount *amount_with_fee,
- const struct TALER_Amount *deposit_fee,
- uint64_t transaction_id,
- const struct GNUNET_HashCode *h_contract,
- struct GNUNET_TIME_Absolute wire_deadline,
- const json_t *wire);
+(*TALER_EXCHANGEDB_DepositIterator)(void *cls,
+ unsigned long long rowid,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_Amount *amount_with_fee,
+ const struct TALER_Amount *deposit_fee,
+ uint64_t transaction_id,
+ const struct GNUNET_HashCode *h_contract,
+ struct GNUNET_TIME_Absolute wire_deadline,
+ const json_t *wire);
/**
@@ -566,10 +567,10 @@ typedef int
* @param shared_secret_enc set to shared secret for the session
*/
typedef void
-(*TALER_MINTDB_TransferDataCallback)(void *cls,
- const struct GNUNET_HashCode *session_hash,
- const struct TALER_TransferPublicKeyP *transfer_pub,
- const struct TALER_EncryptedLinkSecretP *shared_secret_enc);
+(*TALER_EXCHANGEDB_TransferDataCallback)(void *cls,
+ const struct GNUNET_HashCode *session_hash,
+ const struct TALER_TransferPublicKeyP *transfer_pub,
+ const struct TALER_EncryptedLinkSecretP *shared_secret_enc);
/**
@@ -582,16 +583,16 @@ typedef void
* if the transaction was not yet done
* @param coin_contribution how much did the coin we asked about
* contribute to the total transfer value? (deposit value including fee)
- * @param coin_fee how much did the mint charge for the deposit fee
+ * @param coin_fee how much did the exchange charge for the deposit fee
* @param execution_time when was the transaction done, or
* when we expect it to be done (if @a wtid was NULL)
*/
typedef void
-(*TALER_MINTDB_DepositWtidCallback)(void *cls,
- const struct TALER_WireTransferIdentifierRawP *wtid,
- const struct TALER_Amount *coin_contribution,
- const struct TALER_Amount *coin_fee,
- struct GNUNET_TIME_Absolute execution_time);
+(*TALER_EXCHANGEDB_DepositWtidCallback)(void *cls,
+ const struct TALER_WireTransferIdentifierRawP *wtid,
+ const struct TALER_Amount *coin_contribution,
+ const struct TALER_Amount *coin_fee,
+ struct GNUNET_TIME_Absolute execution_time);
/**
@@ -608,14 +609,14 @@ typedef void
* @param coin_fee applicable fee for this coin
*/
typedef void
-(*TALER_MINTDB_WireTransferDataCallback)(void *cls,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- const struct GNUNET_HashCode *h_wire,
- const struct GNUNET_HashCode *h_contract,
- uint64_t transaction_id,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- const struct TALER_Amount *coin_value,
- const struct TALER_Amount *coin_fee);
+(*TALER_EXCHANGEDB_WireTransferDataCallback)(void *cls,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ const struct GNUNET_HashCode *h_wire,
+ const struct GNUNET_HashCode *h_contract,
+ uint64_t transaction_id,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_Amount *coin_value,
+ const struct TALER_Amount *coin_fee);
/**
@@ -627,17 +628,17 @@ typedef void
* @param buf_size number of bytes in @a buf, 0 on error
*/
typedef void
-(*TALER_MINTDB_WirePreparationCallback) (void *cls,
- unsigned long long rowid,
- const char *buf,
- size_t buf_size);
+(*TALER_EXCHANGEDB_WirePreparationCallback) (void *cls,
+ unsigned long long rowid,
+ const char *buf,
+ size_t buf_size);
/**
* @brief The plugin API, returned from the plugin's "init" function.
* The argument given to "init" is simply a configuration handle.
*/
-struct TALER_MINTDB_Plugin
+struct TALER_EXCHANGEDB_Plugin
{
/**
@@ -660,7 +661,7 @@ struct TALER_MINTDB_Plugin
* database default one
* @param the database connection, or NULL on error
*/
- struct TALER_MINTDB_Session *
+ struct TALER_EXCHANGEDB_Session *
(*get_session) (void *cls,
int temporary);
@@ -673,7 +674,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*drop_temporary) (void *cls,
- struct TALER_MINTDB_Session *db);
+ struct TALER_EXCHANGEDB_Session *db);
/**
@@ -697,7 +698,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*start) (void *cls,
- struct TALER_MINTDB_Session *session);
+ struct TALER_EXCHANGEDB_Session *session);
/**
@@ -710,7 +711,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*commit) (void *cls,
- struct TALER_MINTDB_Session *session);
+ struct TALER_EXCHANGEDB_Session *session);
/**
@@ -721,7 +722,7 @@ struct TALER_MINTDB_Plugin
*/
void
(*rollback) (void *cls,
- struct TALER_MINTDB_Session *session);
+ struct TALER_EXCHANGEDB_Session *session);
/**
@@ -737,9 +738,9 @@ struct TALER_MINTDB_Plugin
*/
int
(*insert_denomination_info) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_DenominationPublicKey *denom_pub,
- const struct TALER_MINTDB_DenominationKeyInformationP *issue);
+ const struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue);
/**
@@ -753,9 +754,9 @@ struct TALER_MINTDB_Plugin
*/
int
(*get_denomination_info) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_DenominationPublicKey *denom_pub,
- struct TALER_MINTDB_DenominationKeyInformationP *issue);
+ struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue);
/**
@@ -770,8 +771,8 @@ struct TALER_MINTDB_Plugin
*/
int
(*reserve_get) (void *cls,
- struct TALER_MINTDB_Session *db,
- struct TALER_MINTDB_Reserve *reserve);
+ struct TALER_EXCHANGEDB_Session *db,
+ struct TALER_EXCHANGEDB_Reserve *reserve);
/**
@@ -793,7 +794,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*reserves_in_insert) (void *cls,
- struct TALER_MINTDB_Session *db,
+ struct TALER_EXCHANGEDB_Session *db,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *balance,
struct GNUNET_TIME_Absolute execution_time,
@@ -816,9 +817,9 @@ struct TALER_MINTDB_Plugin
*/
int
(*get_withdraw_info) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_blind,
- struct TALER_MINTDB_CollectableBlindcoin *collectable);
+ struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable);
/**
@@ -835,8 +836,8 @@ struct TALER_MINTDB_Plugin
*/
int
(*insert_withdraw_info) (void *cls,
- struct TALER_MINTDB_Session *session,
- const struct TALER_MINTDB_CollectableBlindcoin *collectable);
+ struct TALER_EXCHANGEDB_Session *session,
+ const struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable);
/**
@@ -848,9 +849,9 @@ struct TALER_MINTDB_Plugin
* @param reserve_pub public key of the reserve
* @return known transaction history (NULL if reserve is unknown)
*/
- struct TALER_MINTDB_ReserveHistory *
+ struct TALER_EXCHANGEDB_ReserveHistory *
(*get_reserve_history) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_ReservePublicKeyP *reserve_pub);
@@ -862,7 +863,7 @@ struct TALER_MINTDB_Plugin
*/
void
(*free_reserve_history) (void *cls,
- struct TALER_MINTDB_ReserveHistory *rh);
+ struct TALER_EXCHANGEDB_ReserveHistory *rh);
/**
@@ -877,8 +878,8 @@ struct TALER_MINTDB_Plugin
*/
int
(*have_deposit) (void *cls,
- struct TALER_MINTDB_Session *session,
- const struct TALER_MINTDB_Deposit *deposit);
+ struct TALER_EXCHANGEDB_Session *session,
+ const struct TALER_EXCHANGEDB_Deposit *deposit);
/**
@@ -891,8 +892,8 @@ struct TALER_MINTDB_Plugin
*/
int
(*insert_deposit) (void *cls,
- struct TALER_MINTDB_Session *session,
- const struct TALER_MINTDB_Deposit *deposit);
+ struct TALER_EXCHANGEDB_Session *session,
+ const struct TALER_EXCHANGEDB_Deposit *deposit);
/**
@@ -907,7 +908,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*mark_deposit_tiny) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
unsigned long long rowid);
@@ -923,7 +924,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*mark_deposit_done) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
unsigned long long rowid);
@@ -941,11 +942,22 @@ struct TALER_MINTDB_Plugin
*/
int
(*get_ready_deposit) (void *cls,
- struct TALER_MINTDB_Session *session,
- TALER_MINTDB_DepositIterator deposit_cb,
+ struct TALER_EXCHANGEDB_Session *session,
+ TALER_EXCHANGEDB_DepositIterator deposit_cb,
void *deposit_cb_cls);
+/**
+ * Maximum number of results we return from iterate_matching_deposits().
+ *
+ * Limit on the number of transactions we aggregate at once. Note
+ * that the limit must be big enough to ensure that when transactions
+ * of the smallest possible unit are aggregated, they do surpass the
+ * "tiny" threshold beyond which we never trigger a wire transaction!
+ */
+#define TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT 10000
+#define TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT_STR "10000"
+
/**
* Obtain information about other pending deposits for the same
* destination. Those deposits must not already be "done".
@@ -956,16 +968,18 @@ struct TALER_MINTDB_Plugin
* @param merchant_pub public key of the merchant
* @param deposit_cb function to call for each deposit
* @param deposit_cb_cls closure for @a deposit_cb
- * @param limit maximum number of matching deposits to return
+ * @param limit maximum number of matching deposits to return; should
+ * be #TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT, larger values
+ * are not supported, smaller values would be inefficient.
* @return number of rows processed, 0 if none exist,
* #GNUNET_SYSERR on error
*/
int
(*iterate_matching_deposits) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_wire,
const struct TALER_MerchantPublicKeyP *merchant_pub,
- TALER_MINTDB_DepositIterator deposit_cb,
+ TALER_EXCHANGEDB_DepositIterator deposit_cb,
void *deposit_cb_cls,
uint32_t limit);
@@ -983,9 +997,9 @@ struct TALER_MINTDB_Plugin
*/
int
(*get_refresh_session) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
- struct TALER_MINTDB_RefreshSession *refresh_session);
+ struct TALER_EXCHANGEDB_RefreshSession *refresh_session);
/**
@@ -1000,9 +1014,9 @@ struct TALER_MINTDB_Plugin
*/
int
(*create_refresh_session) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
- const struct TALER_MINTDB_RefreshSession *refresh_session);
+ const struct TALER_EXCHANGEDB_RefreshSession *refresh_session);
/**
@@ -1018,9 +1032,9 @@ struct TALER_MINTDB_Plugin
*/
int
(*insert_refresh_melt) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
uint16_t oldcoin_index,
- const struct TALER_MINTDB_RefreshMelt *melt);
+ const struct TALER_EXCHANGEDB_RefreshMelt *melt);
/**
@@ -1036,10 +1050,10 @@ struct TALER_MINTDB_Plugin
*/
int
(*get_refresh_melt) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t oldcoin_index,
- struct TALER_MINTDB_RefreshMelt *melt);
+ struct TALER_EXCHANGEDB_RefreshMelt *melt);
/**
@@ -1056,7 +1070,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*insert_refresh_order) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t num_newcoins,
const struct TALER_DenominationPublicKey *denom_pubs);
@@ -1076,7 +1090,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*get_refresh_order) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t num_newcoins,
struct TALER_DenominationPublicKey *denom_pubs);
@@ -1097,11 +1111,11 @@ struct TALER_MINTDB_Plugin
*/
int
(*insert_refresh_commit_coins) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t cnc_index,
uint16_t num_newcoins,
- const struct TALER_MINTDB_RefreshCommitCoin *commit_coins);
+ const struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins);
/**
@@ -1120,11 +1134,11 @@ struct TALER_MINTDB_Plugin
*/
int
(*get_refresh_commit_coins) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t cnc_index,
uint16_t num_coins,
- struct TALER_MINTDB_RefreshCommitCoin *commit_coins);
+ struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins);
/**
@@ -1141,7 +1155,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*insert_refresh_commit_links) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t cnc_index,
uint16_t num_links,
@@ -1163,7 +1177,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*get_refresh_commit_links) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t cnc_index,
uint16_t num_links,
@@ -1179,9 +1193,9 @@ struct TALER_MINTDB_Plugin
* @return NULL if the @a session_hash does not correspond to any known melt
* operation
*/
- struct TALER_MINTDB_MeltCommitment *
+ struct TALER_EXCHANGEDB_MeltCommitment *
(*get_melt_commitment) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash);
@@ -1193,7 +1207,7 @@ struct TALER_MINTDB_Plugin
*/
void
(*free_melt_commitment) (void *cls,
- struct TALER_MINTDB_MeltCommitment *mc);
+ struct TALER_EXCHANGEDB_MeltCommitment *mc);
/**
@@ -1211,7 +1225,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*insert_refresh_out) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash,
uint16_t newcoin_index,
const struct TALER_DenominationSignature *ev_sig);
@@ -1226,9 +1240,9 @@ struct TALER_MINTDB_Plugin
* @param session_hash session to get linkage data for
* @return all known link data for the session
*/
- struct TALER_MINTDB_LinkDataList *
+ struct TALER_EXCHANGEDB_LinkDataList *
(*get_link_data_list) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *session_hash);
@@ -1240,7 +1254,7 @@ struct TALER_MINTDB_Plugin
*/
void
(*free_link_data_list) (void *cls,
- struct TALER_MINTDB_LinkDataList *ldl);
+ struct TALER_EXCHANGEDB_LinkDataList *ldl);
/**
@@ -1261,9 +1275,9 @@ struct TALER_MINTDB_Plugin
*/
int
(*get_transfer) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
- TALER_MINTDB_TransferDataCallback tdc,
+ TALER_EXCHANGEDB_TransferDataCallback tdc,
void *tdc_cls);
@@ -1276,9 +1290,9 @@ struct TALER_MINTDB_Plugin
* @param coin_pub coin to investigate
* @return list of transactions, NULL if coin is fresh
*/
- struct TALER_MINTDB_TransactionList *
+ struct TALER_EXCHANGEDB_TransactionList *
(*get_coin_transactions) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_CoinSpendPublicKeyP *coin_pub);
@@ -1290,7 +1304,7 @@ struct TALER_MINTDB_Plugin
*/
void
(*free_coin_transaction_list) (void *cls,
- struct TALER_MINTDB_TransactionList *list);
+ struct TALER_EXCHANGEDB_TransactionList *list);
/**
@@ -1307,9 +1321,9 @@ struct TALER_MINTDB_Plugin
*/
int
(*lookup_wire_transfer) (void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_WireTransferIdentifierRawP *wtid,
- TALER_MINTDB_WireTransferDataCallback cb,
+ TALER_EXCHANGEDB_WireTransferDataCallback cb,
void *cb_cls);
@@ -1332,13 +1346,13 @@ struct TALER_MINTDB_Plugin
*/
int
(*wire_lookup_deposit_wtid)(void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_contract,
const struct GNUNET_HashCode *h_wire,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_MerchantPublicKeyP *merchant_pub,
uint64_t transaction_id,
- TALER_MINTDB_DepositWtidCallback cb,
+ TALER_EXCHANGEDB_DepositWtidCallback cb,
void *cb_cls);
@@ -1355,12 +1369,12 @@ struct TALER_MINTDB_Plugin
* @param execution_time when did we execute the transaction
* @param coin_pub which public key was this payment about
* @param coin_value amount contributed by this coin in total
- * @param coin_fee deposit fee charged by mint for this coin
+ * @param coin_fee deposit fee charged by exchange for this coin
* @return #GNUNET_OK on success, #GNUNET_SYSERR on DB errors
*/
int
(*insert_aggregation_tracking)(void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const struct TALER_WireTransferIdentifierRawP *wtid,
const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct GNUNET_HashCode *h_wire,
@@ -1384,7 +1398,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*wire_prepare_data_insert)(void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const char *type,
const char *buf,
size_t buf_size);
@@ -1400,7 +1414,7 @@ struct TALER_MINTDB_Plugin
*/
int
(*wire_prepare_data_mark_finished)(void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
unsigned long long rowid);
@@ -1419,13 +1433,13 @@ struct TALER_MINTDB_Plugin
*/
int
(*wire_prepare_data_get)(void *cls,
- struct TALER_MINTDB_Session *session,
+ struct TALER_EXCHANGEDB_Session *session,
const char *type,
- TALER_MINTDB_WirePreparationCallback cb,
+ TALER_EXCHANGEDB_WirePreparationCallback cb,
void *cb_cls);
};
-#endif /* _TALER_MINT_DB_H */
+#endif /* _TALER_EXCHANGE_DB_H */
diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h
index d9fa05188..79589dba7 100644
--- a/src/include/taler_json_lib.h
+++ b/src/include/taler_json_lib.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
+ Copyright (C) 2014, 2015, 2016 GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -17,14 +17,18 @@
* @file include/taler_json_lib.h
* @brief helper functions for JSON processing using libjansson
* @author Sree Harsha Totakura
+ * @author Christian Grothoff
*/
-#ifndef TALER_json_LIB_H_
-#define TALER_json_LIB_H_
+#ifndef TALER_JSON_LIB_H_
+#define TALER_JSON_LIB_H_
#include
+#include
+#include "taler_util.h"
/**
* Print JSON parsing related error information
+ * @deprecated
*/
#define TALER_json_warn(error) \
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \
@@ -39,106 +43,42 @@
* @return a json object describing the amount
*/
json_t *
-TALER_json_from_amount (const struct TALER_Amount *amount);
+TALER_JSON_from_amount (const struct TALER_Amount *amount);
/**
- * Convert absolute timestamp to a json string.
+ * Provide specification to parse given JSON object to an amount.
*
- * @param stamp the time stamp
- * @return a json string with the timestamp in @a stamp
- */
-json_t *
-TALER_json_from_abs (struct GNUNET_TIME_Absolute stamp);
-
-
-/**
- * Convert RSA public key to JSON.
- *
- * @param pk public key to convert
- * @return corresponding JSON encoding
- */
-json_t *
-TALER_json_from_rsa_public_key (struct GNUNET_CRYPTO_rsa_PublicKey *pk);
-
-
-/**
- * Convert RSA signature to JSON.
- *
- * @param sig signature to convert
- * @return corresponding JSON encoding
- */
-json_t *
-TALER_json_from_rsa_signature (struct GNUNET_CRYPTO_rsa_Signature *sig);
-
-
-/**
- * Convert binary data to a JSON string
- * with the base32crockford encoding.
- *
- * @param data binary data
- * @param size size of @a data in bytes
- * @return json string that encodes @a data
- */
-json_t *
-TALER_json_from_data (const void *data,
- size_t size);
-
-
-/**
- * Parse given JSON object to Amount
- *
- * @param json the json object representing Amount
+ * @param name name of the amount field in the JSON
* @param[out] r_amount where the amount has to be written
- * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
*/
-int
-TALER_json_to_amount (json_t *json,
- struct TALER_Amount *r_amount);
-
-/**
- * Parse given JSON object to absolute time.
- *
- * @param json the json object representing absolute time in seconds
- * @param[out] abs where the time has to be written
- * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
- */
-int
-TALER_json_to_abs (json_t *json,
- struct GNUNET_TIME_Absolute *abs);
-
-/**
- * Parse given JSON object to data
- *
- * @param json the json object representing data
- * @param out the pointer to hold the parsed data.
- * @param out_size the size of @a out
- * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
- */
-int
-TALER_json_to_data (json_t *json,
- void *out,
- size_t out_size);
+struct GNUNET_JSON_Specification
+TALER_JSON_spec_amount (const char *name,
+ struct TALER_Amount *r_amount);
/**
- * Convert JSON to RSA public key.
+ * Generate line in parser specification for denomination public key.
*
- * @param json JSON encoding to convert
- * @return corresponding public key
+ * @param field name of the field
+ * @param[out] pk key to initialize
+ * @return corresponding field spec
*/
-struct GNUNET_CRYPTO_rsa_PublicKey *
-TALER_json_to_rsa_public_key (json_t *json);
+struct GNUNET_JSON_Specification
+TALER_JSON_spec_denomination_public_key (const char *field,
+ struct TALER_DenominationPublicKey *pk);
/**
- * Convert JSON to RSA signature.
+ * Generate line in parser specification for denomination signature.
*
- * @param json JSON encoding to convert
- * @return corresponding signature
+ * @param field name of the field
+ * @param sig the signature to initialize
+ * @return corresponding field spec
*/
-struct GNUNET_CRYPTO_rsa_Signature *
-TALER_json_to_rsa_signature (json_t *json);
+struct GNUNET_JSON_Specification
+TALER_JSON_spec_denomination_signature (const char *field,
+ struct TALER_DenominationSignature *sig);
/**
@@ -149,22 +89,9 @@ TALER_json_to_rsa_signature (json_t *json);
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
int
-TALER_hash_json (json_t *json,
+TALER_JSON_hash (const json_t *json,
struct GNUNET_HashCode *hc);
-
-/**
- * Check if the given wire format JSON object is correctly formatted
- *
- * @param allowed NULL-terminated array of allowed wire format types
- * @param wire the JSON wire format object
- * @return #GNUNET_YES if correctly formatted; #GNUNET_NO if not
- */
-int
-TALER_json_validate_wireformat (const char **allowed,
- const json_t *wire);
-
-
-#endif /* TALER_json_LIB_H_ */
+#endif /* TALER_JSON_LIB_H_ */
/* End of taler_json_lib.h */
diff --git a/src/include/taler_pq_lib.h b/src/include/taler_pq_lib.h
index 49e067846..dfcea30e1 100644
--- a/src/include/taler_pq_lib.h
+++ b/src/include/taler_pq_lib.h
@@ -24,6 +24,7 @@
#define TALER_PQ_LIB_H_
#include
+#include
#include
#include "taler_util.h"
diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h
index 2526597ee..bd892e793 100644
--- a/src/include/taler_signatures.h
+++ b/src/include/taler_signatures.h
@@ -54,62 +54,68 @@
#define TALER_IDLE_RESERVE_EXPIRATION_TIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS, 5)
/*********************************************/
-/* Mint offline signatures (with master key) */
+/* Exchange offline signatures (with master key) */
/*********************************************/
/**
- * Purpose for signing public keys signed by the mint master key.
+ * Purpose for signing public keys signed by the exchange master key.
*/
#define TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY 1024
/**
- * Purpose for denomination keys signed by the mint master key.
+ * Purpose for denomination keys signed by the exchange master key.
*/
#define TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY 1025
/**
- * Signature where the Mint confirms its SEPA details in
- * the /wire/sepa response.
+ * Signature where the Exchange confirms its SEPA details in
+ * the /wire response.
*/
#define TALER_SIGNATURE_MASTER_SEPA_DETAILS 1026
+/**
+ * Signature where the Exchange confirms its TEST details in
+ * the /wire response.
+ */
+#define TALER_SIGNATURE_MASTER_TEST_DETAILS 1027
+
/*********************************************/
-/* Mint online signatures (with signing key) */
+/* Exchange online signatures (with signing key) */
/*********************************************/
/**
- * Purpose for the state of a reserve, signed by the mint's signing
+ * Purpose for the state of a reserve, signed by the exchange's signing
* key.
*/
-#define TALER_SIGNATURE_MINT_RESERVE_STATUS 1032
+#define TALER_SIGNATURE_EXCHANGE_RESERVE_STATUS 1032
/**
- * Signature where the Mint confirms a deposit request.
+ * Signature where the Exchange confirms a deposit request.
*/
-#define TALER_SIGNATURE_MINT_CONFIRM_DEPOSIT 1033
+#define TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT 1033
/**
- * Signature where the mint (current signing key) confirms the
+ * Signature where the exchange (current signing key) confirms the
* no-reveal index for cut-and-choose and the validity of the melted
* coins.
*/
-#define TALER_SIGNATURE_MINT_CONFIRM_MELT 1034
+#define TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT 1034
/**
- * Signature where the Mint confirms the full /keys response set.
+ * Signature where the Exchange confirms the full /keys response set.
*/
-#define TALER_SIGNATURE_MINT_KEY_SET 1035
+#define TALER_SIGNATURE_EXCHANGE_KEY_SET 1035
/**
- * Signature where the Mint confirms the /wire response.
+ * Signature where the Exchange confirms the /deposit/wtid response.
*/
-#define TALER_SIGNATURE_MINT_WIRE_TYPES 1036
+#define TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE 1036
/**
- * Signature where the Mint confirms the /deposit/wtid response.
+ * Signature where the Exchange confirms the /wire/deposit response.
*/
-#define TALER_SIGNATURE_MINT_CONFIRM_WIRE 1036
+#define TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT 1037
/*********************/
@@ -118,9 +124,9 @@
/**
* Signature where the auditor confirms that he is
- * aware of certain denomination keys from the mint.
+ * aware of certain denomination keys from the exchange.
*/
-#define TALER_SIGNATURE_AUDITOR_MINT_KEYS 1064
+#define TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS 1064
/***********************/
@@ -176,7 +182,7 @@
/**
* EdDSA test signature.
*/
-#define TALER_SIGNATURE_MINT_TEST_EDDSA 1303
+#define TALER_SIGNATURE_EXCHANGE_TEST_EDDSA 1303
@@ -202,7 +208,7 @@ struct TALER_WithdrawRequestPS
struct TALER_ReservePublicKeyP reserve_pub;
/**
- * Value of the coin being minted (matching the denomination key)
+ * Value of the coin being exchangeed (matching the denomination key)
* plus the transaction fee. We include this in what is being
* signed so that we can verify a reserve's remaining total balance
* without needing to access the respective denomination key
@@ -211,14 +217,14 @@ struct TALER_WithdrawRequestPS
struct TALER_AmountNBO amount_with_fee;
/**
- * Withdrawl fee charged by the mint. This must match the Mint's
+ * Withdrawl fee charged by the exchange. This must match the Exchange's
* denomination key's withdrawl fee. If the client puts in an
* invalid withdrawl fee (too high or too low) that does not match
- * the Mint's denomination key, the withdraw operation is invalid
- * and will be rejected by the mint. The @e amount_with_fee minus
+ * the Exchange's denomination key, the withdraw operation is invalid
+ * and will be rejected by the exchange. The @e amount_with_fee minus
* the @e withdraw_fee is must match the value of the generated
* coin. We include this in what is being signed so that we can
- * verify a mint's accounting without needing to access the
+ * verify a exchange's accounting without needing to access the
* respective denomination key information each time.
*/
struct TALER_AmountNBO withdraw_fee;
@@ -229,7 +235,7 @@ struct TALER_WithdrawRequestPS
struct GNUNET_HashCode h_denomination_pub GNUNET_PACKED;
/**
- * Hash of the (blinded) message to be signed by the Mint.
+ * Hash of the (blinded) message to be signed by the Exchange.
*/
struct GNUNET_HashCode h_coin_envelope GNUNET_PACKED;
};
@@ -260,12 +266,12 @@ struct TALER_DepositRequestPS
/**
* Time when this request was generated. Used, for example, to
* assess when (roughly) the income was achieved for tax purposes.
- * Note that the Mint will only check that the timestamp is not "too
+ * Note that the Exchange will only check that the timestamp is not "too
* far" into the future (i.e. several days). The fact that the
* timestamp falls within the validity period of the coin's
* denomination key is irrelevant for the validity of the deposit
* request, as obviously the customer and merchant could conspire to
- * set any timestamp. Also, the Mint must accept very old deposit
+ * set any timestamp. Also, the Exchange must accept very old deposit
* requests, as the merchant might have been unable to transmit the
* deposit request in a timely fashion (so back-dating is not
* prevented).
@@ -293,17 +299,17 @@ struct TALER_DepositRequestPS
/**
* Amount to be deposited, including deposit fee charged by the
- * mint. This is the total amount that the coin's value at the mint
+ * exchange. This is the total amount that the coin's value at the exchange
* will be reduced by.
*/
struct TALER_AmountNBO amount_with_fee;
/**
- * Depositing fee charged by the mint. This must match the Mint's
+ * Depositing fee charged by the exchange. This must match the Exchange's
* denomination key's depositing fee. If the client puts in an
* invalid deposit fee (too high or too low) that does not match the
- * Mint's denomination key, the deposit operation is invalid and
- * will be rejected by the mint. The @e amount_with_fee minus the
+ * Exchange's denomination key, the deposit operation is invalid and
+ * will be rejected by the exchange. The @e amount_with_fee minus the
* @e deposit_fee is the amount that will be transferred to the
* account identified by @e h_wire.
*/
@@ -317,7 +323,7 @@ struct TALER_DepositRequestPS
/**
* The coin's public key. This is the value that must have been
- * signed (blindly) by the Mint. The deposit request is to be
+ * signed (blindly) by the Exchange. The deposit request is to be
* signed by the corresponding private key (using EdDSA).
*/
struct TALER_CoinSpendPublicKeyP coin_pub;
@@ -327,13 +333,13 @@ struct TALER_DepositRequestPS
/**
* @brief Format used to generate the signature on a confirmation
- * from the mint that a deposit request succeeded.
+ * from the exchange that a deposit request succeeded.
*/
struct TALER_DepositConfirmationPS
{
/**
- * Purpose must be #TALER_SIGNATURE_MINT_CONFIRM_DEPOSIT. Signed
- * by a `struct TALER_MintPublicKeyP` using EdDSA.
+ * Purpose must be #TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT. Signed
+ * by a `struct TALER_ExchangePublicKeyP` using EdDSA.
*/
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
@@ -362,7 +368,7 @@ struct TALER_DepositConfirmationPS
* How much time does the @e merchant have to issue a refund
* request? Zero if refunds are not allowed. After this time, the
* coin cannot be refunded. Note that the wire transfer will not be
- * performed by the mint until the refund deadline. This value
+ * performed by the exchange until the refund deadline. This value
* is taken from the original deposit request.
*/
struct GNUNET_TIME_AbsoluteNBO refund_deadline;
@@ -375,7 +381,7 @@ struct TALER_DepositConfirmationPS
/**
* The coin's public key. This is the value that must have been
- * signed (blindly) by the Mint. The deposit request is to be
+ * signed (blindly) by the Exchange. The deposit request is to be
* signed by the corresponding private key (using EdDSA).
*/
struct TALER_CoinSpendPublicKeyP coin_pub;
@@ -417,11 +423,11 @@ struct TALER_RefreshMeltCoinAffirmationPS
struct TALER_AmountNBO amount_with_fee;
/**
- * Melting fee charged by the mint. This must match the Mint's
+ * Melting fee charged by the exchange. This must match the Exchange's
* denomination key's melting fee. If the client puts in an invalid
- * melting fee (too high or too low) that does not match the Mint's
+ * melting fee (too high or too low) that does not match the Exchange's
* denomination key, the melting operation is invalid and will be
- * rejected by the mint. The @e amount_with_fee minus the @e
+ * rejected by the exchange. The @e amount_with_fee minus the @e
* melt_fee is the amount that will be credited to the melting
* session.
*/
@@ -429,7 +435,7 @@ struct TALER_RefreshMeltCoinAffirmationPS
/**
* The coin's public key. This is the value that must have been
- * signed (blindly) by the Mint. The deposit request is to be
+ * signed (blindly) by the Exchange. The deposit request is to be
* signed by the corresponding private key (using EdDSA).
*/
struct TALER_CoinSpendPublicKeyP coin_pub;
@@ -437,16 +443,16 @@ struct TALER_RefreshMeltCoinAffirmationPS
/**
- * @brief Format of the block signed by the Mint in response to a successful
- * "/refresh/melt" request. Hereby the mint affirms that all of the
- * coins were successfully melted. This also commits the mint to a
+ * @brief Format of the block signed by the Exchange in response to a successful
+ * "/refresh/melt" request. Hereby the exchange affirms that all of the
+ * coins were successfully melted. This also commits the exchange to a
* particular index to not be revealed during the refresh.
*/
struct TALER_RefreshMeltConfirmationPS
{
/**
- * Purpose is #TALER_SIGNATURE_MINT_CONFIRM_MELT. Signed
- * by a `struct TALER_MintPublicKeyP` using EdDSA.
+ * Purpose is #TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT. Signed
+ * by a `struct TALER_ExchangePublicKeyP` using EdDSA.
*/
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
@@ -469,14 +475,14 @@ struct TALER_RefreshMeltConfirmationPS
/**
- * @brief Information about a signing key of the mint. Signing keys are used
- * to sign mint messages other than coins, i.e. to confirm that a
+ * @brief Information about a signing key of the exchange. Signing keys are used
+ * to sign exchange messages other than coins, i.e. to confirm that a
* deposit was successful or that a refresh was accepted.
*/
-struct TALER_MintSigningKeyValidityPS
+struct TALER_ExchangeSigningKeyValidityPS
{
/**
- * Signature over the signing key (by the master key of the mint).
+ * Signature over the signing key (by the master key of the exchange).
*
* FIXME: should be moved outside of the "PS" struct, this is ugly.
* (and makes this struct different from all of the others)
@@ -489,8 +495,8 @@ struct TALER_MintSigningKeyValidityPS
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
/**
- * Master public key of the mint corresponding to @e signature.
- * This is the long-term offline master key of the mint.
+ * Master public key of the exchange corresponding to @e signature.
+ * This is the long-term offline master key of the exchange.
*/
struct TALER_MasterPublicKeyP master_public_key;
@@ -501,7 +507,7 @@ struct TALER_MintSigningKeyValidityPS
/**
* When does this signing key expire? Note: This is currently when
- * the Mint will definitively stop using it. Signatures made with
+ * the Exchange will definitively stop using it. Signatures made with
* the key remain valid until @e end. When checking validity periods,
* clients should allow for some overlap between keys and tolerate
* the use of either key during the overlap time (due to the
@@ -512,31 +518,31 @@ struct TALER_MintSigningKeyValidityPS
/**
* When do signatures with this signing key become invalid? After
* this point, these signatures cannot be used in (legal) disputes
- * anymore, as the Mint is then allowed to destroy its side of the
+ * anymore, as the Exchange is then allowed to destroy its side of the
* evidence. @e end is expected to be significantly larger than @e
* expire (by a year or more).
*/
struct GNUNET_TIME_AbsoluteNBO end;
/**
- * The public online signing key that the mint will use
+ * The public online signing key that the exchange will use
* between @e start and @e expire.
*/
- struct TALER_MintPublicKeyP signkey_pub;
+ struct TALER_ExchangePublicKeyP signkey_pub;
};
/**
- * @brief Signature made by the mint over the full set of keys, used
- * to detect cheating mints that give out different sets to
+ * @brief Signature made by the exchange over the full set of keys, used
+ * to detect cheating exchanges that give out different sets to
* different users.
*/
-struct TALER_MintKeySetPS
+struct TALER_ExchangeKeySetPS
{
/**
- * Purpose is #TALER_SIGNATURE_MINT_KEY_SET. Signed
- * by a `struct TALER_MintPublicKeyP` using EdDSA.
+ * Purpose is #TALER_SIGNATURE_EXCHANGE_KEY_SET. Signed
+ * by a `struct TALER_ExchangePublicKeyP` using EdDSA.
*/
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
@@ -565,7 +571,7 @@ struct TALER_DenominationKeyValidityPS
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
/**
- * The long-term offline master key of the mint that was
+ * The long-term offline master key of the exchange that was
* used to create @e signature.
*/
struct TALER_MasterPublicKeyP master;
@@ -576,14 +582,14 @@ struct TALER_DenominationKeyValidityPS
struct GNUNET_TIME_AbsoluteNBO start;
/**
- * The mint will sign fresh coins between @e start and this time.
+ * The exchange will sign fresh coins between @e start and this time.
* @e expire_withdraw will be somewhat larger than @e start to
* ensure a sufficiently large anonymity set, while also allowing
- * the Mint to limit the financial damage in case of a key being
- * compromised. Thus, mints with low volume are expected to have a
- * longer withdraw period (@e expire_withdraw - @e start) than mints
+ * the Exchange to limit the financial damage in case of a key being
+ * compromised. Thus, exchanges with low volume are expected to have a
+ * longer withdraw period (@e expire_withdraw - @e start) than exchanges
* with high transaction volume. The period may also differ between
- * types of coins. A mint may also have a few denomination keys
+ * types of coins. A exchange may also have a few denomination keys
* with the same value with overlapping validity periods, to address
* issues such as clock skew.
*/
@@ -592,7 +598,7 @@ struct TALER_DenominationKeyValidityPS
/**
* Coins signed with the denomination key must be spent or refreshed
* between @e start and this expiration time. After this time, the
- * mint will refuse transactions involving this key as it will
+ * exchange will refuse transactions involving this key as it will
* "drop" the table with double-spending information (shortly after)
* this time. Note that wallets should refresh coins significantly
* before this time to be on the safe side. @e expire_spend must be
@@ -604,7 +610,7 @@ struct TALER_DenominationKeyValidityPS
/**
* When do signatures with this denomination key become invalid?
* After this point, these signatures cannot be used in (legal)
- * disputes anymore, as the Mint is then allowed to destroy its side
+ * disputes anymore, as the Exchange is then allowed to destroy its side
* of the evidence. @e expire_legal is expected to be significantly
* larger than @e expire_spend (by a year or more).
*/
@@ -616,19 +622,19 @@ struct TALER_DenominationKeyValidityPS
struct TALER_AmountNBO value;
/**
- * The fee the mint charges when a coin of this type is withdrawn.
+ * The fee the exchange charges when a coin of this type is withdrawn.
* (can be zero).
*/
struct TALER_AmountNBO fee_withdraw;
/**
- * The fee the mint charges when a coin of this type is deposited.
+ * The fee the exchange charges when a coin of this type is deposited.
* (can be zero).
*/
struct TALER_AmountNBO fee_deposit;
/**
- * The fee the mint charges when a coin of this type is refreshed.
+ * The fee the exchange charges when a coin of this type is refreshed.
* (can be zero).
*/
struct TALER_AmountNBO fee_refresh;
@@ -645,19 +651,24 @@ struct TALER_DenominationKeyValidityPS
/**
* @brief Information signed by an auditor affirming
* the master public key and the denomination keys
- * of a mint.
+ * of a exchange.
*/
-struct TALER_MintKeyValidityPS
+struct TALER_ExchangeKeyValidityPS
{
/**
- * Purpose is #TALER_SIGNATURE_AUDITOR_MINT_KEYS.
+ * Purpose is #TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS.
*/
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
/**
- * The long-term offline master key of the mint, affirmed by the
- * auditor.
+ * Hash of the auditor's URL.
+ */
+ struct GNUNET_HashCode auditor_url_hash;
+
+ /**
+ * The long-term offline master key of the exchange, affirmed by the
+ * auditor. Hashed string, including 0-terminator.
*/
struct TALER_MasterPublicKeyP master;
@@ -667,14 +678,14 @@ struct TALER_MintKeyValidityPS
struct GNUNET_TIME_AbsoluteNBO start;
/**
- * The mint will sign fresh coins between @e start and this time.
+ * The exchange will sign fresh coins between @e start and this time.
* @e expire_withdraw will be somewhat larger than @e start to
* ensure a sufficiently large anonymity set, while also allowing
- * the Mint to limit the financial damage in case of a key being
- * compromised. Thus, mints with low volume are expected to have a
- * longer withdraw period (@e expire_withdraw - @e start) than mints
+ * the Exchange to limit the financial damage in case of a key being
+ * compromised. Thus, exchanges with low volume are expected to have a
+ * longer withdraw period (@e expire_withdraw - @e start) than exchanges
* with high transaction volume. The period may also differ between
- * types of coins. A mint may also have a few denomination keys
+ * types of coins. A exchange may also have a few denomination keys
* with the same value with overlapping validity periods, to address
* issues such as clock skew.
*/
@@ -683,7 +694,7 @@ struct TALER_MintKeyValidityPS
/**
* Coins signed with the denomination key must be spent or refreshed
* between @e start and this expiration time. After this time, the
- * mint will refuse transactions involving this key as it will
+ * exchange will refuse transactions involving this key as it will
* "drop" the table with double-spending information (shortly after)
* this time. Note that wallets should refresh coins significantly
* before this time to be on the safe side. @e expire_spend must be
@@ -695,7 +706,7 @@ struct TALER_MintKeyValidityPS
/**
* When do signatures with this denomination key become invalid?
* After this point, these signatures cannot be used in (legal)
- * disputes anymore, as the Mint is then allowed to destroy its side
+ * disputes anymore, as the Exchange is then allowed to destroy its side
* of the evidence. @e expire_legal is expected to be significantly
* larger than @e expire_spend (by a year or more).
*/
@@ -707,19 +718,19 @@ struct TALER_MintKeyValidityPS
struct TALER_AmountNBO value;
/**
- * The fee the mint charges when a coin of this type is withdrawn.
+ * The fee the exchange charges when a coin of this type is withdrawn.
* (can be zero).
*/
struct TALER_AmountNBO fee_withdraw;
/**
- * The fee the mint charges when a coin of this type is deposited.
+ * The fee the exchange charges when a coin of this type is deposited.
* (can be zero).
*/
struct TALER_AmountNBO fee_deposit;
/**
- * The fee the mint charges when a coin of this type is refreshed.
+ * The fee the exchange charges when a coin of this type is refreshed.
* (can be zero).
*/
struct TALER_AmountNBO fee_refresh;
@@ -737,7 +748,7 @@ struct TALER_MintKeyValidityPS
* @brief For each (old) coin being melted, we have a `struct
* RefreshCommitLinkP` that allows the user to find the shared secret
* to decrypt the respective refresh links for the new coins in the
- * `struct TALER_MINTDB_RefreshCommitCoin`.
+ * `struct TALER_EXCHANGEDB_RefreshCommitCoin`.
*
* Part of the construction of the refresh session's hash and
* thus of what is signed there.
@@ -759,14 +770,15 @@ struct TALER_RefreshCommitLinkP
/**
- * @brief Information signed by the mint's master
- * key affirming the SEPA details for the mint.
+ * @brief Information signed by the exchange's master
+ * key affirming the SEPA details for the exchange.
*/
-struct TALER_MasterWireSepaDetailsPS
+struct TALER_MasterWireDetailsPS
{
/**
- * Purpose is #TALER_SIGNATURE_MASTER_SEPA_DETAILS.
+ * Purpose is #TALER_SIGNATURE_MASTER_SEPA_DETAILS or
+ * #TALER_SIGNATURE_MASTER_TEST_DETAILS.
*/
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
@@ -779,27 +791,6 @@ struct TALER_MasterWireSepaDetailsPS
};
-/**
- * @brief Information signed by a mint's online signing key affirming
- * the wire formats supported by the mint.
- */
-struct TALER_MintWireSupportMethodsPS
-{
-
- /**
- * Purpose is #TALER_SIGNATURE_MINT_WIRE_TYPES.
- */
- struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
-
- /**
- * Hash over the various wire formats supported by this mint
- * (all as 0-terminated strings).
- */
- struct GNUNET_HashCode h_wire_types GNUNET_PACKED;
-
-};
-
-
/**
* @brief Format used to generate the signature on a request to obtain
* the wire transfer identifier associated with a deposit.
@@ -841,13 +832,83 @@ struct TALER_DepositTrackPS
/**
* The coin's public key. This is the value that must have been
- * signed (blindly) by the Mint.
+ * signed (blindly) by the Exchange.
*/
struct TALER_CoinSpendPublicKeyP coin_pub;
};
+/**
+ * @brief Format internally used for packing the detailed information
+ * to generate the signature for /wire/deposit signatures.
+ */
+struct TALER_WireDepositDetailP
+{
+
+ /**
+ * Hash of the contract
+ */
+ struct GNUNET_HashCode h_contract;
+
+ /**
+ * Merchant's transaction ID in NBO.
+ */
+ uint64_t transaction_id GNUNET_PACKED;
+
+ /**
+ * Coin's public key.
+ */
+ struct TALER_CoinSpendPublicKeyP coin_pub;
+
+ /**
+ * Total value of the coin.
+ */
+ struct TALER_AmountNBO deposit_value;
+
+ /**
+ * Fees charged by the exchange for the deposit.
+ */
+ struct TALER_AmountNBO deposit_fee;
+
+};
+
+
+/**
+ * @brief Format used to generate the signature for /wire/deposit
+ * replies.
+ */
+struct TALER_WireDepositDataPS
+{
+ /**
+ * Purpose header for the signature over the contract with
+ * purpose #TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT.
+ */
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+
+ /**
+ * Total amount that was transferred.
+ */
+ struct TALER_AmountNBO total;
+
+ /**
+ * Public key of the merchant (for all aggregated transactions).
+ */
+ struct TALER_MerchantPublicKeyP merchant_pub;
+
+ /**
+ * Hash of wire details of the merchant.
+ */
+ struct GNUNET_HashCode h_wire;
+
+ /**
+ * Hash of the individual deposits that were aggregated,
+ * each in the format of a `struct TALER_WireDepositDetailP`.
+ */
+ struct GNUNET_HashCode h_details;
+
+};
+
/**
* The contract sent by the merchant to the wallet.
*/
@@ -896,14 +957,14 @@ struct TALER_ContractPS
/**
- * Details affirmed by the mint about a wire transfer the mint
+ * Details affirmed by the exchange about a wire transfer the exchange
* claims to have done with respect to a deposit operation.
*/
struct TALER_ConfirmWirePS
{
/**
* Purpose header for the signature over the contract with
- * purpose #TALER_SIGNATURE_MINT_CONFIRM_WIRE.
+ * purpose #TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE.
*/
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
@@ -924,7 +985,7 @@ struct TALER_ConfirmWirePS
/**
* The coin's public key. This is the value that must have been
- * signed (blindly) by the Mint.
+ * signed (blindly) by the Exchange.
*/
struct TALER_CoinSpendPublicKeyP coin_pub;
@@ -941,7 +1002,7 @@ struct TALER_ConfirmWirePS
uint64_t transaction_id GNUNET_PACKED;
/**
- * When did the mint execute this transfer? Note that the
+ * When did the exchange execute this transfer? Note that the
* timestamp may not be exactly the same on the wire, i.e.
* because the wire has a different timezone or resolution.
*/
diff --git a/src/include/taler_util.h b/src/include/taler_util.h
index 380901812..0b1d40c85 100644
--- a/src/include/taler_util.h
+++ b/src/include/taler_util.h
@@ -24,8 +24,6 @@
#include
#include "taler_amount_lib.h"
#include "taler_crypto_lib.h"
-#include "taler_json_lib.h"
-
/* Define logging functions */
@@ -97,41 +95,6 @@ TALER_b2s (const void *buf,
#define TALER_B2S(obj) TALER_b2s (obj, sizeof (*obj))
-/**
- * Round a time value so that it is suitable for transmission
- * via JSON encodings.
- *
- * @param at time to round
- * @return #GNUNET_OK if time was already rounded, #GNUNET_NO if
- * it was just now rounded
- */
-int
-TALER_round_abs_time (struct GNUNET_TIME_Absolute *at);
-
-
-/**
- * Round a time value so that it is suitable for transmission
- * via JSON encodings.
- *
- * @param rt time to round
- * @return #GNUNET_OK if time was already rounded, #GNUNET_NO if
- * it was just now rounded
- */
-int
-TALER_round_rel_time (struct GNUNET_TIME_Relative *rt);
-
-
-/**
- * Load configuration by parsing all configuration
- * files in the given directory.
- *
- * @param base_dir directory with the configuration files
- * @return NULL on error, otherwise configuration
- */
-struct GNUNET_CONFIGURATION_Handle *
-TALER_config_load (const char *base_dir);
-
-
/**
* Obtain denomination amount from configuration file.
*
@@ -147,40 +110,4 @@ TALER_config_get_denom (struct GNUNET_CONFIGURATION_Handle *cfg,
struct TALER_Amount *denom);
-/**
- * Get the path to a specific Taler installation directory or, with
- * #GNUNET_OS_IPK_SELF_PREFIX, the current running apps installation
- * directory.
- *
- * @param dirkind what kind of directory is desired?
- * @return a pointer to the dir path (to be freed by the caller)
- */
-char *
-TALER_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind);
-
-
-/**
- * Print out details on command line options (implements --help).
- *
- * @param ctx command line processing context
- * @param scls additional closure (points to about text)
- * @param option name of the option
- * @param value not used (NULL)
- * @return #GNUNET_NO (do not continue, not an error)
- */
-int
-TALER_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
- void *scls,
- const char *option,
- const char *value);
-
-/**
- * Macro defining the option to print the command line
- * help text (-h option).
- *
- * @param about string with brief description of the application
- */
-#define TALER_GETOPT_OPTION_HELP(about) \
- { 'h', "help", (const char *) NULL, gettext_noop("print this help"), 0, &TALER_GETOPT_format_help_, (void *) about }
-
#endif
diff --git a/src/include/taler_wire_plugin.h b/src/include/taler_wire_plugin.h
index 8fb194c57..9b2bc8fde 100644
--- a/src/include/taler_wire_plugin.h
+++ b/src/include/taler_wire_plugin.h
@@ -98,14 +98,51 @@ struct TALER_WIRE_Plugin
struct TALER_Amount *amount);
+ /**
+ * Obtain wire transfer details in the plugin-specific format
+ * from the configuration.
+ *
+ * @param cls closure
+ * @param cfg configuration with details about wire accounts
+ * @param account_name which section in the configuration should we parse
+ * @return NULL if @a cfg fails to have valid wire details for @a account_name
+ */
+ json_t *
+ (*get_wire_details)(void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *account_name);
+
+
+ /**
+ * Sign wire transfer details in the plugin-specific format.
+ *
+ * @param cls closure
+ * @param in wire transfer details in JSON format
+ * @param key private signing key to use
+ * @param salt salt to add
+ * @param[out] sig where to write the signature
+ * @return #GNUNET_OK on success
+ */
+ int
+ (*sign_wire_details)(void *cls,
+ const json_t *in,
+ const struct TALER_MasterPrivateKeyP *key,
+ const struct GNUNET_HashCode *salt,
+ struct TALER_MasterSignatureP *sig);
+
+
/**
* Check if the given wire format JSON object is correctly formatted
*
+ * @param cls the @e cls of this struct with the plugin-specific state
* @param wire the JSON wire format object
+ * @param master_pub public key of the exchange to verify against
* @return #GNUNET_YES if correctly formatted; #GNUNET_NO if not
*/
int
- (*wire_validate) (const json_t *wire);
+ (*wire_validate) (void *cls,
+ const json_t *wire,
+ const struct TALER_MasterPublicKeyP *master_pub);
/**
diff --git a/src/json/Makefile.am b/src/json/Makefile.am
new file mode 100644
index 000000000..6f71b8718
--- /dev/null
+++ b/src/json/Makefile.am
@@ -0,0 +1,38 @@
+# This Makefile.am is in the public domain
+AM_CPPFLAGS = -I$(top_srcdir)/src/include
+
+if USE_COVERAGE
+ AM_CFLAGS = --coverage -O0
+ XLIB = -lgcov
+endif
+
+lib_LTLIBRARIES = \
+ libtalerjson.la
+
+libtalerjson_la_SOURCES = \
+ json.c \
+ json_helper.c
+libtalerjson_la_LDFLAGS = \
+ -version-info 0:0:0 \
+ -export-dynamic -no-undefined
+libtalerjson_la_LIBADD = \
+ -lgnunetjson \
+ $(top_builddir)/src/util/libtalerutil.la \
+ -lgnunetutil \
+ -ljansson \
+ $(XLIB)
+
+TESTS = \
+ test_json
+
+check_PROGRAMS= \
+ test_json
+
+test_json_SOURCES = \
+ test_json.c
+test_json_LDADD = \
+ -ltalerjson \
+ -lgnunetjson \
+ $(top_builddir)/src/util/libtalerutil.la \
+ -lgnunetutil \
+ -ljansson
diff --git a/src/json/json.c b/src/json/json.c
new file mode 100644
index 000000000..da9e8b9f8
--- /dev/null
+++ b/src/json/json.c
@@ -0,0 +1,53 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2014, 2015, 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+*/
+/**
+ * @file json/json.c
+ * @brief helper functions for JSON processing using libjansson
+ * @author Sree Harsha Totakura
+ */
+#include "platform.h"
+#include
+#include "taler_util.h"
+#include "taler_json_lib.h"
+
+
+/**
+ * Hash a JSON for binary signing.
+ *
+ * @param[in] json some JSON value
+ * @param[out] hc resulting hash code
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
+ */
+int
+TALER_JSON_hash (const json_t *json,
+ struct GNUNET_HashCode *hc)
+{
+ char *wire_enc;
+ size_t len;
+
+ if (NULL == (wire_enc = json_dumps (json,
+ JSON_COMPACT | JSON_SORT_KEYS)))
+ return GNUNET_SYSERR;
+ len = strlen (wire_enc) + 1;
+ GNUNET_CRYPTO_hash (wire_enc,
+ len,
+ hc);
+ free (wire_enc);
+ return GNUNET_OK;
+}
+
+
+/* End of json/json.c */
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
new file mode 100644
index 000000000..7eaaa441a
--- /dev/null
+++ b/src/json/json_helper.c
@@ -0,0 +1,178 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2014, 2015, 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+*/
+/**
+ * @file json/json_helper.c
+ * @brief helper functions to generate specifications to parse
+ * Taler-specific JSON objects with libgnunetjson
+ * @author Sree Harsha Totakura
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include
+#include "taler_util.h"
+#include "taler_json_lib.h"
+
+
+/**
+ * Convert a TALER amount to a JSON object.
+ *
+ * @param amount the amount
+ * @return a json object describing the amount
+ */
+json_t *
+TALER_JSON_from_amount (const struct TALER_Amount *amount)
+{
+ json_t *j;
+
+ if ( (amount->value != (uint64_t) ((json_int_t) amount->value)) ||
+ (0 > ((json_int_t) amount->value)) )
+ {
+ /* Theoretically, json_int_t can be a 32-bit "long", or we might
+ have a 64-bit value which converted to a 63-bit signed long
+ long causes problems here. So we check. Note that depending
+ on the platform, the compiler may be able to statically tell
+ that at least the first check is always false. */
+ GNUNET_break (0);
+ return NULL;
+ }
+ j = json_pack ("{s:s, s:I, s:I}",
+ "currency", amount->currency,
+ "value", (json_int_t) amount->value,
+ "fraction", (json_int_t) amount->fraction);
+ GNUNET_assert (NULL != j);
+ return j;
+}
+
+
+/**
+ * Parse given JSON object to Amount
+ *
+ * @param cls closure, NULL
+ * @param root the json object representing data
+ * @param[out] spec where to write the data
+ * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
+ */
+static int
+parse_amount (void *cls,
+ json_t *root,
+ struct GNUNET_JSON_Specification *spec)
+{
+ struct TALER_Amount *r_amount = spec->ptr;
+ json_int_t value;
+ json_int_t fraction;
+ const char *currency;
+
+ memset (r_amount,
+ 0,
+ sizeof (struct TALER_Amount));
+ if (0 != json_unpack (root,
+ "{s:I, s:I, s:s}",
+ "value", &value,
+ "fraction", &fraction,
+ "currency", ¤cy))
+ {
+ char *json_enc;
+
+ if (NULL == (json_enc = json_dumps (root,
+ JSON_COMPACT | JSON_ENCODE_ANY)))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Malformed JSON amount: %s\n",
+ json_enc);
+ free (json_enc);
+ return GNUNET_SYSERR;
+ }
+ if ( (value < 0) ||
+ (fraction < 0) ||
+ (value > UINT64_MAX) ||
+ (fraction > UINT32_MAX) )
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
+ if (strlen (currency) >= TALER_CURRENCY_LEN)
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
+ r_amount->value = (uint64_t) value;
+ r_amount->fraction = (uint32_t) fraction;
+ strcpy (r_amount->currency, currency);
+ (void) TALER_amount_normalize (r_amount);
+ return GNUNET_OK;
+}
+
+
+
+/**
+ * Provide specification to parse given JSON object to an amount.
+ *
+ * @param name name of the amount field in the JSON
+ * @param[out] r_amount where the amount has to be written
+ */
+struct GNUNET_JSON_Specification
+TALER_JSON_spec_amount (const char *name,
+ struct TALER_Amount *r_amount)
+{
+ struct GNUNET_JSON_Specification ret = {
+ .parser = &parse_amount,
+ .cleaner = NULL,
+ .cls = NULL,
+ .field = name,
+ .ptr = r_amount,
+ .ptr_size = 0,
+ .size_ptr = NULL
+ };
+ return ret;
+}
+
+
+/**
+ * Generate line in parser specification for denomination public key.
+ *
+ * @param field name of the field
+ * @param[out] pk key to initialize
+ * @return corresponding field spec
+ */
+struct GNUNET_JSON_Specification
+TALER_JSON_spec_denomination_public_key (const char *field,
+ struct TALER_DenominationPublicKey *pk)
+{
+ return GNUNET_JSON_spec_rsa_public_key (field,
+ &pk->rsa_public_key);
+}
+
+
+/**
+ * Generate line in parser specification for denomination signature.
+ *
+ * @param field name of the field
+ * @param sig the signature to initialize
+ * @return corresponding field spec
+ */
+struct GNUNET_JSON_Specification
+TALER_JSON_spec_denomination_signature (const char *field,
+ struct TALER_DenominationSignature *sig)
+{
+ return GNUNET_JSON_spec_rsa_signature (field,
+ &sig->rsa_signature);
+}
+
+
+/* end of json/json_helper.c */
diff --git a/src/json/test_json.c b/src/json/test_json.c
new file mode 100644
index 000000000..9f42dbd34
--- /dev/null
+++ b/src/json/test_json.c
@@ -0,0 +1,71 @@
+/*
+ This file is part of TALER
+ (C) 2015, 2016 GNUnet e.V. and Inria
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+*/
+
+/**
+ * @file json/test_json.c
+ * @brief Tests for Taler-specific crypto logic
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include "taler_util.h"
+#include "taler_json_lib.h"
+
+
+/**
+ * Test amount conversion from/to JSON.
+ *
+ * @return 0 on success
+ */
+static int
+test_amount ()
+{
+ json_t *j;
+ struct TALER_Amount a1;
+ struct TALER_Amount a2;
+ struct GNUNET_JSON_Specification spec[] = {
+ TALER_JSON_spec_amount (NULL, &a2),
+ GNUNET_JSON_spec_end()
+ };
+
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount ("EUR:4.3",
+ &a1));
+ j = TALER_JSON_from_amount (&a1);
+ GNUNET_assert (NULL != j);
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_JSON_parse (j, spec,
+ NULL, NULL));
+ GNUNET_assert (0 ==
+ TALER_amount_cmp (&a1,
+ &a2));
+ json_decref (j);
+ return 0;
+}
+
+
+int
+main(int argc,
+ const char *const argv[])
+{
+ GNUNET_log_setup ("test-json",
+ "WARNING",
+ NULL);
+ if (0 != test_amount ())
+ return 1;
+ return 0;
+}
+
+/* end of test_json.c */
diff --git a/src/mint-lib/Makefile.am b/src/mint-lib/Makefile.am
deleted file mode 100644
index 171a42464..000000000
--- a/src/mint-lib/Makefile.am
+++ /dev/null
@@ -1,62 +0,0 @@
-# This Makefile.am is in the public domain
-AM_CPPFLAGS = -I$(top_srcdir)/src/include
-
-if USE_COVERAGE
- AM_CFLAGS = --coverage -O0
- XLIB = -lgcov
-endif
-
-lib_LTLIBRARIES = \
- libtalermint.la
-
-libtalermint_la_LDFLAGS = \
- -version-info 0:0:0 \
- -no-undefined
-
-libtalermint_la_SOURCES = \
- mint_api_common.c mint_api_common.h \
- mint_api_context.c mint_api_context.h \
- mint_api_json.c mint_api_json.h \
- mint_api_handle.c mint_api_handle.h \
- mint_api_admin.c \
- mint_api_deposit.c \
- mint_api_deposit_wtid.c \
- mint_api_refresh.c \
- mint_api_refresh_link.c \
- mint_api_reserve.c \
- mint_api_wire.c \
- mint_api_wire_deposits.c
-
-libtalermint_la_LIBADD = \
- -lgnunetutil \
- -ljansson \
- $(XLIB)
-
-if HAVE_LIBCURL
-libtalermint_la_LIBADD += -lcurl
-else
-if HAVE_LIBGNURL
-libtalermint_la_LIBADD += -lgnurl
-endif
-endif
-
-check_PROGRAMS = \
- test_mint_api
-
-TESTS = \
- $(check_PROGRAMS)
-
-test_mint_api_SOURCES = \
- test_mint_api.c
-test_mint_api_LDADD = \
- libtalermint.la \
- $(LIBGCRYPT_LIBS) \
- $(top_builddir)/src/util/libtalerutil.la \
- -lgnunetutil \
- -ljansson
-
-EXTRA_DIST = \
- test-mint-home/config/mint-common.conf \
- test-mint-home/master.priv \
- test-mint-home/denomkeys/ \
- test-mint-home/signkeys/
diff --git a/src/mint-lib/mint_api_json.c b/src/mint-lib/mint_api_json.c
deleted file mode 100644
index 7de33e5eb..000000000
--- a/src/mint-lib/mint_api_json.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU Affero General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License along with
- TALER; see the file COPYING. If not, If not, see
-*/
-/**
- * @file mint-lib/mint_api_json.c
- * @brief functions to parse incoming requests (JSON snippets)
- * @author Florian Dold
- * @author Benedikt Mueller
- * @author Christian Grothoff
- */
-#include "platform.h"
-#include "mint_api_json.h"
-
-/**
- * Navigate and parse data in a JSON tree.
- *
- * @param root the JSON node to start the navigation at.
- * @param spec parse specification array
- * @return offset in @a spec where parsing failed, -1 on success (!)
- */
-static int
-parse_json (json_t *root,
- struct MAJ_Specification *spec)
-{
- int i;
- json_t *pos; /* what's our current position? */
-
- pos = root;
- for (i=0;MAJ_CMD_END != spec[i].cmd;i++)
- {
- pos = json_object_get (root,
- spec[i].field);
- if (NULL == pos)
- {
- GNUNET_break_op (0);
- return i;
- }
- switch (spec[i].cmd)
- {
- case MAJ_CMD_END:
- GNUNET_assert (0);
- return i;
- case MAJ_CMD_AMOUNT:
- if (GNUNET_OK !=
- TALER_json_to_amount (pos,
- spec[i].details.amount))
- {
- GNUNET_break_op (0);
- return i;
- }
- break;
- case MAJ_CMD_TIME_ABSOLUTE:
- if (GNUNET_OK !=
- TALER_json_to_abs (pos,
- spec[i].details.abs_time))
- {
- GNUNET_break_op (0);
- return i;
- }
- break;
-
- case MAJ_CMD_STRING:
- {
- const char *str;
-
- str = json_string_value (pos);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- return i;
- }
- *spec[i].details.strptr = str;
- }
- break;
-
- case MAJ_CMD_BINARY_FIXED:
- {
- const char *str;
- int res;
-
- str = json_string_value (pos);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- return i;
- }
- res = GNUNET_STRINGS_string_to_data (str, strlen (str),
- spec[i].details.fixed_data.dest,
- spec[i].details.fixed_data.dest_size);
- if (GNUNET_OK != res)
- {
- GNUNET_break_op (0);
- return i;
- }
- }
- break;
-
- case MAJ_CMD_BINARY_VARIABLE:
- {
- const char *str;
- size_t size;
- void *data;
- int res;
-
- str = json_string_value (pos);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- return i;
- }
- size = (strlen (str) * 5) / 8;
- if (size >= 1024)
- {
- GNUNET_break_op (0);
- return i;
- }
- data = GNUNET_malloc (size);
- res = GNUNET_STRINGS_string_to_data (str,
- strlen (str),
- data,
- size);
- if (GNUNET_OK != res)
- {
- GNUNET_break_op (0);
- GNUNET_free (data);
- return i;
- }
- *spec[i].details.variable_data.dest_p = data;
- *spec[i].details.variable_data.dest_size_p = size;
- }
- break;
-
- case MAJ_CMD_RSA_PUBLIC_KEY:
- {
- size_t size;
- const char *str;
- int res;
- void *buf;
-
- str = json_string_value (pos);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- return i;
- }
- size = (strlen (str) * 5) / 8;
- buf = GNUNET_malloc (size);
- res = GNUNET_STRINGS_string_to_data (str,
- strlen (str),
- buf,
- size);
- if (GNUNET_OK != res)
- {
- GNUNET_free (buf);
- GNUNET_break_op (0);
- return i;
- }
- *spec[i].details.rsa_public_key
- = GNUNET_CRYPTO_rsa_public_key_decode (buf,
- size);
- GNUNET_free (buf);
- if (NULL == spec[i].details.rsa_public_key)
- {
- GNUNET_break_op (0);
- return i;
- }
- }
- break;
-
- case MAJ_CMD_RSA_SIGNATURE:
- {
- size_t size;
- const char *str;
- int res;
- void *buf;
-
- str = json_string_value (pos);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- return i;
- }
- size = (strlen (str) * 5) / 8;
- buf = GNUNET_malloc (size);
- res = GNUNET_STRINGS_string_to_data (str,
- strlen (str),
- buf,
- size);
- if (GNUNET_OK != res)
- {
- GNUNET_free (buf);
- GNUNET_break_op (0);
- return i;
- }
- *spec[i].details.rsa_signature
- = GNUNET_CRYPTO_rsa_signature_decode (buf,
- size);
- GNUNET_free (buf);
- if (NULL == spec[i].details.rsa_signature)
- return i;
- }
- break;
-
- case MAJ_CMD_UINT16:
- {
- json_int_t val;
-
- if (! json_is_integer (pos))
- {
- GNUNET_break_op (0);
- return i;
- }
- val = json_integer_value (pos);
- if ( (0 > val) || (val > UINT16_MAX) )
- {
- GNUNET_break_op (0);
- return i;
- }
- *spec[i].details.u16 = (uint16_t) val;
- }
- break;
-
- case MAJ_CMD_UINT64:
- {
- json_int_t val;
-
- if (! json_is_integer (pos))
- {
- GNUNET_break_op (0);
- return i;
- }
- val = json_integer_value (pos);
- *spec[i].details.u64 = (uint64_t) val;
- }
- break;
-
- case MAJ_CMD_JSON_OBJECT:
- {
- if (! (json_is_object (pos) || json_is_array (pos)) )
- {
- GNUNET_break_op (0);
- return i;
- }
- json_incref (pos);
- *spec[i].details.obj = pos;
- }
- break;
-
- default:
- GNUNET_break (0);
- return i;
- }
- }
- return -1; /* all OK! */
-}
-
-
-/**
- * Free all elements allocated during a
- * #MAJ_parse_json() operation.
- *
- * @param spec specification of the parse operation
- * @param end number of elements in @a spec to process
- */
-static void
-parse_free (struct MAJ_Specification *spec,
- int end)
-{
- int i;
-
- for (i=0;i
-*/
-/**
- * @file mint-lib/mint_api_json.h
- * @brief functions to parse incoming requests (JSON snippets)
- * @author Florian Dold
- * @author Benedikt Mueller
- * @author Christian Grothoff
- */
-#include "platform.h"
-#include
-#include "taler_util.h"
-#include
-
-
-/**
- * Enumeration with the various commands for the
- * #MAJ_parse_json interpreter.
- */
-enum MAJ_Command
-{
-
- /**
- * End of command list.
- */
- MAJ_CMD_END,
-
- /**
- * Parse amount at current position.
- */
- MAJ_CMD_AMOUNT,
-
- /**
- * Parse absolute time at current position.
- */
- MAJ_CMD_TIME_ABSOLUTE,
-
- /**
- * Parse fixed binary value at current position.
- */
- MAJ_CMD_BINARY_FIXED,
-
- /**
- * Parse variable-size binary value at current position.
- */
- MAJ_CMD_BINARY_VARIABLE,
-
- /**
- * Parse RSA public key at current position.
- */
- MAJ_CMD_RSA_PUBLIC_KEY,
-
- /**
- * Parse RSA signature at current position.
- */
- MAJ_CMD_RSA_SIGNATURE,
-
- /**
- * Parse `const char *` JSON string at current position.
- */
- MAJ_CMD_STRING,
-
- /**
- * Parse `uint16_t` integer at the current position.
- */
- MAJ_CMD_UINT16,
-
- /**
- * Parse `uint64_t` integer at the current position.
- */
- MAJ_CMD_UINT64,
-
- /**
- * Parse JSON object at the current position.
- */
- MAJ_CMD_JSON_OBJECT,
-
- /**
- * Parse ??? at current position.
- */
- MAJ_CMD_C
-
-};
-
-
-/**
- * @brief Entry in parser specification for #MAJ_parse_json.
- */
-struct MAJ_Specification
-{
-
- /**
- * Command to execute.
- */
- enum MAJ_Command cmd;
-
- /**
- * Name of the field to access.
- */
- const char *field;
-
- /**
- * Further details for the command.
- */
- union {
-
- /**
- * Where to store amount for #MAJ_CMD_AMOUNT.
- */
- struct TALER_Amount *amount;
-
- /**
- * Where to store time, for #MAJ_CMD_TIME_ABSOLUTE.
- */
- struct GNUNET_TIME_Absolute *abs_time;
-
- /**
- * Where to write binary data, for #MAJ_CMD_BINARY_FIXED.
- */
- struct {
- /**
- * Where to write the data.
- */
- void *dest;
-
- /**
- * How many bytes to write to @e dest.
- */
- size_t dest_size;
-
- } fixed_data;
-
- /**
- * Where to write binary data, for #MAJ_CMD_BINARY_VARIABLE.
- */
- struct {
- /**
- * Where to store the pointer with the data (is allocated).
- */
- void **dest_p;
-
- /**
- * Where to store the number of bytes allocated at `*dest`.
- */
- size_t *dest_size_p;
-
- } variable_data;
-
- /**
- * Where to store the RSA public key for #MAJ_CMD_RSA_PUBLIC_KEY
- */
- struct GNUNET_CRYPTO_rsa_PublicKey **rsa_public_key;
-
- /**
- * Where to store the RSA signature for #MAJ_CMD_RSA_SIGNATURE
- */
- struct GNUNET_CRYPTO_rsa_Signature **rsa_signature;
-
- /**
- * Details for #MAJ_CMD_EDDSA_SIGNATURE
- */
- struct {
-
- /**
- * Where to store the purpose.
- */
- struct GNUNET_CRYPTO_EccSignaturePurpose **purpose_p;
-
- /**
- * Key to verify the signature against.
- */
- const struct GNUNET_CRYPTO_EddsaPublicKey *pub_key;
-
- } eddsa_signature;
-
- /**
- * Where to store a pointer to the string.
- */
- const char **strptr;
-
- /**
- * Where to store 16-bit integer.
- */
- uint16_t *u16;
-
- /**
- * Where to store 64-bit integer.
- */
- uint64_t *u64;
-
- /**
- * Where to store a JSON object.
- */
- json_t **obj;
-
- } details;
-
-};
-
-
-/**
- * Navigate and parse data in a JSON tree.
- *
- * @param root the JSON node to start the navigation at.
- * @param spec parse specification array
- * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
- */
-int
-MAJ_parse_json (const json_t *root,
- struct MAJ_Specification *spec);
-
-
-/**
- * Free all elements allocated during a
- * #MAJ_parse_json() operation.
- *
- * @param spec specification of the parse operation
- */
-void
-MAJ_parse_free (struct MAJ_Specification *spec);
-
-
-/**
- * End of a parser specification.
- */
-#define MAJ_spec_end { .cmd = MAJ_CMD_END }
-
-/**
- * Fixed size object (in network byte order, encoded using Crockford
- * Base32hex encoding).
- *
- * @param name name of the JSON field
- * @param obj pointer where to write the data (type of `*obj` will determine size)
- */
-#define MAJ_spec_fixed_auto(name,obj) { .cmd = MAJ_CMD_BINARY_FIXED, .field = name, .details.fixed_data.dest = obj, .details.fixed_data.dest_size = sizeof (*obj) }
-
-
-/**
- * Variable size object (in network byte order, encoded using Crockford
- * Base32hex encoding).
- *
- * @param name name of the JSON field
- * @param obj pointer where to write the data (a `void **`)
- * @param size where to store the number of bytes allocated for @a obj (of type `size_t *`
- */
-#define MAJ_spec_varsize(name,obj,size) { .cmd = MAJ_CMD_BINARY_VARIABLE, .field = name, .details.variable_data.dest_p = obj, .details.variable_data.dest_size_p = size }
-
-
-/**
- * The expected field stores a string.
- *
- * @param name name of the JSON field
- * @param strptr where to store a pointer to the field
- */
-struct MAJ_Specification
-MAJ_spec_string (const char *name,
- const char **strptr);
-
-
-/**
- * Absolute time.
- *
- * @param name name of the JSON field
- * @param[out] at where to store the absolute time found under @a name
- */
-struct MAJ_Specification
-MAJ_spec_absolute_time (const char *name,
- struct GNUNET_TIME_Absolute *at);
-
-
-/**
- * 16-bit integer.
- *
- * @param name name of the JSON field
- * @param[out] u16 where to store the integer found under @a name
- */
-struct MAJ_Specification
-MAJ_spec_uint16 (const char *name,
- uint16_t *u16);
-
-
-/**
- * 64-bit integer.
- *
- * @param name name of the JSON field
- * @param[out] u64 where to store the integer found under @a name
- */
-struct MAJ_Specification
-MAJ_spec_uint64 (const char *name,
- uint64_t *u64);
-
-
-/**
- * JSON object.
- *
- * @param name name of the JSON field
- * @param[out] jsonp where to store the JSON found under @a name
- */
-struct MAJ_Specification
-MAJ_spec_json (const char *name,
- json_t **jsonp);
-
-
-/**
- * Specification for parsing an amount value.
- *
- * @param name name of the JSON field
- * @param amount where to store the amount under @a name
- */
-struct MAJ_Specification
-MAJ_spec_amount (const char *name,
- struct TALER_Amount *amount);
-
-
-/**
- * Specification for parsing an RSA public key.
- *
- * @param name name of the JSON field
- * @param pk where to store the RSA key found under @a name
- */
-struct MAJ_Specification
-MAJ_spec_rsa_public_key (const char *name,
- struct GNUNET_CRYPTO_rsa_PublicKey **pk);
-
-
-/**
- * Specification for parsing an RSA signature.
- *
- * @param name name of the JSON field
- * @param sig where to store the RSA signature found under @a name
- */
-struct MAJ_Specification
-MAJ_spec_rsa_signature (const char *name,
- struct GNUNET_CRYPTO_rsa_Signature **sig);
-
-
-
-
-/* end of mint_api_json.h */
diff --git a/src/mint-lib/mint_api_wire.c b/src/mint-lib/mint_api_wire.c
deleted file mode 100644
index 0947354ad..000000000
--- a/src/mint-lib/mint_api_wire.c
+++ /dev/null
@@ -1,620 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, If not, see
-
-*/
-/**
- * @file mint-lib/mint_api_wire.c
- * @brief Implementation of the /wire request of the mint's HTTP API
- * @author Christian Grothoff
- */
-#include "platform.h"
-#include
-#include
-#include /* just for HTTP status codes */
-#include
-#include "taler_mint_service.h"
-#include "mint_api_common.h"
-#include "mint_api_json.h"
-#include "mint_api_context.h"
-#include "mint_api_handle.h"
-#include "taler_signatures.h"
-
-
-/**
- * @brief A Wire Handle
- */
-struct TALER_MINT_WireHandle
-{
-
- /**
- * The connection to mint this request handle will use
- */
- struct TALER_MINT_Handle *mint;
-
- /**
- * The url for this request.
- */
- char *url;
-
- /**
- * Handle for the request.
- */
- struct MAC_Job *job;
-
- /**
- * Function to call with the result.
- */
- TALER_MINT_WireResultCallback cb;
-
- /**
- * Closure for @a cb.
- */
- void *cb_cls;
-
- /**
- * Download buffer
- */
- struct MAC_DownloadBuffer db;
-
- /**
- * Set to the "methods" JSON array returned by the
- * /wire request.
- */
- json_t *methods;
-
- /**
- * Current iteration offset in the @e methods array.
- */
- unsigned int methods_off;
-
-};
-
-
-/**
- * Verify that the signature on the "200 OK" response
- * for /wire/sepa from the mint is valid.
- *
- * @param wh wire handle
- * @param json json reply with the signature
- * @return #GNUNET_SYSERR if @a json is invalid,
- * #GNUNET_NO if the method is unknown,
- * #GNUNET_OK if the json is valid
- */
-static int
-verify_wire_sepa_signature_ok (const struct TALER_MINT_WireHandle *wh,
- json_t *json)
-{
- struct TALER_MasterSignatureP mint_sig;
- struct TALER_MasterWireSepaDetailsPS mp;
- const char *receiver_name;
- const char *iban;
- const char *bic;
- const struct TALER_MINT_Keys *key_state;
- struct GNUNET_HashContext *hc;
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("sig", &mint_sig),
- MAJ_spec_string ("receiver_name", &receiver_name),
- MAJ_spec_string ("iban", &iban),
- MAJ_spec_string ("bic", &bic),
- MAJ_spec_end
- };
-
- if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
- {
- GNUNET_break_op (0);
- return GNUNET_SYSERR;
- }
-
- key_state = TALER_MINT_get_keys (wh->mint);
- mp.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_SEPA_DETAILS);
- mp.purpose.size = htonl (sizeof (struct TALER_MasterWireSepaDetailsPS));
- hc = GNUNET_CRYPTO_hash_context_start ();
- GNUNET_CRYPTO_hash_context_read (hc,
- receiver_name,
- strlen (receiver_name) + 1);
- GNUNET_CRYPTO_hash_context_read (hc,
- iban,
- strlen (iban) + 1);
- GNUNET_CRYPTO_hash_context_read (hc,
- bic,
- strlen (bic) + 1);
- GNUNET_CRYPTO_hash_context_finish (hc,
- &mp.h_sepa_details);
-
- if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SEPA_DETAILS,
- &mp.purpose,
- &mint_sig.eddsa_signature,
- &key_state->master_pub.eddsa_pub))
- {
- GNUNET_break_op (0);
- MAJ_parse_free (spec);
- return GNUNET_SYSERR;
- }
- MAJ_parse_free (spec);
- return GNUNET_OK;
-}
-
-
-/**
- * Verify that the signature on the "200 OK" response
- * for /wire/METHOD from the mint is valid.
- *
- * @param wh wire handle with key material
- * @param method method to verify the reply for
- * @param json json reply with the signature
- * @return #GNUNET_SYSERR if @a json is invalid,
- * #GNUNET_NO if the method is unknown,
- * #GNUNET_OK if the json is valid
- */
-static int
-verify_wire_method_signature_ok (const struct TALER_MINT_WireHandle *wh,
- const char *method,
- json_t *json)
-{
- struct
- {
- /**
- * Name fo the method.
- */
- const char *method;
-
- /**
- * Handler to invoke to verify signature.
- *
- * @param wh wire handle with key material
- * @param json json reply with signature to verify
- */
- int (*handler)(const struct TALER_MINT_WireHandle *wh,
- json_t *json);
- } handlers[] = {
- { "sepa", &verify_wire_sepa_signature_ok },
- { NULL, NULL }
- };
- unsigned int i;
-
- for (i=0;NULL != handlers[i].method; i++)
- if (0 == strcasecmp (handlers[i].method,
- method))
- return handlers[i].handler (wh,
- json);
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Wire transfer method `%s' not supported\n",
- method);
- return GNUNET_NO;
-}
-
-
-/**
- * Perform the next /wire/method request or signal
- * the end of the iteration.
- *
- * @param wh the wire handle
- * @return a handle for this request
- */
-static void
-request_wire_method (struct TALER_MINT_WireHandle *wh);
-
-
-/**
- * Function called when we're done processing the
- * HTTP /wire/METHOD request.
- *
- * @param cls the `struct TALER_MINT_WireHandle`
- * @param eh the curl request handle
- */
-static void
-handle_wire_method_finished (void *cls,
- CURL *eh)
-{
- struct TALER_MINT_WireHandle *wh = cls;
- long response_code;
- json_t *json;
-
- wh->job = NULL;
- json = MAC_download_get_result (&wh->db,
- eh,
- &response_code);
- switch (response_code)
- {
- case 0:
- break;
- case MHD_HTTP_OK:
- {
- const char *method;
-
- method = json_string_value (json_array_get (wh->methods,
- wh->methods_off - 1));
- if (GNUNET_OK !=
- verify_wire_method_signature_ok (wh,
- method,
- json))
- {
- GNUNET_break_op (0);
- response_code = 0;
- break;
- }
- break;
- }
- case MHD_HTTP_FOUND:
- /* /wire/test returns a 302 redirect, we should just give
- this information back to the callback below */
- break;
- case MHD_HTTP_BAD_REQUEST:
- /* This should never happen, either us or the mint is buggy
- (or API version conflict); just pass JSON reply to the application */
- break;
- case MHD_HTTP_NOT_FOUND:
- /* Nothing really to verify, this should never
- happen, we should pass the JSON reply to the application */
- break;
- case MHD_HTTP_INTERNAL_SERVER_ERROR:
- /* Server had an internal issue; we should retry, but this API
- leaves this to the application */
- break;
- default:
- /* unexpected response code */
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u\n",
- response_code);
- GNUNET_break (0);
- response_code = 0;
- break;
- }
- if (0 == response_code)
- {
- /* signal end of iteration */
- wh->cb (wh->cb_cls,
- 0,
- NULL,
- NULL);
- json_decref (json);
- TALER_MINT_wire_cancel (wh);
- return;
- }
- /* pass on successful reply */
- wh->cb (wh->cb_cls,
- response_code,
- json_string_value (json_array_get (wh->methods,
- wh->methods_off-1)),
- json);
- /* trigger request for the next /wire/method */
- request_wire_method (wh);
-}
-
-
-/**
- * Perform the next /wire/method request or signal
- * the end of the iteration.
- *
- * @param wh the wire handle
- * @return a handle for this request
- */
-static void
-request_wire_method (struct TALER_MINT_WireHandle *wh)
-{
- struct TALER_MINT_Context *ctx;
- CURL *eh;
- char *path;
-
- if (json_array_size (wh->methods) <= wh->methods_off)
- {
- /* we are done, signal end of iteration */
- wh->cb (wh->cb_cls,
- 0,
- NULL,
- NULL);
- TALER_MINT_wire_cancel (wh);
- return;
- }
- GNUNET_free_non_null (wh->db.buf);
- wh->db.buf = NULL;
- wh->db.buf_size = 0;
- wh->db.eno = 0;
- GNUNET_free_non_null (wh->url);
- GNUNET_asprintf (&path,
- "/wire/%s",
- json_string_value (json_array_get (wh->methods,
- wh->methods_off++)));
- wh->url = MAH_path_to_url (wh->mint,
- path);
- GNUNET_free (path);
-
- eh = curl_easy_init ();
- GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (eh,
- CURLOPT_URL,
- wh->url));
- GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (eh,
- CURLOPT_WRITEFUNCTION,
- &MAC_download_cb));
- GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (eh,
- CURLOPT_WRITEDATA,
- &wh->db));
- /* The default is 'disabled', but let's be sure */
- GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (eh,
- CURLOPT_FOLLOWLOCATION,
- (long) 0));
- ctx = MAH_handle_to_context (wh->mint);
- wh->job = MAC_job_add (ctx,
- eh,
- GNUNET_YES,
- &handle_wire_method_finished,
- wh);
- TALER_MINT_perform (ctx);
-}
-
-
-/**
- * Verify that the signature on the "200 OK" response
- * for /wire from the mint is valid.
- *
- * @param wh wire handle
- * @param json json reply with the signature
- * @return NULL if @a json is invalid, otherwise the
- * "methods" array (with an RC of 1)
- */
-static json_t *
-verify_wire_signature_ok (const struct TALER_MINT_WireHandle *wh,
- json_t *json)
-{
- struct TALER_MintSignatureP mint_sig;
- struct TALER_MintPublicKeyP mint_pub;
- struct TALER_MintWireSupportMethodsPS mp;
- json_t *methods;
- const struct TALER_MINT_Keys *key_state;
- struct GNUNET_HashContext *hc;
- struct MAJ_Specification spec[] = {
- MAJ_spec_fixed_auto ("sig", &mint_sig),
- MAJ_spec_fixed_auto ("pub", &mint_pub),
- MAJ_spec_json ("methods", &methods),
- MAJ_spec_end
- };
- unsigned int i;
-
- if (GNUNET_OK !=
- MAJ_parse_json (json,
- spec))
- {
- GNUNET_break_op (0);
- return NULL;
- }
- if (! json_is_array (methods))
- {
- GNUNET_break_op (0);
- MAJ_parse_free (spec);
- return NULL;
- }
-
- key_state = TALER_MINT_get_keys (wh->mint);
- if (GNUNET_OK !=
- TALER_MINT_test_signing_key (key_state,
- &mint_pub))
- {
- GNUNET_break_op (0);
- return NULL;
- }
- hc = GNUNET_CRYPTO_hash_context_start ();
- for (i=0;ijob = NULL;
- json = MAC_download_get_result (&wh->db,
- eh,
- &response_code);
- switch (response_code)
- {
- case 0:
- break;
- case MHD_HTTP_OK:
- {
- json_t *methods;
-
- if (NULL ==
- (methods = verify_wire_signature_ok (wh,
- json)))
- {
- GNUNET_break_op (0);
- response_code = 0;
- break;
- }
- wh->methods = methods;
- request_wire_method (wh);
- return;
- }
- break;
- case MHD_HTTP_BAD_REQUEST:
- /* This should never happen, either us or the mint is buggy
- (or API version conflict); just pass JSON reply to the application */
- break;
- case MHD_HTTP_NOT_FOUND:
- /* Nothing really to verify, this should never
- happen, we should pass the JSON reply to the application */
- break;
- case MHD_HTTP_INTERNAL_SERVER_ERROR:
- /* Server had an internal issue; we should retry, but this API
- leaves this to the application */
- break;
- default:
- /* unexpected response code */
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u\n",
- response_code);
- GNUNET_break (0);
- response_code = 0;
- break;
- }
- if (0 != response_code)
- {
- /* pass on successful reply */
- wh->cb (wh->cb_cls,
- response_code,
- NULL,
- json);
- }
- /* signal end of iteration */
- wh->cb (wh->cb_cls,
- 0,
- NULL,
- NULL);
- if (NULL != json)
- json_decref (json);
- TALER_MINT_wire_cancel (wh);
-}
-
-
-/**
- * Obtain information about a mint's wire instructions.
- * A mint may provide wire instructions for creating
- * a reserve. The wire instructions also indicate
- * which wire formats merchants may use with the mint.
- * This API is typically used by a wallet for wiring
- * funds, and possibly by a merchant to determine
- * supported wire formats.
- *
- * Note that while we return the (main) response verbatim to the
- * caller for further processing, we do already verify that the
- * response is well-formed (i.e. that signatures included in the
- * response are all valid). If the mint's reply is not well-formed,
- * we return an HTTP status code of zero to @a cb.
- *
- * @param mint the mint handle; the mint must be ready to operate
- * @param wire_cb the callback to call when a reply for this request is available
- * @param wire_cb_cls closure for the above callback
- * @return a handle for this request
- */
-struct TALER_MINT_WireHandle *
-TALER_MINT_wire (struct TALER_MINT_Handle *mint,
- TALER_MINT_WireResultCallback wire_cb,
- void *wire_cb_cls)
-{
- struct TALER_MINT_WireHandle *wh;
- struct TALER_MINT_Context *ctx;
- CURL *eh;
-
- if (GNUNET_YES !=
- MAH_handle_is_ready (mint))
- {
- GNUNET_break (0);
- return NULL;
- }
- wh = GNUNET_new (struct TALER_MINT_WireHandle);
- wh->mint = mint;
- wh->cb = wire_cb;
- wh->cb_cls = wire_cb_cls;
- wh->url = MAH_path_to_url (mint, "/wire");
-
- eh = curl_easy_init ();
- GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (eh,
- CURLOPT_URL,
- wh->url));
- GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (eh,
- CURLOPT_WRITEFUNCTION,
- &MAC_download_cb));
- GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (eh,
- CURLOPT_WRITEDATA,
- &wh->db));
- ctx = MAH_handle_to_context (mint);
- wh->job = MAC_job_add (ctx,
- eh,
- GNUNET_YES,
- &handle_wire_finished,
- wh);
- return wh;
-}
-
-
-/**
- * Cancel a wire information request. This function cannot be used
- * on a request handle if a response is already served for it.
- *
- * @param wh the wire information request handle
- */
-void
-TALER_MINT_wire_cancel (struct TALER_MINT_WireHandle *wh)
-{
- if (NULL != wh->job)
- {
- MAC_job_cancel (wh->job);
- wh->job = NULL;
- }
- if (NULL != wh->methods)
- {
- json_decref (wh->methods);
- wh->methods = NULL;
- }
- GNUNET_free_non_null (wh->db.buf);
- GNUNET_free (wh->url);
- GNUNET_free (wh);
-}
-
-
-/* end of mint_api_wire.c */
diff --git a/src/mint-lib/test-mint-home/config/mint-common.conf b/src/mint-lib/test-mint-home/config/mint-common.conf
deleted file mode 100644
index b2b948268..000000000
--- a/src/mint-lib/test-mint-home/config/mint-common.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-[mint]
-# Currency supported by the mint (can only be one)
-CURRENCY = EUR
-
-# Wire format supported by the mint
-# We use 'test' for testing of the actual
-# coin operations, and 'sepa' to test SEPA-specific routines.
-WIREFORMAT = test sepa
-
-# HTTP port the mint listens to
-PORT = 8081
-
-# Master public key used to sign the mint's various keys
-MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
-
-# How to access our database
-DB = postgres
-
-# Is this is a testcase, use transient DB actions?
-TESTRUN = YES
-
-[mintdb-postgres]
-
-DB_CONN_STR = "postgres:///talercheck"
-
-[mint-wire-sepa]
-SEPA_RESPONSE_FILE = "test-mint-home/sepa.json"
-
-[mint-wire-test]
-REDIRECT_URL = "http://www.taler.net/"
diff --git a/src/mint-lib/test-mint-home/config/mint-keyup.conf b/src/mint-lib/test-mint-home/config/mint-keyup.conf
deleted file mode 100644
index 8ad1f3bb2..000000000
--- a/src/mint-lib/test-mint-home/config/mint-keyup.conf
+++ /dev/null
@@ -1,86 +0,0 @@
-[mint_keys]
-
-# how long is one signkey valid?
-signkey_duration = 4 weeks
-
-# how long are the signatures with the signkey valid?
-legal_duration = 2 years
-
-# how long do we generate denomination and signing keys
-# ahead of time?
-lookahead_sign = 32 weeks 1 day
-
-# how long do we provide to clients denomination and signing keys
-# ahead of time?
-lookahead_provide = 4 weeks 1 day
-
-
-# Coin definitions are detected because the section
-# name begins with "coin_". The rest of the
-# name is free, but of course following the convention
-# of "coin_$CURRENCY[_$SUBUNIT]_$VALUE" make sense.
-[coin_eur_ct_1]
-value = EUR:0.01
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.00
-fee_deposit = EUR:0.00
-fee_refresh = EUR:0.01
-rsa_keysize = 1024
-
-[coin_eur_ct_10]
-value = EUR:0.10
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-rsa_keysize = 1024
-
-[coin_eur_1]
-value = EUR:1
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-rsa_keysize = 1024
-
-[coin_eur_5]
-value = EUR:5
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-rsa_keysize = 1024
-
-[coin_eur_10]
-value = EUR:10
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-rsa_keysize = 1024
-
-[coin_eur_1000]
-value = EUR:1000
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-rsa_keysize = 2048
diff --git a/src/mint-lib/test-mint-home/sepa.json b/src/mint-lib/test-mint-home/sepa.json
deleted file mode 100644
index 36d12f661..000000000
--- a/src/mint-lib/test-mint-home/sepa.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "receiver_name": "Max Mustermann",
- "iban": "DE89370400440532013000",
- "bic": "COBADEFF370",
- "sig": "8M5YJXM68PRAXKH76HYEBCJW657B23JA0RFGNDMZK2379YZMT626H1BN89KC0M1KJBWGYEN5Z763Q0Y7MCTZQ6BPPT7D9KFCTW60C10"
-}
\ No newline at end of file
diff --git a/src/mint-tools/Makefile.am b/src/mint-tools/Makefile.am
deleted file mode 100644
index 94b8fb391..000000000
--- a/src/mint-tools/Makefile.am
+++ /dev/null
@@ -1,81 +0,0 @@
-# This Makefile.am is in the public domain
-AM_CPPFLAGS = -I$(top_srcdir)/src/include
-
-if USE_COVERAGE
- AM_CFLAGS = --coverage -O0
- XLIB = -lgcov
-endif
-
-bin_PROGRAMS = \
- taler-auditor-sign \
- taler-mint-keyup \
- taler-mint-keycheck \
- taler-mint-reservemod \
- taler-mint-sepa \
- taler-mint-dbinit
-
-taler_mint_keyup_SOURCES = \
- taler-mint-keyup.c
-taler_mint_keyup_LDADD = \
- $(LIBGCRYPT_LIBS) \
- $(top_builddir)/src/util/libtalerutil.la \
- $(top_builddir)/src/pq/libtalerpq.la \
- $(top_builddir)/src/mintdb/libtalermintdb.la \
- -lgnunetutil $(XLIB)
-taler_mint_keyup_LDFLAGS = $(POSTGRESQL_LDFLAGS)
-
-taler_auditor_sign_SOURCES = \
- taler-auditor-sign.c
-taler_auditor_sign_LDADD = \
- $(LIBGCRYPT_LIBS) \
- $(top_builddir)/src/util/libtalerutil.la \
- $(top_builddir)/src/mintdb/libtalermintdb.la \
- -lgnunetutil $(XLIB)
-
-
-taler_mint_sepa_SOURCES = \
- taler-mint-sepa.c
-taler_mint_sepa_LDADD = \
- $(LIBGCRYPT_LIBS) \
- $(top_builddir)/src/util/libtalerutil.la \
- -lgnunetutil -ljansson $(XLIB)
-taler_mint_sepa_LDFLAGS = $(POSTGRESQL_LDFLAGS)
-
-taler_mint_keycheck_SOURCES = \
- taler-mint-keycheck.c
-taler_mint_keycheck_LDADD = \
- $(LIBGCRYPT_LIBS) \
- $(top_builddir)/src/util/libtalerutil.la \
- $(top_builddir)/src/mintdb/libtalermintdb.la \
- -lgnunetutil $(XLIB)
-taler_mint_keycheck_LDFLAGS = $(POSTGRESQL_LDFLAGS)
-
-taler_mint_reservemod_SOURCES = \
- taler-mint-reservemod.c
-taler_mint_reservemod_LDADD = \
- $(LIBGCRYPT_LIBS) \
- $(top_builddir)/src/util/libtalerutil.la \
- $(top_builddir)/src/pq/libtalerpq.la \
- $(top_builddir)/src/mintdb/libtalermintdb.la \
- -lgnunetutil -ljansson $(XLIB)
-taler_mint_reservemod_LDFLAGS = \
- $(POSTGRESQL_LDFLAGS)
-taler_mint_reservemod_CPPFLAGS = \
- -I$(top_srcdir)/src/include \
- -I$(top_srcdir)/src/pq/ \
- $(POSTGRESQL_CPPFLAGS)
-
-taler_mint_dbinit_SOURCES = \
- taler-mint-dbinit.c
-taler_mint_dbinit_LDADD = \
- $(LIBGCRYPT_LIBS) \
- $(top_builddir)/src/util/libtalerutil.la \
- $(top_builddir)/src/pq/libtalerpq.la \
- $(top_builddir)/src/mintdb/libtalermintdb.la \
- -lgnunetutil $(XLIB)
-taler_mint_dbinit_LDFLAGS = \
- $(POSTGRESQL_LDFLAGS)
-taler_mint_dbinit_CPPFLAGS = \
- -I$(top_srcdir)/src/include \
- -I$(top_srcdir)/src/pq/ \
- $(POSTGRESQL_CPPFLAGS)
diff --git a/src/mint-tools/taler-mint-sepa.c b/src/mint-tools/taler-mint-sepa.c
deleted file mode 100644
index e66db541e..000000000
--- a/src/mint-tools/taler-mint-sepa.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, If not, see
-*/
-/**
- * @file taler-mint-sepa.c
- * @brief Create signed response for /wire/sepa requests.
- * @author Christian Grothoff
- */
-#include
-#include
-#include "taler_crypto_lib.h"
-#include "taler_signatures.h"
-
-
-/**
- * Filename of the master private key.
- */
-static char *masterkeyfile;
-
-/**
- * Account holder name.
- */
-static char *sepa_name;
-
-/**
- * IBAN number.
- */
-static char *iban;
-
-/**
- * BIC number.
- */
-static char *bic;
-
-/**
- * Where to write the result.
- */
-static char *output_filename;
-
-
-/**
- * The main function of the taler-mint-sepa tool. This tool is used
- * to sign the SEPA bank account details using the master key.
- *
- * @param argc number of arguments from the command line
- * @param argv command line arguments
- * @return 0 ok, 1 on error
- */
-int
-main (int argc,
- char *const *argv)
-{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'b', "bic", "BICCODE",
- "bank BIC code", 1,
- &GNUNET_GETOPT_set_string, &bic},
- {'i', "iban", "IBAN",
- "IBAN number of the account", 1,
- &GNUNET_GETOPT_set_string, &iban},
- {'m', "master-key", "FILE",
- "master key file (private key)", 1,
- &GNUNET_GETOPT_set_filename, &masterkeyfile},
- {'n', "name", "NAME",
- "name of the account holder", 1,
- &GNUNET_GETOPT_set_string, &sepa_name},
- {'o', "output", "FILE",
- "where to write the result", 1,
- &GNUNET_GETOPT_set_filename, &output_filename},
- TALER_GETOPT_OPTION_HELP ("Setup /wire/sepa response"),
- GNUNET_GETOPT_OPTION_VERSION (VERSION "-" VCS_VERSION),
- GNUNET_GETOPT_OPTION_END
- };
- struct GNUNET_CRYPTO_EddsaPrivateKey *eddsa_priv;
- struct TALER_MasterWireSepaDetailsPS wsd;
- struct TALER_MasterSignatureP sig;
- struct GNUNET_HashContext *hc;
- json_t *reply;
- char *json_str;
-
- GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-mint-sepa",
- "WARNING",
- NULL));
-
- if (GNUNET_GETOPT_run ("taler-mint-sepa",
- options,
- argc, argv) < 0)
- return 1;
- if (NULL == masterkeyfile)
- {
- fprintf (stderr,
- "Master key file not given\n");
- return 1;
- }
- eddsa_priv = GNUNET_CRYPTO_eddsa_key_create_from_file (masterkeyfile);
- if (NULL == eddsa_priv)
- {
- fprintf (stderr,
- "Failed to initialize master key from file `%s'\n",
- masterkeyfile);
- return 1;
- }
-
- /* Compute message to sign */
- hc = GNUNET_CRYPTO_hash_context_start ();
- GNUNET_CRYPTO_hash_context_read (hc,
- sepa_name,
- strlen (sepa_name) + 1);
- GNUNET_CRYPTO_hash_context_read (hc,
- iban,
- strlen (iban) + 1);
- GNUNET_CRYPTO_hash_context_read (hc,
- bic,
- strlen (bic) + 1);
- wsd.purpose.size = htonl (sizeof (wsd));
- wsd.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_SEPA_DETAILS);
- GNUNET_CRYPTO_hash_context_finish (hc,
- &wsd.h_sepa_details);
- GNUNET_CRYPTO_eddsa_sign (eddsa_priv,
- &wsd.purpose,
- &sig.eddsa_signature);
- GNUNET_free (eddsa_priv);
-
- /* build JSON message */
- reply = json_pack ("{s:s, s:s, s:s, s:o}",
- "receiver_name", sepa_name,
- "iban", iban,
- "bic", bic,
- "sig", TALER_json_from_data (&sig,
- sizeof (sig)));
- GNUNET_assert (NULL != reply);
-
- /* dump result to stdout */
- json_str = json_dumps (reply, JSON_INDENT(2));
- GNUNET_assert (NULL != json_str);
-
- if (NULL != output_filename)
- {
- fclose (stdout);
- stdout = fopen (output_filename,
- "w+");
- }
- fprintf (stdout,
- "%s",
- json_str);
- fflush (stdout);
- free (json_str);
- return 0;
-}
-
-/* end of taler-mint-sepa.c */
diff --git a/src/mint/.gitignore b/src/mint/.gitignore
deleted file mode 100644
index a2e71d5da..000000000
--- a/src/mint/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-taler-mint-dbinit
-taler-mint-keycheck
-taler-mint-keyup
-taler-mint-pursemod
-taler-mint-reservemod
-taler-mint-httpd
\ No newline at end of file
diff --git a/src/mint/Makefile.am b/src/mint/Makefile.am
deleted file mode 100644
index 8e2eae77b..000000000
--- a/src/mint/Makefile.am
+++ /dev/null
@@ -1,59 +0,0 @@
-# This Makefile.am is in the public domain
-AM_CPPFLAGS = -I$(top_srcdir)/src/include
-
-if USE_COVERAGE
- AM_CFLAGS = --coverage -O0
- XLIB = -lgcov
-endif
-
-bin_PROGRAMS = \
- taler-mint-aggregator \
- taler-mint-httpd
-
-taler_mint_aggregator_SOURCES = \
- taler-mint-aggregator.c
-taler_mint_aggregator_LDADD = \
- $(LIBGCRYPT_LIBS) \
- $(top_builddir)/src/util/libtalerutil.la \
- $(top_builddir)/src/wire/libtalerwire.la \
- $(top_builddir)/src/mintdb/libtalermintdb.la \
- -ljansson \
- -lgnunetutil
-
-taler_mint_httpd_SOURCES = \
- taler-mint-httpd.c taler-mint-httpd.h \
- taler-mint-httpd_admin.c taler-mint-httpd_admin.h \
- taler-mint-httpd_db.c taler-mint-httpd_db.h \
- taler-mint-httpd_deposit.c taler-mint-httpd_deposit.h \
- taler-mint-httpd_keystate.c taler-mint-httpd_keystate.h \
- taler-mint-httpd_mhd.c taler-mint-httpd_mhd.h \
- taler-mint-httpd_parsing.c taler-mint-httpd_parsing.h \
- taler-mint-httpd_refresh.c taler-mint-httpd_refresh.h \
- taler-mint-httpd_reserve.c taler-mint-httpd_reserve.h \
- taler-mint-httpd_responses.c taler-mint-httpd_responses.h \
- taler-mint-httpd_tracking.c taler-mint-httpd_tracking.h \
- taler-mint-httpd_wire.c taler-mint-httpd_wire.h \
- taler-mint-httpd_validation.c taler-mint-httpd_validation.h
-taler_mint_httpd_LDADD = \
- $(LIBGCRYPT_LIBS) \
- $(top_builddir)/src/util/libtalerutil.la \
- $(top_builddir)/src/mintdb/libtalermintdb.la \
- -lmicrohttpd \
- -ljansson \
- -lgnunetutil \
- -lpthread
-
-if HAVE_DEVELOPER
-taler_mint_httpd_SOURCES += \
- taler-mint-httpd_test.c taler-mint-httpd_test.h
-endif
-
-check_SCRIPTS = \
- test_taler_mint_httpd.sh
-
-if HAVE_EXPENSIVE_TESTS
-check_SCRIPTS += \
- test_taler_mint_httpd_afl.sh
-endif
-
-TESTS = $(check_SCRIPTS)
diff --git a/src/mint/taler-mint-httpd_parsing.c b/src/mint/taler-mint-httpd_parsing.c
deleted file mode 100644
index 365202905..000000000
--- a/src/mint/taler-mint-httpd_parsing.c
+++ /dev/null
@@ -1,1137 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU Affero General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License along with
- TALER; see the file COPYING. If not, If not, see
-*/
-
-/**
- * @file taler-mint-httpd_parsing.c
- * @brief functions to parse incoming requests (MHD arguments and JSON snippets)
- * @author Florian Dold
- * @author Benedikt Mueller
- * @author Christian Grothoff
- */
-
-#include "platform.h"
-#include
-#include "taler-mint-httpd_parsing.h"
-#include "taler-mint-httpd_responses.h"
-
-
-/**
- * Initial size for POST request buffer.
- */
-#define REQUEST_BUFFER_INITIAL (2*1024)
-
-/**
- * Maximum POST request size.
- */
-#define REQUEST_BUFFER_MAX (1024*1024)
-
-
-/**
- * Buffer for POST requests.
- */
-struct Buffer
-{
- /**
- * Allocated memory
- */
- char *data;
-
- /**
- * Number of valid bytes in buffer.
- */
- size_t fill;
-
- /**
- * Number of allocated bytes in buffer.
- */
- size_t alloc;
-};
-
-
-/**
- * Initialize a buffer.
- *
- * @param buf the buffer to initialize
- * @param data the initial data
- * @param data_size size of the initial data
- * @param alloc_size size of the buffer
- * @param max_size maximum size that the buffer can grow to
- * @return a GNUnet result code
- */
-static int
-buffer_init (struct Buffer *buf,
- const void *data,
- size_t data_size,
- size_t alloc_size,
- size_t max_size)
-{
- if (data_size > max_size || alloc_size > max_size)
- return GNUNET_SYSERR;
- if (data_size > alloc_size)
- alloc_size = data_size;
- buf->data = GNUNET_malloc (alloc_size);
- memcpy (buf->data, data, data_size);
- return GNUNET_OK;
-}
-
-
-/**
- * Free the data in a buffer. Does *not* free
- * the buffer object itself.
- *
- * @param buf buffer to de-initialize
- */
-static void
-buffer_deinit (struct Buffer *buf)
-{
- GNUNET_free (buf->data);
- buf->data = NULL;
-}
-
-
-/**
- * Append data to a buffer, growing the buffer if necessary.
- *
- * @param buf the buffer to append to
- * @param data the data to append
- * @param data_size the size of @a data
- * @param max_size maximum size that the buffer can grow to
- * @return #GNUNET_OK on success,
- * #GNUNET_NO if the buffer can't accomodate for the new data
- */
-static int
-buffer_append (struct Buffer *buf,
- const void *data,
- size_t data_size,
- size_t max_size)
-{
- if (buf->fill + data_size > max_size)
- return GNUNET_NO;
- if (data_size + buf->fill > buf->alloc)
- {
- char *new_buf;
- size_t new_size = buf->alloc;
- while (new_size < buf->fill + data_size)
- new_size += 2;
- if (new_size > max_size)
- return GNUNET_NO;
- new_buf = GNUNET_malloc (new_size);
- memcpy (new_buf, buf->data, buf->fill);
- GNUNET_free (buf->data);
- buf->data = new_buf;
- buf->alloc = new_size;
- }
- memcpy (buf->data + buf->fill, data, data_size);
- buf->fill += data_size;
- return GNUNET_OK;
-}
-
-
-/**
- * Release all memory allocated for the variable-size fields in
- * the parser specification.
- *
- * @param spec specification to free
- * @param spec_len number of items in @a spec to look at
- */
-static void
-release_data (struct TMH_PARSE_FieldSpecification *spec,
- unsigned int spec_len)
-{
- unsigned int i;
-
- for (i=0; i < spec_len; i++)
- {
- switch (spec[i].command)
- {
- case TMH_PARSE_JNC_FIELD:
- GNUNET_break (0);
- return;
- case TMH_PARSE_JNC_INDEX:
- GNUNET_break (0);
- return;
- case TMH_PARSE_JNC_RET_DATA:
- break;
- case TMH_PARSE_JNC_RET_DATA_VAR:
- if (NULL != spec[i].destination)
- {
- GNUNET_free (* (void**) spec[i].destination);
- *(void**) spec[i].destination = NULL;
- *spec[i].destination_size_out = 0;
- }
- break;
- case TMH_PARSE_JNC_RET_TYPED_JSON:
- {
- json_t *json;
-
- json = *(json_t **) spec[i].destination;
- if (NULL != json)
- {
- json_decref (json);
- *(json_t**) spec[i].destination = NULL;
- }
- }
- break;
- case TMH_PARSE_JNC_RET_RSA_PUBLIC_KEY:
- {
- struct TALER_DenominationPublicKey *pk;
-
- pk = spec[i].destination;
- if (NULL != pk->rsa_public_key)
- {
- GNUNET_CRYPTO_rsa_public_key_free (pk->rsa_public_key);
- pk->rsa_public_key = NULL;
- }
- }
- break;
- case TMH_PARSE_JNC_RET_RSA_SIGNATURE:
- {
- struct TALER_DenominationSignature *sig;
-
- sig = spec[i].destination;
- if (NULL != sig->rsa_signature)
- {
- GNUNET_CRYPTO_rsa_signature_free (sig->rsa_signature);
- sig->rsa_signature = NULL;
- }
- }
- break;
- case TMH_PARSE_JNC_RET_AMOUNT:
- memset (spec[i].destination,
- 0,
- sizeof (struct TALER_Amount));
- break;
- case TMH_PARSE_JNC_RET_TIME_ABSOLUTE:
- break;
- case TMH_PARSE_JNC_RET_UINT64:
- break;
- }
- }
-}
-
-
-/**
- * Process a POST request containing a JSON object. This function
- * realizes an MHD POST processor that will (incrementally) process
- * JSON data uploaded to the HTTP server. It will store the required
- * state in the @a con_cls, which must be cleaned up using
- * #TMH_PARSE_post_cleanup_callback().
- *
- * @param connection the MHD connection
- * @param con_cls the closure (points to a `struct Buffer *`)
- * @param upload_data the POST data
- * @param upload_data_size number of bytes in @a upload_data
- * @param json the JSON object for a completed request
- * @return
- * #GNUNET_YES if json object was parsed or at least
- * may be parsed in the future (call again);
- * `*json` will be NULL if we need to be called again,
- * and non-NULL if we are done.
- * #GNUNET_NO is request incomplete or invalid
- * (error message was generated)
- * #GNUNET_SYSERR on internal error
- * (we could not even queue an error message,
- * close HTTP session with MHD_NO)
- */
-int
-TMH_PARSE_post_json (struct MHD_Connection *connection,
- void **con_cls,
- const char *upload_data,
- size_t *upload_data_size,
- json_t **json)
-{
- struct Buffer *r = *con_cls;
-
- *json = NULL;
- if (NULL == *con_cls)
- {
- /* We are seeing a fresh POST request. */
- r = GNUNET_new (struct Buffer);
- if (GNUNET_OK !=
- buffer_init (r,
- upload_data,
- *upload_data_size,
- REQUEST_BUFFER_INITIAL,
- REQUEST_BUFFER_MAX))
- {
- *con_cls = NULL;
- buffer_deinit (r);
- GNUNET_free (r);
- return (MHD_NO ==
- TMH_RESPONSE_reply_internal_error (connection,
- "out of memory"))
- ? GNUNET_SYSERR : GNUNET_NO;
- }
- /* everything OK, wait for more POST data */
- *upload_data_size = 0;
- *con_cls = r;
- return GNUNET_YES;
- }
- if (0 != *upload_data_size)
- {
- /* We are seeing an old request with more data available. */
-
- if (GNUNET_OK !=
- buffer_append (r,
- upload_data,
- *upload_data_size,
- REQUEST_BUFFER_MAX))
- {
- /* Request too long */
- *con_cls = NULL;
- buffer_deinit (r);
- GNUNET_free (r);
- return (MHD_NO ==
- TMH_RESPONSE_reply_request_too_large (connection))
- ? GNUNET_SYSERR : GNUNET_NO;
- }
- /* everything OK, wait for more POST data */
- *upload_data_size = 0;
- return GNUNET_YES;
- }
-
- /* We have seen the whole request. */
-
- *json = json_loadb (r->data,
- r->fill,
- 0,
- NULL);
- if (NULL == *json)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Failed to parse JSON request body\n");
- return (MHD_YES ==
- TMH_RESPONSE_reply_invalid_json (connection))
- ? GNUNET_NO : GNUNET_SYSERR;
- }
- buffer_deinit (r);
- GNUNET_free (r);
- *con_cls = NULL;
-
- return GNUNET_YES;
-}
-
-
-/**
- * Function called whenever we are done with a request
- * to clean up our state.
- *
- * @param con_cls value as it was left by
- * #TMH_PARSE_post_json(), to be cleaned up
- */
-void
-TMH_PARSE_post_cleanup_callback (void *con_cls)
-{
- struct Buffer *r = con_cls;
-
- if (NULL != r)
- {
- buffer_deinit (r);
- GNUNET_free (r);
- }
-}
-
-
-/**
- * Extract base32crockford encoded data from request.
- *
- * Queues an error response to the connection if the parameter is missing or
- * invalid.
- *
- * @param connection the MHD connection
- * @param param_name the name of the parameter with the key
- * @param[out] out_data pointer to store the result
- * @param out_size expected size of data
- * @return
- * #GNUNET_YES if the the argument is present
- * #GNUNET_NO if the argument is absent or malformed
- * #GNUNET_SYSERR on internal error (error response could not be sent)
- */
-int
-TMH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
- const char *param_name,
- void *out_data,
- size_t out_size)
-{
- const char *str;
-
- str = MHD_lookup_connection_value (connection,
- MHD_GET_ARGUMENT_KIND,
- param_name);
- if (NULL == str)
- {
- return (MHD_NO ==
- TMH_RESPONSE_reply_arg_missing (connection, param_name))
- ? GNUNET_SYSERR : GNUNET_NO;
- }
- if (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (str,
- strlen (str),
- out_data,
- out_size))
- return (MHD_NO ==
- TMH_RESPONSE_reply_arg_invalid (connection, param_name))
- ? GNUNET_SYSERR : GNUNET_NO;
- return GNUNET_OK;
-}
-
-
-/**
- * Extraxt variable-size base32crockford encoded data from request.
- *
- * Queues an error response to the connection if the parameter is missing
- * or the encoding is invalid.
- *
- * @param connection the MHD connection
- * @param param_name the name of the parameter with the key
- * @param[out] out_data pointer to allocate buffer and store the result
- * @param[out] out_size set to the size of the buffer allocated in @a out_data
- * @return
- * #GNUNET_YES if the the argument is present
- * #GNUNET_NO if the argument is absent or malformed
- * #GNUNET_SYSERR on internal error (error response could not be sent)
- */
-int
-TMH_PARSE_mhd_request_var_arg_data (struct MHD_Connection *connection,
- const char *param_name,
- void **out_data,
- size_t *out_size)
-{
- const char *str;
- size_t slen;
- size_t olen;
- void *out;
-
- str = MHD_lookup_connection_value (connection,
- MHD_GET_ARGUMENT_KIND,
- param_name);
- if (NULL == str)
- {
- return (MHD_NO ==
- TMH_RESPONSE_reply_arg_missing (connection, param_name))
- ? GNUNET_SYSERR : GNUNET_NO;
- }
- slen = strlen (str);
- olen = (slen * 5) / 8;
- out = GNUNET_malloc (olen);
- if (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (str,
- strlen (str),
- out,
- olen))
- {
- GNUNET_free (out);
- *out_size = 0;
- return (MHD_NO ==
- TMH_RESPONSE_reply_arg_invalid (connection, param_name))
- ? GNUNET_SYSERR : GNUNET_NO;
- }
- *out_data = out;
- *out_size = olen;
- return GNUNET_OK;
-}
-
-
-/**
- * Navigate through a JSON tree.
- *
- * Sends an error response if navigation is impossible (i.e.
- * the JSON object is invalid)
- *
- * @param connection the connection to send an error response to
- * @param root the JSON node to start the navigation at.
- * @param ... navigation specification (see `enum TMH_PARSE_JsonNavigationCommand`)
- * @return
- * #GNUNET_YES if navigation was successful
- * #GNUNET_NO if json is malformed, error response was generated
- * #GNUNET_SYSERR on internal error (no response was generated,
- * connection must be closed)
- */
-int
-TMH_PARSE_navigate_json (struct MHD_Connection *connection,
- const json_t *root,
- ...)
-{
- va_list argp;
- int ret;
- json_t *path; /* what's our current path from 'root'? */
-
- path = json_array ();
- va_start (argp, root);
- ret = 2; /* just not any of the valid return values */
- while (2 == ret)
- {
- enum TMH_PARSE_JsonNavigationCommand command
- = va_arg (argp,
- enum TMH_PARSE_JsonNavigationCommand);
-
- switch (command)
- {
- case TMH_PARSE_JNC_FIELD:
- {
- const char *fname = va_arg(argp, const char *);
-
- json_array_append_new (path,
- json_string (fname));
- root = json_object_get (root,
- fname);
- if (NULL == root)
- {
- GNUNET_break_op (0);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:s, s:O}",
- "error", "missing field in JSON",
- "field", fname,
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- }
- break;
-
- case TMH_PARSE_JNC_INDEX:
- {
- int fnum = va_arg(argp, int);
-
- json_array_append_new (path,
- json_integer (fnum));
- root = json_array_get (root,
- fnum);
- if (NULL == root)
- {
- GNUNET_break_op (0);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O}",
- "error", "missing index in JSON",
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- }
- break;
-
- case TMH_PARSE_JNC_RET_DATA:
- {
- void *where = va_arg (argp, void *);
- size_t len = va_arg (argp, size_t);
- const char *str;
- int res;
-
- str = json_string_value (root);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O}",
- "error", "string expected",
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- res = GNUNET_STRINGS_string_to_data (str, strlen (str),
- where, len);
- if (GNUNET_OK != res)
- {
- GNUNET_break_op (0);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O}",
- "error", "malformed binary data in JSON",
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- ret = GNUNET_OK;
- }
- break;
-
- case TMH_PARSE_JNC_RET_DATA_VAR:
- {
- void **where = va_arg (argp, void **);
- size_t *len = va_arg (argp, size_t *);
- const char *str;
- int res;
-
- str = json_string_value (root);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_internal_error (connection,
- "json_string_value() failed"))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- *len = (strlen (str) * 5) / 8;
- if (NULL != where)
- {
- *where = GNUNET_malloc (*len);
- res = GNUNET_STRINGS_string_to_data (str,
- strlen (str),
- *where,
- *len);
- if (GNUNET_OK != res)
- {
- GNUNET_break_op (0);
- GNUNET_free (*where);
- *where = NULL;
- *len = 0;
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O}",
- "error", "malformed binary data in JSON",
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- }
- ret = GNUNET_OK;
- }
- break;
-
- case TMH_PARSE_JNC_RET_TYPED_JSON:
- {
- int typ = va_arg (argp, int);
- const json_t **r_json = va_arg (argp, const json_t **);
-
- if ( (NULL == root) ||
- ( (-1 != typ) &&
- (json_typeof (root) != typ)) )
- {
- GNUNET_break_op (0);
- *r_json = NULL;
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:i, s:i, s:O}",
- "error", "wrong JSON field type",
- "type_expected", typ,
- "type_actual", json_typeof (root),
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- *r_json = root;
- json_incref ((json_t *) root);
- ret = GNUNET_OK;
- }
- break;
-
- case TMH_PARSE_JNC_RET_UINT64:
- {
- uint64_t *r_u64 = va_arg (argp, uint64_t *);
-
- if (json_typeof (root) != JSON_INTEGER)
- {
- GNUNET_break_op (0);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:s, s:i, s:O}",
- "error", "wrong JSON field type",
- "type_expected", "integer",
- "type_actual", json_typeof (root),
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- *r_u64 = (uint64_t) json_integer_value (root);
- ret = GNUNET_OK;
- }
- break;
-
- case TMH_PARSE_JNC_RET_RSA_PUBLIC_KEY:
- {
- struct TALER_DenominationPublicKey *where;
- size_t len;
- const char *str;
- int res;
- void *buf;
-
- where = va_arg (argp,
- struct TALER_DenominationPublicKey *);
- str = json_string_value (root);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O}",
- "error", "string expected",
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- len = (strlen (str) * 5) / 8;
- buf = GNUNET_malloc (len);
- res = GNUNET_STRINGS_string_to_data (str,
- strlen (str),
- buf,
- len);
- if (GNUNET_OK != res)
- {
- GNUNET_break_op (0);
- GNUNET_free (buf);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O}",
- "error", "malformed binary data in JSON",
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- where->rsa_public_key = GNUNET_CRYPTO_rsa_public_key_decode (buf,
- len);
- GNUNET_free (buf);
- if (NULL == where->rsa_public_key)
- {
- GNUNET_break_op (0);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O}",
- "error", "malformed RSA public key in JSON",
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- ret = GNUNET_OK;
- break;
- }
-
- case TMH_PARSE_JNC_RET_RSA_SIGNATURE:
- {
- struct TALER_DenominationSignature *where;
- size_t len;
- const char *str;
- int res;
- void *buf;
-
- where = va_arg (argp,
- struct TALER_DenominationSignature *);
- str = json_string_value (root);
- if (NULL == str)
- {
- GNUNET_break_op (0);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O}",
- "error", "string expected",
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- len = (strlen (str) * 5) / 8;
- buf = GNUNET_malloc (len);
- res = GNUNET_STRINGS_string_to_data (str,
- strlen (str),
- buf,
- len);
- if (GNUNET_OK != res)
- {
- GNUNET_break_op (0);
- GNUNET_free (buf);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O}",
- "error", "malformed binary data in JSON",
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- where->rsa_signature = GNUNET_CRYPTO_rsa_signature_decode (buf,
- len);
- GNUNET_free (buf);
- if (NULL == where->rsa_signature)
- {
- GNUNET_break_op (0);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O}",
- "error", "malformed RSA signature in JSON",
- "path", path))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- ret = GNUNET_OK;
- break;
- }
-
- case TMH_PARSE_JNC_RET_AMOUNT:
- {
- struct TALER_Amount *where = va_arg (argp, void *);
-
- if (GNUNET_OK !=
- TALER_json_to_amount ((json_t *) root,
- where))
- {
- GNUNET_break_op (0);
- ret = (MHD_YES !=
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O}",
- "error", "Bad format",
- "path", path))
- ? GNUNET_SYSERR : GNUNET_NO;
- break;
- }
- if (0 != strcmp (where->currency,
- TMH_mint_currency_string))
- {
- GNUNET_break_op (0);
- ret = (MHD_YES !=
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:O, s:s}",
- "error", "Currency not supported",
- "path", path,
- "currency", where->currency))
- ? GNUNET_SYSERR : GNUNET_NO;
- memset (where, 0, sizeof (struct TALER_Amount));
- break;
- }
- ret = GNUNET_OK;
- break;
- }
-
- case TMH_PARSE_JNC_RET_TIME_ABSOLUTE:
- {
- struct GNUNET_TIME_Absolute *where = va_arg (argp, void *);
-
- if (GNUNET_OK !=
- TALER_json_to_abs ((json_t *) root,
- where))
- {
- GNUNET_break_op (0);
- ret = (MHD_YES !=
- TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_BAD_REQUEST,
- "{s:s, s:s, s:O}",
- "error", "Bad format",
- "hint", "expected absolute time",
- "path", path))
- ? GNUNET_SYSERR : GNUNET_NO;
- break;
- }
- ret = GNUNET_OK;
- break;
- }
-
- default:
- GNUNET_break (0);
- ret = (MHD_YES ==
- TMH_RESPONSE_reply_internal_error (connection,
- "unhandled value in switch"))
- ? GNUNET_NO : GNUNET_SYSERR;
- break;
- }
- }
- va_end (argp);
- json_decref (path);
- return ret;
-}
-
-
-/**
- * Parse JSON object into components based on the given field
- * specification.
- *
- * @param connection the connection to send an error response to
- * @param root the JSON node to start the navigation at.
- * @param spec field specification for the parser
- * @return
- * #GNUNET_YES if navigation was successful (caller is responsible
- * for freeing allocated variable-size data using
- * #TMH_PARSE_release_data() when done)
- * #GNUNET_NO if json is malformed, error response was generated
- * #GNUNET_SYSERR on internal error
- */
-int
-TMH_PARSE_json_data (struct MHD_Connection *connection,
- const json_t *root,
- struct TMH_PARSE_FieldSpecification *spec)
-{
- unsigned int i;
- int ret;
-
- ret = GNUNET_YES;
- for (i=0; NULL != spec[i].field_name; i++)
- {
- if (GNUNET_YES != ret)
- break;
- switch (spec[i].command)
- {
- case TMH_PARSE_JNC_FIELD:
- GNUNET_break (0);
- return GNUNET_SYSERR;
- case TMH_PARSE_JNC_INDEX:
- GNUNET_break (0);
- return GNUNET_SYSERR;
- case TMH_PARSE_JNC_RET_DATA:
- ret = TMH_PARSE_navigate_json (connection,
- root,
- TMH_PARSE_JNC_FIELD,
- spec[i].field_name,
- TMH_PARSE_JNC_RET_DATA,
- spec[i].destination,
- spec[i].destination_size_in);
- break;
- case TMH_PARSE_JNC_RET_DATA_VAR:
- ret = TMH_PARSE_navigate_json (connection,
- root,
- TMH_PARSE_JNC_FIELD,
- spec[i].field_name,
- TMH_PARSE_JNC_RET_DATA_VAR,
- (void **) spec[i].destination,
- spec[i].destination_size_out);
- break;
- case TMH_PARSE_JNC_RET_TYPED_JSON:
- ret = TMH_PARSE_navigate_json (connection,
- root,
- TMH_PARSE_JNC_FIELD,
- spec[i].field_name,
- TMH_PARSE_JNC_RET_TYPED_JSON,
- spec[i].type,
- spec[i].destination);
- break;
- case TMH_PARSE_JNC_RET_RSA_PUBLIC_KEY:
- ret = TMH_PARSE_navigate_json (connection,
- root,
- TMH_PARSE_JNC_FIELD,
- spec[i].field_name,
- TMH_PARSE_JNC_RET_RSA_PUBLIC_KEY,
- spec[i].destination);
- break;
- case TMH_PARSE_JNC_RET_RSA_SIGNATURE:
- ret = TMH_PARSE_navigate_json (connection,
- root,
- TMH_PARSE_JNC_FIELD,
- spec[i].field_name,
- TMH_PARSE_JNC_RET_RSA_SIGNATURE,
- spec[i].destination);
- break;
- case TMH_PARSE_JNC_RET_AMOUNT:
- GNUNET_assert (sizeof (struct TALER_Amount) ==
- spec[i].destination_size_in);
- ret = TMH_PARSE_navigate_json (connection,
- root,
- TMH_PARSE_JNC_FIELD,
- spec[i].field_name,
- TMH_PARSE_JNC_RET_AMOUNT,
- spec[i].destination);
- break;
- case TMH_PARSE_JNC_RET_TIME_ABSOLUTE:
- GNUNET_assert (sizeof (struct GNUNET_TIME_Absolute) ==
- spec[i].destination_size_in);
- ret = TMH_PARSE_navigate_json (connection,
- root,
- TMH_PARSE_JNC_FIELD,
- spec[i].field_name,
- TMH_PARSE_JNC_RET_TIME_ABSOLUTE,
- spec[i].destination);
- break;
- case TMH_PARSE_JNC_RET_UINT64:
- GNUNET_assert (sizeof (uint64_t) ==
- spec[i].destination_size_in);
- ret = TMH_PARSE_navigate_json (connection,
- root,
- TMH_PARSE_JNC_FIELD,
- spec[i].field_name,
- TMH_PARSE_JNC_RET_UINT64,
- spec[i].destination);
- break;
- }
- }
- if (GNUNET_YES != ret)
- release_data (spec,
- i - 1);
- return ret;
-}
-
-
-/**
- * Release all memory allocated for the variable-size fields in
- * the parser specification.
- *
- * @param spec specification to free
- */
-void
-TMH_PARSE_release_data (struct TMH_PARSE_FieldSpecification *spec)
-{
- unsigned int i;
-
- for (i=0; NULL != spec[i].field_name; i++) ;
- release_data (spec, i);
-}
-
-
-/**
- * Generate line in parser specification for 64-bit integer
- * given as an integer in JSON.
- *
- * @param field name of the field
- * @param[out] u64 integer to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_uint64 (const char *field,
- uint64_t *u64)
-{
- struct TMH_PARSE_FieldSpecification ret =
- { field, (void *) u64, sizeof (uint64_t), NULL, TMH_PARSE_JNC_RET_UINT64, 0 };
- return ret;
-}
-
-
-/**
- * Generate line in parser specification for JSON object value.
- *
- * @param field name of the field
- * @param[out] jsonp address of pointer to JSON to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_object (const char *field,
- json_t **jsonp)
-{
- struct TMH_PARSE_FieldSpecification ret =
- { field, jsonp, 0, NULL, TMH_PARSE_JNC_RET_TYPED_JSON, JSON_OBJECT };
- *jsonp = NULL;
- return ret;
-}
-
-
-/**
- * Generate line in parser specification for JSON array value.
- *
- * @param field name of the field
- * @param[out] jsonp address of JSON pointer to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_array (const char *field,
- json_t **jsonp)
-{
- struct TMH_PARSE_FieldSpecification ret =
- { field, jsonp, 0, NULL, TMH_PARSE_JNC_RET_TYPED_JSON, JSON_ARRAY };
- *jsonp = NULL;
- return ret;
-}
-
-
-/**
- * Generate line in parser specification for an absolute time.
- *
- * @param field name of the field
- * @param[out] atime time to initialize
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_time_abs (const char *field,
- struct GNUNET_TIME_Absolute *atime)
-{
- struct TMH_PARSE_FieldSpecification ret =
- { field, atime, sizeof(struct GNUNET_TIME_Absolute), NULL, TMH_PARSE_JNC_RET_TIME_ABSOLUTE, 0 };
- return ret;
-}
-
-
-/**
- * Generate line in parser specification for RSA public key.
- *
- * @param field name of the field
- * @param[out] pk key to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_denomination_public_key (const char *field,
- struct TALER_DenominationPublicKey *pk)
-{
- struct TMH_PARSE_FieldSpecification ret =
- { field, pk, 0, NULL, TMH_PARSE_JNC_RET_RSA_PUBLIC_KEY, 0 };
- pk->rsa_public_key = NULL;
- return ret;
-}
-
-
-/**
- * Generate line in parser specification for RSA public key.
- *
- * @param field name of the field
- * @param sig the signature to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_denomination_signature (const char *field,
- struct TALER_DenominationSignature *sig)
-{
- struct TMH_PARSE_FieldSpecification ret =
- { field, sig, 0, NULL, TMH_PARSE_JNC_RET_RSA_SIGNATURE, 0 };
- sig->rsa_signature = NULL;
- return ret;
-}
-
-
-/**
- * Generate line in parser specification for an amount.
- *
- * @param field name of the field
- * @param amount a `struct TALER_Amount *` to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_amount (const char *field,
- struct TALER_Amount *amount)
-{
- struct TMH_PARSE_FieldSpecification ret =
- { field, amount, sizeof(struct TALER_Amount), NULL, TMH_PARSE_JNC_RET_AMOUNT, 0 };
- memset (amount, 0, sizeof (struct TALER_Amount));
- return ret;
-}
-
-
-/**
- * Generate line in parser specification for variable-size value.
- *
- * @param field name of the field
- * @param[out] ptr pointer to initialize
- * @param[out] ptr_size size to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_variable (const char *field,
- void **ptr,
- size_t *ptr_size)
-{
- struct TMH_PARSE_FieldSpecification ret =
- { field, ptr, 0, ptr_size, TMH_PARSE_JNC_RET_DATA_VAR, 0 };
- *ptr = NULL;
- return ret;
-}
-
-/* end of taler-mint-httpd_parsing.c */
diff --git a/src/mint/taler-mint-httpd_parsing.h b/src/mint/taler-mint-httpd_parsing.h
deleted file mode 100644
index a2cf4c469..000000000
--- a/src/mint/taler-mint-httpd_parsing.h
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU Affero General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License along with
- TALER; see the file COPYING. If not, If not, see
-*/
-/**
- * @file taler-mint-httpd_parsing.h
- * @brief functions to parse incoming requests
- * @author Florian Dold
- * @author Benedikt Mueller
- * @author Christian Grothoff
- */
-#ifndef TALER_MINT_HTTPD_PARSING_H
-#define TALER_MINT_HTTPD_PARSING_H
-
-#include
-#include
-#include "taler_util.h"
-
-
-/**
- * Process a POST request containing a JSON object. This
- * function realizes an MHD POST processor that will
- * (incrementally) process JSON data uploaded to the HTTP
- * server. It will store the required state in the
- * "connection_cls", which must be cleaned up using
- * #TMH_PARSE_post_cleanup_callback().
- *
- * @param connection the MHD connection
- * @param con_cls the closure (points to a `struct Buffer *`)
- * @param upload_data the POST data
- * @param upload_data_size number of bytes in @a upload_data
- * @param json the JSON object for a completed request
- * @return
- * #GNUNET_YES if json object was parsed or at least
- * may be parsed in the future (call again);
- * `*json` will be NULL if we need to be called again,
- * and non-NULL if we are done.
- * #GNUNET_NO is request incomplete or invalid
- * (error message was generated)
- * #GNUNET_SYSERR on internal error
- * (we could not even queue an error message,
- * close HTTP session with MHD_NO)
- */
-int
-TMH_PARSE_post_json (struct MHD_Connection *connection,
- void **con_cls,
- const char *upload_data,
- size_t *upload_data_size,
- json_t **json);
-
-
-/**
- * Function called whenever we are done with a request
- * to clean up our state.
- *
- * @param con_cls value as it was left by
- * #TMH_PARSE_post_json(), to be cleaned up
- */
-void
-TMH_PARSE_post_cleanup_callback (void *con_cls);
-
-
-/**
- * Constants for JSON navigation description.
- */
-enum TMH_PARSE_JsonNavigationCommand
-{
- /**
- * Access a field.
- * Param: const char *
- */
- TMH_PARSE_JNC_FIELD,
-
- /**
- * Access an array index.
- * Param: int
- */
- TMH_PARSE_JNC_INDEX,
-
- /**
- * Return base32crockford encoded data of
- * constant size.
- * Params: (void *, size_t)
- */
- TMH_PARSE_JNC_RET_DATA,
-
- /**
- * Return base32crockford encoded data of
- * variable size.
- * Params: (void **, size_t *)
- */
- TMH_PARSE_JNC_RET_DATA_VAR,
-
- /**
- * Return a json object, which must be
- * of the given type (JSON_* type constants,
- * or -1 for any type).
- * Params: (int, json_t **)
- */
- TMH_PARSE_JNC_RET_TYPED_JSON,
-
- /**
- * Return a `struct GNUNET_CRYPTO_rsa_PublicKey` which was
- * encoded as variable-size base32crockford encoded data.
- */
- TMH_PARSE_JNC_RET_RSA_PUBLIC_KEY,
-
- /**
- * Return a `struct GNUNET_CRYPTO_rsa_Signature` which was
- * encoded as variable-size base32crockford encoded data.
- */
- TMH_PARSE_JNC_RET_RSA_SIGNATURE,
-
- /**
- * Return a `struct TALER_Amount` which was
- * encoded within its own json object.
- */
- TMH_PARSE_JNC_RET_AMOUNT,
-
- /**
- * Return a `struct GNUNET_TIME_Absolute` which was
- * encoded within its own json object.
- * Param: struct GNUNET_TIME_Absolute *
- */
- TMH_PARSE_JNC_RET_TIME_ABSOLUTE,
-
- /**
- * Return a `uint64_t` which was
- * encoded as a JSON integer.
- * Param: uint64_t *
- */
- TMH_PARSE_JNC_RET_UINT64
-
-};
-
-
-/**
- * Navigate through a JSON tree.
- *
- * Sends an error response if navigation is impossible (i.e.
- * the JSON object is invalid)
- *
- * @param connection the connection to send an error response to
- * @param root the JSON node to start the navigation at.
- * @param ... navigation specification (see `enum TMH_PARSE_JsonNavigationCommand`)
- * @return
- * #GNUNET_YES if navigation was successful
- * #GNUNET_NO if json is malformed, error response was generated
- * #GNUNET_SYSERR on internal error
- */
-int
-TMH_PARSE_navigate_json (struct MHD_Connection *connection,
- const json_t *root,
- ...);
-
-
-/**
- * @brief Specification for how to parse a JSON field.
- */
-struct TMH_PARSE_FieldSpecification
-{
- /**
- * Name of the field. NULL only to terminate array.
- */
- const char *field_name;
-
- /**
- * Where to store the result. Must have exactly
- * @e destination_size bytes, except if @e destination_size is zero.
- * NULL to skip assignment (but check presence of the value).
- */
- void *destination;
-
- /**
- * How big should the result be, 0 for variable size. In
- * this case, @e destination must be a "void **", pointing
- * to a location that is currently NULL and is to be allocated.
- */
- size_t destination_size_in;
-
- /**
- * @e destination_size_out will then be set to the size of the
- * value that was stored in @e destination (useful for
- * variable-size allocations).
- */
- size_t *destination_size_out;
-
- /**
- * Navigation command to use to extract the value. Note that
- * #TMH_PARSE_JNC_RET_DATA or #TMH_PARSE_JNC_RET_DATA_VAR must be used for @e
- * destination_size_in and @e destination_size_out to have a
- * meaning. #TMH_PARSE_JNC_FIELD and #TMH_PARSE_JNC_INDEX must not be used here!
- */
- enum TMH_PARSE_JsonNavigationCommand command;
-
- /**
- * JSON type to use, only meaningful in connection with a @e command
- * value of #TMH_PARSE_JNC_RET_TYPED_JSON. Typical values are
- * #JSON_ARRAY and #JSON_OBJECT.
- */
- int type;
-
-};
-
-
-/**
- * Parse JSON object into components based on the given field
- * specification.
- *
- * @param connection the connection to send an error response to
- * @param root the JSON node to start the navigation at.
- * @param spec field specification for the parser
- * @return
- * #GNUNET_YES if navigation was successful (caller is responsible
- * for freeing allocated variable-size data using
- * #TMH_PARSE_release_data() when done)
- * #GNUNET_NO if json is malformed, error response was generated
- * #GNUNET_SYSERR on internal error
- */
-int
-TMH_PARSE_json_data (struct MHD_Connection *connection,
- const json_t *root,
- struct TMH_PARSE_FieldSpecification *spec);
-
-
-/**
- * Release all memory allocated for the variable-size fields in
- * the parser specification.
- *
- * @param spec specification to free
- */
-void
-TMH_PARSE_release_data (struct TMH_PARSE_FieldSpecification *spec);
-
-
-/**
- * Generate line in parser specification for fixed-size value.
- *
- * @param field name of the field
- * @param value where to store the value
- */
-#define TMH_PARSE_member_fixed(field,value) { field, value, sizeof (*value), NULL, TMH_PARSE_JNC_RET_DATA, 0 }
-
-
-/**
- * Generate line in parser specification for variable-size value.
- *
- * @param field name of the field
- * @param[out] ptr pointer to initialize
- * @param[out] ptr_size size to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_variable (const char *field,
- void **ptr,
- size_t *ptr_size);
-
-
-/**
- * Generate line in parser specification for 64-bit integer
- * given as an integer in JSON.
- *
- * @param field name of the field
- * @param[out] u64 integer to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_uint64 (const char *field,
- uint64_t *u64);
-
-
-/**
- * Generate line in parser specification for JSON array value.
- *
- * @param field name of the field
- * @param[out] jsonp address of JSON pointer to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_array (const char *field,
- json_t **jsonp);
-
-
-/**
- * Generate line in parser specification for JSON object value.
- *
- * @param field name of the field
- * @param[out] jsonp address of pointer to JSON to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_object (const char *field,
- json_t **jsonp);
-
-
-/**
- * Generate line in parser specification for RSA public key.
- *
- * @param field name of the field
- * @param[out] pk key to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_denomination_public_key (const char *field,
- struct TALER_DenominationPublicKey *pk);
-
-
-/**
- * Generate line in parser specification for RSA public key.
- *
- * @param field name of the field
- * @param sig the signature to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_denomination_signature (const char *field,
- struct TALER_DenominationSignature *sig);
-
-
-/**
- * Generate line in parser specification for an amount.
- *
- * @param field name of the field
- * @param[out] amount a `struct TALER_Amount *` to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_amount (const char *field,
- struct TALER_Amount *amount);
-
-
-/**
- * Generate line in parser specification for an absolute time.
- *
- * @param field name of the field
- * @param[out] atime time to initialize
- * @return corresponding field spec
- */
-struct TMH_PARSE_FieldSpecification
-TMH_PARSE_member_time_abs (const char *field,
- struct GNUNET_TIME_Absolute *atime);
-
-
-
-/**
- * Generate line in parser specification indicating the end of the spec.
- */
-#define TMH_PARSE_MEMBER_END { NULL, NULL, 0, NULL, TMH_PARSE_JNC_FIELD, 0 }
-
-
-/**
- * Extraxt fixed-size base32crockford encoded data from request.
- *
- * Queues an error response to the connection if the parameter is missing or
- * invalid.
- *
- * @param connection the MHD connection
- * @param param_name the name of the parameter with the key
- * @param[out] out_data pointer to store the result
- * @param out_size expected size of @a out_data
- * @return
- * #GNUNET_YES if the the argument is present
- * #GNUNET_NO if the argument is absent or malformed
- * #GNUNET_SYSERR on internal error (error response could not be sent)
- */
-int
-TMH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
- const char *param_name,
- void *out_data,
- size_t out_size);
-
-
-/**
- * Extraxt variable-size base32crockford encoded data from request.
- *
- * Queues an error response to the connection if the parameter is missing
- * or the encoding is invalid.
- *
- * @param connection the MHD connection
- * @param param_name the name of the parameter with the key
- * @param[out] out_data pointer to allocate buffer and store the result
- * @param[out] out_size set to the size of the buffer allocated in @a out_data
- * @return
- * #GNUNET_YES if the the argument is present
- * #GNUNET_NO if the argument is absent or malformed
- * #GNUNET_SYSERR on internal error (error response could not be sent)
- */
-int
-TMH_PARSE_mhd_request_var_arg_data (struct MHD_Connection *connection,
- const char *param_name,
- void **out_data,
- size_t *out_size);
-
-
-
-
-#endif /* TALER_MINT_HTTPD_PARSING_H */
diff --git a/src/mint/taler-mint-httpd_wire.c b/src/mint/taler-mint-httpd_wire.c
deleted file mode 100644
index 020a7e108..000000000
--- a/src/mint/taler-mint-httpd_wire.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU Affero General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License along with
- TALER; see the file COPYING. If not, If not, see
-*/
-/**
- * @file taler-mint-httpd_wire.c
- * @brief Handle /wire requests
- * @author Christian Grothoff
- */
-#include "platform.h"
-#include "taler-mint-httpd_keystate.h"
-#include "taler-mint-httpd_responses.h"
-#include "taler-mint-httpd_validation.h"
-#include "taler-mint-httpd_wire.h"
-#include
-
-/**
- * Handle a "/wire" request.
- *
- * @param rh context of the handler
- * @param connection the MHD connection to handle
- * @param[in,out] connection_cls the connection's closure (can be updated)
- * @param upload_data upload data
- * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
- * @return MHD result code
- */
-int
-TMH_WIRE_handler_wire (struct TMH_RequestHandler *rh,
- struct MHD_Connection *connection,
- void **connection_cls,
- const char *upload_data,
- size_t *upload_data_size)
-{
- struct TALER_MintWireSupportMethodsPS wsm;
- struct TALER_MintPublicKeyP pub;
- struct TALER_MintSignatureP sig;
- json_t *methods;
-
- wsm.purpose.size = htonl (sizeof (wsm));
- wsm.purpose.purpose = htonl (TALER_SIGNATURE_MINT_WIRE_TYPES);
- methods = TMH_VALIDATION_get_methods (&wsm.h_wire_types);
- TMH_KS_sign (&wsm.purpose,
- &pub,
- &sig);
- return TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_OK,
- "{s:o, s:o, s:o}",
- "methods", methods,
- "sig", TALER_json_from_data (&sig,
- sizeof (sig)),
- "pub", TALER_json_from_data (&pub,
- sizeof (pub)));
-}
-
-
-/**
- * Handle a "/wire/test" request.
- *
- * @param rh context of the handler
- * @param connection the MHD connection to handle
- * @param[in,out] connection_cls the connection's closure (can be updated)
- * @param upload_data upload data
- * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
- * @return MHD result code
- */
-int
-TMH_WIRE_handler_wire_test (struct TMH_RequestHandler *rh,
- struct MHD_Connection *connection,
- void **connection_cls,
- const char *upload_data,
- size_t *upload_data_size)
-{
- struct MHD_Response *response;
- int ret;
- char *wire_test_redirect;
-
- response = MHD_create_response_from_buffer (0, NULL,
- MHD_RESPMEM_PERSISTENT);
- if (NULL == response)
- {
- GNUNET_break (0);
- return MHD_NO;
- }
- TMH_RESPONSE_add_global_headers (response);
- if (GNUNET_NO == TMH_VALIDATION_test_method ("test"))
- {
- /* Return 501: not implemented */
- ret = MHD_queue_response (connection,
- MHD_HTTP_NOT_IMPLEMENTED,
- response);
- MHD_destroy_response (response);
- return ret;
- }
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint-wire-test",
- "REDIRECT_URL",
- &wire_test_redirect))
- {
- /* oopsie, configuration error */
- MHD_destroy_response (response);
- return TMH_RESPONSE_reply_internal_error (connection,
- "REDIRECT_URL not configured");
- }
- MHD_add_response_header (response,
- MHD_HTTP_HEADER_LOCATION,
- wire_test_redirect);
- GNUNET_free (wire_test_redirect);
- ret = MHD_queue_response (connection,
- rh->response_code,
- response);
- MHD_destroy_response (response);
- return ret;
-}
-
-
-/**
- * Handle a "/wire/sepa" request.
- *
- * @param rh context of the handler
- * @param connection the MHD connection to handle
- * @param[in,out] connection_cls the connection's closure (can be updated)
- * @param upload_data upload data
- * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
- * @return MHD result code
- */
-int
-TMH_WIRE_handler_wire_sepa (struct TMH_RequestHandler *rh,
- struct MHD_Connection *connection,
- void **connection_cls,
- const char *upload_data,
- size_t *upload_data_size)
-{
- struct MHD_Response *response;
- int ret;
- char *sepa_wire_file;
- int fd;
- struct stat sbuf;
-
- if (GNUNET_NO == TMH_VALIDATION_test_method ("sepa"))
- {
- /* Return 501: not implemented */
- response = MHD_create_response_from_buffer (0, NULL,
- MHD_RESPMEM_PERSISTENT);
- if (NULL == response)
- {
- GNUNET_break (0);
- return MHD_NO;
- }
- TMH_RESPONSE_add_global_headers (response);
- ret = MHD_queue_response (connection,
- MHD_HTTP_NOT_IMPLEMENTED,
- response);
- MHD_destroy_response (response);
- return ret;
- }
- /* Fetch reply */
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_filename (cfg,
- "mint-wire-sepa",
- "SEPA_RESPONSE_FILE",
- &sepa_wire_file))
- {
- return TMH_RESPONSE_reply_internal_error (connection,
- "SEPA_RESPONSE_FILE not configured");
- }
- fd = open (sepa_wire_file,
- O_RDONLY);
- if (-1 == fd)
- {
- GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
- "open",
- sepa_wire_file);
- GNUNET_free (sepa_wire_file);
- return TMH_RESPONSE_reply_internal_error (connection,
- "Failed to open SEPA_RESPONSE_FILE");
- }
- if (0 != fstat (fd, &sbuf))
- {
- GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
- "fstat",
- sepa_wire_file);
- (void) close (fd);
- GNUNET_free (sepa_wire_file);
- return TMH_RESPONSE_reply_internal_error (connection,
- "Failed to open SEPA_RESPONSE_FILE");
- }
- response = MHD_create_response_from_fd ((size_t) sbuf.st_size,
- fd);
- GNUNET_free (sepa_wire_file);
- if (NULL == response)
- {
- (void) close (fd);
- GNUNET_break (0);
- return MHD_NO;
- }
- TMH_RESPONSE_add_global_headers (response);
- if (NULL != rh->mime_type)
- (void) MHD_add_response_header (response,
- MHD_HTTP_HEADER_CONTENT_TYPE,
- rh->mime_type);
- ret = MHD_queue_response (connection,
- rh->response_code,
- response);
- MHD_destroy_response (response);
- return ret;
-}
-
-/* end of taler-mint-httpd_wire.c */
diff --git a/src/mintdb/Makefile.am b/src/mintdb/Makefile.am
deleted file mode 100644
index e3d37b2e5..000000000
--- a/src/mintdb/Makefile.am
+++ /dev/null
@@ -1,110 +0,0 @@
-# This Makefile.am is in the public domain
-AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/pq/ $(POSTGRESQL_CPPFLAGS)
-
-if USE_COVERAGE
- AM_CFLAGS = --coverage -O0
- XLIB = -lgcov
-endif
-
-plugindir = $(libdir)/taler
-
-if HAVE_POSTGRESQL
-plugin_LTLIBRARIES = \
- libtaler_plugin_mintdb_postgres.la
-endif
-
-EXTRA_DIST = \
- plugin_mintdb_common.c \
- test-mint-db-postgres.conf
-
-libtaler_plugin_mintdb_postgres_la_SOURCES = \
- plugin_mintdb_postgres.c
-libtaler_plugin_mintdb_postgres_la_LIBADD = \
- $(LTLIBINTL)
-libtaler_plugin_mintdb_postgres_la_LDFLAGS = \
- $(TALER_PLUGIN_LDFLAGS) \
- $(top_builddir)/src/pq/libtalerpq.la \
- $(top_builddir)/src/util/libtalerutil.la \
- -lpq \
- -lgnunetpq \
- -lgnunetutil $(XLIB)
-
-lib_LTLIBRARIES = \
- libtalermintdb.la
-
-libtalermintdb_la_SOURCES = \
- mintdb_keyio.c \
- mintdb_plugin.c
-
-libtalermintdb_la_LIBADD = \
- $(top_builddir)/src/util/libtalerutil.la \
- -lgnunetutil $(XLIB)
-
-libtalermintdb_la_LDFLAGS = \
- $(POSTGRESQL_LDFLAGS) \
- -version-info 0:0:0 \
- -no-undefined
-
-
-check_PROGRAMS = \
- test-mintdb-deposits \
- test-mintdb-keyio \
- test-mintdb-postgres \
- test-perf-taler-mintdb \
- perf-mintdb
-
-TESTS = \
- test-mintdb-postgres \
- test-perf-taler-mintdb
-
-test_mintdb_deposits_SOURCES = \
- test_mintdb_deposits.c
-test_mintdb_deposits_LDADD = \
- libtalermintdb.la \
- $(top_srcdir)/src/util/libtalerutil.la \
- $(top_srcdir)/src/pq/libtalerpq.la \
- -lgnunetutil \
- -ljansson \
- -lpq
-
-test_mintdb_keyio_SOURCES = \
- test_mintdb_keyio.c
-test_mintdb_keyio_LDADD = \
- libtalermintdb.la \
- $(top_srcdir)/src/util/libtalerutil.la \
- $(top_srcdir)/src/pq/libtalerpq.la \
- -lgnunetutil
-
-test_mintdb_postgres_SOURCES = \
- test_mintdb.c
-test_mintdb_postgres_LDADD = \
- libtalermintdb.la \
- $(top_srcdir)/src/util/libtalerutil.la \
- $(top_srcdir)/src/pq/libtalerpq.la \
- -lgnunetutil -ljansson
-
-test_perf_taler_mintdb_SOURCES = \
- test_perf_taler_mintdb.c \
- perf_taler_mintdb_init.c \
- perf_taler_mintdb_interpreter.c
-test_perf_taler_mintdb_LDADD = \
- libtalermintdb.la \
- $(top_srcdir)/src/util/libtalerutil.la \
- $(top_srcdir)/src/pq/libtalerpq.la \
- -ljansson \
- -lgnunetutil
-
-perf_mintdb_SOURCES = \
- perf_taler_mintdb.c \
- perf_taler_mintdb_init.c \
- perf_taler_mintdb_interpreter.c
-perf_mintdb_LDADD = \
- libtalermintdb.la \
- $(top_srcdir)/src/util/libtalerutil.la \
- $(top_srcdir)/src/pq/libtalerpq.la \
- -ljansson \
- -lgnunetutil
-
-
-EXTRA_test_mintdb_postgres_DEPENDENCIES = \
- libtaler_plugin_mintdb_postgres.la
diff --git a/src/mintdb/perf_taler_mintdb_init.h b/src/mintdb/perf_taler_mintdb_init.h
deleted file mode 100644
index f94beef10..000000000
--- a/src/mintdb/perf_taler_mintdb_init.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, If not, see
- */
-/**
- * @file mintdb/perf_taler_mintdb_init.h
- * @brief Heler function for creating dummy inputs for the mint database
- * @author Nicolas Fournier
- */
-#ifndef __PERF_TALER_MINTDB_INIT_H___
-#define __PERF_TALER_MINTDB_INIT_H___
-
-#include "taler_mintdb_plugin.h"
-
-
-#define CURRENCY "EUR"
-
-/**
- * All information about a reserve
- */
-struct PERF_TALER_MINTDB_Reserve
-{
- /**
- * Information about a rserve available to the Mint
- */
- struct TALER_MINTDB_Reserve reserve;
-
- /**
- * Private key of a reserve
- */
- struct GNUNET_CRYPTO_EddsaPrivateKey private;
-};
-
-
-/**
- * All informations about a coin
- */
-struct PERF_TALER_MINTDB_Coin
-{
- /**
- * Blinded coin, known by the mint
- */
- struct TALER_MINTDB_CollectableBlindcoin blind;
-
- /**
- * Public key of the coin and othes informations
- */
- struct TALER_CoinPublicInfo public_info;
-
- /**
- * Private key of the coin
- */
- struct GNUNET_CRYPTO_EddsaPrivateKey priv;
-};
-
-
-/**
- * Generate a dummy DenominationKeyInformation for testing purposes
- * @return a dummy denomination key
- */
-struct TALER_MINTDB_DenominationKeyIssueInformation *
-PERF_TALER_MINTDB_denomination_init (void);
-
-
-/**
- * Copies the given denomination
- * @param reserve the deposit copy
- * @return a copy of @a deposit; NULL if error
- */
-struct TALER_MINTDB_DenominationKeyIssueInformation *
-PERF_TALER_MINTDB_denomination_copy (
- const struct TALER_MINTDB_DenominationKeyIssueInformation *dki);
-
-
-/**
- * Free memory of a DenominationKeyIssueInformation
- * @param dki pointer to the struct to free
- */
-int
-PERF_TALER_MINTDB_denomination_free (
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki);
-
-
-/**
- * Generate a dummy reserve for testing
- * @return a reserve with 1000 EUR in it
- */
-struct PERF_TALER_MINTDB_Reserve *
-PERF_TALER_MINTDB_reserve_init (void);
-
-
-/**
- * Copies the given reserve
- * @param reserve the reserve to copy
- * @return a copy of @a reserve; NULL if error
- */
-struct PERF_TALER_MINTDB_Reserve *
-PERF_TALER_MINTDB_reserve_copy (const struct PERF_TALER_MINTDB_Reserve *reserve);
-
-
-/**
- * Free memory of a reserve
- * @param reserve pointer to the structure to be freed
- */
-int
-PERF_TALER_MINTDB_reserve_free (struct PERF_TALER_MINTDB_Reserve *reserve);
-
-
-/**
- * Generate a dummy deposit for testing purposes
- * @param dki the denomination key used to sign the key
- */
-struct TALER_MINTDB_Deposit *
-PERF_TALER_MINTDB_deposit_init (
- const struct PERF_TALER_MINTDB_Coin *coin);
-
-
-/**
- * Copies the given deposit
- * @param reserve the deposit copy
- * @return a copy of @a deposit; NULL if error
- */
-struct TALER_MINTDB_Deposit *
-PERF_TALER_MINTDB_deposit_copy (const struct TALER_MINTDB_Deposit *deposit);
-
-
-/**
- * Free memory of a deposit
- * @param deposit pointer to the structure to free
- */
-int
-PERF_TALER_MINTDB_deposit_free (struct TALER_MINTDB_Deposit *deposit);
-
-
-/**
- * Generate a coin for testing purpuses
- * @param dki denomination key used to sign the coin
- * @param reserve reserve providing the money for the coin
- * @return a randomly generated CollectableBlindcoin
- */
-struct PERF_TALER_MINTDB_Coin *
-PERF_TALER_MINTDB_coin_init (
- const struct TALER_MINTDB_DenominationKeyIssueInformation *dki,
- const struct PERF_TALER_MINTDB_Reserve *reserve);
-
-
-/**
- * Copies the given coin
- * @param coin the coin to copy
- * @return a copy of coin; NULL if error
- */
-struct PERF_TALER_MINTDB_Coin *
-PERF_TALER_MINTDB_coin_copy (
- const struct PERF_TALER_MINTDB_Coin *coin);
-
-
-/**
- * Liberate memory of @a coin
- * @param coin pointer to the structure to free
- */
-int
-PERF_TALER_MINTDB_coin_free (
- struct PERF_TALER_MINTDB_Coin *coin);
-
-
-/**
- * @return a randomly generated refresh session
- */
-struct TALER_MINTDB_RefreshSession *
-PERF_TALER_MINTDB_refresh_session_init (void);
-
-
-/**
- * @return #GNUNET_OK if the copy was successful, #GNUNET_SYSERR if it wasn't
- */
-int
-PERF_TALER_MINTDB_refresh_session_copy (struct TALER_MINTDB_RefreshSession *session,
- struct TALER_MINTDB_RefreshSession *copy);
-
-
-/**
- * Frees memory of a refresh_session
- */
-int
-PERF_TALER_MINTDB_refresh_session_free (
- struct TALER_MINTDB_RefreshSession *refresh_session);
-
-
-/**
- * Create a melt operation
- *
- * @param session the refresh session
- * @param dki the denomination the melted coin uses
- * @return a pointer to a #TALER_MINTDB_RefreshMelt
- */
-struct TALER_MINTDB_RefreshMelt *
-PERF_TALER_MINTDB_refresh_melt_init (struct GNUNET_HashCode *session,
- struct PERF_TALER_MINTDB_Coin *coin);
-
-
-/**
- * Copies the internals of a #TALER_MINTDB_RefreshMelt
- *
- * @param melt the refresh melt to copy
- * @return an copy of @ melt
- */
-struct TALER_MINTDB_RefreshMelt *
-PERF_TALER_MINTDB_refresh_melt_copy (const struct TALER_MINTDB_RefreshMelt *melt);
-
-
-/**
- * Free the internal memory of a #TALER_MINTDB_RefreshMelt
- *
- * @param melt the #TALER_MINTDB_RefreshMelt to free
- * @return #GNUNET_OK if the operation was successful, #GNUNET_SYSERROR
- */
-int
-PERF_TALER_MINTDB_refresh_melt_free (struct TALER_MINTDB_RefreshMelt *melt);
-
-
-/**
- * Create a #TALER_MINTDB_RefreshCommitCoin
- */
-struct TALER_MINTDB_RefreshCommitCoin *
-PERF_TALER_MINTDB_refresh_commit_coin_init (void);
-
-
-/**
- * Copies a #TALER_MINTDB_RefreshCommitCoin
- *
- * @param commit_coin the commit to copy
- * @return a copy of @a commit_coin
- */
-struct TALER_MINTDB_RefreshCommitCoin *
-PERF_TALER_MINTDB_refresh_commit_coin_copy (struct TALER_MINTDB_RefreshCommitCoin *commit_coin);
-
-
-/**
- * Free a #TALER_MINTDB_RefreshCommitCoin
- *
- * @param commit_coin the coin to free
- */
-void
-PERF_TALER_MINTDB_refresh_commit_coin_free (struct TALER_MINTDB_RefreshCommitCoin *commit_coin);
-
-#endif
diff --git a/src/mintdb/test_perf_taler_mintdb.c b/src/mintdb/test_perf_taler_mintdb.c
deleted file mode 100644
index 789a0dd4f..000000000
--- a/src/mintdb/test_perf_taler_mintdb.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, If not, see
- */
-/**
- * @file mintdb/test_perf_taler_mintdb.c
- * @brief Mint database performance analysis
- * @author Nicolas Fournier
- */
-#include "platform.h"
-#include "perf_taler_mintdb_interpreter.h"
-#include "perf_taler_mintdb_init.h"
-
-
-#define NB_DENOMINATION_INIT 2
-#define NB_DENOMINATION_SAVE 2
-
-#define NB_RESERVE_INIT 4
-#define NB_RESERVE_SAVE 1
-
-#define NB_DEPOSIT_INIT 1
-#define NB_DEPOSIT_SAVE 1
-
-#define NB_WITHDRAW_INIT 1
-#define NB_WITHDRAW_SAVE 1
-
-/**
- * Allocate, copies and free all the data used in the interpreter
- * Used to check for memory leaks
- */
-static void
-test_allocate ()
-{
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki, *dki_copy;
- struct PERF_TALER_MINTDB_Reserve *reserve, *reserve_copy;
- struct PERF_TALER_MINTDB_Coin *coin, *coin_copy;
- struct TALER_MINTDB_Deposit *deposit, *deposit_copy;
-
- dki = PERF_TALER_MINTDB_denomination_init ();
- reserve = PERF_TALER_MINTDB_reserve_init ();
- coin = PERF_TALER_MINTDB_coin_init (dki,
- reserve);
- deposit = PERF_TALER_MINTDB_deposit_init (coin);
-
- dki_copy = PERF_TALER_MINTDB_denomination_copy (dki);
- reserve_copy = PERF_TALER_MINTDB_reserve_copy (reserve);
- coin_copy = PERF_TALER_MINTDB_coin_copy (coin);
- deposit_copy = PERF_TALER_MINTDB_deposit_copy (deposit);
-
- PERF_TALER_MINTDB_denomination_free (dki);
- PERF_TALER_MINTDB_denomination_free (dki_copy);
- PERF_TALER_MINTDB_reserve_free (reserve);
- PERF_TALER_MINTDB_reserve_free (reserve_copy);
- PERF_TALER_MINTDB_coin_free (coin);
- PERF_TALER_MINTDB_coin_free (coin_copy);
- PERF_TALER_MINTDB_deposit_free (deposit);
- PERF_TALER_MINTDB_deposit_free (deposit_copy);
-}
-
-/**
- * Runs the performances tests for the mint database
- * and logs the results using Gauger
- */
-int
-main (int argc, char ** argv)
-{
- int ret = 0;
- struct PERF_TALER_MINTDB_Cmd init[] =
- {
- PERF_TALER_MINTDB_INIT_CMD_END ("init")
- };
- struct PERF_TALER_MINTDB_Cmd benchmark[] =
- {
- // Denomination used to create coins
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("00 - Start of interpreter"),
-
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("01 - denomination loop",
- NB_DENOMINATION_INIT),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("01 - start transaction"),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_DENOMINATION ("01 - denomination"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("01 - insert",
- "01 - denomination"),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("01 - commit transaction"),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination",
- "01 - denomination loop",
- "01 - denomination",
- NB_DENOMINATION_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("01 - denomination loop end",
- "01 - denomination loop"),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("01 - init denomination complete"),
- // End of initialization
- // Reserve initialization
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("02 - init reserve loop",
- NB_RESERVE_INIT),
-
- PERF_TALER_MINTDB_INIT_CMD_CREATE_RESERVE ("02 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("02 - insert",
- "02 - reserve"),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve",
- "02 - init reserve loop",
- "02 - reserve",
- NB_RESERVE_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("02 - init reserve end loop",
- "02 - init reserve loop"),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("02 - reserve init complete"),
- // End reserve init
- // Withdrawal initialization
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("03 - init withdraw loop",
- NB_WITHDRAW_INIT),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("03 - start transaction"),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("03 - denomination load",
- "03 - init withdraw loop",
- "01 - save denomination"),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("03 - reserve load",
- "03 - init withdraw loop",
- "02 - save reserve"),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_WITHDRAW ("03 - withdraw",
- "03 - denomination load",
- "03 - reserve load"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW ("03 - insert withdraw",
- "03 - withdraw"),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("03 - commit transaction"),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("03 - coin array",
- "03 - init withdraw loop",
- "03 - withdraw",
- NB_WITHDRAW_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("03 - withdraw init end loop",
- "03 - init withdraw loop"),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("03 - withdraw init complete"),
- //End of withdrawal initialization
- //Deposit initialization
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("04 - time start"),
- PERF_TALER_MINTDB_INIT_CMD_LOOP ("04 - deposit init loop",
- NB_DEPOSIT_INIT),
- PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("04 - start transaction"),
- PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("04 - coin load",
- "04 - deposit init loop",
- "03 - coin array"),
- PERF_TALER_MINTDB_INIT_CMD_CREATE_DEPOSIT ("04 - deposit",
- "04 - coin load"),
- PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("04 - insert deposit",
- "04 - deposit"),
- PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("04 - commit transaction"),
- PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("04 - deposit array",
- "04 - deposit init loop",
- "04 - deposit",
- NB_DEPOSIT_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("04 - deposit init loop end",
- "04 - deposit init loop"),
- PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("04 - time stop"),
- PERF_TALER_MINTDB_INIT_CMD_GAUGER ("04 - gauger",
- "04 - time start",
- "04 - time stop",
- "TEST",
- "time to insert a deposit",
- "deposit/sec",
- NB_DEPOSIT_SAVE),
- PERF_TALER_MINTDB_INIT_CMD_DEBUG ("04 - deposit init complete"),
- // End of deposit initialization
- PERF_TALER_MINTDB_INIT_CMD_END ("end"),
- };
-
- test_allocate ();
- ret = PERF_TALER_MINTDB_run_benchmark ("test-perf-taler-mintdb",
- "./test-mint-db-postgres.conf",
- init,
- benchmark);
- if (GNUNET_SYSERR == ret)
- return 1;
- return 0;
-}
diff --git a/src/pq/pq_result_helper.c b/src/pq/pq_result_helper.c
index 748ce0c29..49d0668a0 100644
--- a/src/pq/pq_result_helper.c
+++ b/src/pq/pq_result_helper.c
@@ -72,7 +72,7 @@ extract_amount_nbo_helper (PGresult *result,
frac_name);
curr_num = PQfnumber (result,
curr_name);
- if (val_num < 0)
+ if (val_num < 0)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Field `%s' does not exist in result\n",
@@ -140,7 +140,7 @@ extract_amount_nbo_helper (PGresult *result,
* #GNUNET_YES if all results could be extracted
* #GNUNET_NO if at least one result was NULL
* #GNUNET_SYSERR if a result was invalid (non-existing field)
- */
+ */
static int
extract_amount_nbo (void *cls,
PGresult *result,
@@ -153,7 +153,7 @@ extract_amount_nbo (void *cls,
char *frac_name;
char *curr_name;
int ret;
-
+
GNUNET_asprintf (&val_name,
"%s_val",
fname);
@@ -189,7 +189,7 @@ TALER_PQ_result_spec_amount_nbo (const char *name,
{
struct GNUNET_PQ_ResultSpec res =
{ &extract_amount_nbo, NULL, NULL,
- (void *) amount, sizeof (*amount),
+ (void *) amount, sizeof (*amount),
name, NULL };
return res;
}
@@ -208,7 +208,7 @@ TALER_PQ_result_spec_amount_nbo (const char *name,
* #GNUNET_YES if all results could be extracted
* #GNUNET_NO if at least one result was NULL
* #GNUNET_SYSERR if a result was invalid (non-existing field)
- */
+ */
static int
extract_amount (void *cls,
PGresult *result,
@@ -223,7 +223,7 @@ extract_amount (void *cls,
char *curr_name;
struct TALER_AmountNBO amount_nbo;
int ret;
-
+
GNUNET_asprintf (&val_name,
"%s_val",
fname);
@@ -280,7 +280,7 @@ TALER_PQ_result_spec_amount (const char *name,
* #GNUNET_YES if all results could be extracted
* #GNUNET_NO if at least one result was NULL
* #GNUNET_SYSERR if a result was invalid (non-existing field)
- */
+ */
static int
extract_json (void *cls,
PGresult *result,
@@ -294,7 +294,7 @@ extract_json (void *cls,
int fnum;
json_error_t json_error;
size_t slen;
-
+
fnum = PQfnumber (result,
fname);
if (fnum < 0)
@@ -320,10 +320,11 @@ extract_json (void *cls,
&json_error);
if (NULL == *j_dst)
{
- TALER_json_warn (json_error);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Failed to parse JSON result for field `%s'\n",
- fname);
+ "Failed to parse JSON result for field `%s': %s (%s)\n",
+ fname,
+ json_error.text,
+ json_error.source);
return GNUNET_SYSERR;
}
return GNUNET_OK;
@@ -364,7 +365,7 @@ TALER_PQ_result_spec_json (const char *name,
{
struct GNUNET_PQ_ResultSpec res =
{ &extract_json, &clean_json, NULL,
- (void *) jp, 0,
+ (void *) jp, 0,
name, NULL };
return res;
}
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 8efc3987a..22bc788b8 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -1,11 +1,32 @@
# This Makefile.am is in the public domain
-AM_CPPFLAGS = -I$(top_srcdir)/src/include $(LIBGCRYPT_CFLAGS) $(POSTGRESQL_CPPFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir)/src/include $(LIBGCRYPT_CFLAGS)
if USE_COVERAGE
AM_CFLAGS = --coverage -O0
XLIB = -lgcov
endif
+
+pkgcfgdir = $(prefix)/share/taler/config.d/
+
+pkgcfg_DATA = \
+ paths.conf
+
+EXTRA_DIST = \
+ paths.conf
+
+dist_bin_SCRIPTS = taler-config
+
+# See https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
+# for and explanation and why this ugliness is necessary.
+edit = sed -e 's|@libdir[@]|$(libdir)|g'
+taler-config: Makefile $(srcdir)/taler-config.in
+ rm -f $@ $@.tmp
+ $(edit) '$(srcdir)/$@.in' >$@.tmp
+ chmod +x $@.tmp
+ chmod a-w $@.tmp
+ mv $@.tmp $@
+
if WALLET_ONLY
lib_LTLIBRARIES = \
libtalerutil_wallet.la
@@ -31,15 +52,11 @@ libtalerutil_la_SOURCES = \
amount.c \
crypto.c \
util.c \
- json.c \
- os_installation.c \
- plugin.c \
- wireformats.c
+ os_installation.c
libtalerutil_la_LIBADD = \
-lgnunetutil \
$(LIBGCRYPT_LIBS) \
- -ljansson \
-lmicrohttpd $(XLIB)
libtalerutil_la_LDFLAGS = \
@@ -48,13 +65,11 @@ libtalerutil_la_LDFLAGS = \
TESTS = \
test_amount \
- test_crypto \
- test_json
+ test_crypto
-check_PROGRAMS= \
+check_PROGRAMS = \
test_amount \
- test_crypto \
- test_json
+ test_crypto
test_amount_SOURCES = \
@@ -68,10 +83,3 @@ test_crypto_SOURCES = \
test_crypto_LDADD = \
-lgnunetutil \
libtalerutil.la
-
-test_json_SOURCES = \
- test_json.c
-test_json_LDADD = \
- -lgnunetutil \
- -ljansson \
- libtalerutil.la
diff --git a/src/util/amount.c b/src/util/amount.c
index dc2d2e400..4ac7d30ab 100644
--- a/src/util/amount.c
+++ b/src/util/amount.c
@@ -150,6 +150,30 @@ TALER_string_to_amount (const char *str,
}
+/**
+ * Parse denomination description, in the format "T:V.F".
+ *
+ * @param str denomination description
+ * @param denom denomination to write the result to, in NBO
+ * @return #GNUNET_OK if the string is a valid denomination specification,
+ * #GNUNET_SYSERR if it is invalid.
+ */
+int
+TALER_string_to_amount_nbo (const char *str,
+ struct TALER_AmountNBO *denom)
+{
+ struct TALER_Amount amount;
+
+ if (GNUNET_OK !=
+ TALER_string_to_amount (str,
+ &amount))
+ return GNUNET_SYSERR;
+ TALER_amount_hton (denom,
+ &amount);
+ return GNUNET_OK;
+}
+
+
/**
* Convert amount from host to network representation.
*
diff --git a/src/util/json.c b/src/util/json.c
deleted file mode 100644
index 6aca7548c..000000000
--- a/src/util/json.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, If not, see
-*/
-/**
- * @file util/json.c
- * @brief helper functions for JSON processing using libjansson
- * @author Sree Harsha Totakura
- */
-#include "platform.h"
-#if HAVE_GNUNET_GNUNET_UTIL_TALER_WALLET_LIB_H
-#include
-#endif
-#if HAVE_GNUNET_GNUNET_UTIL_LIB_H
-#include
-#endif
-#include "taler_util.h"
-
-/**
- * Shorthand for exit jumps.
- */
-#define EXITIF(cond) \
- do { \
- if (cond) { GNUNET_break (0); goto EXITIF_exit; } \
- } while (0)
-
-/**
- * Shorthand for JSON parsing related exit jumps.
- */
-#define UNPACK_EXITIF(cond) \
- do { \
- if (cond) { TALER_json_warn (error); goto EXITIF_exit; } \
- } while (0)
-
-
-/**
- * Convert a TALER amount to a JSON
- * object.
- *
- * @param amount the amount
- * @return a json object describing the amount
- */
-json_t *
-TALER_json_from_amount (const struct TALER_Amount *amount)
-{
- json_t *j;
-
- if ( (amount->value != (uint64_t) ((json_int_t) amount->value)) ||
- (0 > ((json_int_t) amount->value)) )
- {
- /* Theoretically, json_int_t can be a 32-bit "long", or we might
- have a 64-bit value which converted to a 63-bit signed long
- long causes problems here. So we check. Note that depending
- on the platform, the compiler may be able to statically tell
- that at least the first check is always false. */
- GNUNET_break (0);
- return NULL;
- }
- j = json_pack ("{s:s, s:I, s:I}",
- "currency", amount->currency,
- "value", (json_int_t) amount->value,
- "fraction", (json_int_t) amount->fraction);
- GNUNET_assert (NULL != j);
- return j;
-}
-
-
-/**
- * Convert absolute timestamp to a json string.
- *
- * @param stamp the time stamp
- * @return a json string with the timestamp in @a stamp
- */
-json_t *
-TALER_json_from_abs (struct GNUNET_TIME_Absolute stamp)
-{
- json_t *j;
- char *mystr;
- int ret;
-
- GNUNET_assert (GNUNET_OK ==
- TALER_round_abs_time (&stamp));
- if (stamp.abs_value_us == GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us)
- return json_string ("/never/");
- ret = GNUNET_asprintf (&mystr,
- "/Date(%llu)/",
- (unsigned long long) (stamp.abs_value_us / (1000LL * 1000LL)));
- GNUNET_assert (ret > 0);
- j = json_string (mystr);
- GNUNET_free (mystr);
- return j;
-}
-
-
-/**
- * Convert RSA public key to JSON.
- *
- * @param pk public key to convert
- * @return corresponding JSON encoding
- */
-json_t *
-TALER_json_from_rsa_public_key (struct GNUNET_CRYPTO_rsa_PublicKey *pk)
-{
- char *buf;
- size_t buf_len;
- json_t *ret;
-
- buf_len = GNUNET_CRYPTO_rsa_public_key_encode (pk,
- &buf);
- ret = TALER_json_from_data (buf,
- buf_len);
- GNUNET_free (buf);
- return ret;
-}
-
-
-/**
- * Convert JSON to RSA public key.
- *
- * @param json JSON encoding to convert
- * @return corresponding public key
- */
-struct GNUNET_CRYPTO_rsa_PublicKey *
-TALER_json_to_rsa_public_key (json_t *json)
-{
- const char *enc;
- char *buf;
- size_t len;
- size_t buf_len;
- struct GNUNET_CRYPTO_rsa_PublicKey *pk;
-
- buf = NULL;
- EXITIF (NULL == (enc = json_string_value (json)));
- len = strlen (enc);
- buf_len = (len * 5) / 8;
- buf = GNUNET_malloc (buf_len);
- EXITIF (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (enc,
- len,
- buf,
- buf_len));
- EXITIF (NULL == (pk = GNUNET_CRYPTO_rsa_public_key_decode (buf,
- buf_len)));
- GNUNET_free (buf);
- return pk;
- EXITIF_exit:
- GNUNET_free_non_null (buf);
- return NULL;
-}
-
-
-/**
- * Convert JSON to RSA signature.
- *
- * @param json JSON encoding to convert
- * @return corresponding signature
- */
-struct GNUNET_CRYPTO_rsa_Signature *
-TALER_json_to_rsa_signature (json_t *json)
-{
- const char *enc;
- char *buf;
- size_t len;
- size_t buf_len;
- struct GNUNET_CRYPTO_rsa_Signature *sig;
-
- buf = NULL;
- EXITIF (NULL == (enc = json_string_value (json)));
- len = strlen (enc);
- buf_len = (len * 5) / 8;
- buf = GNUNET_malloc (buf_len);
- EXITIF (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (enc,
- len,
- buf,
- buf_len));
- EXITIF (NULL == (sig = GNUNET_CRYPTO_rsa_signature_decode (buf,
- buf_len)));
- GNUNET_free (buf);
- return sig;
- EXITIF_exit:
- GNUNET_free_non_null (buf);
- return NULL;
-}
-
-
-/**
- * Convert RSA signature to JSON.
- *
- * @param sig signature to convert
- * @return corresponding JSON encoding
- */
-json_t *
-TALER_json_from_rsa_signature (struct GNUNET_CRYPTO_rsa_Signature *sig)
-{
- char *buf;
- size_t buf_len;
- json_t *ret;
-
- buf_len = GNUNET_CRYPTO_rsa_signature_encode (sig,
- &buf);
- ret = TALER_json_from_data (buf,
- buf_len);
- GNUNET_free (buf);
- return ret;
-}
-
-
-/**
- * Convert binary data to a JSON string
- * with the base32crockford encoding.
- *
- * @param data binary data
- * @param size size of @a data in bytes
- * @return json string that encodes @a data
- */
-json_t *
-TALER_json_from_data (const void *data,
- size_t size)
-{
- char *buf;
- json_t *json;
-
- buf = GNUNET_STRINGS_data_to_string_alloc (data, size);
- json = json_string (buf);
- GNUNET_free (buf);
- return json;
-}
-
-
-/**
- * Parse given JSON object to Amount
- *
- * @param json the json object representing Amount
- * @param[out] r_amount where the amount has to be written
- * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
- */
-int
-TALER_json_to_amount (json_t *json,
- struct TALER_Amount *r_amount)
-{
- json_int_t value;
- json_int_t fraction;
- const char *currency;
-
- memset (r_amount,
- 0,
- sizeof (struct TALER_Amount));
- if (0 != json_unpack (json,
- "{s:I, s:I, s:s}",
- "value", &value,
- "fraction", &fraction,
- "currency", ¤cy))
- {
- char *json_enc;
-
- if (NULL == (json_enc = json_dumps (json,
- JSON_COMPACT | JSON_ENCODE_ANY)))
- {
- GNUNET_break (0);
- return GNUNET_SYSERR;
- }
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Malformed JSON amount: %s\n",
- json_enc);
- free (json_enc);
- return GNUNET_SYSERR;
- }
- if ( (value < 0) ||
- (fraction < 0) ||
- (value > UINT64_MAX) ||
- (fraction > UINT32_MAX) )
- {
- GNUNET_break_op (0);
- return GNUNET_SYSERR;
- }
- if (strlen (currency) >= TALER_CURRENCY_LEN)
- {
- GNUNET_break_op (0);
- return GNUNET_SYSERR;
- }
- r_amount->value = (uint64_t) value;
- r_amount->fraction = (uint32_t) fraction;
- strcpy (r_amount->currency, currency);
- (void) TALER_amount_normalize (r_amount);
- return GNUNET_OK;
-}
-
-
-/**
- * Parse given JSON object to absolute time.
- *
- * @param json the json object representing Amount
- * @param[out] abs where the amount has to be written
- * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
- */
-int
-TALER_json_to_abs (json_t *json,
- struct GNUNET_TIME_Absolute *abs)
-{
- const char *val;
- unsigned long long int tval;
-
- val = json_string_value (json);
- if (NULL == val)
- {
- GNUNET_break_op (0);
- return GNUNET_SYSERR;
- }
- if ( (0 == strcasecmp (val,
- "/forever/")) ||
- (0 == strcasecmp (val,
- "/never/")) )
- {
- *abs = GNUNET_TIME_UNIT_FOREVER_ABS;
- return GNUNET_OK;
- }
- if (1 != sscanf (val,
- "/Date(%llu)/",
- &tval))
- {
- GNUNET_break_op (0);
- return GNUNET_SYSERR;
- }
- /* Time is in seconds in JSON, but in microseconds in GNUNET_TIME_Absolute */
- abs->abs_value_us = tval * 1000LL * 1000LL;
- if ( (abs->abs_value_us) / 1000LL / 1000LL != tval)
- {
- /* Integer overflow */
- GNUNET_break_op (0);
- return GNUNET_SYSERR;
- }
- return GNUNET_OK;
-}
-
-
-/**
- * Parse given JSON object to data
- *
- * @param json the json object representing data
- * @param out the pointer to hold the parsed data.
- * @param out_size the size of @a out
- * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
- */
-int
-TALER_json_to_data (json_t *json,
- void *out,
- size_t out_size)
-{
- const char *enc;
- unsigned int len;
-
- EXITIF (NULL == (enc = json_string_value (json)));
- len = strlen (enc);
- EXITIF (((len * 5) / 8) != out_size);
- EXITIF (GNUNET_OK != GNUNET_STRINGS_string_to_data (enc, len, out, out_size));
- return GNUNET_OK;
- EXITIF_exit:
- return GNUNET_SYSERR;
-}
-
-
-/**
- * Hash a JSON for binary signing.
- *
- * @param[in] json some JSON value
- * @param[out] hc resulting hash code
- * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
- */
-int
-TALER_hash_json (json_t *json,
- struct GNUNET_HashCode *hc)
-{
- char *wire_enc;
- size_t len;
-
- if (NULL == (wire_enc = json_dumps (json,
- JSON_COMPACT | JSON_SORT_KEYS)))
- return GNUNET_SYSERR;
- len = strlen (wire_enc) + 1;
- GNUNET_CRYPTO_hash (wire_enc,
- len,
- hc);
- free (wire_enc);
- return GNUNET_OK;
-}
-
-
-/* End of util/json.c */
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index 0eab118fe..5aa34f1b9 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -1,701 +1,64 @@
/*
- This file is part of GNUnet.
- Copyright (C) 2006-2014 GNUnet e.V.
+ This file is part of GNU Taler.
+ Copyright (C) 2016 Inria
- GNUnet is free software; you can redistribute it and/or modify
+ Taler is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
- GNUnet is distributed in the hope that it will be useful, but
+ Taler is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
+ along with Taler; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
/**
* @file os_installation.c
- * @brief get paths used by the program; based heavily on the
- * corresponding GNUnet file, just adapted for Taler.
- * @author Milan
+ * @brief initialize libgnunet OS subsystem for Taler.
+ * @author Christian Grothoff
*/
#include "platform.h"
#include
-#if DARWIN
-#include
-#include
-#elif WINDOWS
-#include
-#endif
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
-
-#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
-
-
-#if LINUX
/**
- * Try to determine path by reading /proc/PID/exe
- *
- * @return NULL on error
+ * Default project data used for installation path detection
+ * for GNU Taler.
*/
-static char *
-get_path_from_proc_maps ()
-{
- char fn[64];
- char line[1024];
- char dir[1024];
- FILE *f;
- char *lgu;
+static const struct GNUNET_OS_ProjectData taler_pd = {
+ .libname = "libtalerutil",
+ .project_dirname = "taler",
+ .binary_name = "taler-exchange-httpd",
+ .env_varname = "TALER_PREFIX",
+ .bug_email = "taler@gnu.org",
+ .homepage = "http://www.gnu.org/s/taler/",
+};
- GNUNET_snprintf (fn, sizeof (fn), "/proc/%u/maps", getpid ());
- if (NULL == (f = FOPEN (fn, "r")))
- return NULL;
- while (NULL != fgets (line, sizeof (line), f))
- {
- if ((1 ==
- SSCANF (line, "%*x-%*x %*c%*c%*c%*c %*x %*2x:%*2x %*u%*[ ]%1023s", dir)) &&
- (NULL != (lgu = strstr (dir, "libtalerutil"))))
- {
- lgu[0] = '\0';
- FCLOSE (f);
- return GNUNET_strdup (dir);
- }
- }
- FCLOSE (f);
- return NULL;
+
+/**
+ * Return default project data used by Taler.
+ */
+const struct GNUNET_OS_ProjectData *
+TALER_project_data_default (void)
+{
+ return &taler_pd;
}
/**
- * Try to determine path by reading /proc/PID/exe
- *
- * @return NULL on error
+ * Initialize libtalerutil.
*/
-static char *
-get_path_from_proc_exe ()
+void __attribute__ ((constructor))
+TALER_OS_init ()
{
- char fn[64];
- char lnk[1024];
- ssize_t size;
-
- GNUNET_snprintf (fn, sizeof (fn), "/proc/%u/exe", getpid ());
- size = readlink (fn, lnk, sizeof (lnk) - 1);
- if (size <= 0)
- {
- LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "readlink", fn);
- return NULL;
- }
- GNUNET_assert (size < sizeof (lnk));
- lnk[size] = '\0';
- while ((lnk[size] != '/') && (size > 0))
- size--;
- /* test for being in lib/taler/libexec/ or lib/MULTIARCH/taler/libexec */
- if ( (size > strlen ("/taler/libexec/")) &&
- (0 == strcmp ("/taler/libexec/",
- &lnk[size - strlen ("/taler/libexec/")])) )
- size -= strlen ("taler/libexec/");
- if ((size < 4) || (lnk[size - 4] != '/'))
- {
- /* not installed in "/bin/" -- binary path probably useless */
- return NULL;
- }
- lnk[size] = '\0';
- return GNUNET_strdup (lnk);
+ GNUNET_OS_init (&taler_pd);
}
-#endif
-
-
-#if WINDOWS
-static HINSTANCE dll_instance;
-
-
-/**
- * GNUNET_util_cl_init() in common_logging.c is preferred.
- * This function is only for thread-local storage (not used in GNUnet)
- * and hInstance saving.
- */
-BOOL WINAPI
-DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
-{
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- dll_instance = hinstDLL;
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_THREAD_DETACH:
- break;
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
-
-/**
- * Try to determine path with win32-specific function
- *
- * @return NULL on error
- */
-static char *
-get_path_from_module_filename ()
-{
- size_t pathlen = 512;
- DWORD real_pathlen;
- wchar_t *idx;
- wchar_t *modulepath = NULL;
- char *upath;
- uint8_t *u8_string;
- size_t u8_string_length;
-
- /* This braindead function won't tell us how much space it needs, so
- * we start at 1024 and double the space up if it doesn't fit, until
- * it fits, or we exceed the threshold.
- */
- do
- {
- pathlen = pathlen * 2;
- modulepath = GNUNET_realloc (modulepath, pathlen * sizeof (wchar_t));
- SetLastError (0);
- real_pathlen = GetModuleFileNameW (dll_instance, modulepath, pathlen * sizeof (wchar_t));
- } while (real_pathlen >= pathlen && pathlen < 16*1024);
- if (real_pathlen >= pathlen)
- GNUNET_assert (0);
- /* To be safe */
- modulepath[real_pathlen] = '\0';
-
- idx = modulepath + real_pathlen;
- while ((idx > modulepath) && (*idx != L'\\') && (*idx != L'/'))
- idx--;
- *idx = L'\0';
-
- /* Now modulepath holds full path to the directory where libtalerutil is.
- * This directory should look like /bin or .
- */
- if (wcschr (modulepath, L'/') || wcschr (modulepath, L'\\'))
- {
- /* At least one directory component (i.e. we're not in a root directory) */
- wchar_t *dirname = idx;
- while ((dirname > modulepath) && (*dirname != L'\\') && (*dirname != L'/'))
- dirname--;
- *dirname = L'\0';
- if (dirname > modulepath)
- {
- dirname++;
- /* Now modulepath holds full path to the parent directory of the directory
- * where libtalerutil is.
- * dirname holds the name of the directory where libtalerutil is.
- */
- if (wcsicmp (dirname, L"bin") == 0)
- {
- /* pass */
- }
- else
- {
- /* Roll back our changes to modulepath */
- dirname--;
- *dirname = L'/';
- }
- }
- }
-
- /* modulepath is TALER_PREFIX */
- u8_string = u16_to_u8 (modulepath, wcslen (modulepath), NULL, &u8_string_length);
- if (NULL == u8_string)
- GNUNET_assert (0);
-
- upath = GNUNET_malloc (u8_string_length + 1);
- memcpy (upath, u8_string, u8_string_length);
- upath[u8_string_length] = '\0';
-
- free (u8_string);
- GNUNET_free (modulepath);
-
- return upath;
-}
-#endif
-
-
-#if DARWIN
-/**
- * Signature of the '_NSGetExecutablePath" function.
- *
- * @param buf where to write the path
- * @param number of bytes available in 'buf'
- * @return 0 on success, otherwise desired number of bytes is stored in 'bufsize'
- */
-typedef int (*MyNSGetExecutablePathProto) (char *buf, size_t * bufsize);
-
-
-/**
- * Try to obtain the path of our executable using '_NSGetExecutablePath'.
- *
- * @return NULL on error
- */
-static char *
-get_path_from_NSGetExecutablePath ()
-{
- static char zero = '\0';
- char *path;
- size_t len;
- MyNSGetExecutablePathProto func;
-
- path = NULL;
- if (NULL == (func =
- (MyNSGetExecutablePathProto) dlsym (RTLD_DEFAULT, "_NSGetExecutablePath")))
- return NULL;
- path = &zero;
- len = 0;
- /* get the path len, including the trailing \0 */
- (void) func (path, &len);
- if (0 == len)
- return NULL;
- path = GNUNET_malloc (len);
- if (0 != func (path, &len))
- {
- GNUNET_free (path);
- return NULL;
- }
- len = strlen (path);
- while ((path[len] != '/') && (len > 0))
- len--;
- path[len] = '\0';
- return path;
-}
-
-
-/**
- * Try to obtain the path of our executable using '_dyld_image' API.
- *
- * @return NULL on error
- */
-static char *
-get_path_from_dyld_image ()
-{
- const char *path;
- char *p;
- char *s;
- unsigned int i;
- int c;
-
- c = _dyld_image_count ();
- for (i = 0; i < c; i++)
- {
- if (((const void *) _dyld_get_image_header (i)) != (const void *)&_mh_dylib_header)
- continue;
- path = _dyld_get_image_name (i);
- if ( (NULL == path) || (0 == strlen (path)) )
- continue;
- p = GNUNET_strdup (path);
- s = p + strlen (p);
- while ((s > p) && ('/' != *s))
- s--;
- s++;
- *s = '\0';
- return p;
- }
- return NULL;
-}
-#endif
-
-
-/**
- * Return the actual path to a file found in the current
- * PATH environment variable.
- *
- * @param binary the name of the file to find
- * @return path to binary, NULL if not found
- */
-static char *
-get_path_from_PATH (const char *binary)
-{
- char *path;
- char *pos;
- char *end;
- char *buf;
- const char *p;
-
- if (NULL == (p = getenv ("PATH")))
- return NULL;
-#if WINDOWS
- /* On W32 look in CWD first. */
- GNUNET_asprintf (&path, ".%c%s", PATH_SEPARATOR, p);
-#else
- path = GNUNET_strdup (p); /* because we write on it */
-#endif
- buf = GNUNET_malloc (strlen (path) + strlen (binary) + 1 + 1);
- pos = path;
- while (NULL != (end = strchr (pos, PATH_SEPARATOR)))
- {
- *end = '\0';
- sprintf (buf, "%s/%s", pos, binary);
- if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
- {
- pos = GNUNET_strdup (pos);
- GNUNET_free (buf);
- GNUNET_free (path);
- return pos;
- }
- pos = end + 1;
- }
- sprintf (buf, "%s/%s", pos, binary);
- if (GNUNET_YES == GNUNET_DISK_file_test (buf))
- {
- pos = GNUNET_strdup (pos);
- GNUNET_free (buf);
- GNUNET_free (path);
- return pos;
- }
- GNUNET_free (buf);
- GNUNET_free (path);
- return NULL;
-}
-
-
-/**
- * Try to obtain the installation path using the "TALER_PREFIX" environment
- * variable.
- *
- * @return NULL on error (environment variable not set)
- */
-static char *
-get_path_from_TALER_PREFIX ()
-{
- const char *p;
-
- if (NULL != (p = getenv ("TALER_PREFIX")))
- return GNUNET_strdup (p);
- return NULL;
-}
-
-
-/**
- * @brief get the path to Taler bin/ or lib/, prefering the lib/ path
- * @author Milan
- *
- * @return a pointer to the executable path, or NULL on error
- */
-static char *
-os_get_taler_path ()
-{
- char *ret;
-
- if (NULL != (ret = get_path_from_TALER_PREFIX ()))
- return ret;
-#if LINUX
- if (NULL != (ret = get_path_from_proc_maps ()))
- return ret;
- /* try path *first*, before /proc/exe, as /proc/exe can be wrong */
- if (NULL != (ret = get_path_from_PATH ("taler-mint-httpd")))
- return ret;
- if (NULL != (ret = get_path_from_proc_exe ()))
- return ret;
-#endif
-#if WINDOWS
- if (NULL != (ret = get_path_from_module_filename ()))
- return ret;
-#endif
-#if DARWIN
- if (NULL != (ret = get_path_from_dyld_image ()))
- return ret;
- if (NULL != (ret = get_path_from_NSGetExecutablePath ()))
- return ret;
-#endif
- if (NULL != (ret = get_path_from_PATH ("taler-mint-httpd")))
- return ret;
- /* other attempts here */
- LOG (GNUNET_ERROR_TYPE_ERROR,
- _("Could not determine installation path for %s. Set `%s' environment variable.\n"),
- "Taler", "TALER_PREFIX");
- return NULL;
-}
-
-
-/**
- * @brief get the path to current app's bin/
- * @author Milan
- *
- * @return a pointer to the executable path, or NULL on error
- */
-static char *
-os_get_exec_path ()
-{
- char *ret = NULL;
-
-#if LINUX
- if (NULL != (ret = get_path_from_proc_exe ()))
- return ret;
-#endif
-#if WINDOWS
- if (NULL != (ret = get_path_from_module_filename ()))
- return ret;
-#endif
-#if DARWIN
- if (NULL != (ret = get_path_from_NSGetExecutablePath ()))
- return ret;
-#endif
- /* other attempts here */
- return ret;
-}
-
-
-/**
- * @brief get the path to a specific Taler installation directory or,
- * with #GNUNET_OS_IPK_SELF_PREFIX, the current running apps installation directory
- * @author Milan
- * @return a pointer to the dir path (to be freed by the caller)
- */
-char *
-TALER_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind)
-{
- size_t n;
- const char *dirname;
- char *execpath = NULL;
- char *tmp;
- char *multiarch;
- char *libdir;
- int isbasedir;
-
- /* if wanted, try to get the current app's bin/ */
- if (dirkind == GNUNET_OS_IPK_SELF_PREFIX)
- execpath = os_get_exec_path ();
-
- /* try to get Taler's bin/ or lib/, or if previous was unsuccessful some
- * guess for the current app */
- if (NULL == execpath)
- execpath = os_get_taler_path ();
-
- if (NULL == execpath)
- return NULL;
-
- n = strlen (execpath);
- if (0 == n)
- {
- /* should never happen, but better safe than sorry */
- GNUNET_free (execpath);
- return NULL;
- }
- /* remove filename itself */
- while ((n > 1) && (DIR_SEPARATOR == execpath[n - 1]))
- execpath[--n] = '\0';
-
- isbasedir = 1;
- if ((n > 6) &&
- ((0 == strcasecmp (&execpath[n - 6], "/lib32")) ||
- (0 == strcasecmp (&execpath[n - 6], "/lib64"))))
- {
- if ( (GNUNET_OS_IPK_LIBDIR != dirkind) &&
- (GNUNET_OS_IPK_LIBEXECDIR != dirkind) )
- {
- /* strip '/lib32' or '/lib64' */
- execpath[n - 6] = '\0';
- n -= 6;
- }
- else
- isbasedir = 0;
- }
- else if ((n > 4) &&
- ((0 == strcasecmp (&execpath[n - 4], "/bin")) ||
- (0 == strcasecmp (&execpath[n - 4], "/lib"))))
- {
- /* strip '/bin' or '/lib' */
- execpath[n - 4] = '\0';
- n -= 4;
- }
- multiarch = NULL;
- if (NULL != (libdir = strstr (execpath, "/lib/")))
- {
- /* test for multi-arch path of the form "PREFIX/lib/MULTIARCH/";
- here we need to re-add 'multiarch' to lib and libexec paths later! */
- multiarch = &libdir[5];
- if (NULL == strchr (multiarch, '/'))
- libdir[0] = '\0'; /* Debian multiarch format, cut of from 'execpath' but preserve in multicarch */
- else
- multiarch = NULL; /* maybe not, multiarch still has a '/', which is not OK */
- }
- /* in case this was a directory named foo-bin, remove "foo-" */
- while ((n > 1) && (execpath[n - 1] == DIR_SEPARATOR))
- execpath[--n] = '\0';
- switch (dirkind)
- {
- case GNUNET_OS_IPK_PREFIX:
- case GNUNET_OS_IPK_SELF_PREFIX:
- dirname = DIR_SEPARATOR_STR;
- break;
- case GNUNET_OS_IPK_BINDIR:
- dirname = DIR_SEPARATOR_STR "bin" DIR_SEPARATOR_STR;
- break;
- case GNUNET_OS_IPK_LIBDIR:
- if (isbasedir)
- {
- GNUNET_asprintf (&tmp,
- "%s%s%s%s%s",
- execpath,
- DIR_SEPARATOR_STR "lib",
- (NULL != multiarch) ? DIR_SEPARATOR_STR : "",
- (NULL != multiarch) ? multiarch : "",
- DIR_SEPARATOR_STR "taler" DIR_SEPARATOR_STR);
- if (GNUNET_YES ==
- GNUNET_DISK_directory_test (tmp, GNUNET_YES))
- {
- GNUNET_free (execpath);
- return tmp;
- }
- GNUNET_free (tmp);
- tmp = NULL;
- if (4 == sizeof (void *))
- {
- dirname =
- DIR_SEPARATOR_STR "lib32" DIR_SEPARATOR_STR "taler" DIR_SEPARATOR_STR;
- GNUNET_asprintf (&tmp,
- "%s%s",
- execpath,
- dirname);
- }
- if (8 == sizeof (void *))
- {
- dirname =
- DIR_SEPARATOR_STR "lib64" DIR_SEPARATOR_STR "taler" DIR_SEPARATOR_STR;
- GNUNET_asprintf (&tmp,
- "%s%s",
- execpath,
- dirname);
- }
-
- if ( (NULL != tmp) &&
- (GNUNET_YES ==
- GNUNET_DISK_directory_test (tmp, GNUNET_YES)) )
- {
- GNUNET_free (execpath);
- return tmp;
- }
- GNUNET_free (tmp);
- }
- dirname = DIR_SEPARATOR_STR "taler" DIR_SEPARATOR_STR;
- break;
- case GNUNET_OS_IPK_DATADIR:
- dirname =
- DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "taler" DIR_SEPARATOR_STR;
- break;
- case GNUNET_OS_IPK_LOCALEDIR:
- dirname =
- DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "locale" DIR_SEPARATOR_STR;
- break;
- case GNUNET_OS_IPK_ICONDIR:
- dirname =
- DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "icons" DIR_SEPARATOR_STR;
- break;
- case GNUNET_OS_IPK_DOCDIR:
- dirname =
- DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "doc" DIR_SEPARATOR_STR \
- "gnunet" DIR_SEPARATOR_STR;
- break;
- case GNUNET_OS_IPK_LIBEXECDIR:
- if (isbasedir)
- {
- dirname =
- DIR_SEPARATOR_STR "taler" DIR_SEPARATOR_STR "libexec" DIR_SEPARATOR_STR;
- GNUNET_asprintf (&tmp,
- "%s%s%s%s",
- execpath,
- DIR_SEPARATOR_STR "lib" DIR_SEPARATOR_STR,
- (NULL != multiarch) ? multiarch : "",
- dirname);
- if (GNUNET_YES ==
- GNUNET_DISK_directory_test (tmp, GNUNET_YES))
- {
- GNUNET_free (execpath);
- return tmp;
- }
- GNUNET_free (tmp);
- tmp = NULL;
- if (4 == sizeof (void *))
- {
- dirname =
- DIR_SEPARATOR_STR "lib32" DIR_SEPARATOR_STR "taler" DIR_SEPARATOR_STR \
- "libexec" DIR_SEPARATOR_STR;
- GNUNET_asprintf (&tmp,
- "%s%s",
- execpath,
- dirname);
- }
- if (8 == sizeof (void *))
- {
- dirname =
- DIR_SEPARATOR_STR "lib64" DIR_SEPARATOR_STR "taler" DIR_SEPARATOR_STR \
- "libexec" DIR_SEPARATOR_STR;
- GNUNET_asprintf (&tmp,
- "%s%s",
- execpath,
- dirname);
- }
- if ( (NULL != tmp) &&
- (GNUNET_YES ==
- GNUNET_DISK_directory_test (tmp, GNUNET_YES)) )
- {
- GNUNET_free (execpath);
- return tmp;
- }
-
- GNUNET_free (tmp);
- }
- dirname =
- DIR_SEPARATOR_STR "taler" DIR_SEPARATOR_STR \
- "libexec" DIR_SEPARATOR_STR;
- break;
- default:
- GNUNET_free (execpath);
- return NULL;
- }
- GNUNET_asprintf (&tmp,
- "%s%s",
- execpath,
- dirname);
- GNUNET_free (execpath);
- return tmp;
-}
-
-
-/**
- * Given the name of a taler-helper, taler-service or taler-daemon
- * binary, try to prefix it with the libexec/-directory to get the
- * full path.
- *
- * @param progname name of the binary
- * @return full path to the binary, if possible, otherwise copy of 'progname'
- */
-char *
-TALER_OS_get_libexec_binary_path (const char *progname)
-{
- static char *cache;
- char *libexecdir;
- char *binary;
-
- if ( (DIR_SEPARATOR == progname[0]) ||
- (GNUNET_YES == GNUNET_STRINGS_path_is_absolute (progname, GNUNET_NO, NULL, NULL)) )
- return GNUNET_strdup (progname);
- if (NULL != cache)
- libexecdir = cache;
- else
- libexecdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBEXECDIR);
- if (NULL == libexecdir)
- return GNUNET_strdup (progname);
- GNUNET_asprintf (&binary,
- "%s%s",
- libexecdir,
- progname);
- cache = libexecdir;
- return binary;
-}
-
/* end of os_installation.c */
diff --git a/src/util/paths.conf b/src/util/paths.conf
new file mode 100644
index 000000000..03febb0e4
--- /dev/null
+++ b/src/util/paths.conf
@@ -0,0 +1,29 @@
+# This file is in the public domain.
+#
+[PATHS]
+# The PATHS section is special, as filenames including $-expression are
+# expanded using the values from PATHS or the system environment (PATHS
+# is checked first). Taler also supports expanding $-expressions using
+# defaults with the syntax "${VAR:-default}". Here, "default" can again
+# be a $-expression.
+#
+# We usually want $HOME for $TALER_HOME, but we allow testcases to
+# easily override this by setting $TALER_TEST_HOME.
+#
+TALER_HOME = ${TALER_TEST_HOME:-${HOME:-${USERPROFILE}}}
+
+# see XDG Base Directory Specification at
+# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+# for how these should be used.
+
+# Persistant data storage
+TALER_DATA_HOME = ${XDG_DATA_HOME:-$TALER_HOME/.local/share}/taler/
+
+# Configuration files
+TALER_CONFIG_HOME = ${XDG_CONFIG_HOME:-$TALER_HOME/.config}/taler/
+
+# Cached data, no big deal if lost
+TALER_CACHE_HOME = ${XDG_CACHE_HOME:-$TALER_HOME/.cache}/taler/
+
+# Runtime data (always lost on system boot)
+TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/taler-system-runtime/
diff --git a/src/util/plugin.c b/src/util/plugin.c
deleted file mode 100644
index 6f8e03df6..000000000
--- a/src/util/plugin.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, If not, see
-*/
-/**
- * @file util/plugin.c
- * @brief Setup paths so that we can load Taler plugins
- * @author Christian Grothoff
- * @author Sree Harsha Totakura
- */
-#include "platform.h"
-#include "taler_util.h"
-#include
-
-/**
- * Libtool search path before we started.
- */
-static char *old_dlsearchpath;
-
-
-/**
- * Setup libtool paths.
- */
-void __attribute__ ((constructor))
-plugin_init ()
-{
- int err;
- const char *opath;
- char *path;
- char *cpath;
-
- err = lt_dlinit ();
- if (err > 0)
- {
- FPRINTF (stderr,
- _("Initialization of plugin mechanism failed: %s!\n"),
- lt_dlerror ());
- return;
- }
- opath = lt_dlgetsearchpath ();
- if (NULL != opath)
- old_dlsearchpath = GNUNET_strdup (opath);
- path = TALER_OS_installation_get_path (GNUNET_OS_IPK_LIBDIR);
- if (NULL != path)
- {
- if (NULL != opath)
- {
- GNUNET_asprintf (&cpath, "%s:%s", opath, path);
- lt_dlsetsearchpath (cpath);
- GNUNET_free (path);
- GNUNET_free (cpath);
- }
- else
- {
- lt_dlsetsearchpath (path);
- GNUNET_free (path);
- }
- }
-}
-
-
-/**
- * Shutdown libtool.
- */
-void __attribute__ ((destructor))
-plugin_fini ()
-{
- lt_dlsetsearchpath (old_dlsearchpath);
- if (NULL != old_dlsearchpath)
- {
- GNUNET_free (old_dlsearchpath);
- old_dlsearchpath = NULL;
- }
- lt_dlexit ();
-}
-
-/* end of plugin.c */
diff --git a/src/util/taler-config.in b/src/util/taler-config.in
new file mode 100644
index 000000000..eb4114c82
--- /dev/null
+++ b/src/util/taler-config.in
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+if ! type gnunet-config >/dev/null; then
+ echo "$0 needs gnunet-config to be installed"
+ exit 1
+fi
+
+# FIXME: not very portable ...
+export LD_PRELOAD=@libdir@/libtalerutil.so
+exec gnunet-config "$@"
diff --git a/src/util/test_amount.c b/src/util/test_amount.c
index 3f33334bc..640477156 100644
--- a/src/util/test_amount.c
+++ b/src/util/test_amount.c
@@ -73,6 +73,19 @@ main(int argc,
GNUNET_assert (4 == a1.value);
GNUNET_assert (0 == a1.fraction);
+ /* test conversion with leading zero in fraction */
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount ("eur:0.02",
+ &a2));
+ GNUNET_assert (0 == strcasecmp ("eur",
+ a2.currency));
+ GNUNET_assert (0 == a2.value);
+ GNUNET_assert (TALER_AMOUNT_FRAC_BASE / 100 * 2 == a2.fraction);
+ c = TALER_amount_to_string (&a2);
+ GNUNET_assert (0 == strcmp ("eur:0.02",
+ c));
+ GNUNET_free (c);
+
/* test conversion with leading space and with fraction */
GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount (" eur:4.12",
diff --git a/src/util/test_json.c b/src/util/test_json.c
deleted file mode 100644
index 5e2f50fe8..000000000
--- a/src/util/test_json.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- This file is part of TALER
- (C) 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, If not, see
-*/
-
-/**
- * @file util/test_json.c
- * @brief Tests for Taler-specific crypto logic
- * @author Christian Grothoff
- */
-#include "platform.h"
-#include "taler_util.h"
-#include "taler_json_lib.h"
-
-
-/**
- * Test amount conversion from/to JSON.
- *
- * @return 0 on success
- */
-static int
-test_amount ()
-{
- json_t *j;
- struct TALER_Amount a1;
- struct TALER_Amount a2;
-
- GNUNET_assert (GNUNET_OK ==
- TALER_string_to_amount ("EUR:4.3",
- &a1));
- j = TALER_json_from_amount (&a1);
- GNUNET_assert (NULL != j);
- GNUNET_assert (GNUNET_OK ==
- TALER_json_to_amount (j,
- &a2));
- GNUNET_assert (0 ==
- TALER_amount_cmp (&a1,
- &a2));
- json_decref (j);
- return 0;
-}
-
-
-/**
- * Test time conversion from/to JSON.
- *
- * @return 0 on success
- */
-static int
-test_time ()
-{
- json_t *j;
- struct GNUNET_TIME_Absolute a1;
- struct GNUNET_TIME_Absolute a2;
-
- a1 = GNUNET_TIME_absolute_get ();
- TALER_round_abs_time (&a1);
- j = TALER_json_from_abs (a1);
- GNUNET_assert (NULL != j);
- GNUNET_assert (GNUNET_OK ==
- TALER_json_to_abs (j,
- &a2));
- GNUNET_assert (a1.abs_value_us ==
- a2.abs_value_us);
- json_decref (j);
-
- a1 = GNUNET_TIME_UNIT_FOREVER_ABS;
- j = TALER_json_from_abs (a1);
- GNUNET_assert (NULL != j);
- GNUNET_assert (GNUNET_OK ==
- TALER_json_to_abs (j,
- &a2));
- GNUNET_assert (a1.abs_value_us ==
- a2.abs_value_us);
- json_decref (j);
- return 0;
-}
-
-
-/**
- * Test raw (binary) conversion from/to JSON.
- *
- * @return 0 on success
- */
-static int
-test_raw ()
-{
- char blob[256];
- char blob2[256];
- unsigned int i;
- json_t *j;
-
- for (i=0;i<=256;i++)
- {
- memset (blob, i, i);
- j = TALER_json_from_data (blob, i);
- GNUNET_assert (NULL != j);
- GNUNET_assert (GNUNET_OK ==
- TALER_json_to_data (j,
- blob2,
- i));
- GNUNET_assert (0 ==
- memcmp (blob,
- blob2,
- i));
- }
- return 0;
-}
-
-
-/**
- * Test rsa conversions from/to JSON.
- *
- * @return 0 on success
- */
-static int
-test_rsa ()
-{
- struct GNUNET_CRYPTO_rsa_PublicKey *pub;
- struct GNUNET_CRYPTO_rsa_PublicKey *pub2;
- struct GNUNET_CRYPTO_rsa_Signature *sig;
- struct GNUNET_CRYPTO_rsa_Signature *sig2;
- struct GNUNET_CRYPTO_rsa_PrivateKey *priv;
- char msg[] = "Hello";
- json_t *jp;
- json_t *js;
-
- priv = GNUNET_CRYPTO_rsa_private_key_create (1024);
- pub = GNUNET_CRYPTO_rsa_private_key_get_public (priv);
- sig = GNUNET_CRYPTO_rsa_sign (priv,
- msg,
- sizeof (msg));
- GNUNET_assert (NULL != (jp = TALER_json_from_rsa_public_key (pub)));
- GNUNET_assert (NULL != (js = TALER_json_from_rsa_signature (sig)));
- GNUNET_assert (NULL != (pub2 = TALER_json_to_rsa_public_key (jp)));
- GNUNET_assert (NULL != (sig2 = TALER_json_to_rsa_signature (js)));
- GNUNET_break (0 ==
- GNUNET_CRYPTO_rsa_signature_cmp (sig,
- sig2));
- GNUNET_break (0 ==
- GNUNET_CRYPTO_rsa_public_key_cmp (pub,
- pub2));
- GNUNET_CRYPTO_rsa_signature_free (sig);
- GNUNET_CRYPTO_rsa_signature_free (sig2);
- GNUNET_CRYPTO_rsa_private_key_free (priv);
- GNUNET_CRYPTO_rsa_public_key_free (pub);
- GNUNET_CRYPTO_rsa_public_key_free (pub2);
- return 0;
-}
-
-
-int
-main(int argc,
- const char *const argv[])
-{
- GNUNET_log_setup ("test-json",
- "WARNING",
- NULL);
- if (0 != test_amount ())
- return 1;
- if (0 != test_time ())
- return 1;
- if (0 != test_raw ())
- return 1;
- if (0 != test_rsa ())
- return 1;
- /* FIXME: test EdDSA signature conversion... */
- return 0;
-}
-
-/* end of test_json.c */
diff --git a/src/util/util.c b/src/util/util.c
index addafacf7..d5fa8c05c 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -56,7 +56,7 @@ TALER_b2s (const void *buf,
GNUNET_free (tmp);
ret[8] = '\0';
return ret;
-}
+}
/**
@@ -89,179 +89,4 @@ TALER_config_get_denom (struct GNUNET_CONFIGURATION_Handle *cfg,
}
-/**
- * Round a time value so that it is suitable for transmission
- * via JSON encodings.
- *
- * @param at time to round
- * @return #GNUNET_OK if time was already rounded, #GNUNET_NO if
- * it was just now rounded
- */
-int
-TALER_round_abs_time (struct GNUNET_TIME_Absolute *at)
-{
- if (at->abs_value_us == GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us)
- return GNUNET_OK;
- if (0 == at->abs_value_us % 1000000)
- return GNUNET_OK;
- at->abs_value_us -= at->abs_value_us % 1000000;
- return GNUNET_NO;
-}
-
-
-/**
- * Round a time value so that it is suitable for transmission
- * via JSON encodings.
- *
- * @param rt time to round
- * @return #GNUNET_OK if time was already rounded, #GNUNET_NO if
- * it was just now rounded
- */
-int
-TALER_round_rel_time (struct GNUNET_TIME_Relative *rt)
-{
- if (rt->rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us)
- return GNUNET_OK;
- if (0 == rt->rel_value_us % 1000000)
- return GNUNET_OK;
- rt->rel_value_us -= rt->rel_value_us % 1000000;
- return GNUNET_NO;
-}
-
-
-/**
- * Load configuration by parsing all configuration
- * files in the given directory.
- *
- * @param base_dir directory with the configuration files
- * @return NULL on error, otherwise configuration
- */
-struct GNUNET_CONFIGURATION_Handle *
-TALER_config_load (const char *base_dir)
-{
- struct GNUNET_CONFIGURATION_Handle *cfg;
- char *cfg_dir;
- int res;
-
- res = GNUNET_asprintf (&cfg_dir,
- "%s" DIR_SEPARATOR_STR "config",
- base_dir);
- GNUNET_assert (res > 0);
- cfg = GNUNET_CONFIGURATION_create ();
- res = GNUNET_CONFIGURATION_load_from (cfg, cfg_dir);
- GNUNET_free (cfg_dir);
- if (GNUNET_OK != res)
- return NULL;
- return cfg;
-}
-
-
-
-/**
- * At what offset does the help text start?
- */
-#define BORDER 29
-
-/**
- * Print out details on command line options (implements --help).
- *
- * @param ctx command line processing context
- * @param scls additional closure (points to about text)
- * @param option name of the option
- * @param value not used (NULL)
- * @return #GNUNET_NO (do not continue, not an error)
- */
-int
-TALER_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
- void *scls,
- const char *option,
- const char *value)
-{
- const char *about = scls;
- size_t slen;
- unsigned int i;
- int j;
- size_t ml;
- size_t p;
- char *scp;
- const char *trans;
- const struct GNUNET_GETOPT_CommandLineOption *opt;
-
- if (NULL != about)
- {
- printf ("%s\n%s\n",
- ctx->binaryOptions,
- gettext (about));
- printf (_("Arguments mandatory for long options are also mandatory for short options.\n"));
- }
- opt = ctx->allOptions;
- for (i=0;NULL != opt[i].description;i++)
- {
- if (opt[i].shortName == '\0')
- printf (" ");
- else
- printf (" -%c, ", opt[i].shortName);
- printf ("--%s", opt[i].name);
- slen = 8 + strlen (opt[i].name);
- if (opt[i].argumentHelp != NULL)
- {
- printf ("=%s", opt[i].argumentHelp);
- slen += 1 + strlen (opt[i].argumentHelp);
- }
- if (slen > BORDER)
- {
- printf ("\n%*s", BORDER, "");
- slen = BORDER;
- }
- if (slen < BORDER)
- {
- printf ("%*s", (int) (BORDER - slen), "");
- slen = BORDER;
- }
- if (0 < strlen (opt[i].description))
- trans = gettext (opt[i].description);
- else
- trans = "";
- ml = strlen (trans);
- p = 0;
-OUTER:
- while (ml - p > 78 - slen)
- {
- for (j = p + 78 - slen; j > p; j--)
- {
- if (isspace ((unsigned char) trans[j]))
- {
- scp = GNUNET_malloc (j - p + 1);
- memcpy (scp, &trans[p], j - p);
- scp[j - p] = '\0';
- printf ("%s\n%*s", scp, BORDER + 2, "");
- GNUNET_free (scp);
- p = j + 1;
- slen = BORDER + 2;
- goto OUTER;
- }
- }
- /* could not find space to break line */
- scp = GNUNET_malloc (78 - slen + 1);
- memcpy (scp, &trans[p], 78 - slen);
- scp[78 - slen] = '\0';
- printf ("%s\n%*s", scp, BORDER + 2, "");
- GNUNET_free (scp);
- slen = BORDER + 2;
- p = p + 78 - slen;
- }
- /* print rest */
- if (p < ml)
- printf ("%s\n", &trans[p]);
- if (strlen (trans) == 0)
- printf ("\n");
- }
- printf ("Report bugs to taler@gnu.org.\n"
- "Taler home page: http://www.gnu.org/software/taler/\n"
- "General help using GNU software: http://www.gnu.org/gethelp/\n");
- return GNUNET_NO;
-}
-
-
-
/* end of util.c */
diff --git a/src/util/wireformats.c b/src/util/wireformats.c
deleted file mode 100644
index cd5a9c3d4..000000000
--- a/src/util/wireformats.c
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2014, 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, If not, see
-*/
-/**
- * @file util/wireformats.c
- * @brief helper functions for JSON processing using libjansson
- * @author Sree Harsha Totakura
- * @author Christian Grothoff
- */
-#include "platform.h"
-#include
-#include "taler_util.h"
-
-/**
- * Shorthand for exit jumps.
- */
-#define EXITIF(cond) \
- do { \
- if (cond) { GNUNET_break (0); goto EXITIF_exit; } \
- } while (0)
-
-/**
- * Shorthand for JSON parsing related exit jumps.
- */
-#define UNPACK_EXITIF(cond) \
- do { \
- if (cond) { TALER_json_warn (error); goto EXITIF_exit; } \
- } while (0)
-
-
-/* Taken from GNU gettext */
-
-/**
- * Entry in the country table.
- */
-struct table_entry
-{
- /**
- * 2-Character international country code.
- */
- const char *code;
-
- /**
- * Long English name of the country.
- */
- const char *english;
-};
-
-/* Keep the following table in sync with gettext.
- WARNING: the entries should stay sorted according to the code */
-/**
- * List of country codes.
- */
-static const struct table_entry country_table[] =
- {
- { "AE", "U.A.E." },
- { "AF", "Afghanistan" },
- { "AL", "Albania" },
- { "AM", "Armenia" },
- { "AN", "Netherlands Antilles" },
- { "AR", "Argentina" },
- { "AT", "Austria" },
- { "AU", "Australia" },
- { "AZ", "Azerbaijan" },
- { "BA", "Bosnia and Herzegovina" },
- { "BD", "Bangladesh" },
- { "BE", "Belgium" },
- { "BG", "Bulgaria" },
- { "BH", "Bahrain" },
- { "BN", "Brunei Darussalam" },
- { "BO", "Bolivia" },
- { "BR", "Brazil" },
- { "BT", "Bhutan" },
- { "BY", "Belarus" },
- { "BZ", "Belize" },
- { "CA", "Canada" },
- { "CG", "Congo" },
- { "CH", "Switzerland" },
- { "CI", "Cote d'Ivoire" },
- { "CL", "Chile" },
- { "CM", "Cameroon" },
- { "CN", "People's Republic of China" },
- { "CO", "Colombia" },
- { "CR", "Costa Rica" },
- { "CS", "Serbia and Montenegro" },
- { "CZ", "Czech Republic" },
- { "DE", "Germany" },
- { "DK", "Denmark" },
- { "DO", "Dominican Republic" },
- { "DZ", "Algeria" },
- { "EC", "Ecuador" },
- { "EE", "Estonia" },
- { "EG", "Egypt" },
- { "ER", "Eritrea" },
- { "ES", "Spain" },
- { "ET", "Ethiopia" },
- { "FI", "Finland" },
- { "FO", "Faroe Islands" },
- { "FR", "France" },
- { "GB", "United Kingdom" },
- { "GD", "Caribbean" },
- { "GE", "Georgia" },
- { "GL", "Greenland" },
- { "GR", "Greece" },
- { "GT", "Guatemala" },
- { "HK", "Hong Kong" },
- { "HK", "Hong Kong S.A.R." },
- { "HN", "Honduras" },
- { "HR", "Croatia" },
- { "HT", "Haiti" },
- { "HU", "Hungary" },
- { "ID", "Indonesia" },
- { "IE", "Ireland" },
- { "IL", "Israel" },
- { "IN", "India" },
- { "IQ", "Iraq" },
- { "IR", "Iran" },
- { "IS", "Iceland" },
- { "IT", "Italy" },
- { "JM", "Jamaica" },
- { "JO", "Jordan" },
- { "JP", "Japan" },
- { "KE", "Kenya" },
- { "KG", "Kyrgyzstan" },
- { "KH", "Cambodia" },
- { "KR", "South Korea" },
- { "KW", "Kuwait" },
- { "KZ", "Kazakhstan" },
- { "LA", "Laos" },
- { "LB", "Lebanon" },
- { "LI", "Liechtenstein" },
- { "LK", "Sri Lanka" },
- { "LT", "Lithuania" },
- { "LU", "Luxembourg" },
- { "LV", "Latvia" },
- { "LY", "Libya" },
- { "MA", "Morocco" },
- { "MC", "Principality of Monaco" },
- { "MD", "Moldava" },
- { "MD", "Moldova" },
- { "ME", "Montenegro" },
- { "MK", "Former Yugoslav Republic of Macedonia" },
- { "ML", "Mali" },
- { "MM", "Myanmar" },
- { "MN", "Mongolia" },
- { "MO", "Macau S.A.R." },
- { "MT", "Malta" },
- { "MV", "Maldives" },
- { "MX", "Mexico" },
- { "MY", "Malaysia" },
- { "NG", "Nigeria" },
- { "NI", "Nicaragua" },
- { "NL", "Netherlands" },
- { "NO", "Norway" },
- { "NP", "Nepal" },
- { "NZ", "New Zealand" },
- { "OM", "Oman" },
- { "PA", "Panama" },
- { "PE", "Peru" },
- { "PH", "Philippines" },
- { "PK", "Islamic Republic of Pakistan" },
- { "PL", "Poland" },
- { "PR", "Puerto Rico" },
- { "PT", "Portugal" },
- { "PY", "Paraguay" },
- { "QA", "Qatar" },
- { "RE", "Reunion" },
- { "RO", "Romania" },
- { "RS", "Serbia" },
- { "RU", "Russia" },
- { "RW", "Rwanda" },
- { "SA", "Saudi Arabia" },
- { "SE", "Sweden" },
- { "SG", "Singapore" },
- { "SI", "Slovenia" },
- { "SK", "Slovak" },
- { "SN", "Senegal" },
- { "SO", "Somalia" },
- { "SR", "Suriname" },
- { "SV", "El Salvador" },
- { "SY", "Syria" },
- { "TH", "Thailand" },
- { "TJ", "Tajikistan" },
- { "TM", "Turkmenistan" },
- { "TN", "Tunisia" },
- { "TR", "Turkey" },
- { "TT", "Trinidad and Tobago" },
- { "TW", "Taiwan" },
- { "TZ", "Tanzania" },
- { "UA", "Ukraine" },
- { "US", "United States" },
- { "UY", "Uruguay" },
- { "VA", "Vatican" },
- { "VE", "Venezuela" },
- { "VN", "Viet Nam" },
- { "YE", "Yemen" },
- { "ZA", "South Africa" },
- { "ZW", "Zimbabwe" }
- };
-
-
-/**
- * Country code comparator function, for binary search with bsearch().
- *
- * @param ptr1 pointer to a `struct table_entry`
- * @param ptr2 pointer to a `struct table_entry`
- * @return result of strncmp()'ing the 2-digit country codes of the entries
- */
-static int
-cmp_country_code (const void *ptr1,
- const void *ptr2)
-{
- const struct table_entry *cc1 = ptr1;
- const struct table_entry *cc2 = ptr2;
-
- return strncmp (cc1->code, cc2->code, 2);
-}
-
-
-/**
- * Validates given IBAN according to the European Banking Standards. See:
- * http://www.europeanpaymentscouncil.eu/documents/ECBS%20IBAN%20standard%20EBS204_V3.2.pdf
- *
- * @param iban the IBAN number to validate
- * @return #GNUNET_YES if correctly formatted; #GNUNET_NO if not
- */
-static int
-validate_iban (const char *iban)
-{
- char cc[2];
- char ibancpy[35];
- struct table_entry cc_entry;
- unsigned int len;
- char *nbuf;
- unsigned int i;
- unsigned int j;
- unsigned long long dividend;
- unsigned long long remainder;
- int nread;
- int ret;
-
- len = strlen (iban);
- if (len > 34)
- return GNUNET_NO;
- strncpy (cc, iban, 2);
- strncpy (ibancpy, iban + 4, len - 4);
- strncpy (ibancpy + len - 4, iban, 4);
- ibancpy[len] = '\0';
- cc_entry.code = cc;
- cc_entry.english = NULL;
- if (NULL ==
- bsearch (&cc_entry,
- country_table,
- sizeof (country_table) / sizeof (struct table_entry),
- sizeof (struct table_entry),
- &cmp_country_code))
- return GNUNET_NO;
- nbuf = GNUNET_malloc ((len * 2) + 1);
- for (i=0, j=0; i < len; i++)
- {
- if (isalpha ((int) ibancpy[i]))
- {
- EXITIF(2 != snprintf(&nbuf[j],
- 3,
- "%2u",
- (ibancpy[i] - 'A' + 10)));
- j += 2;
- continue;
- }
- nbuf[j] = ibancpy[i];
- j++;
- }
- for (j=0;'\0' != nbuf[j];j++)
- GNUNET_assert (isdigit(nbuf[j]));
- GNUNET_assert (sizeof(dividend) >= 8);
- remainder = 0;
- for (i=0; i
/**
@@ -58,6 +60,8 @@ sepa_amount_round (void *cls,
struct SepaClosure *sc = cls;
uint32_t delta;
+ if (NULL == sc->currency)
+ return GNUNET_SYSERR;
if (0 != strcasecmp (amount->currency,
sc->currency))
{
@@ -347,42 +351,139 @@ validate_iban (const char *iban)
}
+/**
+ * Compute purpose for signing.
+ *
+ * @param sepa_name name of the account holder
+ * @param iban bank account number in IBAN format
+ * @param bic bank identifier
+ * @param[out] mp purpose to be signed
+ */
+static void
+compute_purpose (const char *sepa_name,
+ const char *iban,
+ const char *bic,
+ struct TALER_MasterWireDetailsPS *wsd)
+{
+ struct GNUNET_HashContext *hc;
+
+ wsd->purpose.size = htonl (sizeof (struct TALER_MasterWireDetailsPS));
+ wsd->purpose.purpose = htonl (TALER_SIGNATURE_MASTER_SEPA_DETAILS);
+ hc = GNUNET_CRYPTO_hash_context_start ();
+ GNUNET_CRYPTO_hash_context_read (hc,
+ "sepa",
+ strlen ("sepa") + 1);
+ GNUNET_CRYPTO_hash_context_read (hc,
+ sepa_name,
+ strlen (sepa_name) + 1);
+ GNUNET_CRYPTO_hash_context_read (hc,
+ iban,
+ strlen (iban) + 1);
+ GNUNET_CRYPTO_hash_context_read (hc,
+ bic,
+ strlen (bic) + 1);
+ GNUNET_CRYPTO_hash_context_finish (hc,
+ &wsd->h_sepa_details);
+}
+
+
+/**
+ * Verify that the signature in the @a json for /wire/sepa is valid.
+ *
+ * @param json json reply with the signature
+ * @param master_pub public key of the exchange to verify against
+ * @return #GNUNET_SYSERR if @a json is invalid,
+ * #GNUNET_NO if the method is unknown,
+ * #GNUNET_OK if the json is valid
+ */
+static int
+verify_wire_sepa_signature_ok (const json_t *json,
+ const struct TALER_MasterPublicKeyP *master_pub)
+{
+ struct TALER_MasterSignatureP exchange_sig;
+ struct TALER_MasterWireDetailsPS mp;
+ const char *name;
+ const char *iban;
+ const char *bic;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("sig", &exchange_sig),
+ GNUNET_JSON_spec_string ("name", &name),
+ GNUNET_JSON_spec_string ("iban", &iban),
+ GNUNET_JSON_spec_string ("bic", &bic),
+ GNUNET_JSON_spec_end()
+ };
+
+ if (NULL == master_pub)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Skipping signature check as master public key not given\n");
+ return GNUNET_OK;
+ }
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (json, spec,
+ NULL, NULL))
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
+ compute_purpose (name,
+ iban,
+ bic,
+ &mp);
+ if (GNUNET_OK !=
+ GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SEPA_DETAILS,
+ &mp.purpose,
+ &exchange_sig.eddsa_signature,
+ &master_pub->eddsa_pub))
+ {
+ GNUNET_break_op (0);
+ GNUNET_JSON_parse_free (spec);
+ return GNUNET_SYSERR;
+ }
+ GNUNET_JSON_parse_free (spec);
+ return GNUNET_OK;
+}
+
+
/**
* Check if the given wire format JSON object is correctly formatted
*
+ * @param cls the @e cls of this struct with the plugin-specific state
* @param wire the JSON wire format object
+ * @param master_pub public key of the exchange to verify against
* @return #GNUNET_YES if correctly formatted; #GNUNET_NO if not
*/
static int
-sepa_wire_validate (const json_t *wire)
+sepa_wire_validate (void *cls,
+ const json_t *wire,
+ const struct TALER_MasterPublicKeyP *master_pub)
{
json_error_t error;
const char *type;
const char *iban;
const char *name;
const char *bic;
- uint64_t r;
- const char *address;
if (0 != json_unpack_ex
((json_t *) wire,
- &error, JSON_STRICT,
+ &error, 0,
"{"
- "s:s," /* TYPE: sepa */
- "s:s," /* IBAN: iban */
+ "s:s," /* type: sepa */
+ "s:s," /* iban: IBAN */
"s:s," /* name: beneficiary name */
- "s:s," /* BIC: beneficiary bank's BIC */
- "s:i," /* r: random 64-bit integer nounce */
- "s:s" /* address: address of the beneficiary */
+ "s:s" /* bic: beneficiary bank's BIC */
"}",
"type", &type,
- "IBAN", &iban,
+ "iban", &iban,
"name", &name,
- "bic", &bic,
- "r", &r,
- "address", &address))
+ "bic", &bic))
{
- TALER_json_warn (error);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "JSON parsing failed at %s:%u: %s (%s)\n",
+ __FILE__, __LINE__,
+ error.text, error.source);
+ json_dumpf (wire, stderr, 0);
+ fprintf (stderr, "\n");
return GNUNET_SYSERR;
}
if (0 != strcasecmp (type,
@@ -400,10 +501,143 @@ sepa_wire_validate (const json_t *wire)
iban);
return GNUNET_NO;
}
+ /* FIXME: don't parse again, integrate properly... */
+ if (GNUNET_OK !=
+ verify_wire_sepa_signature_ok (wire,
+ master_pub))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Signature invalid\n");
+ return GNUNET_NO;
+ }
return GNUNET_YES;
}
+/**
+ * Obtain wire transfer details in the plugin-specific format
+ * from the configuration.
+ *
+ * @param cls closure
+ * @param cfg configuration with details about wire accounts
+ * @param account_name which section in the configuration should we parse
+ * @return NULL if @a cfg fails to have valid wire details for @a account_name
+ */
+static json_t *
+sepa_get_wire_details (void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *account_name)
+{
+ char *sepa_wire_file;
+ json_error_t err;
+ json_t *ret;
+
+ /* Fetch reply */
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ account_name,
+ "SEPA_RESPONSE_FILE",
+ &sepa_wire_file))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
+ account_name,
+ "SEPA_RESPONSE_FILE");
+ return NULL;
+ }
+ ret = json_load_file (sepa_wire_file,
+ JSON_REJECT_DUPLICATES,
+ &err);
+ if (NULL == ret)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to parse JSON in %s: %s (%s:%u)\n",
+ sepa_wire_file,
+ err.text,
+ err.source,
+ err.line);
+ GNUNET_free (sepa_wire_file);
+ return NULL;
+ }
+ if (GNUNET_YES != sepa_wire_validate (cls,
+ ret,
+ NULL))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to validate SEPA data in %s\n",
+ sepa_wire_file);
+ GNUNET_free (sepa_wire_file);
+ json_decref (ret);
+ return NULL;
+ }
+ GNUNET_free (sepa_wire_file);
+ return ret;
+}
+
+
+/**
+ * Sign wire transfer details in the plugin-specific format.
+ *
+ * @param cls closure
+ * @param in wire transfer details in JSON format
+ * @param key private signing key to use
+ * @param salt salt to add
+ * @param[out] sig where to write the signature
+ * @return #GNUNET_OK on success
+ */
+static int
+sepa_sign_wire_details (void *cls,
+ const json_t *in,
+ const struct TALER_MasterPrivateKeyP *key,
+ const struct GNUNET_HashCode *salt,
+ struct TALER_MasterSignatureP *sig)
+{
+ struct TALER_MasterWireDetailsPS wsd;
+ const char *sepa_name;
+ const char *iban;
+ const char *bic;
+ const char *type;
+ json_error_t err;
+
+ if (0 !=
+ json_unpack_ex ((json_t *) in,
+ &err,
+ 0 /* flags */,
+ "{s:s, s:s, s:s, s:s}",
+ "type", &type,
+ "name", &sepa_name,
+ "iban", &iban,
+ "bic", &bic))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Failed to unpack JSON: %s (at %u)\n",
+ err.text,
+ err.position);
+ return GNUNET_SYSERR;
+ }
+ if (0 != strcmp (type,
+ "sepa"))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "`type' must be `sepa' for SEPA wire details\n");
+ return GNUNET_SYSERR;
+ }
+ if (1 != validate_iban (iban))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "IBAN invalid in SEPA wire details\n");
+ return GNUNET_SYSERR;
+ }
+ compute_purpose (sepa_name,
+ iban,
+ bic,
+ &wsd);
+ GNUNET_CRYPTO_eddsa_sign (&key->eddsa_priv,
+ &wsd.purpose,
+ &sig->eddsa_signature);
+ return GNUNET_OK;
+}
+
+
/**
* Prepare for exeuction of a wire transfer.
*
@@ -499,22 +733,26 @@ libtaler_plugin_wire_sepa_init (void *cls)
struct TALER_WIRE_Plugin *plugin;
sc = GNUNET_new (struct SepaClosure);
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint",
- "CURRENCY",
- &sc->currency))
+ if (NULL != cfg)
{
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint",
- "CURRENCY");
- GNUNET_free (sc);
- return NULL;
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "exchange",
+ "CURRENCY",
+ &sc->currency))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "CURRENCY");
+ GNUNET_free (sc);
+ return NULL;
+ }
}
-
plugin = GNUNET_new (struct TALER_WIRE_Plugin);
plugin->cls = sc;
plugin->amount_round = &sepa_amount_round;
+ plugin->get_wire_details = &sepa_get_wire_details;
+ plugin->sign_wire_details = &sepa_sign_wire_details;
plugin->wire_validate = &sepa_wire_validate;
plugin->prepare_wire_transfer = &sepa_prepare_wire_transfer;
plugin->prepare_wire_transfer_cancel = &sepa_prepare_wire_transfer_cancel;
@@ -536,7 +774,7 @@ libtaler_plugin_wire_sepa_done (void *cls)
struct TALER_WIRE_Plugin *plugin = cls;
struct SepaClosure *sc = plugin->cls;
- GNUNET_free (sc->currency);
+ GNUNET_free_non_null (sc->currency);
GNUNET_free (sc);
GNUNET_free (plugin);
return NULL;
diff --git a/src/wire/plugin_wire_template.c b/src/wire/plugin_wire_template.c
index baf0ee7d5..46908c297 100644
--- a/src/wire/plugin_wire_template.c
+++ b/src/wire/plugin_wire_template.c
@@ -73,14 +73,37 @@ template_amount_round (void *cls,
}
+/**
+ * Obtain wire transfer details in the plugin-specific format
+ * from the configuration.
+ *
+ * @param cls closure
+ * @param cfg configuration with details about wire accounts
+ * @param account_name which section in the configuration should we parse
+ * @return NULL if @a cfg fails to have valid wire details for @a account_name
+ */
+static json_t *
+template_get_wire_details (void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *account_name)
+{
+ GNUNET_break (0);
+ return NULL;
+}
+
+
/**
* Check if the given wire format JSON object is correctly formatted
*
+ * @param cls the @e cls of this struct with the plugin-specific state
* @param wire the JSON wire format object
+ * @param master_pub public key of the exchange to verify against
* @return #GNUNET_YES if correctly formatted; #GNUNET_NO if not
*/
static int
-template_wire_validate (const json_t *wire)
+template_wire_validate (void *cls,
+ const json_t *wire,
+ const struct TALER_MasterPublicKeyP *master_pub)
{
GNUNET_break (0);
return GNUNET_SYSERR;
@@ -148,6 +171,28 @@ template_execute_wire_transfer (void *cls,
}
+/**
+ * Sign wire transfer details in the plugin-specific format.
+ *
+ * @param cls closure
+ * @param in wire transfer details in JSON format
+ * @param key private signing key to use
+ * @param salt salt to add
+ * @param[out] sig where to write the signature
+ * @return #GNUNET_OK on success
+ */
+static int
+template_sign_wire_details (void *cls,
+ const json_t *in,
+ const struct TALER_MasterPrivateKeyP *key,
+ const struct GNUNET_HashCode *salt,
+ struct TALER_MasterSignatureP *sig)
+{
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+}
+
+
/**
* Abort execution of a wire transfer. For example, because we are
* shutting down. Note that if an execution is aborted, it may or
@@ -197,12 +242,12 @@ libtaler_plugin_wire_template_init (void *cls)
}
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint",
+ "exchange",
"CURRENCY",
&tc->currency))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint",
+ "exchange",
"CURRENCY");
GNUNET_free (tc->bank_uri);
GNUNET_free (tc);
@@ -212,6 +257,8 @@ libtaler_plugin_wire_template_init (void *cls)
plugin = GNUNET_new (struct TALER_WIRE_Plugin);
plugin->cls = tc;
plugin->amount_round = &template_amount_round;
+ plugin->get_wire_details = &template_get_wire_details;
+ plugin->sign_wire_details = &template_sign_wire_details;
plugin->wire_validate = &template_wire_validate;
plugin->prepare_wire_transfer = &template_prepare_wire_transfer;
plugin->prepare_wire_transfer_cancel = &template_prepare_wire_transfer_cancel;
diff --git a/src/wire/plugin_wire_test.c b/src/wire/plugin_wire_test.c
index 8a6f98ea2..d467b7bdd 100644
--- a/src/wire/plugin_wire_test.c
+++ b/src/wire/plugin_wire_test.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2016 GNUnet e.V.
+ Copyright (C) 2016 GNUnet e.V. & Inria
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -22,6 +22,7 @@
#include "platform.h"
#include "taler_wire_plugin.h"
#include "taler_bank_service.h"
+#include "taler_signatures.h"
/* only for HTTP status codes */
#include
@@ -33,21 +34,32 @@
struct TestClosure
{
- /**
- * Handle to the bank for sending funds to the bank.
- */
- struct TALER_BANK_Context *bank;
-
/**
* Which currency do we support?
*/
char *currency;
+ /**
+ * URI of our bank.
+ */
+ char *bank_uri;
+
+ /**
+ * Handle to the bank for sending funds to the bank.
+ */
+ struct TALER_BANK_Context *bank;
+
/**
* Handle to the bank task, or NULL.
*/
struct GNUNET_SCHEDULER_Task *bt;
+ /**
+ * Number of the account that the exchange has at the bank for
+ * outgoing transfers.
+ */
+ unsigned long long exchange_account_outgoing_no;
+
};
@@ -124,11 +136,9 @@ struct TALER_WIRE_ExecuteHandle
* scheduler.
*
* @param cls our `struct TestClosure`
- * @param tc scheduler context (unused)
*/
static void
-context_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *sct)
+context_task (void *cls)
{
struct TestClosure *tc = cls;
long timeout;
@@ -171,7 +181,7 @@ context_task (void *cls,
rs,
ws,
&context_task,
- cls);
+ tc);
GNUNET_NETWORK_fdset_destroy (rs);
GNUNET_NETWORK_fdset_destroy (ws);
}
@@ -210,6 +220,13 @@ test_amount_round (void *cls,
struct TestClosure *tc = cls;
uint32_t delta;
+ if (NULL == tc->currency)
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "CURRENCY");
+ return GNUNET_SYSERR; /* not configured with currency */
+ }
if (0 != strcasecmp (amount->currency,
tc->currency))
{
@@ -225,28 +242,70 @@ test_amount_round (void *cls,
}
+/**
+ * Compute purpose for signing.
+ *
+ * @param account number of the account
+ * @param bank_uri URI of the bank
+ * @param[out] mp purpose to be signed
+ */
+static void
+compute_purpose (uint64_t account,
+ const char *bank_uri,
+ struct TALER_MasterWireDetailsPS *wsd)
+{
+ struct GNUNET_HashContext *hc;
+ uint64_t n = GNUNET_htonll (account);
+
+ wsd->purpose.size = htonl (sizeof (struct TALER_MasterWireDetailsPS));
+ wsd->purpose.purpose = htonl (TALER_SIGNATURE_MASTER_TEST_DETAILS);
+ hc = GNUNET_CRYPTO_hash_context_start ();
+ GNUNET_CRYPTO_hash_context_read (hc,
+ "test",
+ strlen ("test") + 1);
+ GNUNET_CRYPTO_hash_context_read (hc,
+ &n,
+ sizeof (n));
+ GNUNET_CRYPTO_hash_context_read (hc,
+ bank_uri,
+ strlen (bank_uri) + 1);
+ GNUNET_CRYPTO_hash_context_finish (hc,
+ &wsd->h_sepa_details);
+}
+
+
/**
* Check if the given wire format JSON object is correctly formatted.
* Right now, the only thing we require is a field
* "account_number" which must contain a positive 53-bit integer.
*
+ * @param cls the @e cls of this struct with the plugin-specific state
* @param wire the JSON wire format object
+ * @param master_pub public key of the exchange to verify against
* @return #GNUNET_YES if correctly formatted; #GNUNET_NO if not
*/
static int
-test_wire_validate (const json_t *wire)
+test_wire_validate (void *cls,
+ const json_t *wire,
+ const struct TALER_MasterPublicKeyP *master_pub)
{
+ struct TestClosure *tc = cls;
json_error_t error;
json_int_t account_no;
+ const char *bank_uri;
+ const char *sig_s;
+ struct TALER_MasterWireDetailsPS wsd;
+ struct TALER_MasterSignatureP sig;
if (0 !=
json_unpack_ex ((json_t *) wire,
&error,
0,
- "{s:I}",
- "account_number", &account_no))
+ "{s:I, s:s}",
+ "account_number", &account_no,
+ "bank_uri", &bank_uri))
{
- GNUNET_break (0);
+ GNUNET_break_op (0);
return GNUNET_SYSERR;
}
if ( (account_no < 0) ||
@@ -255,10 +314,119 @@ test_wire_validate (const json_t *wire)
GNUNET_break (0);
return GNUNET_SYSERR;
}
+ if ( (NULL != tc->bank_uri) &&
+ (0 != strcmp (bank_uri,
+ tc->bank_uri)) )
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Wire specifies bank URI %s, but this exchange only supports %s\n",
+ bank_uri,
+ tc->bank_uri);
+ return GNUNET_NO;
+ }
+ if (NULL == master_pub)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Skipping signature check as master public key not given\n");
+ return GNUNET_OK;
+ }
+ if (0 !=
+ json_unpack_ex ((json_t *) wire,
+ &error,
+ 0,
+ "{s:s}",
+ "sig", &sig_s))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Signature check required, but signature is missing\n");
+ return GNUNET_NO;
+ }
+ compute_purpose (account_no,
+ bank_uri,
+ &wsd);
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_string_to_data (sig_s,
+ strlen (sig_s),
+ &sig,
+ sizeof (sig)))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ if (GNUNET_OK !=
+ GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_TEST_DETAILS,
+ &wsd.purpose,
+ &sig.eddsa_signature,
+ &master_pub->eddsa_pub))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
return GNUNET_YES;
}
+/**
+ * Obtain wire transfer details in the plugin-specific format
+ * from the configuration.
+ *
+ * @param cls closure
+ * @param cfg configuration with details about wire accounts
+ * @param account_name which section in the configuration should we parse
+ * @return NULL if @a cfg fails to have valid wire details for @a account_name
+ */
+static json_t *
+test_get_wire_details (void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *account_name)
+{
+ struct TestClosure *tc = cls;
+ char *test_wire_file;
+ json_error_t err;
+ json_t *ret;
+
+ /* Fetch reply */
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ account_name,
+ "TEST_RESPONSE_FILE",
+ &test_wire_file))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ account_name,
+ "TEST_RESPONSE_FILE");
+ return NULL;
+ }
+ ret = json_load_file (test_wire_file,
+ JSON_REJECT_DUPLICATES,
+ &err);
+ if (NULL == ret)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to parse JSON in %s: %s (%s:%u)\n",
+ test_wire_file,
+ err.text,
+ err.source,
+ err.line);
+ GNUNET_free (test_wire_file);
+ return NULL;
+ }
+ if (GNUNET_YES != test_wire_validate (tc,
+ ret,
+ NULL))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to validate TEST wire data in %s\n",
+ test_wire_file);
+ GNUNET_free (test_wire_file);
+ json_decref (ret);
+ return NULL;
+ }
+ GNUNET_free (test_wire_file);
+ return ret;
+}
+
+
GNUNET_NETWORK_STRUCT_BEGIN
/**
* Format we used for serialized transaction data.
@@ -287,11 +455,9 @@ GNUNET_NETWORK_STRUCT_END
* callback with the serialized state.
*
* @param cls the `struct TALER_WIRE_PrepareHandle`
- * @param sct unused
*/
static void
-do_prepare (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *sct)
+do_prepare (void *cls)
{
struct TALER_WIRE_PrepareHandle *pth = cls;
char *wire_enc;
@@ -363,9 +529,11 @@ test_prepare_wire_transfer (void *cls,
struct TALER_WIRE_PrepareHandle *pth;
if (GNUNET_YES !=
- test_wire_validate (wire))
+ test_wire_validate (tc,
+ wire,
+ NULL))
{
- GNUNET_break (0);
+ GNUNET_break_op (0);
return NULL;
}
pth = GNUNET_new (struct TALER_WIRE_PrepareHandle);
@@ -406,26 +574,99 @@ test_prepare_wire_transfer_cancel (void *cls,
* @param cls closure with the `struct TALER_WIRE_ExecuteHandle`
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
* 0 if the bank's reply is bogus (fails to follow the protocol)
+ * @param json detailed response from the HTTPD, or NULL if reply was not JSON
*/
static void
execute_cb (void *cls,
- unsigned int http_status)
+ unsigned int http_status,
+ json_t *json)
{
struct TALER_WIRE_ExecuteHandle *eh = cls;
- char s[14];
+ json_t *reason;
+ const char *emsg;
+ char *s;
eh->aaih = NULL;
- GNUNET_snprintf (s,
- sizeof (s),
- "%u",
- http_status);
+ emsg = NULL;
+ if (NULL != json)
+ {
+ reason = json_object_get (json,
+ "reason");
+ if (NULL != reason)
+ emsg = json_string_value (reason);
+ }
+ if (NULL != emsg)
+ GNUNET_asprintf (&s,
+ "%u (%s)",
+ http_status,
+ emsg);
+ else
+ GNUNET_asprintf (&s,
+ "%u",
+ http_status);
eh->cc (eh->cc_cls,
(MHD_HTTP_OK == http_status) ? GNUNET_OK : GNUNET_SYSERR,
(MHD_HTTP_OK == http_status) ? NULL : s);
+ GNUNET_free (s);
GNUNET_free (eh);
}
+/**
+ * Sign wire transfer details in the plugin-specific format.
+ *
+ * @param cls closure
+ * @param in wire transfer details in JSON format
+ * @param key private signing key to use
+ * @param salt salt to add
+ * @param[out] sig where to write the signature
+ * @return #GNUNET_OK on success
+ */
+static int
+test_sign_wire_details (void *cls,
+ const json_t *in,
+ const struct TALER_MasterPrivateKeyP *key,
+ const struct GNUNET_HashCode *salt,
+ struct TALER_MasterSignatureP *sig)
+{
+ struct TALER_MasterWireDetailsPS wsd;
+ const char *bank_uri;
+ const char *type;
+ json_int_t account;
+ json_error_t err;
+
+ if (0 !=
+ json_unpack_ex ((json_t *) in,
+ &err,
+ 0 /* flags */,
+ "{s:s, s:s, s:I}",
+ "type", &type,
+ "bank_uri", &bank_uri,
+ "account_number", &account))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Failed to unpack JSON: %s (at %u)\n",
+ err.text,
+ err.position);
+ return GNUNET_SYSERR;
+ }
+ if (0 != strcmp (type,
+ "test"))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "`type' must be `test' for test wire details\n");
+ return GNUNET_SYSERR;
+ }
+ compute_purpose (account,
+ bank_uri,
+ &wsd);
+ GNUNET_CRYPTO_eddsa_sign (&key->eddsa_priv,
+ &wsd.purpose,
+ &sig->eddsa_signature);
+ return GNUNET_OK;
+}
+
+
/**
* Execute a wire transfer.
*
@@ -451,6 +692,12 @@ test_execute_wire_transfer (void *cls,
json_int_t account_no;
struct BufFormatP bf;
+ if (NULL == tc->bank)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Bank not initialized, cannot do transfers!\n");
+ return NULL; /* not initialized with configuration, cannot do transfers */
+ }
if ( (buf_size <= sizeof (struct BufFormatP)) ||
('\0' != buf[buf_size -1]) )
{
@@ -471,7 +718,9 @@ test_execute_wire_transfer (void *cls,
return NULL;
}
GNUNET_assert (GNUNET_YES ==
- test_wire_validate (wire));
+ test_wire_validate (tc,
+ wire,
+ NULL));
if (0 !=
json_unpack_ex (wire,
&error,
@@ -482,13 +731,14 @@ test_execute_wire_transfer (void *cls,
GNUNET_break (0);
return NULL;
}
-
+
eh = GNUNET_new (struct TALER_WIRE_ExecuteHandle);
eh->cc = cc;
eh->cc_cls = cc_cls;
eh->aaih = TALER_BANK_admin_add_incoming (tc->bank,
&bf.wtid,
&amount,
+ (uint64_t) tc->exchange_account_outgoing_no,
(uint64_t) account_no,
&execute_cb,
eh);
@@ -537,45 +787,63 @@ libtaler_plugin_wire_test_init (void *cls)
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
struct TestClosure *tc;
struct TALER_WIRE_Plugin *plugin;
- char *uri;
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "wire-test",
- "bank_uri",
- &uri))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "wire-test",
- "bank_uri");
- return NULL;
- }
tc = GNUNET_new (struct TestClosure);
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint",
- "CURRENCY",
- &tc->currency))
+ if (NULL != cfg)
{
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint",
- "CURRENCY");
- GNUNET_free (uri);
- GNUNET_free (tc);
- return NULL;
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "wire-outgoing-test",
+ "BANK_URI",
+ &tc->bank_uri))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "wire-outgoing-test",
+ "BANK_URI");
+ GNUNET_free (tc);
+ return NULL;
+ }
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_number (cfg,
+ "wire-outgoing-test",
+ "EXCHANGE_ACCOUNT_NUMBER",
+ &tc->exchange_account_outgoing_no))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "wire-outgoing-test",
+ "EXCHANGE_ACCOUNT_NUMBER");
+ GNUNET_free (tc->bank_uri);
+ GNUNET_free (tc);
+ return NULL;
+ }
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "exchange",
+ "CURRENCY",
+ &tc->currency))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "CURRENCY");
+ GNUNET_free (tc->bank_uri);
+ GNUNET_free (tc);
+ return NULL;
+ }
+ tc->bank = TALER_BANK_init (tc->bank_uri);
+ if (NULL == tc->bank)
+ {
+ GNUNET_break (0);
+ GNUNET_free (tc->currency);
+ GNUNET_free (tc->bank_uri);
+ GNUNET_free (tc);
+ return NULL;
+ }
}
- tc->bank = TALER_BANK_init (uri);
- if (NULL == tc->bank)
- {
- GNUNET_break (0);
- GNUNET_free (tc->currency);
- GNUNET_free (tc);
- return NULL;
- }
-
plugin = GNUNET_new (struct TALER_WIRE_Plugin);
plugin->cls = tc;
plugin->amount_round = &test_amount_round;
+ plugin->get_wire_details = &test_get_wire_details;
+ plugin->sign_wire_details = &test_sign_wire_details;
plugin->wire_validate = &test_wire_validate;
plugin->prepare_wire_transfer = &test_prepare_wire_transfer;
plugin->prepare_wire_transfer_cancel = &test_prepare_wire_transfer_cancel;
@@ -602,8 +870,13 @@ libtaler_plugin_wire_test_done (void *cls)
GNUNET_SCHEDULER_cancel (tc->bt);
tc->bt = NULL;
}
- TALER_BANK_fini (tc->bank);
- GNUNET_free (tc->currency);
+ if (NULL != tc->bank)
+ {
+ TALER_BANK_fini (tc->bank);
+ tc->bank = NULL;
+ }
+ GNUNET_free_non_null (tc->currency);
+ GNUNET_free_non_null (tc->bank_uri);
GNUNET_free (tc);
GNUNET_free (plugin);
return NULL;
diff --git a/src/wire/test_sepa_wireformat.c b/src/wire/test_sepa_wireformat.c
index edbe5bc45..cd31a971c 100644
--- a/src/wire/test_sepa_wireformat.c
+++ b/src/wire/test_sepa_wireformat.c
@@ -28,37 +28,37 @@
/* Valid SEPA data */
static const char * const valid_wire_str =
"{ \"type\":\"SEPA\", \
-\"IBAN\":\"DE67830654080004822650\", \
+\"iban\":\"DE67830654080004822650\", \
\"name\":\"GNUnet e.V.\", \
\"bic\":\"GENODEF1SLR\", \
-\"r\":123456789, \
+\"salt\":\"123456789\", \
\"address\": \"foobar\"}";
/* IBAN has wrong country code */
static const char * const invalid_wire_str =
"{ \"type\":\"SEPA\", \
-\"IBAN\":\"XX67830654080004822650\", \
+\"iban\":\"XX67830654080004822650\", \
\"name\":\"GNUnet e.V.\", \
\"bic\":\"GENODEF1SLR\", \
-\"r\":123456789, \
+\"salt\":\"123456789\", \
\"address\": \"foobar\"}";
/* IBAN has wrong checksum */
static const char * const invalid_wire_str2 =
"{ \"type\":\"SEPA\", \
-\"IBAN\":\"DE67830654080004822651\", \
+\"iban\":\"DE67830654080004822651\", \
\"name\":\"GNUnet e.V.\", \
\"bic\":\"GENODEF1SLR\", \
-\"r\":123456789, \
+\"salt\":\"123456789\", \
\"address\": \"foobar\"}";
/* Unsupported wireformat type */
static const char * const unsupported_wire_str =
"{ \"type\":\"unsupported\", \
-\"IBAN\":\"DE67830654080004822650\", \
+\"iban\":\"DE67830654080004822650\", \
\"name\":\"GNUnet e.V.\", \
\"bic\":\"GENODEF1SLR\", \
-\"r\":123456789, \
+\"salt\":\"123456789\", \
\"address\": \"foobar\"}";
@@ -77,7 +77,7 @@ main(int argc,
NULL);
cfg = GNUNET_CONFIGURATION_create ();
GNUNET_CONFIGURATION_set_value_string (cfg,
- "mint",
+ "exchange",
"currency",
"EUR");
plugin = TALER_WIRE_plugin_load (cfg,
@@ -85,16 +85,24 @@ main(int argc,
GNUNET_assert (NULL != plugin);
(void) memset(&error, 0, sizeof(error));
GNUNET_assert (NULL != (wire = json_loads (unsupported_wire_str, 0, NULL)));
- GNUNET_assert (GNUNET_YES != plugin->wire_validate (wire));
+ GNUNET_assert (GNUNET_YES != plugin->wire_validate (NULL,
+ wire,
+ NULL));
json_decref (wire);
GNUNET_assert (NULL != (wire = json_loads (invalid_wire_str, 0, NULL)));
- GNUNET_assert (GNUNET_NO == plugin->wire_validate (wire));
+ GNUNET_assert (GNUNET_NO == plugin->wire_validate (NULL,
+ wire,
+ NULL));
json_decref (wire);
GNUNET_assert (NULL != (wire = json_loads (invalid_wire_str2, 0, NULL)));
- GNUNET_assert (GNUNET_NO == plugin->wire_validate (wire));
+ GNUNET_assert (GNUNET_NO == plugin->wire_validate (NULL,
+ wire,
+ NULL));
json_decref (wire);
GNUNET_assert (NULL != (wire = json_loads (valid_wire_str, 0, &error)));
- ret = plugin->wire_validate (wire);
+ ret = plugin->wire_validate (NULL,
+ wire,
+ NULL);
json_decref (wire);
TALER_WIRE_plugin_unload (plugin);
GNUNET_CONFIGURATION_destroy (cfg);
diff --git a/src/wire/test_wire_plugin.c b/src/wire/test_wire_plugin.c
new file mode 100644
index 000000000..27b4366c1
--- /dev/null
+++ b/src/wire/test_wire_plugin.c
@@ -0,0 +1,196 @@
+/*
+ This file is part of TALER
+ (C) 2015, 2016 GNUnet e.V. and Inria
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, If not, see
+*/
+/**
+ * @file wire/test_wire_plugin.c
+ * @brief Tests for wire plugins
+ * @author Christian Grothoff
+ * @author Sree Harsha Totakura
+ */
+#include "platform.h"
+#include "taler_util.h"
+#include "taler_wire_lib.h"
+#include "taler_wire_plugin.h"
+#include
+#include
+
+
+/**
+ * Definitions for a test with a plugin.
+ */
+struct TestBlock {
+
+ /**
+ * Name of the plugin to test.
+ */
+ const char *plugin_name;
+
+ /**
+ * JSON template expected by the plugin for an account definition.
+ */
+ const char *json_proto;
+
+};
+
+
+/**
+ * List of plugins and (unsigned) JSON account definitions
+ * to use for the tests.
+ */
+static struct TestBlock tests[] = {
+ { "sepa", "{ \"type\":\"sepa\", \"iban\":\"DE67830654080004822650\", \"name\":\"GNUnet e.V.\", \"bic\":\"GENODEF1SLR\" }" },
+ { "test", "{ \"type\":\"test\", \"bank_uri\":\"http://localhost/\", \"account_number\":42 }" },
+ { NULL, NULL }
+};
+
+
+/**
+ * Private key used to sign wire details.
+ */
+static struct TALER_MasterPrivateKeyP priv_key;
+
+/**
+ * Public key matching #priv_key.
+ */
+static struct TALER_MasterPublicKeyP pub_key;
+
+/**
+ * Our configuration.
+ */
+static struct GNUNET_CONFIGURATION_Handle *cfg;
+
+
+/**
+ * Run the test.
+ *
+ * @param name of the test
+ * @param plugin plugin to test
+ * @param wire wire details for testing
+ * @return #GNUNET_OK on success
+ */
+static int
+run_test (const char *name,
+ struct TALER_WIRE_Plugin *plugin,
+ json_t *wire)
+{
+ struct GNUNET_HashCode salt;
+ struct TALER_MasterSignatureP sig;
+ json_t *lwire;
+
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
+ &salt,
+ sizeof (salt));
+ if (GNUNET_OK !=
+ plugin->sign_wire_details (plugin->cls,
+ wire,
+ &priv_key,
+ &salt,
+ &sig))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ json_object_set_new (wire,
+ "salt",
+ GNUNET_JSON_from_data (&salt,
+ sizeof (salt)));
+ json_object_set_new (wire,
+ "sig",
+ GNUNET_JSON_from_data (&sig,
+ sizeof (sig)));
+ if (GNUNET_OK !=
+ plugin->wire_validate (plugin->cls,
+ wire,
+ &pub_key))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ /* load wire details from file */
+ lwire = plugin->get_wire_details (plugin->cls,
+ cfg,
+ name);
+ if (NULL == lwire)
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ if (GNUNET_OK !=
+ plugin->wire_validate (plugin->cls,
+ lwire,
+ &pub_key))
+ {
+ GNUNET_break (0);
+ json_decref (lwire);
+ return GNUNET_SYSERR;
+ }
+ json_decref (lwire);
+ return GNUNET_OK;
+}
+
+
+int
+main (int argc,
+ const char *const argv[])
+{
+ json_t *wire;
+ int ret;
+ struct TALER_WIRE_Plugin *plugin;
+ const struct TestBlock *test;
+ unsigned int i;
+ struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
+
+ GNUNET_log_setup ("test-wire-plugin",
+ "WARNING",
+ NULL);
+ cfg = GNUNET_CONFIGURATION_create ();
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CONFIGURATION_load (cfg,
+ "test_wire_plugin.conf"));
+ pk = GNUNET_CRYPTO_eddsa_key_create_from_file ("test_wire_plugin_key.priv");
+ priv_key.eddsa_priv = *pk;
+ GNUNET_free (pk);
+ GNUNET_CRYPTO_eddsa_key_get_public (&priv_key.eddsa_priv,
+ &pub_key.eddsa_pub);
+ ret = GNUNET_OK;
+ for (i=0;NULL != (test = &tests[i])->plugin_name;i++)
+ {
+ plugin = TALER_WIRE_plugin_load (cfg,
+ test->plugin_name);
+ GNUNET_assert (NULL != plugin);
+ wire = json_loads (test->json_proto, 0, NULL);
+ GNUNET_assert (NULL != wire);
+ ret = run_test (test->plugin_name, plugin, wire);
+ json_decref (wire);
+ TALER_WIRE_plugin_unload (plugin);
+ if (GNUNET_OK != ret)
+ {
+ fprintf (stdout,
+ "%s FAILED\n",
+ test->plugin_name);
+ break;
+ }
+ else
+ {
+ fprintf (stdout,
+ "%s PASS\n",
+ test->plugin_name);
+ }
+ }
+ GNUNET_CONFIGURATION_destroy (cfg);
+ if (GNUNET_NO == ret)
+ return 1;
+ return 0;
+}
diff --git a/src/wire/test_wire_plugin.conf b/src/wire/test_wire_plugin.conf
new file mode 100644
index 000000000..ece816954
--- /dev/null
+++ b/src/wire/test_wire_plugin.conf
@@ -0,0 +1,21 @@
+# This file is in the public domain.
+#
+[test]
+# This is the response we give out for the /wire request. It provides
+# wallets with the bank information for transfers to the exchange.
+TEST_RESPONSE_FILE = test_wire_plugin_test.json
+
+[sepa]
+# This is the response we give out for the /wire request. It provides
+# wallets with the bank information for transfers to the exchange.
+SEPA_RESPONSE_FILE = test_wire_plugin_sepa.json
+
+
+[wire-outgoing-test]
+# For transfers made by the exchange, we need to know
+# the URI of the bank (where the /admin/add/incoming API
+# is avaialble).
+BANK_URI = http://localhost/
+
+[exchange]
+CURRENCY = "EUR"
diff --git a/src/wire/test_wire_plugin_key.priv b/src/wire/test_wire_plugin_key.priv
new file mode 100644
index 000000000..26b4f26f6
--- /dev/null
+++ b/src/wire/test_wire_plugin_key.priv
@@ -0,0 +1 @@
+?Sgb@Js;%aKȉs_Hў
\ No newline at end of file
diff --git a/src/wire/test_wire_plugin_sepa.json b/src/wire/test_wire_plugin_sepa.json
new file mode 100644
index 000000000..175345f0c
--- /dev/null
+++ b/src/wire/test_wire_plugin_sepa.json
@@ -0,0 +1,8 @@
+{
+ "salt": "32V01R7K4T02S74PZZMVXRQ1K7FR948RBNB9BJ5Z101HEQFH7CW7J82006GY3BPTGQ4FM775PSSRD3K9MY97HSNVVCGEVBPVSAQ2710",
+ "type": "sepa",
+ "iban": "DE67830654080004822650",
+ "sig": "K48GPPM715ZXX0DC597WESD5ECT3R0B3TAFQMB68SBF4K5CZ5KCE9NESN1JX412SPZ82PSV7JAPVJFXDDTZ63YV4295S5RC28E4221G",
+ "name": "GNUnet e.V.",
+ "bic": "GENODEF1SLR"
+}
\ No newline at end of file
diff --git a/src/wire/test_wire_plugin_test.json b/src/wire/test_wire_plugin_test.json
new file mode 100644
index 000000000..6fe6b2359
--- /dev/null
+++ b/src/wire/test_wire_plugin_test.json
@@ -0,0 +1,7 @@
+{
+ "type": "test",
+ "bank_uri": "http://localhost/",
+ "sig": "KX1CMHNFH1WE10244AEF07AXHJCF9PZDZVNZBC9P4EJEQ1MH1Y3C2TWF08VTQMK4N5TCV0V1VTGWSV0WB8TB9YQRZW87F5A6KCEZ81R",
+ "account_number": 42,
+ "salt": "EZV905MQPVAZEMGC6SEZQF2Z75P6ZKTN8TX00JHN11S7J81DQ78G8Z551K6TGR9WHPP0JW1X9J9X9CVRY48JTHBCP6Q4XKJ6R2G18G0"
+}
\ No newline at end of file
diff --git a/src/wire/wire-sepa.conf b/src/wire/wire-sepa.conf
new file mode 100644
index 000000000..7321a2be6
--- /dev/null
+++ b/src/wire/wire-sepa.conf
@@ -0,0 +1,10 @@
+# Configuration for SEPA wire plugin.
+
+[wire-incoming-sepa]
+# This is the response we give out for the /wire request. It provides
+# wallets with the bank information for transfers to the exchange.
+SEPA_RESPONSE_FILE = ${TALER_CONFIG_HOME}/sepa.json
+
+[wire-outgoing-sepa]
+# This section should contain the options required for making outgoing
+# SEPA transfers. Not yet supported (need libebics).
diff --git a/src/wire/wire-test.conf b/src/wire/wire-test.conf
new file mode 100644
index 000000000..98e486acb
--- /dev/null
+++ b/src/wire/wire-test.conf
@@ -0,0 +1,16 @@
+# This file is in the public domain.
+#
+[wire-incoming-test]
+# This is the response we give out for the /wire request. It provides
+# wallets with the bank information for transfers to the exchange.
+TEST_RESPONSE_FILE = ${TALER_CONFIG_HOME}/test.json
+
+[wire-outgoing-test]
+# For outgoing transfers, we need to know the exchange's
+# account number at the bank.
+EXCHANGE_ACCOUNT_NUMBER = 2
+
+# For transfers made by the exchange, we need to know
+# the URI of the bank (where the /admin/add/incoming API
+# is avaialble).
+# BANK_URI = https://bank.demo.taler.net/