Skip to content

Commit

Permalink
Test overflowing edict ID cenotaph
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Mar 28, 2024
1 parent 80860d9 commit 518902c
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions crates/ordinals/src/runestone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,11 +849,28 @@ mod tests {
}

#[test]
fn runestone_with_overflowing_edict_delta_is_cenotaph() {
fn runestone_with_overflowing_edict_id_delta_is_cenotaph() {
assert_eq!(
decipher(&[Tag::Body.into(), 1, 0, u64::MAX.into(), 0]),
decipher(&[Tag::Body.into(), 1, 0, 0, 0, u64::MAX.into(), 0, 0, 0]),
Runestone {
edicts: Vec::new(),
edicts: vec![Edict {
id: RuneId::new(1, 0).unwrap(),
amount: 0,
output: 0,
}],
cenotaph: Cenotaph::EdictRuneId.into(),
..default()
},
);

assert_eq!(
decipher(&[Tag::Body.into(), 1, 1, 0, 0, 0, u64::MAX.into(), 0, 0]),
Runestone {
edicts: vec![Edict {
id: RuneId::new(1, 0).unwrap(),
amount: 0,
output: 0,
}],
cenotaph: Cenotaph::EdictRuneId.into(),
..default()
},
Expand Down

0 comments on commit 518902c

Please sign in to comment.