mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Refactor AccountLinesRPC no_ripple_default logic
This commit is contained in:
committed by
Nik Bougalis
parent
2bba79138f
commit
8116b569c7
@@ -87,6 +87,12 @@ public:
|
||||
return mFlags & (!mViewLowest ? lsfLowAuth : lsfHighAuth);
|
||||
}
|
||||
|
||||
bool
|
||||
getDefaultRipple() const
|
||||
{
|
||||
return mFlags & lsfDefaultRipple;
|
||||
}
|
||||
|
||||
bool
|
||||
getNoRipple() const
|
||||
{
|
||||
|
||||
@@ -62,10 +62,10 @@ addLine(Json::Value& jsonLines, RippleState const& line)
|
||||
jPeer[jss::authorized] = true;
|
||||
if (line.getAuthPeer())
|
||||
jPeer[jss::peer_authorized] = true;
|
||||
if (line.getNoRipple())
|
||||
jPeer[jss::no_ripple] = true;
|
||||
if (line.getNoRipplePeer())
|
||||
jPeer[jss::no_ripple_peer] = true;
|
||||
if (line.getNoRipple() || !line.getDefaultRipple())
|
||||
jPeer[jss::no_ripple] = line.getNoRipple();
|
||||
if (line.getNoRipplePeer() || !line.getDefaultRipple())
|
||||
jPeer[jss::no_ripple_peer] = line.getNoRipplePeer();
|
||||
if (line.getFreeze())
|
||||
jPeer[jss::freeze] = true;
|
||||
if (line.getFreezePeer())
|
||||
|
||||
@@ -135,12 +135,12 @@ public:
|
||||
{
|
||||
auto const aliceLines = getAccountLines(alice);
|
||||
BEAST_EXPECT(aliceLines.size() == 1);
|
||||
BEAST_EXPECT(!aliceLines[0u].isMember(jss::no_ripple));
|
||||
BEAST_EXPECT(aliceLines[0u][jss::no_ripple].asBool() == false);
|
||||
|
||||
auto const bobLines = getAccountLines(bob);
|
||||
BEAST_EXPECT(bobLines.size() == 2);
|
||||
BEAST_EXPECT(!bobLines[0u].isMember(jss::no_ripple));
|
||||
BEAST_EXPECT(!bobLines[1u].isMember(jss::no_ripple));
|
||||
BEAST_EXPECT(bobLines[0u][jss::no_ripple].asBool() == false);
|
||||
BEAST_EXPECT(bobLines[1u][jss::no_ripple].asBool() == false);
|
||||
}
|
||||
|
||||
// Now carol sends the 50 USD back to alice. Then alice and
|
||||
|
||||
Reference in New Issue
Block a user