refactor(zcash): finish the preflight-to-check rename for the batch entry point
What changed, and why it matters
This commit is a pure rename refactor. It changes the word 'preflight' to 'check' in function names, variable names, test names, and comments across three files related to Zcash batch transaction handling. The commit message explicitly states there is no behavior change, and the diff shows only identifier and comment updates with no logic modifications.
No security action required. This is a non-functional refactor. Normal code review and CI validation are sufficient.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit completes a naming consistency refactor for the Zcash cypherpunk batch PCZT flow. It renames preflight_batch_pczt_cypherpunk to check_batch_pczt_cypherpunk, updates corresponding test names (e.g., test_preflight_batch_pczt_* to test_check_batch_pczt_*), renames the C variable g_batchPreflightError to g_batchCheckError, and updates prose comments. The call site in rust/rust_c/src/zcash/mod.rs is updated to use the new function name. No algorithmic, control-flow, or data-flow changes are present.
Changed components
rust/apps/zcash/src/lib.rsrust/rust_c/src/zcash/mod.rssrc/ui/gui_widgets/multi/cypherpunk/gui_zcash_batch_widgets.cInspect captured patch +24 / −24
diff --git a/rust/apps/zcash/src/lib.rs b/rust/apps/zcash/src/lib.rs
index 22bcc10..5858263 100644
--- a/rust/apps/zcash/src/lib.rs
+++ b/rust/apps/zcash/src/lib.rs
@@ -114,12 +114,12 @@ fn check_parsed_pczt_cypherpunk<P: consensus::Parameters>(
Ok(())
}
-/// Batch preflight for one `ZcashSignBatch` message: parses once, runs the full
+/// Batch check for one `ZcashSignBatch` message: parses once, runs the full
/// policy checks, enforces the batch shielded-action policy (the PCZT must be
/// batch-signable by this account), and returns the normalized encoding. See
/// `check_pczt_cypherpunk` for the normalization contract.
#[cfg(feature = "cypherpunk")]
-pub fn preflight_batch_pczt_cypherpunk<P: consensus::Parameters>(
+pub fn check_batch_pczt_cypherpunk<P: consensus::Parameters>(
params: &P,
pczt_bytes: &[u8],
ufvk_text: &str,
@@ -369,7 +369,7 @@ mod legacy_tests {
&sample.seed_fingerprint,
0,
)
- .expect("selected account PCZT should preflight");
+ .expect("selected account PCZT should pass the check");
assert!(
parse_pczt_multi_coins(&MainNetwork, &normalized, &sample.seed_fingerprint).is_ok()
);
@@ -657,7 +657,7 @@ fn ensure_shielded_actions_are_signed(
Ok(verifier.finish())
}
-/// Signs a preflight-checked, normalized PCZT and confirms in memory that every
+/// Signs a checked, normalized PCZT and confirms in memory that every
/// supported shielded action owned by (`seed_fingerprint`, `account_index`)
/// received a spend authorization signature. Single-transaction policy: a PCZT
/// with no owned shielded action still signs if any action matched the seed.
@@ -681,7 +681,7 @@ pub fn sign_checked_pczt<P: consensus::Parameters>(
)
}
-/// Signs a preflight-checked, normalized PCZT and confirms in memory that every
+/// Signs a checked, normalized PCZT and confirms in memory that every
/// supported shielded action owned by (`seed_fingerprint`, `account_index`)
/// received a spend authorization signature. Batch policy: additionally rejects
/// PCZT shapes the batch flow does not support and requires at least one owned
@@ -1353,7 +1353,7 @@ mod tests {
#[test]
fn test_sign_checked_batch_pczt_signs_ironwood_spend() {
let sample = pczt::test_support::sample_ironwood_pczt();
- let normalized = preflight_batch_pczt_cypherpunk(
+ let normalized = check_batch_pczt_cypherpunk(
&pczt::test_support::Nu6_3Network,
&sample.bytes,
&sample.ufvk_text,
@@ -1478,12 +1478,12 @@ mod tests {
#[cfg(zcash_unstable = "nu6.3")]
#[test]
- fn test_preflight_batch_pczt_accepts_orchard_and_ironwood_spends() {
+ fn test_check_batch_pczt_accepts_orchard_and_ironwood_spends() {
for sample in [
pczt::test_support::sample_orchard_change_pczt(),
pczt::test_support::sample_ironwood_pczt(),
] {
- let normalized = preflight_batch_pczt_cypherpunk(
+ let normalized = check_batch_pczt_cypherpunk(
&pczt::test_support::Nu6_3Network,
&sample.bytes,
&sample.ufvk_text,
@@ -1495,7 +1495,7 @@ mod tests {
// Account 1 owns nothing in these PCZTs: batch policy rejects.
assert_eq!(
- preflight_batch_pczt_cypherpunk(
+ check_batch_pczt_cypherpunk(
&pczt::test_support::Nu6_3Network,
&sample.bytes,
&sample.ufvk_text,
@@ -1510,13 +1510,13 @@ mod tests {
#[cfg(zcash_unstable = "nu6.3")]
#[test]
- fn test_preflight_resolves_compact_pczt_and_signs() {
+ fn test_check_resolves_compact_pczt_and_signs() {
use zcash_vendor::pczt::roles::redactor::Redactor;
let sample = pczt::test_support::sample_migration_pczt();
// Compact the sample the way the wallet's batch redaction will: drop cv_net and
// the v6 anchors, and swap each Ironwood output's ciphertext down to its memo
- // plaintext. `resolve_fields` in the preflight must undo all of it.
+ // plaintext. `resolve_fields` in the check must undo all of it.
let compact = {
let parsed = Pczt::parse(&sample.bytes).unwrap();
let redacted = Redactor::new(parsed)
@@ -1556,7 +1556,7 @@ mod tests {
&sample.seed_fingerprint,
0,
)
- .expect("preflight must resolve compact fields before checking");
+ .expect("the check must resolve compact fields first");
let reparsed = Pczt::parse(&normalized).expect("normalized bytes must parse");
assert!(reparsed
@@ -1587,9 +1587,9 @@ mod tests {
#[cfg(zcash_unstable = "nu6.3")]
#[test]
- fn test_preflight_batch_pczt_rejects_sapling_outputs() {
+ fn test_check_batch_pczt_rejects_sapling_outputs() {
let sample = pczt_with_sapling_output();
- assert_batch_unsupported_sapling_error(preflight_batch_pczt_cypherpunk(
+ assert_batch_unsupported_sapling_error(check_batch_pczt_cypherpunk(
&pczt::test_support::Nu6_3Network,
&sample.bytes,
&sample.ufvk_text,
diff --git a/rust/rust_c/src/zcash/mod.rs b/rust/rust_c/src/zcash/mod.rs
index ee031f3..abfcb23 100644
--- a/rust/rust_c/src/zcash/mod.rs
+++ b/rust/rust_c/src/zcash/mod.rs
@@ -313,7 +313,7 @@ pub unsafe extern "C" fn check_zcash_batch_tx_cypherpunk(
let mut checked_messages = Vec::with_capacity(batch.get_messages().len());
for message in batch.get_messages() {
- match app_zcash::preflight_batch_pczt_cypherpunk(
+ match app_zcash::check_batch_pczt_cypherpunk(
&MainNetwork,
message.get_payload(),
&ufvk_text,
diff --git a/src/ui/gui_widgets/multi/cypherpunk/gui_zcash_batch_widgets.c b/src/ui/gui_widgets/multi/cypherpunk/gui_zcash_batch_widgets.c
index 520ab11..ca2a707 100644
--- a/src/ui/gui_widgets/multi/cypherpunk/gui_zcash_batch_widgets.c
+++ b/src/ui/gui_widgets/multi/cypherpunk/gui_zcash_batch_widgets.c
@@ -33,10 +33,10 @@ static TransactionParseResult_DisplayZcashBatch *g_parseResult = NULL;
static DisplayZcashBatch *g_displayZcashBatch = NULL;
static DisplayPczt *g_currentTransaction = NULL;
static ZcashCheckedPczt *g_checkedBatch = NULL;
-// Holds a batch preflight failure message when the QR display path runs the
+// Holds a batch check failure message when the QR display path runs the
// check itself (see GuiParseZcashBatchData), so the parse-fail handler can
// surface it instead of a generic "invalid QR" window.
-static char g_batchPreflightError[128] = {0};
+static char g_batchCheckError[128] = {0};
static PageWidget_t *g_pageWidget = NULL;
static lv_obj_t *g_cont = NULL;
@@ -379,20 +379,20 @@ void GuiZcashBatchWidgetsRefresh(void)
static void *GuiParseZcashBatchData(void)
{
- g_batchPreflightError[0] = '\0';
+ g_batchCheckError[0] = '\0';
// The QR scan path opens this view directly (gui_scan_widgets.c), bypassing
- // the model check step that the USB path runs, so the preflight that
+ // the model check step that the USB path runs, so the check that
// populates g_checkedBatch has not run yet. g_checkedBatch is the normalized,
// checked bytes that this parse and later signing consume, so run the
- // preflight here when it is missing. On failure, stash the real message for
+ // check here when it is missing. On failure, stash the real message for
// the parse-fail handler; only after it passes can parse succeed.
if (g_checkedBatch == NULL) {
PtrT_TransactionCheckResult checkResult = GuiGetZcashBatchCheckResult();
if (checkResult == NULL || checkResult->error_code != 0) {
if (checkResult != NULL) {
if (checkResult->error_message != NULL) {
- snprintf_s(g_batchPreflightError, sizeof(g_batchPreflightError), "%s",
+ snprintf_s(g_batchCheckError, sizeof(g_batchCheckError), "%s",
checkResult->error_message);
}
free_TransactionCheckResult(checkResult);
@@ -427,11 +427,11 @@ void GuiZcashBatchWidgetsTransactionParseSuccess(void)
void GuiZcashBatchWidgetsTransactionParseFail(void)
{
printf("GuiZcashBatchWidgetsTransactionParseFail\n");
- // A failed preflight leaves g_parseResult NULL but records its message in
- // g_batchPreflightError; prefer whichever carries the real reason.
+ // A failed check leaves g_parseResult NULL but records its message in
+ // g_batchCheckError; prefer whichever carries the real reason.
const char *errorMessage = (g_parseResult != NULL)
? g_parseResult->error_message
- : (g_batchPreflightError[0] != '\0' ? g_batchPreflightError : NULL);
+ : (g_batchCheckError[0] != '\0' ? g_batchCheckError : NULL);
if (errorMessage != NULL) {
printf("error: %s\n", errorMessage);
if (IsZcashBatchUsbMode()) {
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.