Skip to content

Commit

Permalink
WIP: testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Dec 20, 2024
1 parent d22cd7f commit 022685a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/zcash_address/src/kind/unified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ pub(crate) mod private {
}
}

if only_transparent && revision == Revision::R0 {
if std::dbg!(only_transparent) && std::dbg!(revision == Revision::R0) {
Err(ParseError::OnlyTransparent)
} else {
// All checks pass!
Expand Down
13 changes: 7 additions & 6 deletions components/zcash_address/src/kind/unified/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,14 @@ mod tests {
0xea, 0xdb, 0xc5, 0x20, 0x62, 0xf9, 0x6f, 0xa9, 0x86, 0xcc,
];

// We can't actually exercise this error, because at present the only transparent
// receivers we can use are P2PKH and P2SH (which cannot be used together), and
// with only one of them we don't have sufficient data for F4Jumble (so we hit a
// different error).
assert_matches!(
Address::parse_internal(Address::MAINNET_R0, &encoded[..]),
Err(ParseError::InvalidEncoding(_))
std::dbg!(Address::parse_internal(Address::MAINNET_R0, &encoded[..])),
Err(ParseError::OnlyTransparent)
);

assert_matches!(
Address::parse_internal(Address::MAINNET_R1, &encoded[..]),
Ok(addr) if addr.receivers().len() == 1
);
}

Expand Down

0 comments on commit 022685a

Please sign in to comment.