Skip to content

Commit

Permalink
feat: Upgrade to libxrpl 2.4.0-b1 (#1789)
Browse files Browse the repository at this point in the history
  • Loading branch information
godexsoft authored Dec 18, 2024
1 parent 017cf2a commit 2d0253b
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Clio(ConanFile):
'protobuf/3.21.9',
'grpc/1.50.1',
'openssl/1.1.1u',
'xrpl/2.3.0',
'xrpl/2.4.0-b1',
'zlib/1.3.1',
'libbacktrace/cci.20210118'
]
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/AMMHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ getAmmLpHolds(
return getAmmLpHolds(
backend,
sequence,
ammSle[ripple::sfAsset].currency,
ammSle[ripple::sfAsset2].currency,
ammSle[ripple::sfAsset].get<ripple::Issue>().currency,
ammSle[ripple::sfAsset2].get<ripple::Issue>().currency,
ammSle[ripple::sfAccount],
lpAccount,
yield
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/BookChangesHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
#include <boost/json/conversion.hpp>
#include <boost/json/object.hpp>
#include <boost/json/value.hpp>
#include <xrpl/basics/IOUAmount.h>
#include <xrpl/basics/XRPAmount.h>
#include <xrpl/beast/utility/Zero.h>
#include <xrpl/protocol/IOUAmount.h>
#include <xrpl/protocol/Issue.h>
#include <xrpl/protocol/LedgerFormats.h>
#include <xrpl/protocol/LedgerHeader.h>
Expand All @@ -38,6 +37,7 @@
#include <xrpl/protocol/STObject.h>
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/TxFormats.h>
#include <xrpl/protocol/XRPAmount.h>
#include <xrpl/protocol/jss.h>

#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/RPCHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <fmt/core.h>
#include <xrpl/basics/Slice.h>
#include <xrpl/basics/StringUtilities.h>
#include <xrpl/basics/XRPAmount.h>
#include <xrpl/protocol/XRPAmount.h>
#include <xrpl/basics/base_uint.h>
#include <xrpl/basics/chrono.h>
#include <xrpl/basics/strHex.h>
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/RPCHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <boost/regex/v5/regex_fwd.hpp>
#include <boost/regex/v5/regex_match.hpp>
#include <fmt/core.h>
#include <xrpl/basics/XRPAmount.h>
#include <xrpl/protocol/XRPAmount.h>
#include <xrpl/basics/base_uint.h>
#include <xrpl/json/json_value.h>
#include <xrpl/protocol/AccountID.h>
Expand Down
18 changes: 14 additions & 4 deletions src/rpc/handlers/AMMInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ AMMInfoHandler::process(AMMInfoHandler::Input input, Context const& ctx) const
// If the issue1 and issue2 are not specified, we need to get them from the AMM.
// Otherwise we preserve the mapping of asset1 -> issue1 and asset2 -> issue2 as requested by the user.
if (issue1 == ripple::noIssue() and issue2 == ripple::noIssue()) {
issue1 = amm[sfAsset];
issue2 = amm[sfAsset2];
issue1 = amm[sfAsset].get<Issue>();
issue2 = amm[sfAsset2].get<Issue>();
}

auto const [asset1Balance, asset2Balance] =
Expand Down Expand Up @@ -204,12 +204,22 @@ AMMInfoHandler::process(AMMInfoHandler::Input input, Context const& ctx) const

if (!isXRP(asset1Balance)) {
response.asset1Frozen = isFrozen(
*sharedPtrBackend_, lgrInfo.seq, ammAccountID, amm[sfAsset].currency, amm[sfAsset].account, ctx.yield
*sharedPtrBackend_,
lgrInfo.seq,
ammAccountID,
amm[sfAsset].get<Issue>().currency,
amm[sfAsset].get<Issue>().account,
ctx.yield
);
}
if (!isXRP(asset2Balance)) {
response.asset2Frozen = isFrozen(
*sharedPtrBackend_, lgrInfo.seq, ammAccountID, amm[sfAsset2].currency, amm[sfAsset2].account, ctx.yield
*sharedPtrBackend_,
lgrInfo.seq,
ammAccountID,
amm[sfAsset2].get<Issue>().currency,
amm[sfAsset2].get<Issue>().account,
ctx.yield
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/BackendInterfaceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <xrpl/basics/Blob.h>
#include <xrpl/basics/XRPAmount.h>
#include <xrpl/protocol/XRPAmount.h>
#include <xrpl/basics/base_uint.h>
#include <xrpl/protocol/Indexes.h>

Expand Down

0 comments on commit 2d0253b

Please sign in to comment.