lightningd: update decryptencrypteddata API to new terminology.

It's not documented, and only used internally, so we don't need a deprecation
cycle.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-10-15 09:54:21 +10:30
parent fd717c71af
commit 014459d893
3 changed files with 5 additions and 5 deletions

View File

@ -283,7 +283,7 @@ static struct command_result *json_decryptencrypteddata(struct command *cmd,
if (!param_check(cmd, buffer, params,
p_req("encrypted_data", param_bin_from_hex, &encdata),
p_req("blinding", param_pubkey, &path_key),
p_req("path_key", param_pubkey, &path_key),
NULL))
return command_param_failed();
@ -314,7 +314,7 @@ static struct command_result *json_decryptencrypteddata(struct command *cmd,
response = json_stream_success(cmd);
json_object_start(response, "decryptencrypteddata");
json_add_hex_talarr(response, "decrypted", decrypted);
json_add_pubkey(response, "next_blinding", &next_path_key);
json_add_pubkey(response, "next_path_key", &next_path_key);
json_object_end(response);
return command_success(cmd, response);
}

View File

@ -1117,7 +1117,7 @@ decrypt_done(struct command *cmd,
err = json_scan(tmpctx, buf, result,
"{decryptencrypteddata:{decrypted:%"
",next_blinding:%}}",
",next_path_key:%}}",
JSON_SCAN_TAL(tmpctx, json_tok_bin_from_hex, &encdata),
JSON_SCAN(json_to_pubkey, &next_path_key));
if (err) {
@ -1205,7 +1205,7 @@ preapproveinvoice_succeed(struct command *cmd,
json_add_hex_talarr(req->js, "encrypted_data",
p->blindedpath->path[0]->encrypted_recipient_data);
json_add_pubkey(req->js, "blinding", &p->blindedpath->first_path_key);
json_add_pubkey(req->js, "path_key", &p->blindedpath->first_path_key);
return send_outreq(cmd->plugin, req);
}

View File

@ -5967,7 +5967,7 @@ def test_decryptencrypteddata(node_factory):
# 1. type: 4 (`next_node_id`)
# 2. data:
# * [`point`:`node_id`]
dec = l2.rpc.decryptencrypteddata(encrypted_data=encdata1, blinding=first_path_key)['decryptencrypteddata']
dec = l2.rpc.decryptencrypteddata(encrypted_data=encdata1, path_key=first_path_key)['decryptencrypteddata']
assert dec['decrypted'].startswith('0421' + l3.info['id'])