Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-checkdatasig-activation.py
Show All 40 Lines | def create_checkdatasig_tx(self, count): | ||||
node = self.nodes[0] | node = self.nodes[0] | ||||
utxos = node.listunspent() | utxos = node.listunspent() | ||||
assert(len(utxos) > 0) | assert(len(utxos) > 0) | ||||
utxo = utxos[0] | utxo = utxos[0] | ||||
tx = CTransaction() | tx = CTransaction() | ||||
value = int(satoshi_round(utxo["amount"]) * COIN) // count | value = int(satoshi_round(utxo["amount"]) * COIN) // count | ||||
tx.vin = [CTxIn(COutPoint(int(utxo["txid"], 16), utxo["vout"]))] | tx.vin = [CTxIn(COutPoint(int(utxo["txid"], 16), utxo["vout"]))] | ||||
tx.vout = [] | tx.vout = [] | ||||
signature = bytearray.fromhex( | signature = bytearray() | ||||
'30440220052a549456efe256a8c190650648e7ebdd46161f330830733fc7c674aeb7d3da0220519999b4f25b37de557a9c909cb5b155d1f0b11293b0890236696bfa0bd310e1') | message = bytearray.fromhex('00') | ||||
message = bytearray.fromhex( | |||||
'0100000000000000000000000000000000000000000000000000000000000000') | |||||
pubkey = bytearray.fromhex( | pubkey = bytearray.fromhex( | ||||
'038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508') | '038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508') | ||||
for _ in range(count): | for _ in range(count): | ||||
tx.vout.append(CTxOut(value, CScript( | tx.vout.append(CTxOut(value, CScript( | ||||
[signature, message, pubkey, OP_CHECKDATASIG]))) | [signature, message, pubkey, OP_CHECKDATASIG, OP_NOT]))) | ||||
schancel: Not sure about this fix. It looks like you intentionally NULLDUMMY the fail, and then OP_NOT… | |||||
MengerianUnsubmitted Not Done Inline ActionsYeah, looks like it calls it in way that we can easily see that the opcode is called and should return FALSE. So test that the opcode is activated, but not whether it works properly for checking various signatures. Mengerian: Yeah, looks like it calls it in way that we can easily see that the opcode is called and should… | |||||
tx.vout[0].nValue -= node.calculate_fee(tx) | tx.vout[0].nValue -= node.calculate_fee(tx) | ||||
tx_signed = node.signrawtransaction(ToHex(tx))["hex"] | tx_signed = node.signrawtransaction(ToHex(tx))["hex"] | ||||
return tx_signed | return tx_signed | ||||
def run_test(self): | def run_test(self): | ||||
self.test = TestManager(self, self.options.tmpdir) | self.test = TestManager(self, self.options.tmpdir) | ||||
self.test.add_all_connections(self.nodes) | self.test.add_all_connections(self.nodes) | ||||
# Start up network handling in another thread | # Start up network handling in another thread | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |
Not sure about this fix. It looks like you intentionally NULLDUMMY the fail, and then OP_NOT it. However, that doesn't check that the signature was verified correctly? Are we asserting that the unit test does that instead?