This commit is contained in:
Richard Holland
2023-10-20 13:21:30 +00:00
parent fcd935cecf
commit 263c6342cf
3 changed files with 579 additions and 568 deletions

View File

@@ -394,9 +394,12 @@ int64_t hook(uint32_t r)
{
lost_majority = previous_votes >= q51 && votes < q51;
if (lost_majority)
trace(SBUF("Governance: Majority lost, undoing L1 vote..."),0,0,0);
{
DONE("Governance: Majority lost... but your L1 vote is unchanged. See documentation.");
// RH TODO: correctly action a majority loss at L2 as an "undo" vote at L1
}
else if (votes < q51)
DONE("Governance: Not yet enough votes to action L1 vote..");
DONE("Governance: Not yet enough votes to action L1 vote...");
}
@@ -481,7 +484,7 @@ int64_t hook(uint32_t r)
trace_num(SBUF("Governance: Emit result"), emit_result);
if (emit_result == 32)
accept(SBUF("Governance: Successfully emitted L1 vote."), __LINE__);
DONE("Governance: Successfully emitted L1 vote.");
NOPE("Governance: L1 vote emission failed.");
}

File diff suppressed because it is too large Load Diff

View File

@@ -1967,6 +1967,7 @@ struct XahauGenesis_test : public beast::unit_test::suite
{
std::cout
<< "Counter at " << lineno << "L: "
<< ((!!counterLE && counterLE->getFieldVL(sfHookStateData) == std::vector<uint8_t>{c}) ? "pass " : "failed ")
<< (!!counterLE ? strHex(counterLE->getFieldVL(sfHookStateData)) : "doesn't exist")
<< " vs " << std::string(1, (char)('0' + c)) << "\n";
}
@@ -1990,13 +1991,15 @@ struct XahauGenesis_test : public beast::unit_test::suite
checkCounter(__LINE__, 4);
// reverting a L2 vote should emit a txn undoing the vote
// reverting a L2 vote should emit a txn undoing the vote (not anymore Oct 20 2023)
/*
doL2Vote(__LINE__, 1, t2, m13, 'R', 'R', original_data, vote_data, false);
env.close();
env.close();
checkCounter(__LINE__, 3);
*/
}
@@ -2053,13 +2056,15 @@ struct XahauGenesis_test : public beast::unit_test::suite
checkCounter(__LINE__, 4);
// reverting a L2 vote should emit a txn undoing the vote
// reverting a L2 vote should emit a txn undoing the vote (not anymore Oct 20 2023)
/*
doL2Vote(__LINE__, 1, t2, m11, 'R', 'D', original_data, vote_data, false);
env.close();
env.close();
checkCounter(__LINE__, 3);
*/
}