aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/test/spend_tests.cpp
AgeCommit message (Collapse)Author
2022-08-16refactor: Add lock annotations to Active* methodsMacroFake
This is a refactor, putting the burden to think about thread safety to the caller. Otherwise, there is a risk that the caller will assume thread safety where none exists, as is evident in the previous two commits.
2022-08-03refactor: Replace BResult with util::ResultRyan Ofsky
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-07-08send: refactor CreateTransaction flow to return a BResult<CTransactionRef>furszy
2022-07-08wallet: refactor, include 'FeeCalculation' inside 'CreatedTransactionResult'furszy
2022-05-16wallet: CreateTransaction(): return out-params as (optional) structSebastian Falbesoner
2022-01-24wallet: Allow user specified input size to overrideAndrew Chow
If the user specifies an input size, allow it to override any input size calculations during coin selection.
2022-01-06Add src/wallet/* code to wallet:: namespaceRussell Yanofsky
2021-11-09Remove `gArgs` from `wallet.h` and `wallet.cpp`Kiminuo
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
2021-10-15tests: Use legacy change type in subtract fee from outputs testAndrew Chow
The subtract fee from outputs assumes that the leftover input amount will be dropped to fees. However this only happens if that amount is less than the cost of change. In the event that it is higher than the cost of change, the leftover amount will actually become a change output. To avoid this scenario, force a change type which has a high cost of change.
2021-09-30[MOVEONLY] consensus: move amount.h into consensusfanquake
Move amount.h to consensus/amount.h. Renames, adds missing and removes uneeded includes.
2021-09-01refactor: Detach wallet transaction methods (followup for move-only)Russell Yanofsky
Followup to commit "MOVEONLY: CWallet transaction code out of wallet.cpp/.h" that detaches and renames some CWalletTx methods, making into them into standalone functions or CWallet methods instead. There are no changes in behavior and no code changes that aren't purely mechanical. It just gives spend and receive functions more consistent names and removes the circular dependencies added by the earlier MOVEONLY commit. There are also no comment or documentation changes. Removed comments from transaction.h are just migrated to spend.h, receive.h, and wallet.h.
2021-08-04[docs] Add release notes for #21528Amiti Uttarwar
And fix a typo in the test.
2021-06-12wallet test: Add test for subtract fee from recipient behaviorRussell Yanofsky
Behavior might have recently changed in #17331 (it is not clear) but not noticed because there is no test coverage. This adds test coverage for current subtract from recipient behavior without changing it. Co-authored-by: Andrew Chow <achow101-github@achow101.com>