mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Merge pull request #1391 from apoelstra/2025-02--misc-fuzz-fixes
A couple miscellaneous fixes for fuzztests
This commit is contained in:
commit
72a5e4117c
3 changed files with 15 additions and 1 deletions
|
|
@ -135,6 +135,11 @@ public:
|
|||
CConfidentialValue() { SetNull(); }
|
||||
CConfidentialValue(CAmount nAmount) { SetToAmount(nAmount); }
|
||||
|
||||
template <typename Stream>
|
||||
inline void Unserialize(Stream& s) {
|
||||
CConfidentialCommitment::Unserialize(s);
|
||||
}
|
||||
|
||||
/* An explicit value is called an amount. The first byte indicates it is
|
||||
* an explicit value, and the remaining 8 bytes is the value serialized as
|
||||
* a 64-bit big-endian integer. */
|
||||
|
|
|
|||
|
|
@ -295,6 +295,9 @@ public:
|
|||
s >> nAsset;
|
||||
s >> nValue;
|
||||
s >> nNonce;
|
||||
if (nAsset.IsNull() || nValue.IsNull()) {
|
||||
throw std::ios_base::failure("Confidential values may not be null");
|
||||
}
|
||||
} else {
|
||||
CAmount value;
|
||||
s >> value;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,13 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(rbf)
|
||||
void initialize_rbf(void) {
|
||||
// ELEMENTS: our mempool needs Params() to be set for multiple reasons -- to check
|
||||
// the discount CT rate, to figure out pegin policy, etc
|
||||
SelectParams(CBaseChainParams::LIQUID1);
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(rbf, initialize_rbf)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
SetMockTime(ConsumeTime(fuzzed_data_provider));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue