Skip to content

Commit

Permalink
Tweak memo text size property test to pass
Browse files Browse the repository at this point in the history
Previously, there was a case where we were trying to exercise text sizes
that were too large, and this caused the newly added constructor to
fail. This addess extra logic to deal with this.
  • Loading branch information
cronokirby committed Jan 9, 2024
1 parent 95f0bdc commit 29b7cb2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/core/transaction/src/memo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,12 @@ mod tests {
let memo_address = Address::dummy(&mut rng);
let memo_text = s;
let memo = {
let text_len = memo_text.len();
let memo = MemoPlaintext::new(memo_address, memo_text);
if text_len > MAX_TEXT_LEN {
assert!(memo.is_err());
return Ok(());
}
assert!(memo.is_ok());
memo.unwrap()
};
Expand Down

0 comments on commit 29b7cb2

Please sign in to comment.