Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_dersig.py
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
self.nodeaddress, amount=1.0) | self.nodeaddress, amount=1.0) | ||||
unDERify(spendtx) | unDERify(spendtx) | ||||
spendtx.rehash() | spendtx.rehash() | ||||
# First we show that this tx is valid except for DERSIG by getting it | # First we show that this tx is valid except for DERSIG by getting it | ||||
# rejected from the mempool for exactly that reason. | # rejected from the mempool for exactly that reason. | ||||
assert_equal( | assert_equal( | ||||
[{'txid': spendtx.hash, 'allowed': False, | [{'txid': spendtx.hash, 'allowed': False, | ||||
'reject-reason': '16: mandatory-script-verify-flag-failed (Non-canonical DER signature)'}], | 'reject-reason': 'mandatory-script-verify-flag-failed (Non-canonical DER signature)'}], | ||||
self.nodes[0].testmempoolaccept( | self.nodes[0].testmempoolaccept( | ||||
rawtxs=[spendtx.serialize().hex()], maxfeerate=0) | rawtxs=[spendtx.serialize().hex()], maxfeerate=0) | ||||
) | ) | ||||
# Now we verify that a block with this transaction is also invalid. | # Now we verify that a block with this transaction is also invalid. | ||||
block.vtx.append(spendtx) | block.vtx.append(spendtx) | ||||
block.hashMerkleRoot = block.calc_merkle_root() | block.hashMerkleRoot = block.calc_merkle_root() | ||||
block.rehash() | block.rehash() | ||||
Show All 21 Lines |