1#![allow(missing_docs)]
4
5use crate::{
6 opcode::{Control::*, Operation::*},
7 pv,
8 Opcode::{self, Control, Operation, PushValue},
9};
10
11pub const _0: Opcode = PushValue(pv::_0);
12pub const _1NEGATE: Opcode = PushValue(pv::_1NEGATE);
13pub const _1: Opcode = PushValue(pv::_1);
14pub const _2: Opcode = PushValue(pv::_2);
15pub const _3: Opcode = PushValue(pv::_3);
16pub const _4: Opcode = PushValue(pv::_4);
17pub const _5: Opcode = PushValue(pv::_5);
18pub const _6: Opcode = PushValue(pv::_6);
19pub const _7: Opcode = PushValue(pv::_7);
20pub const _8: Opcode = PushValue(pv::_8);
21pub const _9: Opcode = PushValue(pv::_9);
22pub const _10: Opcode = PushValue(pv::_10);
23pub const _11: Opcode = PushValue(pv::_11);
24pub const _12: Opcode = PushValue(pv::_12);
25pub const _13: Opcode = PushValue(pv::_13);
26pub const _14: Opcode = PushValue(pv::_14);
27pub const _15: Opcode = PushValue(pv::_15);
28pub const _16: Opcode = PushValue(pv::_16);
29
30pub fn push_value(value: &[u8]) -> Option<Opcode> {
33 pv::push_value(value).map(PushValue)
34}
35
36pub const NOP: Opcode = Operation(OP_NOP);
37pub const IF: Opcode = Control(OP_IF);
38pub const NOTIF: Opcode = Control(OP_NOTIF);
39pub const ELSE: Opcode = Control(OP_ELSE);
40pub const ENDIF: Opcode = Control(OP_ENDIF);
41pub const VERIFY: Opcode = Operation(OP_VERIFY);
42pub const RETURN: Opcode = Operation(OP_RETURN);
43pub const TOALTSTACK: Opcode = Operation(OP_TOALTSTACK);
44pub const FROMALTSTACK: Opcode = Operation(OP_FROMALTSTACK);
45pub const _2DROP: Opcode = Operation(OP_2DROP);
46pub const _2DUP: Opcode = Operation(OP_2DUP);
47pub const _3DUP: Opcode = Operation(OP_3DUP);
48pub const _2OVER: Opcode = Operation(OP_2OVER);
49pub const _2ROT: Opcode = Operation(OP_2ROT);
50pub const _2SWAP: Opcode = Operation(OP_2SWAP);
51pub const IFDUP: Opcode = Operation(OP_IFDUP);
52pub const DEPTH: Opcode = Operation(OP_DEPTH);
53pub const DROP: Opcode = Operation(OP_DROP);
54pub const DUP: Opcode = Operation(OP_DUP);
55pub const NIP: Opcode = Operation(OP_NIP);
56pub const OVER: Opcode = Operation(OP_OVER);
57pub const PICK: Opcode = Operation(OP_PICK);
58pub const ROLL: Opcode = Operation(OP_ROLL);
59pub const ROT: Opcode = Operation(OP_ROT);
60pub const SWAP: Opcode = Operation(OP_SWAP);
61pub const TUCK: Opcode = Operation(OP_TUCK);
62pub const SIZE: Opcode = Operation(OP_SIZE);
63pub const EQUAL: Opcode = Operation(OP_EQUAL);
64pub const EQUALVERIFY: Opcode = Operation(OP_EQUALVERIFY);
65pub const _1ADD: Opcode = Operation(OP_1ADD);
66pub const _1SUB: Opcode = Operation(OP_1SUB);
67pub const NEGATE: Opcode = Operation(OP_NEGATE);
68pub const ABS: Opcode = Operation(OP_ABS);
69pub const NOT: Opcode = Operation(OP_NOT);
70pub const _0NOTEQUAL: Opcode = Operation(OP_0NOTEQUAL);
71pub const ADD: Opcode = Operation(OP_ADD);
72pub const SUB: Opcode = Operation(OP_SUB);
73pub const BOOLAND: Opcode = Operation(OP_BOOLAND);
74pub const BOOLOR: Opcode = Operation(OP_BOOLOR);
75pub const NUMEQUAL: Opcode = Operation(OP_NUMEQUAL);
76pub const NUMEQUALVERIFY: Opcode = Operation(OP_NUMEQUALVERIFY);
77pub const NUMNOTEQUAL: Opcode = Operation(OP_NUMNOTEQUAL);
78pub const LESSTHAN: Opcode = Operation(OP_LESSTHAN);
79pub const GREATERTHAN: Opcode = Operation(OP_GREATERTHAN);
80pub const LESSTHANOREQUAL: Opcode = Operation(OP_LESSTHANOREQUAL);
81pub const GREATERTHANOREQUAL: Opcode = Operation(OP_GREATERTHANOREQUAL);
82pub const MIN: Opcode = Operation(OP_MIN);
83pub const MAX: Opcode = Operation(OP_MAX);
84pub const WITHIN: Opcode = Operation(OP_WITHIN);
85pub const RIPEMD160: Opcode = Operation(OP_RIPEMD160);
86pub const SHA1: Opcode = Operation(OP_SHA1);
87pub const SHA256: Opcode = Operation(OP_SHA256);
88pub const HASH160: Opcode = Operation(OP_HASH160);
89pub const HASH256: Opcode = Operation(OP_HASH256);
90pub const CHECKSIG: Opcode = Operation(OP_CHECKSIG);
91pub const CHECKSIGVERIFY: Opcode = Operation(OP_CHECKSIGVERIFY);
92pub const CHECKMULTISIG: Opcode = Operation(OP_CHECKMULTISIG);
93pub const CHECKMULTISIGVERIFY: Opcode = Operation(OP_CHECKMULTISIGVERIFY);
94pub const NOP1: Opcode = Operation(OP_NOP1);
95pub const CHECKLOCKTIMEVERIFY: Opcode = Operation(OP_CHECKLOCKTIMEVERIFY);
96pub const NOP3: Opcode = Operation(OP_NOP3);
97pub const NOP4: Opcode = Operation(OP_NOP4);
98pub const NOP5: Opcode = Operation(OP_NOP5);
99pub const NOP6: Opcode = Operation(OP_NOP6);
100pub const NOP7: Opcode = Operation(OP_NOP7);
101pub const NOP8: Opcode = Operation(OP_NOP8);
102pub const NOP9: Opcode = Operation(OP_NOP9);
103pub const NOP10: Opcode = Operation(OP_NOP10);