Compare commits

...

22 Commits

Author SHA1 Message Date
Denis Angell
2d187658ae Update mulDiv.cpp 2024-09-20 17:05:20 +02:00
Denis Angell
94dbb2398f Merge branch 'dev' into strict-builds 2024-09-20 17:00:05 +02:00
Denis Angell
0c2cab76c9 Merge branch 'dev' into strict-builds 2024-09-04 16:50:53 +02:00
Denis Angell
77f9415e51 Update loops.txt 2024-07-08 11:25:36 +02:00
Denis Angell
fa7406fe1e add header includes 2024-07-08 11:22:17 +02:00
Denis Angell
84eee588d3 Merge branch 'dev' into strict-builds 2024-06-05 12:17:36 +02:00
Denis Angell
03569dbb11 add correct imports 2024-05-14 12:03:07 +02:00
Denis Angell
cb77121e20 Merge branch 'dev' into strict-builds 2024-05-06 12:14:05 +02:00
Denis Angell
c55a97c51a Update STValidation.h 2024-03-25 09:27:17 +01:00
Denis Angell
fc0be9c416 Merge branch 'dev' into strict-builds 2024-03-25 09:13:55 +01:00
Denis Angell
aaccf9b5b2 revert remove json log 2024-03-25 09:12:55 +01:00
Denis Angell
17af075665 revert remove json log 2024-03-25 09:12:33 +01:00
Denis Angell
e6b362c832 Merge branch 'dev' into strict-builds 2024-03-22 13:38:51 +01:00
Denis Angell
5b2b915955 clang-format 2024-03-18 14:57:35 +01:00
Denis Angell
e801ead39d fix more headers 2024-03-18 14:52:00 +01:00
Denis Angell
78a96dd633 add missing headers 2024-03-18 13:17:10 +01:00
Denis Angell
b3984c166d misc 2024-03-18 13:13:09 +01:00
Denis Angell
945f737706 Update ServerInfo.cpp 2024-03-18 13:09:01 +01:00
Denis Angell
8360ff8bc2 more linting 2024-03-18 13:03:05 +01:00
Denis Angell
c1274d2a12 Update ServerDefinitions_test.cpp 2024-03-18 13:02:03 +01:00
Denis Angell
4aa79b6100 Update ClaimReward_test.cpp 2024-03-18 12:59:05 +01:00
Denis Angell
6a4c563ced fix
invalid operands to binary expression ('basic_ostream<char, std::char_traits<char>>' and 'Json::Value')
2024-03-18 12:38:25 +01:00
26 changed files with 70 additions and 23 deletions

View File

