Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_dersig.py
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
assert_equal(self.nodes[0].getbestblockhash(), tip) | assert_equal(self.nodes[0].getbestblockhash(), tip) | ||||
self.nodes[0].p2p.sync_with_ping() | self.nodes[0].p2p.sync_with_ping() | ||||
self.log.info( | self.log.info( | ||||
"Test that transactions with non-DER signatures cannot appear in a block") | "Test that transactions with non-DER signatures cannot appear in a block") | ||||
block.nVersion = 3 | block.nVersion = 3 | ||||
spendtx = create_transaction(self.nodes[0], self.coinbase_txids[1], | spendtx = create_transaction(self.nodes[0], self.coinbase_txids[1], | ||||
self.nodeaddress, amount=1.0) | self.nodeaddress, amount=1000000) | ||||
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': 'mandatory-script-verify-flag-failed (Non-canonical DER signature)'}], | 'reject-reason': 'mandatory-script-verify-flag-failed (Non-canonical DER signature)'}], | ||||
Show All 29 Lines |