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

Method script_pubkey

code-ch13/tx.py:461–469  ·  view source on GitHub ↗

Get the ScriptPubKey by looking up the tx hash Returns a Script object

(self, testnet=False)

Source from the content-addressed store, hash-verified

459 return tx.tx_outs[self.prev_index].amount
460
461 def script_pubkey(self, testnet=False):
462 '''Get the ScriptPubKey by looking up the tx hash
463 Returns a Script object
464 '''
465 # use self.fetch_tx to get the transaction
466 tx = self.fetch_tx(testnet=testnet)
467 # get the output at self.prev_index
468 # return the script_pubkey property
469 return tx.tx_outs[self.prev_index].script_pubkey
470
471
472class TxOut:

Callers 4

test_input_pubkeyMethod · 0.95
sig_hashMethod · 0.45
sig_hash_bip143Method · 0.45
verify_inputMethod · 0.45

Calls 1

fetch_txMethod · 0.95

Tested by 1

test_input_pubkeyMethod · 0.76