MCPcopy Create free account
hub / github.com/LUX-Core/lux / encode_op_n

Method encode_op_n

test/functional/test_framework/script.py:56–64  ·  view source on GitHub ↗

Encode a small integer op, returning an opcode

(n)

Source from the content-addressed store, hash-verified

54
55 @staticmethod
56 def encode_op_n(n):
57 """Encode a small integer op, returning an opcode"""
58 if not (0 <= n <= 16):
59 raise ValueError('Integer must be in range 0 <= n <= 16, got %d' % n)
60
61 if n == 0:
62 return OP_0
63 else:
64 return CScriptOp(OP_1 + n-1)
65
66 def decode_op_n(self):
67 """Decode a small integer opcode, returning an integer"""

Callers 1

__coerce_instanceMethod · 0.45

Calls 1

CScriptOpClass · 0.70

Tested by

no test coverage detected