Experimental Inscription Support#3
Conversation
| if ret.last() == Some(&Token::Num(0)) { | ||
| // Inscription Detected | ||
| ret.pop(); | ||
| if let Some(Ok(Instruction::PushBytes(b"ord"))) = it.next() { |
There was a problem hiding this comment.
might be good to use PROTOCOL_ID instead of b"ord" here since you already have it as a const, and in-case you ever want to parse other envelope-using protocols
There was a problem hiding this comment.
the reason is more annoying than that. it's because pattern matching on consts is IMO sketchy... to make it work "right" you want to do ord::PROTOCOL_ID (so it isn't accidentally an unchecked ID), and even then, I couldn't get the compiler to accept it because array/slice stuff. If you know how to get it to work LMK.
There was a problem hiding this comment.
yeah, you're right :-/ unless you wanted to do something like
if let Some(Ok(Instruction::PushBytes(bytes))) = it.next() {
if bytes == PROTOCOL_ID {
// whatever
}
}
this approach is better
There was a problem hiding this comment.
the compiler is no match for me.
There was a problem hiding this comment.
I kinda want to stick a comment in there not to remove the name ord::
| let metaprotocol = Tag::Metaprotocol.remove_field(&mut fields); | ||
| let parent = Tag::Parent.remove_field(&mut fields); | ||
| let pointer = Tag::Pointer.remove_field(&mut fields); | ||
|
|
There was a problem hiding this comment.
there's also an unbound tag (66). are you just having it get rolled into unrecognized_even_field?
There was a problem hiding this comment.
I coppied this code from the ord repo so i'd do whatever they say! is 66 good?
sapio-miniscript@7.0.2-alpha.0 Generated by cargo-workspaces
| pub mod policy; | ||
| pub mod psbt; | ||
| #[allow(missing_docs)] | ||
| pub mod ord; |
There was a problem hiding this comment.
Would it be useful to you if we exported the inscriptions module in ord and made more types public so you can use it as a crate?
There was a problem hiding this comment.
yes, I think it's a good idea. but also not really for sapio unfortunately since we have like the entire rust-bitcoin ecosystem forked with patches.
this patch set though should be upstreamable!
There was a problem hiding this comment.
Would it be useful to you if we exported the
inscriptionsmodule inordand made more types public so you can use it as a crate?
I would love that.
There was a problem hiding this comment.
Have a look if this is useful: ordinals/ord#3042
No description provided.