MCPcopy Index your code
hub / github.com/jimmysong/programmingbitcoin / is_p2sh_script_pubkey

Method is_p2sh_script_pubkey

code-ch08/script.py:204–209  ·  view source on GitHub ↗

Returns whether this follows the OP_HASH160 <20 byte hash> OP_EQUAL pattern.

(self)

Source from the content-addressed store, hash-verified

202 and self.cmds[3] == 0x88 and self.cmds[4] == 0xac
203
204 def is_p2sh_script_pubkey(self):
205 ''&#x27;Returns whether this follows the
206 OP_HASH160 <20 byte hash> OP_EQUAL pattern.''&#x27;
207 return len(self.cmds) == 3 and self.cmds[0] == 0xa9 \
208 and type(self.cmds[1]) == bytes and len(self.cmds[1]) == 20 \
209 and self.cmds[2] == 0x87
210
211
212class ScriptTest(TestCase):

Callers 1

verify_inputFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected