Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/script.py
Show First 20 Lines • Show All 682 Lines • ▼ Show 20 Lines | def SignatureHash(script, txTo, inIdx, hashtype): | ||||
s += struct.pack(b"<I", hashtype) | s += struct.pack(b"<I", hashtype) | ||||
hash = hash256(s) | hash = hash256(s) | ||||
return (hash, None) | return (hash, None) | ||||
# TODO: Allow cached hashPrevouts/hashSequence/hashOutputs to be provided. | # TODO: Allow cached hashPrevouts/hashSequence/hashOutputs to be provided. | ||||
# Performance optimization probably not necessary for python tests, however. | # Performance optimization probably not necessary for python tests, however. | ||||
# Note that this corresponds to sigversion == 1 in EvalScript, which is used | |||||
# for version 0 witnesses. | |||||
def SignatureHashForkId(script, txTo, inIdx, hashtype, amount): | def SignatureHashForkId(script, txTo, inIdx, hashtype, amount): | ||||
hashPrevouts = 0 | hashPrevouts = 0 | ||||
hashSequence = 0 | hashSequence = 0 | ||||
hashOutputs = 0 | hashOutputs = 0 | ||||
if not (hashtype & SIGHASH_ANYONECANPAY): | if not (hashtype & SIGHASH_ANYONECANPAY): | ||||
Show All 33 Lines |