MCPcopy Create free account
hub / github.com/ElementsProject/elements / test_notmine_bumpfee_fails

Function test_notmine_bumpfee_fails

test/functional/wallet_bumpfee.py:238–258  ·  view source on GitHub ↗
(self, rbf_node, peer_node, dest_address)

Source from the content-addressed store, hash-verified

236
237
238def test_notmine_bumpfee_fails(self, rbf_node, peer_node, dest_address):
239 self.log.info('Test that it cannot bump fee if non-owned inputs are included')
240 # here, the rbftx has a peer_node coin and then adds a rbf_node input
241 # Note that this test depends upon the RPC code checking input ownership prior to change outputs
242 # (since it can't use fundrawtransaction, it lacks a proper change output)
243 fee = Decimal("0.001")
244 utxos = [node.listunspent(query_options={'minimumAmount': fee})[-1] for node in (rbf_node, peer_node)]
245 inputs = [{
246 "txid": utxo["txid"],
247 "vout": utxo["vout"],
248 "address": utxo["address"],
249 "sequence": BIP125_SEQUENCE_NUMBER
250 } for utxo in utxos]
251 output_val = sum(utxo["amount"] for utxo in utxos) - fee
252 rawtx = rbf_node.createrawtransaction(inputs, [{dest_address: output_val}, {"fee": fee}])
253 signedtx = rbf_node.signrawtransactionwithwallet(rawtx)
254 signedtx = peer_node.signrawtransactionwithwallet(signedtx["hex"])
255 rbfid = rbf_node.sendrawtransaction(signedtx["hex"])
256 assert_raises_rpc_error(-4, "Transaction contains inputs that don't belong to this wallet",
257 rbf_node.bumpfee, rbfid)
258 self.clear_mempool()
259
260
261def test_bumpfee_with_descendant_fails(self, rbf_node, rbf_node_address, dest_address):

Callers 1

run_testMethod · 0.70

Calls 4

assert_raises_rpc_errorFunction · 0.90
infoMethod · 0.80
sendrawtransactionMethod · 0.80
clear_mempoolMethod · 0.80

Tested by

no test coverage detected