Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/delegation_tests.cpp
Show All 27 Lines | static void CheckDelegation(const Delegation &dg, const Proof &p, | ||||
BOOST_CHECK(pubkey == expected_pubkey); | BOOST_CHECK(pubkey == expected_pubkey); | ||||
BOOST_CHECK(dg.getProofId() == p.getId()); | BOOST_CHECK(dg.getProofId() == p.getId()); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(verify_random) { | BOOST_AUTO_TEST_CASE(verify_random) { | ||||
auto key = CKey::MakeCompressedKey(); | auto key = CKey::MakeCompressedKey(); | ||||
const Proof p = buildRandomProof(123456, key.GetPubKey()); | const Proof p = buildRandomProof(123456, key); | ||||
DelegationBuilder dgb(p); | DelegationBuilder dgb(p); | ||||
{ | { | ||||
Delegation dg = dgb.build(); | Delegation dg = dgb.build(); | ||||
BOOST_CHECK_EQUAL(dg.getId(), p.getId()); | BOOST_CHECK_EQUAL(dg.getId(), p.getId()); | ||||
CheckDelegation(dg, p, p.getMaster()); | CheckDelegation(dg, p, p.getMaster()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines |