Reward hook tests (#117)

* fix warning

* reorder variables/functions

* add reward hook tests
This commit is contained in:
Denis Angell
2023-09-28 09:54:40 +02:00
committed by GitHub
parent 522cfe9d6a
commit 32b7cbe910
3 changed files with 1467 additions and 89 deletions

View File

@@ -193,10 +193,11 @@ XRPNotCreated::finalize(
bool const passed = (drops_ <= maxDropsAdded.drops() - fee.drops());
if (!passed)
JLOG(j.trace())
<< "XRPNotCreated failed.";
{
JLOG(j.trace()) << "XRPNotCreated failed.";
}
return passed;
}
if (view.rules().enabled(featureXahauGenesis) && tt == ttGENESIS_MINT && res == tesSUCCESS)

View File

@@ -9,6 +9,27 @@ namespace XahauGenesis
constexpr XRPAmount InfraAmount { 10'000 * DROPS_PER_XRP };
constexpr XRPAmount ExchangeAmount { 2'000 * DROPS_PER_XRP };
// For the Governance Hook: HookOn is set to ttINVOKE only
inline
ripple::uint256 const
GovernanceHookOn("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFFFFFFBFFFFF");
// For the Reward Hook: HookOn is set to ttCLAIM_REWARD only
inline
ripple::uint256 const
RewardHookOn("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFBFFFFF");
inline
std::vector<std::pair<std::vector<uint8_t>, std::vector<uint8_t>>> const
GovernanceParameters
{
// 0.003333 -xfl-> 6038156834009797973 -le-> 0x55554025A6D7CB53
{{'I', 'R', 'R'}, {0x55U, 0x55U, 0x40U, 0x25U, 0xA6U, 0xD7U, 0xCBU, 0x53U}},
// 2600000 -xfl-> 6199553087261802496 -le-> 0x00806AACAF3C0956
{{'I', 'R', 'D'}, {0x00U, 0x80U, 0x6AU, 0xACU, 0xAFU, 0x3CU, 0x09U, 0x56U}}
};
inline
std::vector<std::pair<std::string, XRPAmount>> const
NonGovernanceDistribution
@@ -39,29 +60,6 @@ namespace XahauGenesis
inline
std::vector<std::pair<std::string, XRPAmount>> TestL1Membership;
// For the Governance Hook: HookOn is set to ttINVOKE only
inline
ripple::uint256 const
GovernanceHookOn("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFFFFFFBFFFFF");
inline
std::vector<std::pair<std::vector<uint8_t>, std::vector<uint8_t>>> const
GovernanceParameters
{
// 0.003333 -xfl-> 6038156834009797973 -le-> 0x55554025A6D7CB53
{{'I', 'R', 'R'}, {0x55U, 0x55U, 0x40U, 0x25U, 0xA6U, 0xD7U, 0xCBU, 0x53U}},
// 2600000 -xfl-> 6199553087261802496 -le-> 0x00806AACAF3C0956
{{'I', 'R', 'D'}, {0x00U, 0x80U, 0x6AU, 0xACU, 0xAFU, 0x3CU, 0x09U, 0x56U}}
};
inline
std::vector<std::pair<std::string, std::vector<std::string>>>
TestL2Membership;
inline
std::vector<std::pair<
std::string, // L2 table account
@@ -112,9 +110,7 @@ namespace XahauGenesis
"rNu4sdVz6d2H37okUeH47ASMwckhzSx3k5"}},
};
// For the Reward Hook: HookOn is set to ttCLAIM_REWARD only
inline
ripple::uint256 const
RewardHookOn("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFBFFFFF");
std::vector<std::pair<std::string, std::vector<std::string>>>
TestL2Membership;
}

File diff suppressed because it is too large Load Diff