aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/test/fuzz/notifications.cpp
AgeCommit message (Collapse)Author
2024-04-25refactor: Drop util::Result operator=Ryan Ofsky
`util::Result` objects are aggregates that can hold multiple fields with different information. Currently Result objects can only hold a success value of an arbitrary type or a single bilingual_str error message. In followup PR https://github.com/bitcoin/bitcoin/pull/25722, Result objects may be able to hold both success and failure values of different types, plus error and warning messages. Having a Result::operator= assignment operator that completely erases all existing Result information before assigning new information is potentially dangerous in this case. For example, code that looks like it is assigning a warning value could erase previously-assigned success or failure values. Conversely, code that looks like it is just assigning a success or failure value could erase previously assigned error and warning messages. To prevent potential bugs like this, disable Result::operator= assignment operator. It is possible in the future we may want to re-enable operator= in limited cases (such as when implicit conversions are not used) or add a Replace() or Reset() method that mimicks default operator= behavior. Followup PR https://github.com/bitcoin/bitcoin/pull/25722 also adds a Result::Update() method providing another way to update an existing Result object. Co-authored-by: stickies-v <stickies-v@protonmail.com>
2024-02-05fuzz: remove unused `args` and `context` from `FuzzedWallet`brunoerg
2024-01-19refactor: pass CRecipient to FundTransactionjosibake
Instead turning tx.vout into a vector of `CRecipient`, make `FundTransaction` take a `CRecipient` vector directly. This allows us to remove SFFO logic from the wrapper RPC `FundTransaction` since the `CRecipient` objects have already been created with the correct SFFO values. This also allows us to remove SFFO from both `FundTransaction` function signatures. This sets us up in a future PR to be able to use these RPCs with BIP352 static payment codes.
2023-12-08wallet: return CreatedTransactionResult from FundTransactionAndrew Chow
Instead of using the output parameters, return CreatedTransactionResult from FundTransaction in the same way that CreateTransaction does. Additionally, instead of modifying the original CMutableTransaction, the result from CreateTransactionInternal is used.
2023-11-29fuzz: Avoid signed-integer-overflow in wallet_notifications fuzz targetMarcoFalke
2023-11-27Merge bitcoin/bitcoin#28933: fuzz: Faster wallet_notifications targetfanquake
fa15861763df71e788849b587883b3c16bb12229 fuzz: Faster wallet_notifications target (MarcoFalke) fa971c09f24887d4848082c551d4eed98e7f4edc Export assert from util/check.h (MarcoFalke) Pull request description: Avoid read/write from storage to speed the target up. ACKs for top commit: dergoegge: reACK fa15861763df71e788849b587883b3c16bb12229 brunoerg: reACK fa15861763df71e788849b587883b3c16bb12229 Tree-SHA512: 90aa856ae31db27a55ef0dfa2cb303d98e6c4d530d2937ad8d808c5f4048389b7ed3c78c27df92db8fe29531b5530aecbb06a0e8274dda424149f46cd6c19f98
2023-11-27fuzz: Faster wallet_notifications targetMarcoFalke
2023-11-24Export assert from util/check.hMarcoFalke
This avoids having to include both headers when assert and Assert are used at the same time.
2023-11-21Use Txid in COutpointdergoegge
2023-09-30validation: pass ChainstateRole for validationinterface callsJames O'Beirne
This allows consumers to decide how to handle events from background or assumedvalid chainstates.
2023-07-13scripted-diff: Use new FUZZ_TARGET macro everywhereMarcoFalke
-BEGIN VERIFY SCRIPT- ren() { sed --regexp-extended -i "s|$1|$2|g" $(git grep -l --extended-regexp "$1"); } # Replace FUZZ_TARGET_INIT ren 'FUZZ_TARGET_INIT\((.+), (.+)\)' 'FUZZ_TARGET(\1, .init = \2)' # Delete unused FUZZ_TARGET_INIT sed -i -e '37,39d' src/test/fuzz/fuzz.h -END VERIFY SCRIPT-
2023-05-30fuzz: fix wallet notifications.cppfurszy
As the fuzzer test requires all blocks to be scanned by the wallet (because it is asserting the wallet balance at the end), we need to ensure that no blocks are skipped by the recently added wallet birth time functionality. This just means setting the chain accumulated time to the maximum value, so the wallet birth time is always below it, and the block is always processed.
2022-12-24scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: - 2021: f47dda2c58b5d8d623e0e7ff4e74bc352dfa83d7 - 2020: fa0074e2d82928016a43ca408717154a1c70a4db - 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
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-18interfaces, refactor: Add more block information to block connected ↵Ryan Ofsky
notifications Add new interfaces::BlockInfo struct to be able to pass extra block information (file and undo information) to indexes which they are updated to use high level interfaces::Chain notifications. This commit does not change behavior in any way.
2022-07-08wallet: refactor GetNewDestination, use BResultfurszy
2022-04-21Disallow more unsafe string->path conversions allowed by path append operatorsRyan Ofsky
Add more fs::path operator/ and operator+ overloads to prevent unsafe string->path conversions on Windows that would cause strings to be decoded according to the current Windows locale & code page instead of the correct string encoding. Update application code to deal with loss of implicit string->path conversions by calling fs::u8path or fs::PathFromString explicitly, or by just changing variable types from std::string to fs::path to avoid conversions altoghther, or make them happen earlier. In all cases, there's no change in behavior either (1) because strings only contained ASCII characters and would be decoded the same regardless of what encoding was used, or (2) because of the 1:1 mapping between paths and strings using the PathToString and PathFromString functions. Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2022-01-06Add src/wallet/* code to wallet:: namespaceRussell Yanofsky
2021-11-16Create a tr() descriptor bech32m DescriptorScriptPubKeyMan by defaultAndrew Chow
2021-11-13depends, wallet: fix typosDimitris Apostolou
2021-10-22fuzz: Add wallet fuzz testMarcoFalke