json: Add the json interface for struct sha256

This commit is contained in:
trueptolemy
2019-08-10 16:19:57 +08:00
committed by ZmnSCPxj, ZmnSCPxj jxPCSmnZ
parent 23bfdc307f
commit a9e346a1f4
2 changed files with 9 additions and 0 deletions

View File

@@ -472,3 +472,9 @@ void json_add_secret(struct json_stream *response, const char *fieldname,
{
json_add_hex(response, fieldname, secret, sizeof(struct secret));
}
void json_add_sha256(struct json_stream *result, const char *fieldname,
const struct sha256 *hash)
{
json_add_hex(result, fieldname, hash, sizeof(*hash));
}