From 518902c1f05be9dccef85e2dfe3a4b33f310430a Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 28 Mar 2024 00:42:35 -0700 Subject: [PATCH] Test overflowing edict ID cenotaph --- crates/ordinals/src/runestone.rs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/crates/ordinals/src/runestone.rs b/crates/ordinals/src/runestone.rs index 7296a91f5b..66869cc4cc 100644 --- a/crates/ordinals/src/runestone.rs +++ b/crates/ordinals/src/runestone.rs @@ -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() },