Skip to content

Commit

Permalink
Merge branch develop
Browse files Browse the repository at this point in the history
  • Loading branch information
thejohnfreeman committed Jul 12, 2023
2 parents 4bc3e56 + 3c9db4b commit bc72e1a
Show file tree
Hide file tree
Showing 101 changed files with 18,102 additions and 650 deletions.
23 changes: 23 additions & 0 deletions Builds/CMake/RippledCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,20 @@ target_sources (xrpl_core PRIVATE
subdir: protocol
#]===============================]
src/ripple/protocol/impl/AccountID.cpp
src/ripple/protocol/impl/AMMCore.cpp
src/ripple/protocol/impl/Book.cpp
src/ripple/protocol/impl/BuildInfo.cpp
src/ripple/protocol/impl/ErrorCodes.cpp
src/ripple/protocol/impl/Feature.cpp
src/ripple/protocol/impl/Indexes.cpp
src/ripple/protocol/impl/InnerObjectFormats.cpp
src/ripple/protocol/impl/Issue.cpp
src/ripple/protocol/impl/STIssue.cpp
src/ripple/protocol/impl/Keylet.cpp
src/ripple/protocol/impl/LedgerFormats.cpp
src/ripple/protocol/impl/PublicKey.cpp
src/ripple/protocol/impl/Quality.cpp
src/ripple/protocol/impl/QualityFunction.cpp
src/ripple/protocol/impl/Rate2.cpp
src/ripple/protocol/impl/Rules.cpp
src/ripple/protocol/impl/SField.cpp
Expand Down Expand Up @@ -223,6 +226,7 @@ install (
install (
FILES
src/ripple/protocol/AccountID.h
src/ripple/protocol/AMMCore.h
src/ripple/protocol/AmountConversions.h
src/ripple/protocol/Book.h
src/ripple/protocol/BuildInfo.h
Expand All @@ -239,12 +243,14 @@ install (
src/ripple/protocol/Protocol.h
src/ripple/protocol/PublicKey.h
src/ripple/protocol/Quality.h
src/ripple/protocol/QualityFunction.h
src/ripple/protocol/Rate.h
src/ripple/protocol/Rules.h
src/ripple/protocol/SField.h
src/ripple/protocol/SOTemplate.h
src/ripple/protocol/STAccount.h
src/ripple/protocol/STAmount.h
src/ripple/protocol/STIssue.h
src/ripple/protocol/STArray.h
src/ripple/protocol/STBase.h
src/ripple/protocol/STBitString.h
Expand Down Expand Up @@ -423,6 +429,8 @@ target_sources (rippled PRIVATE
src/ripple/app/reporting/ReportingETL.cpp
src/ripple/app/reporting/ETLSource.cpp
src/ripple/app/reporting/P2pProxy.cpp
src/ripple/app/misc/impl/AMMHelpers.cpp
src/ripple/app/misc/impl/AMMUtils.cpp
src/ripple/app/misc/CanonicalTXSet.cpp
src/ripple/app/misc/FeeVoteImpl.cpp
src/ripple/app/misc/HashRouter.cpp
Expand All @@ -448,6 +456,8 @@ target_sources (rippled PRIVATE
src/ripple/app/paths/RippleCalc.cpp
src/ripple/app/paths/RippleLineCache.cpp
src/ripple/app/paths/TrustLine.cpp
src/ripple/app/paths/impl/AMMLiquidity.cpp
src/ripple/app/paths/impl/AMMOffer.cpp
src/ripple/app/paths/impl/BookStep.cpp
src/ripple/app/paths/impl/DirectStep.cpp
src/ripple/app/paths/impl/PaySteps.cpp
Expand All @@ -464,6 +474,11 @@ target_sources (rippled PRIVATE
src/ripple/app/rdb/impl/UnitaryShard.cpp
src/ripple/app/rdb/impl/Vacuum.cpp
src/ripple/app/rdb/impl/Wallet.cpp
src/ripple/app/tx/impl/AMMBid.cpp
src/ripple/app/tx/impl/AMMCreate.cpp
src/ripple/app/tx/impl/AMMDeposit.cpp
src/ripple/app/tx/impl/AMMVote.cpp
src/ripple/app/tx/impl/AMMWithdraw.cpp
src/ripple/app/tx/impl/ApplyContext.cpp
src/ripple/app/tx/impl/BookTip.cpp
src/ripple/app/tx/impl/CancelCheck.cpp
Expand Down Expand Up @@ -629,6 +644,7 @@ target_sources (rippled PRIVATE
src/ripple/rpc/handlers/AccountObjects.cpp
src/ripple/rpc/handlers/AccountOffers.cpp
src/ripple/rpc/handlers/AccountTx.cpp
src/ripple/rpc/handlers/AMMInfo.cpp
src/ripple/rpc/handlers/BlackList.cpp
src/ripple/rpc/handlers/BookOffers.cpp
src/ripple/rpc/handlers/CanDelete.cpp
Expand Down Expand Up @@ -735,6 +751,9 @@ if (tests)
src/test/app/AccountDelete_test.cpp
src/test/app/AccountTxPaging_test.cpp
src/test/app/AmendmentTable_test.cpp
src/test/app/AMM_test.cpp
src/test/app/AMMCalc_test.cpp
src/test/app/AMMExtended_test.cpp
src/test/app/Check_test.cpp
src/test/app/Clawback_test.cpp
src/test/app/CrossingLimits_test.cpp
Expand Down Expand Up @@ -877,9 +896,12 @@ if (tests)
src/test/jtx/Env_test.cpp
src/test/jtx/WSClient_test.cpp
src/test/jtx/impl/Account.cpp
src/test/jtx/impl/AMM.cpp
src/test/jtx/impl/AMMTest.cpp
src/test/jtx/impl/Env.cpp
src/test/jtx/impl/JSONRPCClient.cpp
src/test/jtx/impl/ManualTimeKeeper.cpp
src/test/jtx/impl/TestHelpers.cpp
src/test/jtx/impl/WSClient.cpp
src/test/jtx/impl/acctdelete.cpp
src/test/jtx/impl/account_txn_id.cpp
Expand Down Expand Up @@ -995,6 +1017,7 @@ if (tests)
src/test/rpc/AccountSet_test.cpp
src/test/rpc/AccountTx_test.cpp
src/test/rpc/AmendmentBlocked_test.cpp
src/test/rpc/AMMInfo_test.cpp
src/test/rpc/Book_test.cpp
src/test/rpc/DepositAuthorized_test.cpp
src/test/rpc/DeliveredAmount_test.cpp
Expand Down
2 changes: 2 additions & 0 deletions Builds/levelization/results/ordering.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ test.jtx > ripple.json
test.jtx > ripple.ledger
test.jtx > ripple.net
test.jtx > ripple.protocol
test.jtx > ripple.resource
test.jtx > ripple.rpc
test.jtx > ripple.server
test.ledger > ripple.app
test.ledger > ripple.basics
Expand Down
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ target_link_libraries(ripple_libs INTERFACE
ed25519::ed25519
LibArchive::LibArchive
lz4::lz4
nudb::core
OpenSSL::Crypto
OpenSSL::SSL
Ripple::grpc_pbufs
Expand All @@ -110,6 +109,16 @@ target_link_libraries(ripple_libs INTERFACE
SQLite::SQLite3
)

# Work around changes to Conan recipe for now.
if(TARGET nudb::core)
set(nudb nudb::core)
elseif(TARGET NuDB::nudb)
set(nudb NuDB::nudb)
else()
message(FATAL_ERROR "unknown nudb target")
endif()
target_link_libraries(ripple_libs INTERFACE ${nudb})

if(reporting)
find_package(cassandra-cpp-driver REQUIRED)
find_package(PostgreSQL REQUIRED)
Expand Down
18 changes: 17 additions & 1 deletion src/ripple/app/ledger/OrderBookDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <ripple/app/ledger/LedgerMaster.h>
#include <ripple/app/ledger/OrderBookDB.h>
#include <ripple/app/main/Application.h>
#include <ripple/app/misc/AMMUtils.h>
#include <ripple/app/misc/NetworkOPs.h>
#include <ripple/basics/Log.h>
#include <ripple/core/Config.h>
Expand Down Expand Up @@ -93,7 +94,7 @@ OrderBookDB::update(std::shared_ptr<ReadView const> const& ledger)

JLOG(j_.debug()) << "Beginning update (" << ledger->seq() << ")";

// walk through the entire ledger looking for orderbook entries
// walk through the entire ledger looking for orderbook/AMM entries
int cnt = 0;

try
Expand Down Expand Up @@ -126,6 +127,21 @@ OrderBookDB::update(std::shared_ptr<ReadView const> const& ledger)

++cnt;
}
else if (sle->getType() == ltAMM)
{
auto const issue1 = (*sle)[sfAsset];
auto const issue2 = (*sle)[sfAsset2];
auto addBook = [&](Issue const& in, Issue const& out) {
allBooks[in].insert(out);

if (isXRP(out))
xrpBooks.insert(in);

++cnt;
};
addBook(issue1, issue2);
addBook(issue2, issue1);
}
}
}
catch (SHAMapMissingNode const& mn)
Expand Down
Loading

0 comments on commit bc72e1a

Please sign in to comment.