These lambdas are used all over the tests, so make it a static function to maintain it in a single place and simplify the tests.
The amount and height values are updated when possible to make the code simpler by matching the default, allowing for complete removal at a later point in time.
Details
Details
- Reviewers
tyler-smith - Group Reviewers
Restricted Project - Commits
- rABC7c56166a882c: [avalanche] Simplify the peermanager tests by deduplicating the addCoin lambdas
ninja check-avalanche
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Add all the extra cases I was saving for a follow-up as it makes more sense to have them here
Comment Actions
The idea and implementation are great, but I have a minor bikeshed-nit about naming. I don't think that nit should hold up acceptance but is worth considering.
src/avalanche/test/peermanager_tests.cpp | ||
---|---|---|
72 ↗ | (On Diff #33207) | Should this be called something like addUtxo or createUtxo to be more clear about it creating and adding a new UTXO as opposed to simply retrieving an existing one? Reading the code using this function, especially when using defaults, makes it look like a simple lookup function. COutPoint utxo = getUtxo(key); Looks like it should get a UTXO owned by that key, or null/empty value. |
src/avalanche/test/peermanager_tests.cpp | ||
---|---|---|
72 ↗ | (On Diff #33207) | Renamed createUtxo |