mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Update validations on UNL change (RIPD-1566):
Change the trust status of existing validations based when nodes are added or removed from the UNL.
This commit is contained in:
@@ -31,15 +31,38 @@ namespace test {
|
||||
class RCLValidations_test : public beast::unit_test::suite
|
||||
{
|
||||
|
||||
public:
|
||||
void
|
||||
run() override
|
||||
testChangeTrusted()
|
||||
{
|
||||
testcase("Change validation trusted status");
|
||||
PublicKey key = derivePublicKey(KeyType::ed25519, randomSecretKey());
|
||||
auto v = std::make_shared<STValidation>(
|
||||
uint256(), NetClock::time_point(), key, calcNodeID(key), true);
|
||||
|
||||
BEAST_EXPECT(!v->isTrusted());
|
||||
v->setTrusted();
|
||||
BEAST_EXPECT(v->isTrusted());
|
||||
v->setUntrusted();
|
||||
BEAST_EXPECT(!v->isTrusted());
|
||||
|
||||
RCLValidation rcv{v};
|
||||
BEAST_EXPECT(!rcv.trusted());
|
||||
rcv.setTrusted();
|
||||
BEAST_EXPECT(rcv.trusted());
|
||||
rcv.setUntrusted();
|
||||
BEAST_EXPECT(!rcv.trusted());
|
||||
}
|
||||
|
||||
void
|
||||
testRCLValidatedLedger()
|
||||
{
|
||||
testcase("RCLValidatedLedger ancestry");
|
||||
beast::Journal j;
|
||||
|
||||
using Seq = RCLValidatedLedger::Seq;
|
||||
using ID = RCLValidatedLedger::ID;
|
||||
|
||||
|
||||
// This tests RCLValidatedLedger properly implements the type
|
||||
// requirements of a LedgerTrie ledger, with its added behavior that
|
||||
// only the 256 prior ledger hashes are available to determine ancestry.
|
||||
@@ -193,8 +216,14 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
void
|
||||
run() override
|
||||
{
|
||||
testChangeTrusted();
|
||||
testRCLValidatedLedger();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user