Changeset View
Changeset View
Standalone View
Standalone View
test/functional/bip68-112-113-p2p.py
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | 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) | ||||
tx = FromHex(CTransaction(), rawtx) | tx = FromHex(CTransaction(), rawtx) | ||||
return tx | return tx | ||||
def sign_transaction(self, node, unsignedtx): | def sign_transaction(self, node, unsignedtx): | ||||
rawtx = ToHex(unsignedtx) | rawtx = ToHex(unsignedtx) | ||||
signresult = node.signrawtransaction(rawtx) | signresult = node.signrawtransactionwithwallet(rawtx) | ||||
tx = FromHex(CTransaction(), signresult['hex']) | tx = FromHex(CTransaction(), signresult['hex']) | ||||
return tx | return tx | ||||
def generate_blocks(self, number): | def generate_blocks(self, number): | ||||
test_blocks = [] | test_blocks = [] | ||||
for i in range(number): | for i in range(number): | ||||
block = self.create_test_block([]) | block = self.create_test_block([]) | ||||
test_blocks.append([block, True]) | test_blocks.append([block, True]) | ||||
▲ Show 20 Lines • Show All 478 Lines • Show Last 20 Lines |