MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / decode_op_n

Method decode_op_n

bitcoin/core/script.py:64–72  ·  view source on GitHub ↗

Decode a small integer opcode, returning an integer

(self)

Source from the content-addressed store, hash-verified

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

Callers 4

__iter__Method · 0.95
GetSigOpCountMethod · 0.80
tMethod · 0.80

Calls

no outgoing calls

Tested by 2

tMethod · 0.64