mirror of
https://github.com/Xahau/xahaud.git
synced 2026-07-23 15:10:10 +00:00
Revert "test(consensus): harden member binding resolver"
This reverts commit 4f3c0affb4.
This commit is contained in:
@@ -255,23 +255,6 @@ class UNLReportMember_test : public beast::unit_test::suite
|
||||
auto parent = parentLedger(env, {});
|
||||
BEAST_EXPECT(!buildUNLReportMemberBindingView(*parent));
|
||||
}
|
||||
|
||||
{
|
||||
jtx::Env env(
|
||||
*this, jtx::supported_amendments() | featureUNLReportV2);
|
||||
auto parent = parentLedger(env, {v.masterPublic});
|
||||
OpenView view(&*parent);
|
||||
auto report =
|
||||
std::make_shared<SLE>(*view.read(keylet::UNLReport()));
|
||||
std::vector<STObject> active{
|
||||
STObject::makeInnerObject(sfActiveValidator)};
|
||||
std::string const invalidKey(1, '\0');
|
||||
active.front().setFieldVL(sfPublicKey, makeSlice(invalidKey));
|
||||
report->setFieldArray(
|
||||
sfActiveValidators, STArray(active, sfActiveValidators));
|
||||
view.rawReplace(report);
|
||||
BEAST_EXPECT(!buildUNLReportMemberBindingView(view));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -482,33 +465,6 @@ class UNLReportMember_test : public beast::unit_test::suite
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
auto const v = validator();
|
||||
auto parent = parentLedger(env, {v.masterPublic});
|
||||
OpenView view(&*parent);
|
||||
BEAST_EXPECT(
|
||||
apply(env, view, memberTx(manifest(v, 1))) == tesSUCCESS);
|
||||
mutateMember(view, v.masterPublic, [](SLE& sle) {
|
||||
sle.setFieldU32(sfFlags, 0x80000000u);
|
||||
});
|
||||
|
||||
auto bindings = buildUNLReportMemberBindingView(view);
|
||||
if (BEAST_EXPECT(bindings.has_value()))
|
||||
{
|
||||
auto const* frozen = bindings->findMaster(v.masterPublic);
|
||||
BEAST_EXPECT(frozen != nullptr);
|
||||
if (frozen)
|
||||
{
|
||||
BEAST_EXPECT(
|
||||
frozen->resolution ==
|
||||
UNLReportMemberBindingResolution::resolved);
|
||||
BEAST_EXPECT(frozen->frozen());
|
||||
BEAST_EXPECT(!frozen->usableSigningBinding());
|
||||
BEAST_EXPECT(frozen->ledgerFlags == 0x80000000u);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -517,8 +473,8 @@ class UNLReportMember_test : public beast::unit_test::suite
|
||||
testcase("binding view keeps malformed records visible unusable");
|
||||
jtx::Env env(*this, jtx::supported_amendments() | featureUNLReportV2);
|
||||
std::vector<Validator> validators;
|
||||
validators.reserve(6);
|
||||
for (std::size_t i = 0; i < 6; ++i)
|
||||
validators.reserve(5);
|
||||
for (std::size_t i = 0; i < 5; ++i)
|
||||
validators.emplace_back(validator());
|
||||
|
||||
std::vector<PublicKey> masters;
|
||||
@@ -548,10 +504,6 @@ class UNLReportMember_test : public beast::unit_test::suite
|
||||
std::string const invalidBlob(1, '\0');
|
||||
sle.setFieldVL(sfBlob, makeSlice(invalidBlob));
|
||||
});
|
||||
mutateMember(view, validators[5].masterPublic, [](SLE& sle) {
|
||||
std::string const invalidSigningKey(1, '\0');
|
||||
sle.setFieldVL(sfSigningPubKey, makeSlice(invalidSigningKey));
|
||||
});
|
||||
|
||||
auto bindings = buildUNLReportMemberBindingView(view);
|
||||
if (!BEAST_EXPECT(bindings.has_value()))
|
||||
|
||||
Reference in New Issue
Block a user