Skip to content

Commit

Permalink
fixup! Merge branch 'grarco/nullifier-uniqueness' (#2240)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Dec 12, 2023
1 parent 42b0595 commit bd4374b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/types/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1203,13 +1203,17 @@ pub fn is_denom_key(token_addr: &Address, key: &Key) -> bool {

/// Check if the given storage key is a masp key
pub fn is_masp_key(key: &Key) -> bool {
matches!(&key.segments[..],
if key.segments.len() >= 2 {
matches!(&key.segments[..2],
[DbKeySeg::AddressSeg(addr), DbKeySeg::StringSeg(key)]
if *addr == MASP
&& (key == HEAD_TX_KEY
|| key.starts_with(TX_KEY_PREFIX)
|| key.starts_with(PIN_KEY_PREFIX)
|| key.starts_with(MASP_NULLIFIERS_KEY_PREFIX)))
} else {
false
}
}

/// Check if the given storage key is a masp nullifier key
Expand Down

0 comments on commit bd4374b

Please sign in to comment.