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
- Branch
- avalanche_addcoin_tests
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 18810 Build 37411: Build Diff lint-circular-dependencies · build-without-wallet · build-debug · build-diff · build-clang · build-clang-tidy Build 37410: arc lint + arc unit
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 |