Skip to content

Commit 08b9913

Browse files
view_key naming
1 parent f08b579 commit 08b9913

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

wasm/src/programs/snapshot_query.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,23 @@ impl SnapshotQuery {
6363
///
6464
/// Steps:
6565
/// 1) Parse JS inputs, detect record plaintexts (heuristic: contains "_nonce"),
66-
/// and compute their commitments via `to_commitment(program_id, record_name, view_key_field)`
66+
/// and compute their commitments via `to_commitment(program_id, record_name, view_key)`
6767
/// 2) Take a snapshot `(state_root, block_height)`.
6868
/// 3) Fetch all state paths **concurrently** for those commitments (anchored to that snapshot).
6969
/// 4) Return a populated `SnapshotQuery`.
7070
///
7171
/// Notes:
7272
/// - `record_name` must be the concrete name expected by the function (e.g. "credits").
73-
/// - `view_key_field` is the sender's record view key as a `Field<Network>`.
73+
/// - `view_key` is the sender's record view key as a `Field<Network>`.
7474
pub async fn try_from_inputs(
7575
node_url: &str,
7676
program_id: &ProgramID<CurrentNetwork>,
7777
record_name: &Identifier<CurrentNetwork>,
78-
view_key_field: Field<CurrentNetwork>,
78+
view_key: Field<CurrentNetwork>,
7979
js_inputs: &[JsValue],
8080
) -> Result<Self> {
8181
// 1) Extract commitments from inputs.
82-
let commitments = collect_commitments_from_inputs(program_id, record_name, view_key_field, js_inputs)?;
82+
let commitments = collect_commitments_from_inputs(program_id, record_name, view_key, js_inputs)?;
8383

8484
// Fast path: if there are no record inputs, still pin a snapshot (height + root) for consistency.
8585
let (snap_root, snap_height) = snapshot_head(node_url).await?;
@@ -163,7 +163,7 @@ impl QueryTrait<CurrentNetwork> for SnapshotQuery {
163163
fn collect_commitments_from_inputs(
164164
program_id: &ProgramIDNative,
165165
record_name: &IdentifierNative,
166-
view_key_field: Field<CurrentNetwork>,
166+
view_key: Field<CurrentNetwork>,
167167
js_inputs: &[JsValue],
168168
) -> anyhow::Result<Vec<Field<CurrentNetwork>>> {
169169
let mut out = Vec::new();
@@ -176,7 +176,7 @@ fn collect_commitments_from_inputs(
176176
}
177177
// Try parse as a plaintext record. Skip if not a record.
178178
if let Ok(rec) = RecordPlaintextNative::from_str(&s) {
179-
let cm = rec.to_commitment(program_id, record_name, &view_key_field);
179+
let cm = rec.to_commitment(program_id, record_name, &view_key);
180180
out.push(cm?);
181181
}
182182
}

0 commit comments

Comments
 (0)