Move opcode aliases to the all module

The opcode aliases are just that, aliases to opcodes so they can live in
the `all` module along with the other opcodes.
This commit is contained in:
Tobin C. Harding 2023-07-26 14:45:52 +10:00
parent f3e8dbc392
commit 881d1b1a9d
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 11 additions and 11 deletions

View File

@ -55,6 +55,17 @@ macro_rules! all_opcodes {
)*
}
/// Push an empty array onto the stack.
pub static OP_0: All = OP_PUSHBYTES_0;
/// Empty stack is also FALSE.
pub static OP_FALSE: All = OP_PUSHBYTES_0;
/// Number 1 is also TRUE.
pub static OP_TRUE: All = OP_PUSHNUM_1;
/// Previously called OP_NOP2.
pub static OP_NOP2: All = OP_CLTV;
/// Previously called OP_NOP3.
pub static OP_NOP3: All = OP_CSV;
impl fmt::Display for All {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
@ -444,17 +455,6 @@ impl serde::Serialize for All {
}
}
/// Push an empty array onto the stack.
pub static OP_0: All = OP_PUSHBYTES_0;
/// Empty stack is also FALSE.
pub static OP_FALSE: All = OP_PUSHBYTES_0;
/// Number 1 is also TRUE.
pub static OP_TRUE: All = OP_PUSHNUM_1;
/// Previously called OP_NOP2.
pub static OP_NOP2: All = OP_CLTV;
/// Previously called OP_NOP3.
pub static OP_NOP3: All = OP_CSV;
/// Broad categories of opcodes with similar behavior.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum Class {