mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-28 22:45:49 +00:00
clang-format
This commit is contained in:
@@ -1972,7 +1972,9 @@ Transactor::operator()()
|
||||
uint32_t lgrElapsed = lgrCur - lgrLast;
|
||||
|
||||
// overflow safety
|
||||
if (!has240820 && (lgrElapsed > lgrCur || lgrElapsed > lgrLast || lgrElapsed == 0))
|
||||
if (!has240820 &&
|
||||
(lgrElapsed > lgrCur || lgrElapsed > lgrLast ||
|
||||
lgrElapsed == 0))
|
||||
continue;
|
||||
if (has240820 && (lgrElapsed > lgrCur || lgrElapsed == 0))
|
||||
continue;
|
||||
|
||||
@@ -5027,8 +5027,7 @@ struct XahauGenesis_test : public beast::unit_test::suite
|
||||
using namespace std::chrono_literals;
|
||||
testcase("test deposit");
|
||||
|
||||
Env env{
|
||||
*this, envconfig(), features - featureXahauGenesis};
|
||||
Env env{*this, envconfig(), features - featureXahauGenesis};
|
||||
|
||||
double const rateDrops = 0.00333333333 * 1'000'000;
|
||||
STAmount const feesXRP = XRP(1);
|
||||
@@ -5094,13 +5093,19 @@ struct XahauGenesis_test : public beast::unit_test::suite
|
||||
|
||||
// calculate rewards
|
||||
bool const has240819 = env.current()->rules().enabled(fix240819);
|
||||
STAmount const netReward = rewardUserAmount(*acctSle, preLedger, rateDrops);
|
||||
STAmount const netReward =
|
||||
rewardUserAmount(*acctSle, preLedger, rateDrops);
|
||||
BEAST_EXPECT(netReward == (has240819 ? XRP(6.383333) : XRP(6.663333)));
|
||||
|
||||
// validate account fields
|
||||
STAmount const postUser = preUser + netReward;
|
||||
BEAST_EXPECT(expectAccountFields(
|
||||
env, user, preLedger, preLedger + 1, has240819 ? (preUser - feesXRP) : postUser, preTime));
|
||||
env,
|
||||
user,
|
||||
preLedger,
|
||||
preLedger + 1,
|
||||
has240819 ? (preUser - feesXRP) : postUser,
|
||||
preTime));
|
||||
BEAST_EXPECT(
|
||||
postUser == (has240819 ? XRP(2005.383333) : XRP(2005.663333)));
|
||||
}
|
||||
@@ -5112,8 +5117,7 @@ struct XahauGenesis_test : public beast::unit_test::suite
|
||||
using namespace std::chrono_literals;
|
||||
testcase("test deposit withdraw");
|
||||
|
||||
Env env{
|
||||
*this, envconfig(), features - featureXahauGenesis};
|
||||
Env env{*this, envconfig(), features - featureXahauGenesis};
|
||||
|
||||
double const rateDrops = 0.00333333333 * 1'000'000;
|
||||
STAmount const feesXRP = XRP(1);
|
||||
@@ -5182,15 +5186,20 @@ struct XahauGenesis_test : public beast::unit_test::suite
|
||||
|
||||
// calculate rewards
|
||||
bool const has240819 = env.current()->rules().enabled(fix240819);
|
||||
STAmount const netReward = rewardUserAmount(*acctSle, preLedger, rateDrops);
|
||||
STAmount const netReward =
|
||||
rewardUserAmount(*acctSle, preLedger, rateDrops);
|
||||
BEAST_EXPECT(netReward == XRP(3.583333));
|
||||
|
||||
// validate account fields
|
||||
STAmount const postUser = preUser + netReward;
|
||||
BEAST_EXPECT(expectAccountFields(
|
||||
env, user, preLedger, preLedger + 1, has240819 ? (preUser - feesXRP) : postUser, preTime));
|
||||
BEAST_EXPECT(
|
||||
postUser == XRP(1002.583323));
|
||||
env,
|
||||
user,
|
||||
preLedger,
|
||||
preLedger + 1,
|
||||
has240819 ? (preUser - feesXRP) : postUser,
|
||||
preTime));
|
||||
BEAST_EXPECT(postUser == XRP(1002.583323));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -5200,8 +5209,7 @@ struct XahauGenesis_test : public beast::unit_test::suite
|
||||
using namespace std::chrono_literals;
|
||||
testcase("test deposit late");
|
||||
|
||||
Env env{
|
||||
*this, envconfig(), features - featureXahauGenesis};
|
||||
Env env{*this, envconfig(), features - featureXahauGenesis};
|
||||
|
||||
double const rateDrops = 0.00333333333 * 1'000'000;
|
||||
STAmount const feesXRP = XRP(1);
|
||||
@@ -5267,13 +5275,19 @@ struct XahauGenesis_test : public beast::unit_test::suite
|
||||
|
||||
// calculate rewards
|
||||
bool const has240819 = env.current()->rules().enabled(fix240819);
|
||||
STAmount const netReward = rewardUserAmount(*acctSle, preLedger, rateDrops);
|
||||
STAmount const netReward =
|
||||
rewardUserAmount(*acctSle, preLedger, rateDrops);
|
||||
BEAST_EXPECT(netReward == (has240819 ? XRP(3.606666) : XRP(6.663333)));
|
||||
|
||||
// validate account fields
|
||||
STAmount const postUser = preUser + netReward;
|
||||
BEAST_EXPECT(expectAccountFields(
|
||||
env, user, preLedger, preLedger + 1, has240819 ? (preUser - feesXRP) : postUser, preTime));
|
||||
env,
|
||||
user,
|
||||
preLedger,
|
||||
preLedger + 1,
|
||||
has240819 ? (preUser - feesXRP) : postUser,
|
||||
preTime));
|
||||
BEAST_EXPECT(
|
||||
postUser == (has240819 ? XRP(2002.606666) : XRP(2005.663333)));
|
||||
}
|
||||
@@ -5285,8 +5299,7 @@ struct XahauGenesis_test : public beast::unit_test::suite
|
||||
using namespace std::chrono_literals;
|
||||
testcase("test deposit late withdraw");
|
||||
|
||||
Env env{
|
||||
*this, envconfig(), features - featureXahauGenesis};
|
||||
Env env{*this, envconfig(), features - featureXahauGenesis};
|
||||
|
||||
double const rateDrops = 0.00333333333 * 1'000'000;
|
||||
STAmount const feesXRP = XRP(1);
|
||||
@@ -5379,8 +5392,7 @@ struct XahauGenesis_test : public beast::unit_test::suite
|
||||
using namespace std::chrono_literals;
|
||||
testcase("test no claim");
|
||||
|
||||
Env env{
|
||||
*this, envconfig(), features - featureXahauGenesis};
|
||||
Env env{*this, envconfig(), features - featureXahauGenesis};
|
||||
|
||||
double const rateDrops = 0.00333333333 * 1'000'000;
|
||||
STAmount const feesXRP = XRP(1);
|
||||
@@ -5442,14 +5454,21 @@ struct XahauGenesis_test : public beast::unit_test::suite
|
||||
env.close();
|
||||
|
||||
// calculate rewards
|
||||
bool const hasFix = env.current()->rules().enabled(fix240819) && env.current()->rules().enabled(fix240911);
|
||||
STAmount const netReward = rewardUserAmount(*acctSle, preLedger, rateDrops);
|
||||
bool const hasFix = env.current()->rules().enabled(fix240819) &&
|
||||
env.current()->rules().enabled(fix240911);
|
||||
STAmount const netReward =
|
||||
rewardUserAmount(*acctSle, preLedger, rateDrops);
|
||||
BEAST_EXPECT(netReward == (hasFix ? XRP(3.329999) : XRP(3.329999)));
|
||||
|
||||
// validate account fields
|
||||
STAmount const postUser = preUser + netReward;
|
||||
BEAST_EXPECT(expectAccountFields(
|
||||
env, user, preLedger, preLedger + 1, hasFix ? (preUser - feesXRP) : postUser, preTime));
|
||||
env,
|
||||
user,
|
||||
preLedger,
|
||||
preLedger + 1,
|
||||
hasFix ? (preUser - feesXRP) : postUser,
|
||||
preTime));
|
||||
BEAST_EXPECT(
|
||||
postUser == (hasFix ? XRP(1002.329999) : XRP(1002.329999)));
|
||||
}
|
||||
@@ -5461,8 +5480,7 @@ struct XahauGenesis_test : public beast::unit_test::suite
|
||||
using namespace std::chrono_literals;
|
||||
testcase("test no claim late");
|
||||
|
||||
Env env{
|
||||
*this, envconfig(), features - featureXahauGenesis};
|
||||
Env env{*this, envconfig(), features - featureXahauGenesis};
|
||||
|
||||
double const rateDrops = 0.00333333333 * 1'000'000;
|
||||
STAmount const feesXRP = XRP(1);
|
||||
@@ -5527,14 +5545,21 @@ struct XahauGenesis_test : public beast::unit_test::suite
|
||||
env.close();
|
||||
|
||||
// calculate rewards
|
||||
bool const hasFix = env.current()->rules().enabled(fix240819) && env.current()->rules().enabled(fix240911);
|
||||
STAmount const netReward = rewardUserAmount(*acctSle, preLedger, rateDrops);
|
||||
bool const hasFix = env.current()->rules().enabled(fix240819) &&
|
||||
env.current()->rules().enabled(fix240911);
|
||||
STAmount const netReward =
|
||||
rewardUserAmount(*acctSle, preLedger, rateDrops);
|
||||
BEAST_EXPECT(netReward == (hasFix ? XRP(3.479999) : XRP(6.663333)));
|
||||
|
||||
// validate account fields
|
||||
STAmount const postUser = preUser + netReward;
|
||||
BEAST_EXPECT(expectAccountFields(
|
||||
env, user, preLedger, preLedger + 1, hasFix ? (preUser - feesXRP) : postUser, preTime));
|
||||
env,
|
||||
user,
|
||||
preLedger,
|
||||
preLedger + 1,
|
||||
hasFix ? (preUser - feesXRP) : postUser,
|
||||
preTime));
|
||||
BEAST_EXPECT(
|
||||
postUser == (hasFix ? XRP(2002.479999) : XRP(2005.663333)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user