Changeset View
Changeset View
Standalone View
Standalone View
test/functional/nulldummy.py
Show All 38 Lines | |||||
''' | ''' | ||||
class NULLDUMMYTest(BitcoinTestFramework): | class NULLDUMMYTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.extra_args = [['-whitelist=127.0.0.1', | self.extra_args = [['-whitelist=127.0.0.1']] | ||||
"-deprecatedrpc=signrawtransaction"]] | |||||
def run_test(self): | def run_test(self): | ||||
self.address = self.nodes[0].getnewaddress() | self.address = self.nodes[0].getnewaddress() | ||||
self.ms_address = self.nodes[0].addmultisigaddress(1, [self.address]) | self.ms_address = self.nodes[0].addmultisigaddress(1, [self.address]) | ||||
NetworkThread().start() # Start up network handling in another thread | NetworkThread().start() # Start up network handling in another thread | ||||
self.coinbase_blocks = self.nodes[0].generate(2) # Block 2 | self.coinbase_blocks = self.nodes[0].generate(2) # Block 2 | ||||
coinbase_txid = [] | coinbase_txid = [] | ||||
Show All 28 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 |