Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/peermanager_tests.cpp
Show First 20 Lines • Show All 2,033 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < numProofs; i++) { | ||||
// All proofs have finally been discarded | // All proofs have finally been discarded | ||||
BOOST_CHECK(!pm.exists(proofs[i]->getId())); | BOOST_CHECK(!pm.exists(proofs[i]->getId())); | ||||
BOOST_CHECK(!pm.exists(conflictingProofs[i]->getId())); | BOOST_CHECK(!pm.exists(conflictingProofs[i]->getId())); | ||||
} | } | ||||
gArgs.ClearForcedArg("-enableavalancheproofreplacement"); | gArgs.ClearForcedArg("-enableavalancheproofreplacement"); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(register_proof_missing_utxo) { | |||||
ChainstateManager &chainman = *Assert(m_node.chainman); | |||||
avalanche::PeerManager pm(chainman); | |||||
CKey key = CKey::MakeCompressedKey(); | |||||
auto proof = buildProofWithOutpoints(key, {{TxId(GetRandHash()), 0}}, | |||||
PROOF_DUST_THRESHOLD); | |||||
ProofRegistrationState state; | |||||
BOOST_CHECK(!pm.registerProof(proof, state)); | |||||
BOOST_CHECK(state.GetResult() == ProofRegistrationResult::MISSING_UTXO); | |||||
} | |||||
BOOST_AUTO_TEST_SUITE_END() | BOOST_AUTO_TEST_SUITE_END() |