@@ -433,13 +433,17 @@ target_sources (rippled PRIVATE
src/ripple/app/tx/impl/CancelOffer.cpp src/ripple/app/tx/impl/CancelOffer.cpp
src/ripple/app/tx/impl/CashCheck.cpp src/ripple/app/tx/impl/CashCheck.cpp
src/ripple/app/tx/impl/Change.cpp src/ripple/app/tx/impl/Change.cpp
src/ripple/app/tx/impl/ClaimReward.cpp
src/ripple/app/tx/impl/CreateCheck.cpp src/ripple/app/tx/impl/CreateCheck.cpp
src/ripple/app/tx/impl/CreateOffer.cpp src/ripple/app/tx/impl/CreateOffer.cpp
src/ripple/app/tx/impl/CreateTicket.cpp src/ripple/app/tx/impl/CreateTicket.cpp
src/ripple/app/tx/impl/DeleteAccount.cpp src/ripple/app/tx/impl/DeleteAccount.cpp
src/ripple/app/tx/impl/DepositPreauth.cpp src/ripple/app/tx/impl/DepositPreauth.cpp
src/ripple/app/tx/impl/Escrow.cpp src/ripple/app/tx/impl/Escrow.cpp
src/ripple/app/tx/impl/GenesisMint.cpp
src/ripple/app/tx/impl/Import.cpp
src/ripple/app/tx/impl/InvariantCheck.cpp src/ripple/app/tx/impl/InvariantCheck.cpp
src/ripple/app/tx/impl/Invoke.cpp
src/ripple/app/tx/impl/NFTokenAcceptOffer.cpp src/ripple/app/tx/impl/NFTokenAcceptOffer.cpp
src/ripple/app/tx/impl/NFTokenBurn.cpp src/ripple/app/tx/impl/NFTokenBurn.cpp
src/ripple/app/tx/impl/NFTokenCancelOffer.cpp src/ripple/app/tx/impl/NFTokenCancelOffer.cpp
@@ -448,14 +452,10 @@ target_sources (rippled PRIVATE
src/ripple/app/tx/impl/OfferStream.cpp src/ripple/app/tx/impl/OfferStream.cpp
src/ripple/app/tx/impl/PayChan.cpp src/ripple/app/tx/impl/PayChan.cpp
src/ripple/app/tx/impl/Payment.cpp src/ripple/app/tx/impl/Payment.cpp
src/ripple/app/tx/impl/SetAccount.cpp
src/ripple/app/tx/impl/SetRegularKey.cpp
src/ripple/app/tx/impl/SetHook.cpp
src/ripple/app/tx/impl/ClaimReward.cpp
src/ripple/app/tx/impl/GenesisMint.cpp
src/ripple/app/tx/impl/Import.cpp
src/ripple/app/tx/impl/Invoke.cpp
src/ripple/app/tx/impl/Remit.cpp src/ripple/app/tx/impl/Remit.cpp
src/ripple/app/tx/impl/SetAccount.cpp
src/ripple/app/tx/impl/SetHook.cpp
src/ripple/app/tx/impl/SetRegularKey.cpp
src/ripple/app/tx/impl/SetSignerList.cpp src/ripple/app/tx/impl/SetSignerList.cpp
src/ripple/app/tx/impl/SetTrust.cpp src/ripple/app/tx/impl/SetTrust.cpp
src/ripple/app/tx/impl/SignerEntries.cpp src/ripple/app/tx/impl/SignerEntries.cpp

View File

@@ -53,7 +53,7 @@ Loop: test.app test.jtx
test.app > test.jtx test.app > test.jtx
Loop: test.app test.rpc Loop: test.app test.rpc
test.rpc == test.app test.rpc ~= test.app
Loop: test.jtx test.toplevel Loop: test.jtx test.toplevel
test.toplevel > test.jtx test.toplevel > test.jtx

View File

@@ -1,12 +1,17 @@
#include <ripple/app/hook/applyHook.h> #include <ripple/app/hook/applyHook.h>
#include <ripple/app/ledger/OpenLedger.h> #include <ripple/app/ledger/OpenLedger.h>
#include <ripple/app/ledger/TransactionMaster.h> #include <ripple/app/ledger/TransactionMaster.h>
#include <ripple/app/misc/HashRouter.h>
#include <ripple/app/misc/NetworkOPs.h> #include <ripple/app/misc/NetworkOPs.h>
#include <ripple/app/misc/Transaction.h> #include <ripple/app/misc/Transaction.h>
#include <ripple/app/misc/TxQ.h> #include <ripple/app/misc/TxQ.h>
#include <ripple/app/tx/impl/Import.h>
#include <ripple/app/tx/impl/details/NFTokenUtils.h>
#include <ripple/basics/Log.h> #include <ripple/basics/Log.h>
#include <ripple/basics/Slice.h> #include <ripple/basics/Slice.h>
#include <ripple/protocol/ErrorCodes.h> #include <ripple/protocol/ErrorCodes.h>
#include <ripple/protocol/TxFlags.h>
#include <ripple/protocol/st.h>
#include <ripple/protocol/tokens.h> #include <ripple/protocol/tokens.h>
#include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/multiprecision/cpp_dec_float.hpp>
#include <any> #include <any>

View File

@@ -19,7 +19,9 @@
#include <ripple/app/consensus/RCLValidations.h> #include <ripple/app/consensus/RCLValidations.h>
#include <ripple/app/ledger/Ledger.h> #include <ripple/app/ledger/Ledger.h>
#include <ripple/app/main/Application.h>
#include <ripple/app/misc/NegativeUNLVote.h> #include <ripple/app/misc/NegativeUNLVote.h>
#include <ripple/json/to_string.h>
namespace ripple { namespace ripple {

View File

@@ -23,6 +23,7 @@
#include <ripple/ledger/View.h> #include <ripple/ledger/View.h>
#include <ripple/protocol/Feature.h> #include <ripple/protocol/Feature.h>
#include <ripple/protocol/Indexes.h> #include <ripple/protocol/Indexes.h>
#include <ripple/protocol/st.h>
namespace ripple { namespace ripple {

View File

@@ -24,12 +24,15 @@
#include <ripple/basics/base64.h> #include <ripple/basics/base64.h>
#include <ripple/json/json_reader.h> #include <ripple/json/json_reader.h>
#include <ripple/json/json_value.h> #include <ripple/json/json_value.h>
#include <ripple/json/to_string.h>
#include <ripple/ledger/View.h> #include <ripple/ledger/View.h>
#include <ripple/protocol/Feature.h> #include <ripple/protocol/Feature.h>
#include <ripple/protocol/Import.h> #include <ripple/protocol/Import.h>
#include <ripple/protocol/Indexes.h> #include <ripple/protocol/Indexes.h>
#include <ripple/protocol/PublicKey.h> #include <ripple/protocol/PublicKey.h>
#include <ripple/protocol/STTx.h> #include <ripple/protocol/STTx.h>
#include <ripple/protocol/STValidation.h>
#include <ripple/protocol/st.h>
#include <algorithm> #include <algorithm>
#include <charconv> #include <charconv>
#include <iostream> #include <iostream>

View File

@@ -22,6 +22,7 @@
#include <ripple/ledger/View.h> #include <ripple/ledger/View.h>
#include <ripple/protocol/Feature.h> #include <ripple/protocol/Feature.h>
#include <ripple/protocol/Indexes.h> #include <ripple/protocol/Indexes.h>
#include <ripple/protocol/st.h>
namespace ripple { namespace ripple {

View File

@@ -23,6 +23,9 @@
#include <ripple/ledger/View.h> #include <ripple/ledger/View.h>
#include <ripple/protocol/Feature.h> #include <ripple/protocol/Feature.h>
#include <ripple/protocol/Indexes.h> #include <ripple/protocol/Indexes.h>
#include <ripple/protocol/TxFlags.h>
#include <ripple/protocol/st.h>
namespace ripple { namespace ripple {
TxConsequences TxConsequences

View File

@@ -153,8 +153,10 @@ SetSignerList::preCompute()
// NOTE: This way of computing the OwnerCount associated with a SignerList // NOTE: This way of computing the OwnerCount associated with a SignerList
// is valid until the featureMultiSignReserve amendment passes. Once it // is valid until the featureMultiSignReserve amendment passes. Once it
// passes then just 1 OwnerCount is associated with a SignerList. // passes then just 1 OwnerCount is associated with a SignerList.
static int int
signerCountBasedOwnerCountDelta(std::size_t entryCount, Rules const& rules) SetSignerList::signerCountBasedOwnerCountDelta(
std::size_t entryCount,
Rules const& rules)
{ {
// We always compute the full change in OwnerCount, taking into account: // We always compute the full change in OwnerCount, taking into account:
// o The fact that we're adding/removing a SignerList and // o The fact that we're adding/removing a SignerList and
@@ -176,8 +178,8 @@ signerCountBasedOwnerCountDelta(std::size_t entryCount, Rules const& rules)
return 2 + static_cast<int>(entryCount); return 2 + static_cast<int>(entryCount);
} }
static TER TER
removeSignersFromLedger( SetSignerList::removeSignersFromLedger(
Application& app, Application& app,
ApplyView& view, ApplyView& view,
Keylet const& accountKeylet, Keylet const& accountKeylet,

View File

@@ -71,6 +71,18 @@ public:
AccountID const& account, AccountID const& account,
beast::Journal j); beast::Journal j);
static TER
removeSignersFromLedger(
Application& app,
ApplyView& view,
Keylet const& accountKeylet,
Keylet const& ownerDirKeylet,
Keylet const& signerListKeylet,
beast::Journal j);
static int
signerCountBasedOwnerCountDelta(std::size_t entryCount, Rules const& rules);
private: private:
static void static void
writeSignersToSLE( writeSignersToSLE(

View File

@@ -23,6 +23,7 @@
#include <ripple/app/tx/impl/CancelOffer.h> #include <ripple/app/tx/impl/CancelOffer.h>
#include <ripple/app/tx/impl/CashCheck.h> #include <ripple/app/tx/impl/CashCheck.h>
#include <ripple/app/tx/impl/Change.h> #include <ripple/app/tx/impl/Change.h>
#include <ripple/app/tx/impl/ClaimReward.h>
#include <ripple/app/tx/impl/CreateCheck.h> #include <ripple/app/tx/impl/CreateCheck.h>
#include <ripple/app/tx/impl/CreateOffer.h> #include <ripple/app/tx/impl/CreateOffer.h>
#include <ripple/app/tx/impl/CreateTicket.h> #include <ripple/app/tx/impl/CreateTicket.h>
@@ -39,12 +40,14 @@
#include <ripple/app/tx/impl/NFTokenMint.h> #include <ripple/app/tx/impl/NFTokenMint.h>
#include <ripple/app/tx/impl/PayChan.h> #include <ripple/app/tx/impl/PayChan.h>
#include <ripple/app/tx/impl/Payment.h> #include <ripple/app/tx/impl/Payment.h>
#include <ripple/app/tx/impl/Remit.h>
#include <ripple/app/tx/impl/SetAccount.h> #include <ripple/app/tx/impl/SetAccount.h>
#include <ripple/app/tx/impl/SetHook.h> #include <ripple/app/tx/impl/SetHook.h>
#include <ripple/app/tx/impl/SetRegularKey.h> #include <ripple/app/tx/impl/SetRegularKey.h>
#include <ripple/app/tx/impl/SetSignerList.h> #include <ripple/app/tx/impl/SetSignerList.h>
#include <ripple/app/tx/impl/SetTrust.h> #include <ripple/app/tx/impl/SetTrust.h>
#include <ripple/app/tx/impl/URIToken.h> #include <ripple/app/tx/impl/URIToken.h>
#include <ripple/app/tx/impl/XahauGenesis.h>
namespace ripple { namespace ripple {

View File

@@ -30,7 +30,7 @@ mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div)
{ {
using namespace boost::multiprecision; using namespace boost::multiprecision;
uint128_t result; boost::multiprecision::uint128_t result;
result = multiply(result, value, mul); result = multiply(result, value, mul);
result /= div; result /= div;

View File

@@ -19,6 +19,7 @@
#include <ripple/basics/contract.h> #include <ripple/basics/contract.h>
#include <ripple/ledger/detail/ApplyViewBase.h> #include <ripple/ledger/detail/ApplyViewBase.h>
#include <ripple/protocol/STAccount.h>
namespace ripple { namespace ripple {
namespace detail { namespace detail {

View File

@@ -19,6 +19,7 @@
#include <ripple/app/main/Application.h> #include <ripple/app/main/Application.h>
#include <ripple/app/misc/NetworkOPs.h> #include <ripple/app/misc/NetworkOPs.h>
#include <ripple/app/reporting/P2pProxy.h>
#include <ripple/protocol/jss.h> #include <ripple/protocol/jss.h>
#include <ripple/rpc/Context.h> #include <ripple/rpc/Context.h>
#include <ripple/rpc/Role.h> #include <ripple/rpc/Role.h>

View File

@@ -17,7 +17,9 @@
*/ */
//============================================================================== //==============================================================================
#include <ripple/app/ledger/LedgerMaster.h>
#include <ripple/protocol/Feature.h> #include <ripple/protocol/Feature.h>
#include <ripple/protocol/jss.h>
#include <test/jtx.h> #include <test/jtx.h>
namespace ripple { namespace ripple {

View File

@@ -15,8 +15,8 @@
*/ */
//============================================================================== //==============================================================================
#include <ripple/app/tx/impl/XahauGenesis.h>
#include <ripple/protocol/Feature.h> #include <ripple/protocol/Feature.h>
#include <ripple/protocol/jss.h>
#include <optional> #include <optional>
#include <test/jtx.h> #include <test/jtx.h>
@@ -94,7 +94,7 @@ struct GenesisMint_test : public beast::unit_test::suite
using namespace jtx; using namespace jtx;
using namespace std::literals::chrono_literals; using namespace std::literals::chrono_literals;
Env env{*this, envconfig(), features, nullptr}; Env env{*this, envconfig(), features};
auto const alice = Account("alice"); auto const alice = Account("alice");
auto const bob = Account("bob"); auto const bob = Account("bob");
auto const invoker = Account("invoker"); auto const invoker = Account("invoker");
@@ -133,11 +133,7 @@ struct GenesisMint_test : public beast::unit_test::suite
using namespace jtx; using namespace jtx;
using namespace std::literals::chrono_literals; using namespace std::literals::chrono_literals;
Env env{*this, envconfig(), features, nullptr}; Env env{*this, envconfig(), features};
// Env env{*this, envconfig(), features, nullptr,
// // beast::severities::kWarning
// beast::severities::kTrace
// };
auto const alice = Account("alice"); auto const alice = Account("alice");
auto const bob = Account("bob"); auto const bob = Account("bob");
auto const invoker = Account("invoker"); auto const invoker = Account("invoker");
@@ -639,7 +635,7 @@ struct GenesisMint_test : public beast::unit_test::suite
using namespace jtx; using namespace jtx;
using namespace std::literals::chrono_literals; using namespace std::literals::chrono_literals;
Env env{*this, envconfig(), features, nullptr}; Env env{*this, envconfig(), features};
auto const alice = Account("alice"); auto const alice = Account("alice");
auto const bob = Account("bob"); auto const bob = Account("bob");
env.fund(XRP(10000), alice, bob); env.fund(XRP(10000), alice, bob);
@@ -661,7 +657,7 @@ struct GenesisMint_test : public beast::unit_test::suite
using namespace jtx; using namespace jtx;
using namespace std::literals::chrono_literals; using namespace std::literals::chrono_literals;
Env env{*this, envconfig(), features, nullptr}; Env env{*this, envconfig(), features};
auto const alice = Account("alice"); auto const alice = Account("alice");
auto const bob = Account("bob"); auto const bob = Account("bob");
env.fund(XRP(10000), alice, bob); env.fund(XRP(10000), alice, bob);

View File

@@ -17,6 +17,7 @@
*/ */
//============================================================================== //==============================================================================
#include <ripple/protocol/jss.h>
#include <test/jtx.h> #include <test/jtx.h>
namespace ripple { namespace ripple {

View File

@@ -2132,7 +2132,6 @@ struct Remit_test : public beast::unit_test::suite
auto const delta = USD(100); auto const delta = USD(100);
env(remit::remit(alice, bob), remit::amts({delta})); env(remit::remit(alice, bob), remit::amts({delta}));
env.close(); env.close();
auto xferRate = transferRate(*env.current(), gw);
auto const postAlice = env.balance(alice, USD.issue()); auto const postAlice = env.balance(alice, USD.issue());
BEAST_EXPECT(env.balance(bob, USD.issue()) == preBob + delta); BEAST_EXPECT(env.balance(bob, USD.issue()) == preBob + delta);
BEAST_EXPECT(to_string(postAlice.value()) == tc.result); BEAST_EXPECT(to_string(postAlice.value()) == tc.result);

View File

@@ -18,6 +18,7 @@
*/ */
//============================================================================== //==============================================================================
#include <ripple/app/hook/Enum.h>
#include <ripple/app/misc/HashRouter.h> #include <ripple/app/misc/HashRouter.h>
#include <ripple/app/misc/TxQ.h> #include <ripple/app/misc/TxQ.h>
#include <ripple/app/tx/apply.h> #include <ripple/app/tx/apply.h>
@@ -31,6 +32,13 @@
namespace ripple { namespace ripple {
namespace test { namespace test {
#define BEAST_REQUIRE(x) \
{ \
BEAST_EXPECT(!!(x)); \
if (!(x)) \
return; \
}
struct SetHookTSH_test : public beast::unit_test::suite struct SetHookTSH_test : public beast::unit_test::suite
{ {
private: private:

View File

@@ -17,6 +17,7 @@
*/ */
//============================================================================== //==============================================================================
#include <ripple/protocol/jss.h>
#include <test/jtx/Env.h> #include <test/jtx/Env.h>
#include <test/jtx/acctdelete.h> #include <test/jtx/acctdelete.h>

View File

@@ -17,6 +17,7 @@
*/ */
//============================================================================== //==============================================================================
#include <ripple/protocol/TxFlags.h>
#include <ripple/protocol/jss.h> #include <ripple/protocol/jss.h>
#include <test/jtx/escrow.h> #include <test/jtx/escrow.h>

View File

@@ -17,6 +17,7 @@
*/ */
//============================================================================== //==============================================================================
#include <ripple/basics/StringUtilities.h>
#include <ripple/json/json_reader.h> #include <ripple/json/json_reader.h>
#include <ripple/json/json_writer.h> #include <ripple/json/json_writer.h>
#include <ripple/protocol/Feature.h> #include <ripple/protocol/Feature.h>

View File

@@ -17,6 +17,7 @@
*/ */
//============================================================================== //==============================================================================
#include <ripple/protocol/TxFlags.h>
#include <ripple/protocol/jss.h> #include <ripple/protocol/jss.h>
#include <test/jtx/paychan.h> #include <test/jtx/paychan.h>

View File

@@ -23,6 +23,7 @@
#include <ripple/json/json_value.h> #include <ripple/json/json_value.h>
#include <ripple/protocol/STAmount.h> #include <ripple/protocol/STAmount.h>
#include <test/jtx/Account.h> #include <test/jtx/Account.h>
#include <test/jtx/Env.h>
namespace ripple { namespace ripple {
namespace test { namespace test {

View File

@@ -24,6 +24,7 @@
#include <ripple/beast/unit_test.h> #include <ripple/beast/unit_test.h>
#include <ripple/protocol/ErrorCodes.h> #include <ripple/protocol/ErrorCodes.h>
#include <ripple/protocol/jss.h> #include <ripple/protocol/jss.h>
#include <test/app/Import_json.h>
#include <test/jtx.h> #include <test/jtx.h>
namespace ripple { namespace ripple {

View File

@@ -19,6 +19,7 @@
#include <ripple/app/misc/AmendmentTable.h> #include <ripple/app/misc/AmendmentTable.h>
#include <ripple/beast/unit_test.h> #include <ripple/beast/unit_test.h>
#include <ripple/json/json_reader.h>
#include <ripple/protocol/Feature.h> #include <ripple/protocol/Feature.h>
#include <ripple/protocol/jss.h> #include <ripple/protocol/jss.h>
#include <test/jtx.h> #include <test/jtx.h>