mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 00:36:48 +00:00
minor review changes
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
#include <xrpl/beast/hash/uhash.h>
|
||||
#include <xrpl/beast/utility/instrumentation.h>
|
||||
#include <xrpl/protocol/Feature.h>
|
||||
#include <xrpl/protocol/IOUAmount.h>
|
||||
#include <xrpl/protocol/STVector256.h>
|
||||
|
||||
#include <memory>
|
||||
@@ -89,7 +88,6 @@ createGuards(
|
||||
if (useRulesGuards(rules))
|
||||
{
|
||||
// raii classes for the current ledger rules.
|
||||
// fixUniversalNumber predates the rulesGuard and should be replaced.
|
||||
rulesGuard.emplace(rules);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -854,7 +854,7 @@ STAmount::canonicalize()
|
||||
set(MPTAmount{num});
|
||||
}
|
||||
else
|
||||
{
|
||||
{ // LCOV_EXCL_LINE here
|
||||
Throw<std::runtime_error>("Unknown integral asset type");
|
||||
}
|
||||
offset_ = 0;
|
||||
|
||||
@@ -4333,12 +4333,10 @@ private:
|
||||
testAmendment()
|
||||
{
|
||||
testcase("Amendment");
|
||||
FeatureBitset const all{testableAmendments()};
|
||||
FeatureBitset const noAMM{all - featureAMM};
|
||||
using namespace jtx;
|
||||
Env env{*this, testableAmendments() - featureAMM};
|
||||
|
||||
{
|
||||
Env env{*this, noAMM};
|
||||
fund(env, gw_, {alice_}, {USD(1'000)}, Fund::All);
|
||||
AMM amm(env, alice_, XRP(1'000), USD(1'000), Ter(temDISABLED));
|
||||
|
||||
|
||||
@@ -1973,38 +1973,36 @@ public:
|
||||
|
||||
using namespace jtx;
|
||||
|
||||
{
|
||||
Env env{*this, features};
|
||||
Env env{*this, features};
|
||||
|
||||
auto const gw = Account{"gateway"};
|
||||
auto const alice = Account{"alice"};
|
||||
auto const bob = Account{"bob"};
|
||||
auto const usd = gw["USD"];
|
||||
auto const gw = Account{"gateway"};
|
||||
auto const alice = Account{"alice"};
|
||||
auto const bob = Account{"bob"};
|
||||
auto const usd = gw["USD"];
|
||||
|
||||
env.fund(XRP(10000), gw, alice, bob);
|
||||
env.close();
|
||||
env.fund(XRP(10000), gw, alice, bob);
|
||||
env.close();
|
||||
|
||||
env(rate(gw, 1.005));
|
||||
env(rate(gw, 1.005));
|
||||
|
||||
env(trust(alice, usd(1000)));
|
||||
env(trust(bob, usd(1000)));
|
||||
env(trust(gw, alice["USD"](50)));
|
||||
env(trust(alice, usd(1000)));
|
||||
env(trust(bob, usd(1000)));
|
||||
env(trust(gw, alice["USD"](50)));
|
||||
|
||||
env(pay(gw, bob, bob["USD"](1)));
|
||||
env(pay(alice, gw, usd(50)));
|
||||
env(pay(gw, bob, bob["USD"](1)));
|
||||
env(pay(alice, gw, usd(50)));
|
||||
|
||||
env(trust(gw, alice["USD"](0)));
|
||||
env(trust(gw, alice["USD"](0)));
|
||||
|
||||
env(offer(alice, usd(50), XRP(150000)));
|
||||
env(offer(bob, XRP(100), usd(0.1)));
|
||||
env(offer(alice, usd(50), XRP(150000)));
|
||||
env(offer(bob, XRP(100), usd(0.1)));
|
||||
|
||||
auto jrr = ledgerEntryState(env, alice, gw, "USD");
|
||||
BEAST_EXPECT(jrr[jss::node][sfBalance.fieldName][jss::value] == "49.96666666666667");
|
||||
auto jrr = ledgerEntryState(env, alice, gw, "USD");
|
||||
BEAST_EXPECT(jrr[jss::node][sfBalance.fieldName][jss::value] == "49.96666666666667");
|
||||
|
||||
jrr = ledgerEntryState(env, bob, gw, "USD");
|
||||
json::Value const bobUSD = jrr[jss::node][sfBalance.fieldName][jss::value];
|
||||
BEAST_EXPECT(bobUSD == "-0.9665000000333333");
|
||||
}
|
||||
jrr = ledgerEntryState(env, bob, gw, "USD");
|
||||
json::Value const bobUSD = jrr[jss::node][sfBalance.fieldName][jss::value];
|
||||
BEAST_EXPECT(bobUSD == "-0.9665000000333333");
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user