Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/delegation_tests.cpp
Show All 13 Lines | |||||
#include <streams.h> | #include <streams.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
using namespace avalanche; | using namespace avalanche; | ||||
BOOST_FIXTURE_TEST_SUITE(delegation_tests, TestingSetup) | BOOST_FIXTURE_TEST_SUITE(delegation_tests, TestingSetup) | ||||
static void CheckDelegation(const Delegation &dg, | static void CheckDelegation(const Delegation &dg, const ProofRef &p, | ||||
const std::shared_ptr<Proof> &p, | |||||
const CPubKey &expected_pubkey) { | const CPubKey &expected_pubkey) { | ||||
DelegationState state; | DelegationState state; | ||||
CPubKey pubkey; | CPubKey pubkey; | ||||
BOOST_CHECK(dg.verify(state, pubkey)); | BOOST_CHECK(dg.verify(state, pubkey)); | ||||
BOOST_CHECK(state.GetResult() == DelegationResult::NONE); | BOOST_CHECK(state.GetResult() == DelegationResult::NONE); | ||||
BOOST_CHECK(pubkey == expected_pubkey); | BOOST_CHECK(pubkey == expected_pubkey); | ||||
BOOST_CHECK(dg.getProofId() == p->getId()); | BOOST_CHECK(dg.getProofId() == p->getId()); | ||||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |