diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-11-30 00:10:55 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-11-30 00:10:55 +0100 |
commit | 652de42caba601d0cab7264909f78ec483af4d9d (patch) | |
tree | 889f4fbc766246c279fc85033b6ff3a59c100420 | |
parent | 8bc99e1fdcacade9f29fa0b4c44418817f4e5c80 (diff) |
more traitsdemo-2019-12-03-01
-rw-r--r-- | src/lib/testing_api_cmd_proposal_lookup.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/lib/testing_api_cmd_proposal_lookup.c b/src/lib/testing_api_cmd_proposal_lookup.c index 41bbfe8f..c166e3f8 100644 --- a/src/lib/testing_api_cmd_proposal_lookup.c +++ b/src/lib/testing_api_cmd_proposal_lookup.c @@ -50,11 +50,21 @@ struct ProposalLookupState json_t *contract_terms; /** - * Hash over the contract terms. + * Hash over the contract terms. Only set if we got #MHD_HTTP_OK. */ struct GNUNET_HashCode contract_terms_hash; /** + * Signature of the merchant. Only set if we got #MHD_HTTP_OK. + */ + struct TALER_MerchantSignatureP merchant_sig; + + /** + * Public key of the merchant. Only set if we got #MHD_HTTP_OK. + */ + struct TALER_MerchantPublicKeyP merchant_pub; + + /** * Expected status code. */ unsigned int http_status; @@ -141,6 +151,23 @@ proposal_lookup_cb (void *cls, TALER_TESTING_FAIL (pls->is); json_incref (pls->contract_terms); pls->contract_terms_hash = *hash; + pls->merchant_sig = *sig; + { + const char *error_name; + unsigned int error_line; + struct GNUNET_JSON_Specification spec[] = { + GNUNET_JSON_spec_fixed_auto ("merchant_pub", + &pls->merchant_pub), + GNUNET_JSON_spec_end () + }; + + if (GNUNET_OK != + GNUNET_JSON_parse (contract_terms, + spec, + &error_name, + &error_line)) + TALER_TESTING_FAIL (pls->is); + } } TALER_TESTING_interpreter_next (pls->is); } @@ -225,6 +252,10 @@ proposal_lookup_traits (void *cls, pls->contract_terms), TALER_TESTING_make_trait_h_contract_terms (0, &pls->contract_terms_hash), + TALER_TESTING_make_trait_merchant_sig (0, + &pls->merchant_sig), + TALER_TESTING_make_trait_peer_key_pub (0, + &pls->merchant_pub.eddsa_pub), TALER_TESTING_trait_end () }; |