| 10 | #include <string> |
| 11 | |
| 12 | std::string GetOpName(opcodetype opcode) |
| 13 | { |
| 14 | switch (opcode) |
| 15 | { |
| 16 | // push value |
| 17 | case OP_0 : return "0"; |
| 18 | case OP_PUSHDATA1 : return "OP_PUSHDATA1"; |
| 19 | case OP_PUSHDATA2 : return "OP_PUSHDATA2"; |
| 20 | case OP_PUSHDATA4 : return "OP_PUSHDATA4"; |
| 21 | case OP_1NEGATE : return "-1"; |
| 22 | case OP_RESERVED : return "OP_RESERVED"; |
| 23 | case OP_1 : return "1"; |
| 24 | case OP_2 : return "2"; |
| 25 | case OP_3 : return "3"; |
| 26 | case OP_4 : return "4"; |
| 27 | case OP_5 : return "5"; |
| 28 | case OP_6 : return "6"; |
| 29 | case OP_7 : return "7"; |
| 30 | case OP_8 : return "8"; |
| 31 | case OP_9 : return "9"; |
| 32 | case OP_10 : return "10"; |
| 33 | case OP_11 : return "11"; |
| 34 | case OP_12 : return "12"; |
| 35 | case OP_13 : return "13"; |
| 36 | case OP_14 : return "14"; |
| 37 | case OP_15 : return "15"; |
| 38 | case OP_16 : return "16"; |
| 39 | |
| 40 | // control |
| 41 | case OP_NOP : return "OP_NOP"; |
| 42 | case OP_VER : return "OP_VER"; |
| 43 | case OP_IF : return "OP_IF"; |
| 44 | case OP_NOTIF : return "OP_NOTIF"; |
| 45 | case OP_VERIF : return "OP_VERIF"; |
| 46 | case OP_VERNOTIF : return "OP_VERNOTIF"; |
| 47 | case OP_ELSE : return "OP_ELSE"; |
| 48 | case OP_ENDIF : return "OP_ENDIF"; |
| 49 | case OP_VERIFY : return "OP_VERIFY"; |
| 50 | case OP_RETURN : return "OP_RETURN"; |
| 51 | |
| 52 | // stack ops |
| 53 | case OP_TOALTSTACK : return "OP_TOALTSTACK"; |
| 54 | case OP_FROMALTSTACK : return "OP_FROMALTSTACK"; |
| 55 | case OP_2DROP : return "OP_2DROP"; |
| 56 | case OP_2DUP : return "OP_2DUP"; |
| 57 | case OP_3DUP : return "OP_3DUP"; |
| 58 | case OP_2OVER : return "OP_2OVER"; |
| 59 | case OP_2ROT : return "OP_2ROT"; |
| 60 | case OP_2SWAP : return "OP_2SWAP"; |
| 61 | case OP_IFDUP : return "OP_IFDUP"; |
| 62 | case OP_DEPTH : return "OP_DEPTH"; |
| 63 | case OP_DROP : return "OP_DROP"; |
| 64 | case OP_DUP : return "OP_DUP"; |
| 65 | case OP_NIP : return "OP_NIP"; |
| 66 | case OP_OVER : return "OP_OVER"; |
| 67 | case OP_PICK : return "OP_PICK"; |
| 68 | case OP_ROLL : return "OP_ROLL"; |
| 69 | case OP_ROT : return "OP_ROT"; |
no outgoing calls