mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
fix: trust line RPC no ripple flag (#5345)
The Trustline RPC `no_ripple` flag gets set depending on `lsfDefaultRipple` flag, which is not a flag of a trustline but of the account root. The `lsfDefaultRipple` flag does not provide any insight if this particular trust line has `lsfLowNoRipple` or `lsfHighNoRipple` flag set, so it should not be used here at all. This change simplifies the logic.
This commit is contained in:
@@ -250,6 +250,10 @@ public:
|
||||
gw1.human() + R"("})");
|
||||
BEAST_EXPECT(lines[jss::result][jss::lines].isArray());
|
||||
BEAST_EXPECT(lines[jss::result][jss::lines].size() == 26);
|
||||
|
||||
// Check no ripple is not set for trustlines between alice and gw1
|
||||
auto const& line = lines[jss::result][jss::lines][0u];
|
||||
BEAST_EXPECT(!line[jss::no_ripple].isMember(jss::no_ripple));
|
||||
}
|
||||
{
|
||||
// Use a malformed peer.
|
||||
|
||||
@@ -101,12 +101,6 @@ public:
|
||||
return mFlags & (!mViewLowest ? lsfLowAuth : lsfHighAuth);
|
||||
}
|
||||
|
||||
bool
|
||||
getDefaultRipple() const
|
||||
{
|
||||
return mFlags & lsfDefaultRipple;
|
||||
}
|
||||
|
||||
bool
|
||||
getNoRipple() const
|
||||
{
|
||||
|
||||
@@ -54,10 +54,10 @@ addLine(Json::Value& jsonLines, RPCTrustLine const& line)
|
||||
jPeer[jss::authorized] = true;
|
||||
if (line.getAuthPeer())
|
||||
jPeer[jss::peer_authorized] = 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.getNoRipple())
|
||||
jPeer[jss::no_ripple] = true;
|
||||
if (line.getNoRipplePeer())
|
||||
jPeer[jss::no_ripple_peer] = true;
|
||||
if (line.getFreeze())
|
||||
jPeer[jss::freeze] = true;
|
||||
if (line.getFreezePeer())
|
||||
|
||||
Reference in New Issue
Block a user