Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/proof_tests.cpp
Show All 40 Lines | BOOST_AUTO_TEST_CASE(proofbuilder) { | ||||
const int64_t expiration = InsecureRandBits(64); | const int64_t expiration = InsecureRandBits(64); | ||||
ProofBuilder pb(sequence, expiration, master); | ProofBuilder pb(sequence, expiration, master); | ||||
for (int i = 0; i < 3; i++) { | for (int i = 0; i < 3; i++) { | ||||
key.MakeNewKey(true); | key.MakeNewKey(true); | ||||
pb.addUTXO(COutPoint(TxId(GetRandHash()), InsecureRand32()), | pb.addUTXO(COutPoint(TxId(GetRandHash()), InsecureRand32()), | ||||
int64_t(InsecureRand32()) * COIN / 100, InsecureRand32(), | int64_t(InsecureRand32()) * COIN / 100, InsecureRand32(), | ||||
key); | InsecureRandBool(), key); | ||||
} | } | ||||
Proof p = pb.build(); | Proof p = pb.build(); | ||||
ProofValidationState state; | ProofValidationState state; | ||||
BOOST_CHECK(p.verify(state)); | BOOST_CHECK(p.verify(state)); | ||||
BOOST_CHECK_EQUAL(p.getSequence(), sequence); | BOOST_CHECK_EQUAL(p.getSequence(), sequence); | ||||
▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines |