@@ -63,23 +63,23 @@ impl SnapshotQuery {
63
63
///
64
64
/// Steps:
65
65
/// 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 )`
67
67
/// 2) Take a snapshot `(state_root, block_height)`.
68
68
/// 3) Fetch all state paths **concurrently** for those commitments (anchored to that snapshot).
69
69
/// 4) Return a populated `SnapshotQuery`.
70
70
///
71
71
/// Notes:
72
72
/// - `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>`.
74
74
pub async fn try_from_inputs (
75
75
node_url : & str ,
76
76
program_id : & ProgramID < CurrentNetwork > ,
77
77
record_name : & Identifier < CurrentNetwork > ,
78
- view_key_field : Field < CurrentNetwork > ,
78
+ view_key : Field < CurrentNetwork > ,
79
79
js_inputs : & [ JsValue ] ,
80
80
) -> Result < Self > {
81
81
// 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) ?;
83
83
84
84
// Fast path: if there are no record inputs, still pin a snapshot (height + root) for consistency.
85
85
let ( snap_root, snap_height) = snapshot_head ( node_url) . await ?;
@@ -163,7 +163,7 @@ impl QueryTrait<CurrentNetwork> for SnapshotQuery {
163
163
fn collect_commitments_from_inputs (
164
164
program_id : & ProgramIDNative ,
165
165
record_name : & IdentifierNative ,
166
- view_key_field : Field < CurrentNetwork > ,
166
+ view_key : Field < CurrentNetwork > ,
167
167
js_inputs : & [ JsValue ] ,
168
168
) -> anyhow:: Result < Vec < Field < CurrentNetwork > > > {
169
169
let mut out = Vec :: new ( ) ;
@@ -176,7 +176,7 @@ fn collect_commitments_from_inputs(
176
176
}
177
177
// Try parse as a plaintext record. Skip if not a record.
178
178
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 ) ;
180
180
out. push ( cm?) ;
181
181
}
182
182
}
0 commit comments