Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_fundrawtransaction.py
Show First 20 Lines • Show All 240 Lines • ▼ Show 20 Lines | def test_invalid_change_address(self): | ||||
inputs = [{'txid': utx['txid'], 'vout': utx['vout']}] | inputs = [{'txid': utx['txid'], 'vout': utx['vout']}] | ||||
outputs = {self.nodes[0].getnewaddress(): Decimal(4000000)} | outputs = {self.nodes[0].getnewaddress(): Decimal(4000000)} | ||||
rawTx = self.nodes[2].createrawtransaction(inputs, outputs) | rawTx = self.nodes[2].createrawtransaction(inputs, outputs) | ||||
dec_tx = self.nodes[2].decoderawtransaction(rawTx) | dec_tx = self.nodes[2].decoderawtransaction(rawTx) | ||||
assert_equal(utx['txid'], dec_tx['vin'][0]['txid']) | assert_equal(utx['txid'], dec_tx['vin'][0]['txid']) | ||||
assert_raises_rpc_error( | assert_raises_rpc_error( | ||||
-5, "changeAddress must be a valid bitcoin address", | -5, "Change address must be a valid bitcoin address", | ||||
self.nodes[2].fundrawtransaction, rawTx, {'changeAddress': 'foobar'}) | self.nodes[2].fundrawtransaction, rawTx, {'changeAddress': 'foobar'}) | ||||
def test_valid_change_address(self): | def test_valid_change_address(self): | ||||
self.log.info("Test fundrawtxn with a provided change address") | self.log.info("Test fundrawtxn with a provided change address") | ||||
utx = get_unspent(self.nodes[2].listunspent(), 5000000) | utx = get_unspent(self.nodes[2].listunspent(), 5000000) | ||||
inputs = [{'txid': utx['txid'], 'vout': utx['vout']}] | inputs = [{'txid': utx['txid'], 'vout': utx['vout']}] | ||||
outputs = {self.nodes[0].getnewaddress(): Decimal(4000000)} | outputs = {self.nodes[0].getnewaddress(): Decimal(4000000)} | ||||
▲ Show 20 Lines • Show All 607 Lines • Show Last 20 Lines |