Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_rawtransaction.py
Show First 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
inputs = [ | inputs = [ | ||||
{'txid': "1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000", 'vout': 1}] | {'txid': "1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000", 'vout': 1}] | ||||
outputs = {self.nodes[0].getnewaddress(): 4.998} | outputs = {self.nodes[0].getnewaddress(): 4.998} | ||||
rawtx = self.nodes[2].createrawtransaction(inputs, outputs) | rawtx = self.nodes[2].createrawtransaction(inputs, outputs) | ||||
rawtx = pad_raw_tx(rawtx) | rawtx = pad_raw_tx(rawtx) | ||||
rawtx = self.nodes[2].signrawtransactionwithwallet(rawtx) | rawtx = self.nodes[2].signrawtransactionwithwallet(rawtx) | ||||
# This will raise an exception since there are missing inputs | # This will raise an exception since there are missing inputs | ||||
assert_raises_rpc_error( | assert_raises_rpc_error(-25, | ||||
-25, "Missing inputs", self.nodes[2].sendrawtransaction, rawtx['hex']) | "bad-txns-inputs-missingorspent", | ||||
self.nodes[2].sendrawtransaction, | |||||
rawtx['hex']) | |||||
##################################### | ##################################### | ||||
# getrawtransaction with block hash # | # getrawtransaction with block hash # | ||||
##################################### | ##################################### | ||||
# make a tx by sending then generate 2 blocks; block1 has the tx in it | # make a tx by sending then generate 2 blocks; block1 has the tx in it | ||||
tx = self.nodes[2].sendtoaddress(self.nodes[1].getnewaddress(), 1) | tx = self.nodes[2].sendtoaddress(self.nodes[1].getnewaddress(), 1) | ||||
block1, block2 = self.nodes[2].generate(2) | block1, block2 = self.nodes[2].generate(2) | ||||
▲ Show 20 Lines • Show All 372 Lines • Show Last 20 Lines |