Skip to content

Commit

Permalink
fix length checking and other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-o-how committed Feb 12, 2025
1 parent e14cb41 commit 90b64a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/chia-consensus/src/gen/conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,9 @@ pub fn parse_args(
if flags & ENABLE_SHA256TREE_CONDITIONS == 0 {
return Err(ValidationErr(c, ErrorCode::InvalidConditionOpcode));
}
// maybe_check_args_terminator(a, c, flags)?;
let sexp = first(a, c)?;
c = rest(a, c)?;
maybe_check_args_terminator(a, c, flags)?;
let id = sanitize_hash(a, first(a, c)?, 32, ErrorCode::InvalidHashValue)?;
Ok(Condition::AssertSha256Tree(sexp, id))
}
Expand Down Expand Up @@ -2004,7 +2004,7 @@ fn test_strict_args_count(
"((({{h1}} ({{h2}} (123 ((({} ({} ( 1337 )))))",
condition as u8, arg
),
flags | DONT_VALIDATE_SIGNATURE,
flags | DONT_VALIDATE_SIGNATURE | ENABLE_SHA256TREE_CONDITIONS,
);
if flags == 0 {
// two of the cases won't pass, even when garbage at the end is allowed.
Expand Down

0 comments on commit 90b64a0

Please sign in to comment.