mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 00:36:48 +00:00
Fix clang-tidy errors
This commit is contained in:
@@ -4130,7 +4130,7 @@ class Invariants_test : public beast::unit_test::Suite
|
||||
: std::make_pair(TER(tecINVARIANT_FAILED), TER(tefINVARIANT_FAILED));
|
||||
doInvariantCheck(
|
||||
{{isSuccess ? "" : "invalid MPToken transfer between holders"}},
|
||||
[&](Account const& A1, Account const& A2, ApplyContext& ac) {
|
||||
[&](Account const& a1, Account const& a2, ApplyContext& ac) {
|
||||
auto update = [&](AccountID const& a, std::uint64_t v) {
|
||||
auto sle = ac.view().peek(keylet::mptoken(id, a));
|
||||
if (!sle)
|
||||
@@ -4153,7 +4153,7 @@ class Invariants_test : public beast::unit_test::Suite
|
||||
}
|
||||
issuanceSle->at(sfOutstandingAmount) = 200;
|
||||
ac.view().update(issuanceSle);
|
||||
return update(A1, 101) && update(A2, 99);
|
||||
return update(a1, 101) && update(a2, 99);
|
||||
},
|
||||
XRPAmount{},
|
||||
STTx{
|
||||
@@ -4166,12 +4166,12 @@ class Invariants_test : public beast::unit_test::Suite
|
||||
}
|
||||
}},
|
||||
{error.first, error.second},
|
||||
[&](Account const& A1, Account const& A2, Env& env) {
|
||||
[&](Account const& a1, Account const& a2, Env& env) {
|
||||
Account const gw("gw");
|
||||
env.fund(XRP(1'000), gw);
|
||||
MPTTester const USD(
|
||||
{.env = env, .issuer = gw, .holders = {A1, A2}, .pay = 100});
|
||||
id = USD.issuanceID();
|
||||
MPTTester const usd(
|
||||
{.env = env, .issuer = gw, .holders = {a1, a2}, .pay = 100});
|
||||
id = usd.issuanceID();
|
||||
if (!enabled)
|
||||
{
|
||||
env.disableFeature(featureMPTokensV2);
|
||||
|
||||
@@ -4737,7 +4737,7 @@ public:
|
||||
// getToken:
|
||||
// - Create MPT with CanTransfer + CanTrade; authorize alice as holder.
|
||||
// - Create IOU trustline
|
||||
auto const Token = getToken(env);
|
||||
auto const token = getToken(env);
|
||||
|
||||
// carol: reserve(0) + 1 increment + fee covers placing one offer.
|
||||
// After the offer tx she has exactly reserve(1) + XRP(30).
|
||||
@@ -4749,7 +4749,7 @@ public:
|
||||
// carol's offer goes on the book (no counterpart yet).
|
||||
// TakerPays=Token(30): carol will receive Token when crossed.
|
||||
// TakerGets=XRP(30): carol will give XRP when crossed.
|
||||
env(offer(carol, Token(30), XRP(30)));
|
||||
env(offer(carol, token(30), XRP(30)));
|
||||
env.require(Owners(carol, 1));
|
||||
|
||||
// Execute offer create or cross-currency payment
|
||||
@@ -4758,13 +4758,13 @@ public:
|
||||
// Token:
|
||||
// - MPT: checkCreateMPT auto-creates an MPToken for carol (no reserve check).
|
||||
// - IOU: directSendNoFeeIOU auto-creates an Trustline for carol (no reserve check).
|
||||
execTx(env, Token);
|
||||
execTx(env, token);
|
||||
|
||||
// Carol now owns 2 objects (remaining offer + new MPToken) even
|
||||
// though her XRP balance is only reserve(1) + XRP(15), which is
|
||||
// below reserve(2) = reserve(1) + inc.
|
||||
auto const carolBalance = r + inc + XRP(15);
|
||||
env.require(Owners(carol, 2), Balance(carol, Token(15)), Balance(carol, carolBalance));
|
||||
env.require(Owners(carol, 2), Balance(carol, token(15)), Balance(carol, carolBalance));
|
||||
BEAST_EXPECT(carolBalance < r + 2 * inc); // below reserve(2)
|
||||
};
|
||||
std::function<PrettyAsset(Env&)> const getIOU = [&](Env& env) -> PrettyAsset {
|
||||
@@ -4773,23 +4773,23 @@ public:
|
||||
return gw["USD"];
|
||||
};
|
||||
std::function<PrettyAsset(Env&)> const getMPT = [&](Env& env) -> PrettyAsset {
|
||||
MPT const MPT1 = MPTTester({.env = env, .issuer = gw, .holders = {alice}, .pay = 100});
|
||||
return MPT1;
|
||||
MPT const mpT1 = MPTTester({.env = env, .issuer = gw, .holders = {alice}, .pay = 100});
|
||||
return mpT1;
|
||||
};
|
||||
for (auto&& getToken : {getIOU, getMPT})
|
||||
{
|
||||
test(getToken, [&](Env& env, PrettyAsset const& Token) {
|
||||
test(getToken, [&](Env& env, PrettyAsset const& token) {
|
||||
// alice partially crosses carol's offer.
|
||||
// alice sends Token(15) to carol and receives XRP(15).
|
||||
// Token is MPT: checkCreateMPT auto-creates an MPToken for carol (no reserve
|
||||
// check). Token is IOU: directSendNoFeeIOU auto-creates a trustline for carol (no
|
||||
// reserve check).
|
||||
env(offer(alice, XRP(15), Token(15)));
|
||||
env(offer(alice, XRP(15), token(15)));
|
||||
});
|
||||
test(getToken, [&](Env& env, PrettyAsset const& Token) {
|
||||
test(getToken, [&](Env& env, PrettyAsset const& token) {
|
||||
// Similar to above but with cross-currency payment.
|
||||
env(pay(alice, bob, XRP(15)),
|
||||
Sendmax(Token(15)),
|
||||
Sendmax(token(15)),
|
||||
Path(~XRP),
|
||||
Txflags(tfNoRippleDirect | tfPartialPayment));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user