-draft pull p2p test case

This commit is contained in:
Christian Grothoff 2022-04-26 17:05:12 +02:00
parent 932cef3d8c
commit 25aa208d12
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -147,10 +147,7 @@ run (void *cls,
MHD_HTTP_OK), MHD_HTTP_OK),
TALER_TESTING_cmd_end () TALER_TESTING_cmd_end ()
}; };
struct TALER_TESTING_Command spend[] = { struct TALER_TESTING_Command push[] = {
/**
* Spend the coin.
*/
TALER_TESTING_cmd_purse_create_with_deposit ( TALER_TESTING_cmd_purse_create_with_deposit (
"purse-with-deposit", "purse-with-deposit",
MHD_HTTP_OK, MHD_HTTP_OK,
@ -158,17 +155,41 @@ run (void *cls,
true, /* upload contract */ true, /* upload contract */
GNUNET_TIME_UNIT_MINUTES, /* expiration */ GNUNET_TIME_UNIT_MINUTES, /* expiration */
"withdraw-coin-1", "withdraw-coin-1",
"EUR:1.01", /* FIXME: check amount vs. fees! */ "EUR:1.01",
NULL), NULL),
TALER_TESTING_cmd_contract_get ( TALER_TESTING_cmd_contract_get (
"purse-get-contract", "push-get-contract",
MHD_HTTP_OK, MHD_HTTP_OK,
"purse-with-deposit"), "purse-with-deposit"),
TALER_TESTING_cmd_purse_merge ( TALER_TESTING_cmd_purse_merge (
"purse-merge-into-reserve", "purse-merge-into-reserve",
MHD_HTTP_OK, MHD_HTTP_OK,
"purse-get-contract", "push-get-contract",
"create-reserve-1"), "create-reserve-1"),
// FIXME: long-poll purse status
// FIXME: check reserve history!
TALER_TESTING_cmd_end ()
};
struct TALER_TESTING_Command pull[] = {
TALER_TESTING_cmd_purse_create_with_reserve (
"purse-create-with-reserve",
MHD_HTTP_OK,
"{\"amount\":\"EUR:1\",\"summary\":\"ice cream\"}",
true /* upload contract */,
"create-reserve-1"),
TALER_TESTING_cmd_contract_get (
"pull-get-contract",
MHD_HTTP_OK,
"purse-create-with-reserve"),
TALER_TESTING_cmd_purse_deposit_coins (
"purse-deposit-coins",
MHD_HTTP_OK,
0 /* min age */,
"purse-create-with-reserve",
"withdraw-coin-1",
"EUR:1.01",
NULL),
// FIXME: long-poll purse status
// FIXME: check reserve history! // FIXME: check reserve history!
TALER_TESTING_cmd_end () TALER_TESTING_cmd_end ()
}; };
@ -205,8 +226,10 @@ run (void *cls,
1), 1),
TALER_TESTING_cmd_batch ("withdraw", TALER_TESTING_cmd_batch ("withdraw",
withdraw), withdraw),
TALER_TESTING_cmd_batch ("spend", TALER_TESTING_cmd_batch ("push",
spend), push),
TALER_TESTING_cmd_batch ("pull",
pull),
/* End the suite. */ /* End the suite. */
TALER_TESTING_cmd_end () TALER_TESTING_cmd_end ()
}; };