mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-30 16:58:30 +00:00
@@ -2581,6 +2581,11 @@ class Batch_test : public beast::unit_test::suite
|
||||
{
|
||||
testcase("loan");
|
||||
|
||||
bool const lendingBatchEnabled =
|
||||
!std::any_of(Batch::disabledTxTypes.begin(), Batch::disabledTxTypes.end(), [](auto const& disabled) {
|
||||
return disabled == ttLOAN_BROKER_SET;
|
||||
});
|
||||
|
||||
using namespace test::jtx;
|
||||
|
||||
test::jtx::Env env{*this, features | featureSingleAssetVault | featureLendingProtocol | featureMPTokensV1};
|
||||
@@ -2640,7 +2645,7 @@ class Batch_test : public beast::unit_test::suite
|
||||
{
|
||||
auto const [txIDs, batchID] = submitBatch(
|
||||
env,
|
||||
temBAD_SIGNATURE,
|
||||
lendingBatchEnabled ? temBAD_SIGNATURE : temINVALID_INNER_BATCH,
|
||||
batch::outer(lender, lenderSeq, batchFee, tfAllOrNothing),
|
||||
batch::inner(
|
||||
env.json(
|
||||
@@ -2671,7 +2676,7 @@ class Batch_test : public beast::unit_test::suite
|
||||
{
|
||||
auto const [txIDs, batchID] = submitBatch(
|
||||
env,
|
||||
temBAD_SIGNER,
|
||||
lendingBatchEnabled ? temBAD_SIGNER : temINVALID_INNER_BATCH,
|
||||
batch::outer(lender, lenderSeq, batchFee, tfAllOrNothing),
|
||||
batch::inner(
|
||||
env.json(
|
||||
@@ -2691,7 +2696,7 @@ class Batch_test : public beast::unit_test::suite
|
||||
auto const batchFee = batch::calcBatchFee(env, 1, 2);
|
||||
auto const [txIDs, batchID] = submitBatch(
|
||||
env,
|
||||
TER(tesSUCCESS),
|
||||
lendingBatchEnabled ? TER(tesSUCCESS) : TER(temINVALID_INNER_BATCH),
|
||||
batch::outer(lender, lenderSeq, batchFee, tfAllOrNothing),
|
||||
batch::inner(
|
||||
env.json(
|
||||
@@ -2723,7 +2728,7 @@ class Batch_test : public beast::unit_test::suite
|
||||
auto const batchFee = batch::calcBatchFee(env, 1, 2);
|
||||
auto const [txIDs, batchID] = submitBatch(
|
||||
env,
|
||||
TER(tesSUCCESS),
|
||||
lendingBatchEnabled ? TER(tesSUCCESS) : TER(temINVALID_INNER_BATCH),
|
||||
batch::outer(lender, lenderSeq, batchFee, tfAllOrNothing),
|
||||
batch::inner(
|
||||
env.json(
|
||||
@@ -2738,7 +2743,8 @@ class Batch_test : public beast::unit_test::suite
|
||||
}
|
||||
env.close();
|
||||
BEAST_EXPECT(env.le(brokerKeylet));
|
||||
if (auto const sleLoan = env.le(loanKeylet); BEAST_EXPECT(sleLoan))
|
||||
if (auto const sleLoan = env.le(loanKeylet);
|
||||
lendingBatchEnabled ? BEAST_EXPECT(sleLoan) : !BEAST_EXPECT(!sleLoan))
|
||||
{
|
||||
BEAST_EXPECT(sleLoan->isFlag(lsfLoanImpaired));
|
||||
}
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
#include <test/jtx/AMM.h>
|
||||
#include <test/jtx/Env.h>
|
||||
|
||||
#include <xrpld/app/tx/apply.h>
|
||||
#include <xrpld/app/tx/detail/ApplyContext.h>
|
||||
#include <xrpld/app/tx/detail/InvariantCheck.h>
|
||||
|
||||
#include <xrpl/beast/unit_test/suite.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/protocol/AccountID.h>
|
||||
@@ -18,11 +14,15 @@
|
||||
#include <xrpl/protocol/TER.h>
|
||||
#include <xrpl/protocol/TxFormats.h>
|
||||
#include <xrpl/protocol/XRPAmount.h>
|
||||
#include <xrpl/tx/ApplyContext.h>
|
||||
#include <xrpl/tx/InvariantCheck.h>
|
||||
#include <xrpl/tx/apply.h>
|
||||
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
|
||||
#include <initializer_list>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace xrpl {
|
||||
namespace test {
|
||||
|
||||
@@ -14,8 +14,7 @@ namespace jtx {
|
||||
std::tuple<Json::Value, Keylet>
|
||||
Vault::create(CreateArgs const& args)
|
||||
{
|
||||
auto sequence = args.sequence ? *args.sequence : env.seq(args.owner);
|
||||
auto keylet = keylet::vault(args.owner.id(), sequence);
|
||||
auto keylet = keylet::vault(args.owner.id(), env.seq(args.owner));
|
||||
Json::Value jv;
|
||||
jv[jss::TransactionType] = jss::VaultCreate;
|
||||
jv[jss::Account] = args.owner.human();
|
||||
|
||||
@@ -26,7 +26,6 @@ struct Vault
|
||||
Account owner;
|
||||
Asset asset;
|
||||
std::optional<std::uint32_t> flags{};
|
||||
std::optional<uint32_t> sequence;
|
||||
};
|
||||
|
||||
/** Return a VaultCreate transaction and the Vault's expected keylet. */
|
||||
|
||||
Reference in New Issue
Block a user