0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-15 11:36:00 -05:00
bitcoin-bitcoin-core/src/wallet/test
Ryan Ofsky a23cca56c0 refactor: Replace BResult with util::Result
Rename `BResult` class to `util::Result` and update the class interface to be
more compatible with `std::optional` and with a full-featured result class
implemented in https://github.com/bitcoin/bitcoin/pull/25665. Motivation for
this change is to update existing `BResult` usages now so they don't have to
change later when more features are added in #25665.

This change makes the following improvements originally implemented in #25665:

- More explicit API. Drops potentially misleading `BResult` constructor that
  treats any bilingual string argument as an error. Adds `util::Error`
  constructor so it is never ambiguous when a result is being assigned an error
  or non-error value.

- Better type compatibility. Supports `util::Result<bilingual_str>` return
  values to hold translated messages which are not errors.

- More standard and consistent API. `util::Result` supports most of the same
  operators and methods as `std::optional`. `BResult` had a less familiar
  interface with `HasRes`/`GetObj`/`ReleaseObj` methods. The Result/Res/Obj
  naming was also not internally consistent.

- Better code organization. Puts `src/util/` code in the `util::` namespace so
  naming reflects code organization and it is obvious where the class is coming
  from. Drops "B" from name because it is undocumented what it stands for
  (bilingual?)

- Has unit tests.
2022-08-03 07:33:01 -04:00
..
fuzz refactor: Replace BResult with util::Result 2022-08-03 07:33:01 -04:00
availablecoins_tests.cpp refactor: Replace BResult with util::Result 2022-08-03 07:33:01 -04:00
coinselector_tests.cpp refactor: Replace BResult with util::Result 2022-08-03 07:33:01 -04:00
db_tests.cpp Disallow more unsafe string->path conversions allowed by path append operators 2022-04-21 12:01:00 -05:00
init_test_fixture.cpp Disallow more unsafe string->path conversions allowed by path append operators 2022-04-21 12:01:00 -05:00
init_test_fixture.h Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
init_tests.cpp Replace use of ArgsManager with DatabaseOptions 2022-03-16 08:26:28 +01:00
ismine_tests.cpp Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
psbt_wallet_tests.cpp doc: Delete old line of code that was commented out 2022-03-16 19:33:52 +00:00
scriptpubkeyman_tests.cpp Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
spend_tests.cpp refactor: Replace BResult with util::Result 2022-08-03 07:33:01 -04:00
util.cpp wallet: Save wallet scan progress 2022-06-23 17:13:40 -03:00
util.h Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
wallet_crypto_tests.cpp refactor: use Span in random.* 2022-03-23 17:36:33 -05:00
wallet_test_fixture.cpp wallet: move Assert() check into constructor 2022-03-30 17:07:28 +10:00
wallet_test_fixture.h wallet: move Assert() check into constructor 2022-03-30 17:07:28 +10:00
wallet_tests.cpp refactor: Replace BResult with util::Result 2022-08-03 07:33:01 -04:00
wallet_transaction_tests.cpp Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
walletdb_tests.cpp Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00