Skip to content

Commit

Permalink
Add Runestone::cenotaph() (ordinals#3381)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored and harutyunaraci committed Mar 30, 2024
1 parent e7d3282 commit 417c2bf
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/runes/runestone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,22 @@ impl Runestone {
Self::decipher(transaction).ok().flatten()
}

fn cenotaph() -> Self {
Self {
cenotaph: true,
..default()
}
}

fn decipher(transaction: &Transaction) -> Result<Option<Self>, script::Error> {
let payload = match Runestone::payload(transaction)? {
Some(Payload::Valid(payload)) => payload,
Some(Payload::Invalid) => {
return Ok(Some(Self {
cenotaph: true,
..default()
}))
}
Some(Payload::Invalid) => return Ok(Some(Self::cenotaph())),
None => return Ok(None),
};

let Some(integers) = Runestone::integers(&payload) else {
return Ok(Some(Self {
cenotaph: true,
..default()
}));
return Ok(Some(Self::cenotaph()));
};

let Message {
Expand Down

0 comments on commit 417c2bf

Please sign in to comment.