Changeset View
Changeset View
Standalone View
Standalone View
test/functional/nulldummy.py
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
self.log.info( | self.log.info( | ||||
"Test 3: Non-NULLDUMMY base transactions should be accepted in a block before activation [431]") | "Test 3: Non-NULLDUMMY base transactions should be accepted in a block before activation [431]") | ||||
self.block_submit(self.nodes[0], [test2tx], True) | self.block_submit(self.nodes[0], [test2tx], True) | ||||
def create_transaction(self, node, txid, to_address, amount): | def create_transaction(self, node, txid, to_address, amount): | ||||
inputs = [{"txid": txid, "vout": 0}] | inputs = [{"txid": txid, "vout": 0}] | ||||
outputs = {to_address: amount} | outputs = {to_address: amount} | ||||
rawtx = node.createrawtransaction(inputs, outputs) | rawtx = node.createrawtransaction(inputs, outputs) | ||||
signresult = node.signrawtransaction(rawtx) | signresult = node.signrawtransactionwithwallet(rawtx) | ||||
tx = CTransaction() | tx = CTransaction() | ||||
f = BytesIO(hex_str_to_bytes(signresult['hex'])) | f = BytesIO(hex_str_to_bytes(signresult['hex'])) | ||||
tx.deserialize(f) | tx.deserialize(f) | ||||
return tx | return tx | ||||
def block_submit(self, node, txs, accept=False): | def block_submit(self, node, txs, accept=False): | ||||
block = create_block(self.tip, create_coinbase( | block = create_block(self.tip, create_coinbase( | ||||
self.lastblockheight + 1), self.lastblocktime + 1) | self.lastblockheight + 1), self.lastblocktime + 1) | ||||
Show All 22 Lines |