Refactor OpCodes.
This commit is contained in:
parent
e390509946
commit
b1f5be083c
@ -37,6 +37,9 @@ from .chainparams import (
|
||||
chainparams,
|
||||
Coins,
|
||||
)
|
||||
from .script import (
|
||||
OpCodes,
|
||||
)
|
||||
from .messages_pb2 import (
|
||||
OfferMessage,
|
||||
BidMessage,
|
||||
@ -107,25 +110,6 @@ class TxStates(IntEnum):
|
||||
TX_REFUNDED = auto()
|
||||
|
||||
|
||||
class OpCodes(IntEnum):
|
||||
OP_0 = 0x00,
|
||||
OP_PUSHDATA1 = 0x4c,
|
||||
OP_1 = 0x51,
|
||||
OP_IF = 0x63,
|
||||
OP_ELSE = 0x67,
|
||||
OP_ENDIF = 0x68,
|
||||
OP_DROP = 0x75,
|
||||
OP_DUP = 0x76,
|
||||
OP_SIZE = 0x82,
|
||||
OP_EQUAL = 0x87,
|
||||
OP_EQUALVERIFY = 0x88,
|
||||
OP_SHA256 = 0xa8,
|
||||
OP_HASH160 = 0xa9,
|
||||
OP_CHECKSIG = 0xac,
|
||||
OP_CHECKLOCKTIMEVERIFY = 0xb1,
|
||||
OP_CHECKSEQUENCEVERIFY = 0xb2,
|
||||
|
||||
|
||||
class TxTypes(IntEnum):
|
||||
ITX = auto()
|
||||
PTX = auto()
|
||||
|
25
basicswap/script.py
Normal file
25
basicswap/script.py
Normal file
@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (c) 2019 tecnovert
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
from enum import IntEnum, auto
|
||||
|
||||
class OpCodes(IntEnum):
|
||||
OP_0 = 0x00,
|
||||
OP_PUSHDATA1 = 0x4c,
|
||||
OP_1 = 0x51,
|
||||
OP_IF = 0x63,
|
||||
OP_ELSE = 0x67,
|
||||
OP_ENDIF = 0x68,
|
||||
OP_DROP = 0x75,
|
||||
OP_DUP = 0x76,
|
||||
OP_SIZE = 0x82,
|
||||
OP_EQUAL = 0x87,
|
||||
OP_EQUALVERIFY = 0x88,
|
||||
OP_SHA256 = 0xa8,
|
||||
OP_HASH160 = 0xa9,
|
||||
OP_CHECKSIG = 0xac,
|
||||
OP_CHECKLOCKTIMEVERIFY = 0xb1,
|
||||
OP_CHECKSEQUENCEVERIFY = 0xb2,
|
Loading…
Reference in New Issue
Block a user