mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-27 22:15:49 +00:00
update flags
This commit is contained in:
@@ -217,23 +217,20 @@ invoke_preclaim(PreclaimContext const& ctx)
|
|||||||
|
|
||||||
if (id != beast::zero)
|
if (id != beast::zero)
|
||||||
{
|
{
|
||||||
// TER result = T::checkSeqProxy(ctx.view, ctx.tx, ctx.j);
|
TER result = T::checkSeqProxy(ctx.view, ctx.tx, ctx.j);
|
||||||
|
|
||||||
// if (result != tesSUCCESS)
|
if (result != tesSUCCESS)
|
||||||
// return result;
|
return result;
|
||||||
|
|
||||||
// Ignore Sequence Validation on ttBATCH txns
|
|
||||||
TER result = tesSUCCESS;
|
|
||||||
|
|
||||||
result = T::checkPriorTxAndLastLedger(ctx);
|
result = T::checkPriorTxAndLastLedger(ctx);
|
||||||
|
|
||||||
if (result != tesSUCCESS)
|
if (result != tesSUCCESS)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
// result = T::checkFee(ctx, calculateBaseFee(ctx.view, ctx.tx));
|
result = T::checkFee(ctx, calculateBaseFee(ctx.view, ctx.tx));
|
||||||
|
|
||||||
// if (result != tesSUCCESS)
|
if (result != tesSUCCESS)
|
||||||
// return result;
|
return result;
|
||||||
|
|
||||||
result = T::checkSign(ctx);
|
result = T::checkSign(ctx);
|
||||||
|
|
||||||
@@ -297,7 +294,7 @@ Batch::preflight(PreflightContext const& ctx)
|
|||||||
return temMALFORMED;
|
return temMALFORMED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (txns.size() > 12)
|
if (txns.size() > 8)
|
||||||
{
|
{
|
||||||
JLOG(ctx.j.error()) << "Batch: txns array exceeds 12 entries.";
|
JLOG(ctx.j.error()) << "Batch: txns array exceeds 12 entries.";
|
||||||
return temMALFORMED;
|
return temMALFORMED;
|
||||||
@@ -485,26 +482,28 @@ Batch::doApply()
|
|||||||
|
|
||||||
avi.addBatchExecutionMetaData(std::move(meta));
|
avi.addBatchExecutionMetaData(std::move(meta));
|
||||||
|
|
||||||
std::cout << "tfBatchFirst: " << (flags & tfBatchFirst) << "\n";
|
std::cout << "tfAllOrNothing: " << (flags & tfAllOrNothing) << "\n";
|
||||||
std::cout << "tfBatchOne: " << (flags & tfBatchOne) << "\n";
|
std::cout << "tfOnlyOne: " << (flags & tfOnlyOne) << "\n";
|
||||||
|
std::cout << "tfUntilFailure: " << (flags & tfUntilFailure) << "\n";
|
||||||
|
std::cout << "tfIndependent: " << (flags & tfIndependent) << "\n";
|
||||||
std::cout << "tfBatchAtomic: " << _result.first << "\n";
|
std::cout << "tfBatchAtomic: " << _result.first << "\n";
|
||||||
|
|
||||||
if (_result.first != tesSUCCESS)
|
if (_result.first != tesSUCCESS)
|
||||||
{
|
{
|
||||||
if (flags & tfBatchFirst)
|
if (flags & tfUntilFailure)
|
||||||
{
|
{
|
||||||
actx.discard();
|
actx.discard();
|
||||||
result = tecBATCH_FAILURE;
|
result = tecBATCH_FAILURE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (flags & tfBatchOne)
|
if (flags & tfOnlyOne)
|
||||||
{
|
{
|
||||||
actx.discard();
|
actx.discard();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_result.first == tesSUCCESS && flags & tfBatchOne)
|
if (_result.first == tesSUCCESS && flags & tfOnlyOne)
|
||||||
{
|
{
|
||||||
result = tecBATCH_FAILURE;
|
result = tecBATCH_FAILURE;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -169,13 +169,14 @@ constexpr std::uint32_t const tfURITokenNonMintMask = ~tfUniversal;
|
|||||||
constexpr std::uint32_t const tfOptOut = 0x00000001;
|
constexpr std::uint32_t const tfOptOut = 0x00000001;
|
||||||
|
|
||||||
enum BatchFlags : std::uint32_t {
|
enum BatchFlags : std::uint32_t {
|
||||||
tfBatchAtomic = 0x00000001,
|
tfAllOrNothing = 0x00000001,
|
||||||
tfBatchFirst = 0x00000002,
|
tfOnlyOne = 0x00000002,
|
||||||
tfBatchOne = 0x00000004,
|
tfUntilFailure = 0x00000004,
|
||||||
|
tfIndependent = 0x00000008,
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr std::uint32_t const tfBatchMask =
|
constexpr std::uint32_t const tfBatchMask =
|
||||||
~(tfUniversal | tfBatchAtomic | tfBatchFirst);
|
~(tfUniversal | tfAllOrNothing | tfOnlyOne | tfUntilFailure | tfIndependent);
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
|||||||
@@ -22,12 +22,12 @@
|
|||||||
#include <ripple/protocol/jss.h>
|
#include <ripple/protocol/jss.h>
|
||||||
#include <test/jtx.h>
|
#include <test/jtx.h>
|
||||||
|
|
||||||
// tfBatchOne
|
// tfOnlyOne
|
||||||
// Tx1: Payment = tecUNFUNDED => Leave
|
// Tx1: Payment = tecUNFUNDED => Leave
|
||||||
// Tx2: Payment = tesSUCCESS => Leave
|
// Tx2: Payment = tesSUCCESS => Leave
|
||||||
// TER(tesSUCCESS)
|
// TER(tesSUCCESS)
|
||||||
|
|
||||||
// tfBatchFirst
|
// tfUntilFailure
|
||||||
// Tx1: Payment = tesSUCCESS => Leave
|
// Tx1: Payment = tesSUCCESS => Leave
|
||||||
// Tx2: Payment = tecUNFUNDED => Leave
|
// Tx2: Payment = tecUNFUNDED => Leave
|
||||||
// TER(tesSUCCESS)
|
// TER(tesSUCCESS)
|
||||||
@@ -325,7 +325,7 @@ class Batch_test : public beast::unit_test::suite
|
|||||||
Json::Value const tx2 = pay(alice, bob, XRP(999));
|
Json::Value const tx2 = pay(alice, bob, XRP(999));
|
||||||
jv = addBatchTx(jv, tx2, alice, feeDrops, 1, seq + 2);
|
jv = addBatchTx(jv, tx2, alice, feeDrops, 1, seq + 2);
|
||||||
|
|
||||||
env(jv, fee(feeDrops * 2), txflags(tfBatchAtomic), ter(tecBATCH_FAILURE));
|
env(jv, fee(feeDrops * 2), txflags(tfAllOrNothing), ter(tecBATCH_FAILURE));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
Json::Value params;
|
Json::Value params;
|
||||||
@@ -389,7 +389,7 @@ class Batch_test : public beast::unit_test::suite
|
|||||||
Json::Value const tx3 = pay(alice, bob, XRP(1));
|
Json::Value const tx3 = pay(alice, bob, XRP(1));
|
||||||
jv = addBatchTx(jv, tx3, alice, feeDrops, 2, 2);
|
jv = addBatchTx(jv, tx3, alice, feeDrops, 2, 2);
|
||||||
|
|
||||||
env(jv, fee(feeDrops * 3), txflags(tfBatchFirst), ter(tecBATCH_FAILURE));
|
env(jv, fee(feeDrops * 3), txflags(tfOnlyOne), ter(tecBATCH_FAILURE));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
Json::Value params;
|
Json::Value params;
|
||||||
|
|||||||
Reference in New Issue
Block a user