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

Function test_simple_bumpfee_succeeds

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

Source from the content-addressed store, hash-verified

161
162
163def test_simple_bumpfee_succeeds(self, mode, rbf_node, peer_node, dest_address):
164 self.log.info('Test simple bumpfee: {}'.format(mode))
165 rbfid = spend_one_input(rbf_node, dest_address)
166 rbftx = rbf_node.gettransaction(rbfid)
167 self.sync_mempools((rbf_node, peer_node))
168 assert rbfid in rbf_node.getrawmempool() and rbfid in peer_node.getrawmempool()
169 if mode == "fee_rate":
170 bumped_psbt = rbf_node.psbtbumpfee(rbfid, {"fee_rate": str(NORMAL)})
171 bumped_tx = rbf_node.bumpfee(rbfid, {"fee_rate": NORMAL})
172 else:
173 bumped_psbt = rbf_node.psbtbumpfee(rbfid)
174 bumped_tx = rbf_node.bumpfee(rbfid)
175 assert_equal(bumped_tx["errors"], [])
176 assert bumped_tx["fee"] > -rbftx["fee"]['bitcoin']
177 assert_equal(bumped_tx["origfee"], -rbftx["fee"]['bitcoin'])
178 assert "psbt" not in bumped_tx
179 assert_equal(bumped_psbt["errors"], [])
180 assert bumped_psbt["fee"] > -rbftx["fee"]['bitcoin']
181 assert_equal(bumped_psbt["origfee"], -rbftx["fee"]['bitcoin'])
182 assert "psbt" in bumped_psbt
183 # check that bumped_tx propagates, original tx was evicted and has a wallet conflict
184 self.sync_mempools((rbf_node, peer_node))
185 assert bumped_tx["txid"] in rbf_node.getrawmempool()
186 assert bumped_tx["txid"] in peer_node.getrawmempool()
187 assert rbfid not in rbf_node.getrawmempool()
188 assert rbfid not in peer_node.getrawmempool()
189 oldwtx = rbf_node.gettransaction(rbfid)
190 assert len(oldwtx["walletconflicts"]) > 0
191 # check wallet transaction replaces and replaced_by values
192 bumpedwtx = rbf_node.gettransaction(bumped_tx["txid"])
193 assert_equal(oldwtx["replaced_by_txid"], bumped_tx["txid"])
194 assert_equal(bumpedwtx["replaces_txid"], rbfid)
195 self.clear_mempool()
196
197
198def test_segwit_bumpfee_succeeds(self, rbf_node, dest_address):

Callers 1

run_testMethod · 0.70

Calls 6

assert_equalFunction · 0.90
infoMethod · 0.80
formatMethod · 0.80
sync_mempoolsMethod · 0.80
clear_mempoolMethod · 0.80
spend_one_inputFunction · 0.70

Tested by

no test coverage detected