summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-01 21:07:56 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-01 21:07:56 +0100
commit9572337aed3ebc5f0654db11c10babc88560c481 (patch)
treebd03657b4116cbbe53995e5db2c41cbd3be64ba6 /src/testing
parentd3184e04e2a604673655899989707664736b3468 (diff)
downloadexchange-9572337aed3ebc5f0654db11c10babc88560c481.tar.gz
exchange-9572337aed3ebc5f0654db11c10babc88560c481.tar.bz2
exchange-9572337aed3ebc5f0654db11c10babc88560c481.zip
more management API tests and bugfixes
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_exchange_management_api.c58
-rw-r--r--src/testing/testing_api_cmd_wire_add.c11
2 files changed, 61 insertions, 8 deletions
diff --git a/src/testing/test_exchange_management_api.c b/src/testing/test_exchange_management_api.c
index e44d5c8cd..232944094 100644
--- a/src/testing/test_exchange_management_api.c
+++ b/src/testing/test_exchange_management_api.c
@@ -82,6 +82,64 @@ run (void *cls,
TALER_TESTING_cmd_auditor_del ("del-auditor-IDEMPOTENT",
MHD_HTTP_NO_CONTENT,
false),
+ TALER_TESTING_cmd_set_wire_fee ("set-fee",
+ "foo-method",
+ "EUR:1",
+ "EUR:5",
+ MHD_HTTP_NO_CONTENT,
+ false),
+ TALER_TESTING_cmd_set_wire_fee ("set-fee-conflicting",
+ "foo-method",
+ "EUR:1",
+ "EUR:1",
+ MHD_HTTP_CONFLICT,
+ false),
+ TALER_TESTING_cmd_set_wire_fee ("set-fee-bad-signature",
+ "bar-method",
+ "EUR:1",
+ "EUR:1",
+ MHD_HTTP_FORBIDDEN,
+ true),
+ TALER_TESTING_cmd_set_wire_fee ("set-fee-other-method",
+ "bar-method",
+ "EUR:1",
+ "EUR:1",
+ MHD_HTTP_NO_CONTENT,
+ false),
+ TALER_TESTING_cmd_set_wire_fee ("set-fee-idempotent",
+ "bar-method",
+ "EUR:1",
+ "EUR:1",
+ MHD_HTTP_NO_CONTENT,
+ false),
+ TALER_TESTING_cmd_wire_add ("add-wire-account",
+ "payto://x-taler-bank/localhost/42",
+ MHD_HTTP_NO_CONTENT,
+ false),
+ TALER_TESTING_cmd_wire_add ("add-wire-account-idempotent",
+ "payto://x-taler-bank/localhost/42",
+ MHD_HTTP_NO_CONTENT,
+ false),
+ TALER_TESTING_cmd_wire_add ("add-wire-account-another",
+ "payto://x-taler-bank/localhost/43",
+ MHD_HTTP_NO_CONTENT,
+ false),
+ TALER_TESTING_cmd_wire_add ("add-wire-account-bad-signature",
+ "payto://x-taler-bank/localhost/44",
+ MHD_HTTP_FORBIDDEN,
+ true),
+ TALER_TESTING_cmd_wire_del ("del-wire-account-not-found",
+ "payto://x-taler-bank/localhost/44",
+ MHD_HTTP_NOT_FOUND,
+ false),
+ TALER_TESTING_cmd_wire_del ("del-wire-account-bad-signature",
+ "payto://x-taler-bank/localhost/43",
+ MHD_HTTP_FORBIDDEN,
+ true),
+ TALER_TESTING_cmd_wire_del ("del-wire-account-ok",
+ "payto://x-taler-bank/localhost/43",
+ MHD_HTTP_NO_CONTENT,
+ false),
TALER_TESTING_cmd_end ()
};
diff --git a/src/testing/testing_api_cmd_wire_add.c b/src/testing/testing_api_cmd_wire_add.c
index 698e02399..6f25a0f86 100644
--- a/src/testing/testing_api_cmd_wire_add.c
+++ b/src/testing/testing_api_cmd_wire_add.c
@@ -131,20 +131,15 @@ wire_add_run (void *cls,
.purpose.size = htonl (sizeof (kv)),
.start_date = GNUNET_TIME_absolute_hton (now),
};
- struct TALER_MasterWireDetailsPS wd = {
- .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS),
- .purpose.size = htonl (sizeof (wd)),
- };
TALER_exchange_wire_signature_hash (ds->payto_uri,
&kv.h_wire);
- wd.h_wire_details = kv.h_wire;
GNUNET_CRYPTO_eddsa_sign (&is->master_priv.eddsa_priv,
&kv,
&master_sig1.eddsa_signature);
- GNUNET_CRYPTO_eddsa_sign (&is->master_priv.eddsa_priv,
- &wd,
- &master_sig2.eddsa_signature);
+ TALER_exchange_wire_signature_make (ds->payto_uri,
+ &is->master_priv,
+ &master_sig2);
}
ds->dh = TALER_EXCHANGE_management_enable_wire (
is->ctx,