rpc: rename get_uint64_t to get_uint64
What changed, and why it matters
This commit simply renames an internal helper function from `rpc_get_uint64_t` to `rpc_get_uint64` and updates every place that calls it. There are no changes to what the function does, how it checks data, or how secure it is. It is a routine code cleanup with no security relevance.
No security action needed; treat as normal refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch is a pure identifier rename across 7 files: the function definition, its header declaration, a wrapper default-value helper, and all call sites. The implementation of the uint64 CBOR extraction helper remains identical, including its assertions and cbor_value_get_uint64 call. No logic, validation, or behavior changes are introduced.
Changed components
main/utils/cbor_rpc.cmain/utils/cbor_rpc.hmain/process/get_commitments.cmain/process/get_otp_code.cmain/process/process_utils.cmain/process/sign_tx.cmain/process/sign_utils.cInspect captured patch +11 / −11
diff --git a/main/process/get_commitments.c b/main/process/get_commitments.c
index 1121d6e..2812d10 100644
--- a/main/process/get_commitments.c
+++ b/main/process/get_commitments.c
@@ -51,7 +51,7 @@ void get_commitments_process(void* process_ptr)
goto cleanup;
}
- bool ret = rpc_get_uint64_t("value", ¶ms, &ec.c.value);
+ bool ret = rpc_get_uint64("value", ¶ms, &ec.c.value);
if (!ret) {
jade_process_reject_message(process, CBOR_RPC_BAD_PARAMETERS, "Failed to extract value from parameters");
goto cleanup;
diff --git a/main/process/get_otp_code.c b/main/process/get_otp_code.c
index 9274414..2895f44 100644
--- a/main/process/get_otp_code.c
+++ b/main/process/get_otp_code.c
@@ -71,7 +71,7 @@ void get_otp_code_process(void* process_ptr)
// totp token/code updates with time - but we disable that if an explicit epoch value is passed
bool auto_update = true;
#ifdef CONFIG_DEBUG_MODE
- if (rpc_get_uint64_t("override", ¶ms, &value)) {
+ if (rpc_get_uint64("override", ¶ms, &value)) {
otp_set_explicit_value(&otp_ctx, value);
auto_update = false; // frozen on passed override value
}
diff --git a/main/process/process_utils.c b/main/process/process_utils.c
index a441fc6..03be32b 100644
--- a/main/process/process_utils.c
+++ b/main/process/process_utils.c
@@ -84,7 +84,7 @@ int params_set_epoch_time(CborValue* params, const char** errmsg)
JADE_INIT_OUT_PPTR(errmsg);
uint64_t epoch = 0;
- if (!rpc_get_uint64_t("epoch", params, &epoch)) {
+ if (!rpc_get_uint64("epoch", params, &epoch)) {
*errmsg = "Failed to extract valid epoch value from parameters";
return CBOR_RPC_BAD_PARAMETERS;
}
diff --git a/main/process/sign_tx.c b/main/process/sign_tx.c
index 5fbcf13..e551913 100644
--- a/main/process/sign_tx.c
+++ b/main/process/sign_tx.c
@@ -736,7 +736,7 @@ static void sign_tx_impl(jade_process_t* process, const bool for_liquid)
// Get the amount
uint64_t satoshi;
int res = WALLY_EINVAL;
- if (rpc_get_uint64_t("satoshi", ¶ms, &satoshi)) {
+ if (rpc_get_uint64("satoshi", ¶ms, &satoshi)) {
res = wally_map_add_integer(&signing_data->amounts, index, (uint8_t*)&satoshi, sizeof(uint64_t));
// Keep a running total
input_amount += satoshi;
diff --git a/main/process/sign_utils.c b/main/process/sign_utils.c
index 4937232..8a78fc1 100644
--- a/main/process/sign_utils.c
+++ b/main/process/sign_utils.c
@@ -140,7 +140,7 @@ static void rpc_get_asset_summary(
if (!cbor_value_is_map(&arrayItem)
|| !rpc_get_n_bytes("asset_id", &arrayItem, sizeof(item->asset_id), item->asset_id)
- || !rpc_get_uint64_t("satoshi", &arrayItem, &item->value)) {
+ || !rpc_get_uint64("satoshi", &arrayItem, &item->value)) {
return;
}
@@ -353,7 +353,7 @@ bool params_commitment_data(
if (!(ec.c.content & (COMMITMENTS_VBF | COMMITMENTS_VALUE_BLIND_PROOF))
|| !rpc_get_n_bytes("asset_id", item, sizeof(ec.c.asset_id), ec.c.asset_id)
- || !rpc_get_uint64_t("value", item, &ec.c.value)) {
+ || !rpc_get_uint64("value", item, &ec.c.value)) {
*errmsg = "Invalid or missing trusted commitment data";
return false;
}
diff --git a/main/utils/cbor_rpc.c b/main/utils/cbor_rpc.c
index 47b0e2e..f93ed1b 100644
--- a/main/utils/cbor_rpc.c
+++ b/main/utils/cbor_rpc.c
@@ -303,7 +303,7 @@ bool rpc_get_bool_or(const char* field, const CborValue* value, const bool defau
return res;
}
-bool rpc_get_uint64_t(const char* field, const CborValue* value, uint64_t* res)
+bool rpc_get_uint64(const char* field, const CborValue* value, uint64_t* res)
{
JADE_ASSERT(value);
JADE_ASSERT(res);
@@ -318,10 +318,10 @@ bool rpc_get_uint64_t(const char* field, const CborValue* value, uint64_t* res)
return true;
}
-uint64_t rpc_get_uint64_t_or(const char* field, const CborValue* value, const uint64_t default_value)
+uint64_t rpc_get_uint64_or(const char* field, const CborValue* value, const uint64_t default_value)
{
uint64_t res = default_value;
- IGNORE_RESULT(rpc_get_uint64_t(field, value, &res));
+ IGNORE_RESULT(rpc_get_uint64(field, value, &res));
return res;
}
diff --git a/main/utils/cbor_rpc.h b/main/utils/cbor_rpc.h
index 4d37ddf..0b359af 100644
--- a/main/utils/cbor_rpc.h
+++ b/main/utils/cbor_rpc.h
@@ -53,8 +53,8 @@ void rpc_get_bytes(const char* field, size_t max, const CborValue* value, uint8_
WARN_UNUSED_RESULT bool rpc_get_n_bytes(const char* field, const CborValue* value, size_t expected_size, uint8_t* data);
WARN_UNUSED_RESULT bool rpc_get_sizet(const char* field, const CborValue* value, size_t* res);
WARN_UNUSED_RESULT size_t rpc_get_sizet_or(const char* field, const CborValue* value, size_t default_value);
-WARN_UNUSED_RESULT bool rpc_get_uint64_t(const char* field, const CborValue* value, uint64_t* res);
-WARN_UNUSED_RESULT uint64_t rpc_get_uint64_t_or(const char* field, const CborValue* value, uint64_t default_value);
+WARN_UNUSED_RESULT bool rpc_get_uint64(const char* field, const CborValue* value, uint64_t* res);
+WARN_UNUSED_RESULT uint64_t rpc_get_uint64_or(const char* field, const CborValue* value, uint64_t default_value);
WARN_UNUSED_RESULT bool rpc_get_bool(const char* field, const CborValue* value, bool* res);
WARN_UNUSED_RESULT bool rpc_get_bool_or(const char* field, const CborValue* value, bool default_value);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.