Auto merge of #4179 - defuse:fuzz-addrman, r=str4d
Add More Fuzzing Targets
This commit is contained in:
commit
019507a8ef
|
@ -0,0 +1,29 @@
|
|||
#include "consensus/validation.h"
|
||||
#include "chainparams.h"
|
||||
|
||||
int main (int argc, char *argv[]) {
|
||||
int retval = 0;
|
||||
|
||||
SelectParams(CBaseChainParams::MAIN);
|
||||
|
||||
CBlock block;
|
||||
CAutoFile filein(fopen(argv[1], "rb"), SER_DISK, CLIENT_VERSION);
|
||||
try {
|
||||
filein >> block;
|
||||
} catch (const std::exception& e) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// We don't load the SNARK parameters because it's too slow. This means that
|
||||
// valid blocks with shielded transactions will generate a crash.
|
||||
|
||||
const CChainParams& chainparams = Params();
|
||||
auto verifier = libzcash::ProofVerifier::Disabled();
|
||||
CValidationState state;
|
||||
// We don't check the PoW or Merkle tree root in order to reach more code.
|
||||
if (!CheckBlock(block, state, chainparams, verifier, false, false)) {
|
||||
retval = -1;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,13 @@
|
|||
#include "addrman.h"
|
||||
#include "streams.h"
|
||||
|
||||
int main (int argc, char *argv[]) {
|
||||
CAddrMan addrman;
|
||||
CAutoFile filein(fopen(argv[1], "rb"), SER_DISK, CLIENT_VERSION);
|
||||
try {
|
||||
filein >> addrman;
|
||||
return 0;
|
||||
} catch (const std::exception&) {
|
||||
return -1;
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,13 @@
|
|||
#include "txmempool.h"
|
||||
|
||||
int main (int argc, char *argv[]) {
|
||||
CFeeRate rate;
|
||||
CTxMemPool mempool(rate);
|
||||
CAutoFile est_filein(fopen(argv[1], "rb"), SER_DISK, CLIENT_VERSION);
|
||||
|
||||
if (mempool.ReadFeeEstimates(est_filein)) {
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue