This PR enables one more of the non-wallet functional tests (feature_dbcrash.py) to be run even with the Bitcoin Code wallet by using the MiniWallet instead, as proposed in #20078.
test: use MiniWallet for feature_dbcrash.py #25087
pull theStack wants to merge 1 commits into bitcoin:master from theStack:202205-test-use_MiniWallet_for_feature_dbcrash changing 2 files +34 −28-
theStack commented at 10:54 PM on May 8, 2022: member
- theStack force-pushed on May 8, 2022
- DrahtBot added the label Tests on May 9, 2022
- ayush933 approved
-
ayush933 commented at 12:48 PM on May 16, 2022: contributor
tACK aa9fab1.
-
in test/functional/feature_dbcrash.py:202 in aa9fab18d1 outdated
211 | 212 | - # Sign and send the transaction to get into the mempool 213 | - tx_signed_hex = node.signrawtransactionwithwallet(tx.serialize().hex())['hex'] 214 | - node.sendrawtransaction(tx_signed_hex) 215 | + # Send the transaction to get into the mempool 216 | + node.sendrawtransaction(tx.serialize().hex(), 0)
MarcoFalke commented at 3:11 PM on May 16, 2022:What about setting this to
0by default for MiniWallet?
MarcoFalke commented at 3:15 PM on May 16, 2022:Also, it seems confusing that this needs to be set at all. Why would a fee of
1000sat be ever too high?
theStack commented at 3:58 PM on May 19, 2022:maxfeerate=0is set here only for performance reasons, to skip this part in the course of thesendrawtransactionRPC: https://github.com/bitcoin/bitcoin/blob/0de36941eca1bff91420dd878eb097db2b1a596c/src/node/transaction.cpp#L71-L80With the fee-check enabled, the iterations take about twice as long (~2mins instead of ~1min on my machine). Added a comment to clarify.
in test/functional/feature_dbcrash.py:264 in aa9fab18d1 outdated
262 | self.log.debug(f"Syncing {len(block_hashes)} new blocks...") 263 | self.sync_node3blocks(block_hashes) 264 | - utxo_list = self.nodes[3].listunspent() 265 | - self.log.debug(f"Node3 utxo count: {len(utxo_list)}") 266 | + self.wallet.rescan_utxos() 267 | + utxo_list = self.wallet._utxos
MarcoFalke commented at 3:23 PM on May 16, 2022:Not sure about using the private member here. What about
def get_utxos(self, *, mark_as_spent=True): return copy.copy(self._utxos)or so?
theStack commented at 3:59 PM on May 19, 2022:Agree, accessing private members should be avoided. Thanks, done.
MarcoFalke approvedMarcoFalke commented at 3:23 PM on May 16, 2022: memberlgtm
1da5e45725test: use MiniWallet for feature_dbcrash.py
This test can now be run even with the Bitcoin Core wallet disabled.
theStack force-pushed on May 19, 2022theStack commented at 4:00 PM on May 19, 2022: memberForce-pushed with suggestions from MarcoFalke (https://github.com/bitcoin/bitcoin/pull/25087#discussion_r873860561, #25087 (review)) taken into account.
laanwj referenced this in commit 6db7fbd812 on May 31, 2022laanwj commented at 2:13 PM on June 1, 2022: memberCode review ACK 1da5e45725a49a867f7ce16fb37b138ad329d132
brunoerg approvedbrunoerg commented at 2:17 PM on June 1, 2022: membercrACK 1da5e45725a49a867f7ce16fb37b138ad329d132
MarcoFalke merged this on Jun 1, 2022MarcoFalke closed this on Jun 1, 2022theStack deleted the branch on Jun 1, 2022sidhujag referenced this in commit a7ad5d6dfa on Jun 1, 2022MarcoFalke referenced this in commit 1c7ef0abd1 on Jun 1, 2022sidhujag referenced this in commit 72ad43cbf4 on Jun 2, 2022MarcoFalke referenced this in commit 4c0d1fec16 on Jun 15, 2022sidhujag referenced this in commit 1630aae6a4 on Jun 15, 2022MarcoFalke locked this on Oct 11, 2022fanquake deleted a comment on Oct 11, 2022
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:13 UTC
More mirrored repositories can be found on mirror.b10c.me