MCPcopy Create free account
hub / github.com/ElementsProject/elements / encode_op_n

Method encode_op_n

test/functional/test_framework/script.py:73–81  ·  view source on GitHub ↗

Encode a small integer op, returning an opcode

(n)

Source from the content-addressed store, hash-verified

71
72 @staticmethod
73 def encode_op_n(n):
74 """Encode a small integer op, returning an opcode"""
75 if not (0 <= n <= 16):
76 raise ValueError('Integer must be in range 0 <= n <= 16, got %d' % n)
77
78 if n == 0:
79 return OP_0
80 else:
81 return CScriptOp(OP_1 + n - 1)
82
83 def decode_op_n(self):
84 """Decode a small integer opcode, returning an integer"""

Callers 4

mutateFunction · 0.45
__coerce_instanceMethod · 0.45
keys_to_multisig_scriptFunction · 0.45

Calls 1

CScriptOpClass · 0.70

Tested by

no test coverage detected