Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_csv_activation.py
Show First 20 Lines • Show All 128 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 spend_tx(self, node, prev_tx): | def spend_tx(self, node, prev_tx): | ||||
spendtx = self.create_transaction( | spendtx = self.create_transaction( | ||||
node, prev_tx.hash, self.nodeaddress, (prev_tx.vout[0].nValue - 1000) / COIN) | node, prev_tx.hash, self.nodeaddress, (prev_tx.vout[0].nValue - 1000) / COIN) | ||||
spendtx.nVersion = prev_tx.nVersion | spendtx.nVersion = prev_tx.nVersion | ||||
spendtx.rehash() | spendtx.rehash() | ||||
▲ Show 20 Lines • Show All 559 Lines • Show Last 20 Lines |