Add tests for opcode classification

This commit is contained in:
sanket1729 2021-09-13 07:45:15 -07:00
parent c252b36786
commit b0ad6748e4
1 changed files with 11 additions and 0 deletions

View File

@ -888,6 +888,17 @@ mod tests {
}
}
#[test]
fn classify_test() {
let op186 = all::OP_CHECKSIGADD;
assert_eq!(op186.classify(ClassifyContext::Legacy), Class::ReturnOp);
assert_eq!(op186.classify(ClassifyContext::TapScript), Class::Ordinary(Ordinary::OP_CHECKSIGADD));
let op187 = all::OP_RETURN_187;
assert_eq!(op187.classify(ClassifyContext::Legacy), Class::ReturnOp);
assert_eq!(op187.classify(ClassifyContext::TapScript), Class::SuccessOp);
}
#[test]
fn str_roundtrip() {
let mut unique = HashSet::new();