diff --git a/src/mint-lib/mint_api_refresh_link.c b/src/mint-lib/mint_api_refresh_link.c index f17949af0..b4bed98e6 100644 --- a/src/mint-lib/mint_api_refresh_link.c +++ b/src/mint-lib/mint_api_refresh_link.c @@ -173,73 +173,122 @@ static int parse_refresh_link_ok (struct TALER_MINT_RefreshLinkHandle *rlh, json_t *json) { - json_t *jsona; - struct TALER_TransferPublicKeyP trans_pub; - struct TALER_EncryptedLinkSecretP secret_enc; - struct MAJ_Specification spec[] = { - MAJ_spec_json ("new_coins", &jsona), - MAJ_spec_fixed_auto ("trans_pub", &trans_pub), - MAJ_spec_fixed_auto ("secret_enc", &secret_enc), - MAJ_spec_end - }; + unsigned int session; unsigned int num_coins; int ret; - if (GNUNET_OK != - MAJ_parse_json (json, - spec)) + if (! json_is_array (json)) { GNUNET_break_op (0); return GNUNET_SYSERR; } - if (! json_is_array (jsona)) + num_coins = 0; + for (session=0;sessionlink_cb (rlh->link_cb_cls, + MHD_HTTP_OK, + num_coins, + coin_privs, + sigs, + pubs, + json); + rlh->link_cb = NULL; + ret = GNUNET_OK; } else { - rlh->link_cb (rlh->link_cb_cls, - MHD_HTTP_OK, - num_coins, - coin_privs, - sigs, - pubs, - json); - rlh->link_cb = NULL; - ret = GNUNET_OK; + GNUNET_break_op (0); + ret = GNUNET_SYSERR; } /* clean up */ diff --git a/src/mint-lib/test_mint_api.c b/src/mint-lib/test_mint_api.c index 91a3d7628..51f62cc32 100644 --- a/src/mint-lib/test_mint_api.c +++ b/src/mint-lib/test_mint_api.c @@ -1009,6 +1009,10 @@ link_cb (void *cls, return; } /* check that the coins match */ + fprintf (stderr, + "Got %u coins\n", + num_coins); + /* FIXME: note: coins might be legitimately permutated in here... */ for (i=0;i