MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / decode_op_n

Method decode_op_n

qa/rpc-tests/test_framework/script.py:68–76  ·  view source on GitHub ↗

Decode a small integer opcode, returning an integer

(self)

Source from the content-addressed store, hash-verified

66 return CScriptOp(OP_1 + n-1)
67
68 def decode_op_n(self):
69 """Decode a small integer opcode, returning an integer"""
70 if self == OP_0:
71 return 0
72
73 if not (self == OP_0 or OP_1 <= self <= OP_16):
74 raise ValueError('op %r is not an OP_N' % self)
75
76 return int(self - OP_1+1)
77
78 def is_small_int(self):
79 """Return true if the op pushes a small integer to the stack"""

Callers 2

__iter__Method · 0.95
GetSigOpCountMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected