Skip to content

Commit ce63376

Browse files
committed
added tvk method to Transition struct
1 parent ad1eb95 commit ce63376

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

wasm/src/ledger/transition.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ impl Transition {
176176
Group::from(self.0.tpk())
177177
}
178178

179+
/// Get the transition view key of the transition.
180+
pub fn tvk(&self, view_key: ViewKey) -> Field {
181+
let tpk = self.tpk();
182+
let tvk = tpk.scalar_multiply(&view_key.to_scalar()).to_x_coordinate();
183+
tvk
184+
}
185+
179186
/// Get the transition commitment of the transition.
180187
pub fn tcm(&self) -> Field {
181188
Field::from(self.0.tcm())

0 commit comments

Comments
 (0)