Skip to content

Commit

Permalink
Attaching commitment to decrypted memo
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgenKor committed Apr 26, 2024
1 parent 139d9ba commit 33c22d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libzkbob-rs-wasm/src/client/tx_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub struct StateUpdate {
#[derive(Serialize, Deserialize, Clone, Default, Debug)]
pub struct DecMemo {
pub index: u64,
pub commitment: Option<Hash<Fr>>,
pub acc: Option<NativeAccount<Fr>>,
#[serde(rename = "inNotes")]
pub in_notes: Vec<IndexedNote>,
Expand Down Expand Up @@ -301,6 +302,7 @@ pub fn parse_tx(
ParseResult {
decrypted_memos: vec![DecMemo {
index,
commitment: Some(Num::from_uint_reduced(NumRepr(Uint::from_big_endian(&commitment)))),
in_notes: in_notes_indexed,
tx_hash: match tx_hash {
Some(bytes) => Some(format!("0x{}", hex::encode(bytes))),
Expand Down Expand Up @@ -354,6 +356,7 @@ pub fn parse_tx(
Ok(ParseResult {
decrypted_memos: vec![DecMemo {
index,
commitment: Some(Num::from_uint_reduced(NumRepr(Uint::from_big_endian(&commitment)))),
acc: Some(account),
in_notes: in_notes
.iter()
Expand Down Expand Up @@ -399,6 +402,7 @@ pub fn parse_tx(
Ok(ParseResult {
decrypted_memos: vec![DecMemo {
index,
commitment: Some(Num::from_uint_reduced(NumRepr(Uint::from_big_endian(&commitment)))),
in_notes: in_notes
.iter()
.map(|(index, note)| IndexedNote {
Expand Down

0 comments on commit 33c22d8

Please sign in to comment.