mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
bug fixes
This commit is contained in:
@@ -131,20 +131,6 @@ Import::preflight(PreflightContext const& ctx)
|
||||
|
||||
auto& tx = ctx.tx;
|
||||
|
||||
if (tx.getFieldAmount(sfFee) != beast::zero)
|
||||
{
|
||||
if (tx.isFieldPresent(sfIssuer))
|
||||
{
|
||||
// pass. Import against a Hook does pay a fee
|
||||
}
|
||||
else
|
||||
{
|
||||
JLOG(ctx.j.warn())
|
||||
<< "Import: sfFee must be 0 "
|
||||
<< tx.getTransactionID();
|
||||
return temMALFORMED;
|
||||
}
|
||||
}
|
||||
|
||||
if (tx.getFieldVL(sfBlob).size() > (512 * 1024))
|
||||
{
|
||||
|
||||
@@ -1021,11 +1021,12 @@ std::pair<TER, XRPAmount>
|
||||
Transactor::reset(XRPAmount fee)
|
||||
{
|
||||
ApplyViewImpl& avi = dynamic_cast<ApplyViewImpl&>(ctx_.view());
|
||||
std::vector<STObject> hookMeta;
|
||||
avi.copyHookMetaData(hookMeta);
|
||||
std::vector<STObject> executions;
|
||||
std::vector<STObject> emissions;
|
||||
avi.copyHookMetaData(executions, emissions);
|
||||
ctx_.discard();
|
||||
ApplyViewImpl& avi2 = dynamic_cast<ApplyViewImpl&>(ctx_.view());
|
||||
avi2.setHookMetaData(std::move(hookMeta));
|
||||
avi2.setHookMetaData(std::move(executions), std::move(emissions));
|
||||
|
||||
auto const txnAcct =
|
||||
view().peek(keylet::account(ctx_.tx.getAccountID(sfAccount)));
|
||||
|
||||
@@ -202,7 +202,6 @@ invoke_preclaim(PreclaimContext const& ctx)
|
||||
return result;
|
||||
|
||||
result =
|
||||
ctx.tx.getTxnType() == ttIMPORT ? tesSUCCESS :
|
||||
T::checkFee(ctx, calculateBaseFee(ctx.view, ctx.tx));
|
||||
|
||||
if (result != tesSUCCESS)
|
||||
|
||||
@@ -91,15 +91,17 @@ public:
|
||||
}
|
||||
|
||||
void
|
||||
setHookMetaData(std::vector<STObject>&& vec)
|
||||
setHookMetaData(std::vector<STObject>&& executions, std::vector<STObject>&& emissions)
|
||||
{
|
||||
hookExecution_ = std::move(vec);
|
||||
hookExecution_ = std::move(executions);
|
||||
hookEmission_ = std::move(emissions);
|
||||
}
|
||||
|
||||
void
|
||||
copyHookMetaData(std::vector<STObject>& into)
|
||||
copyHookMetaData(std::vector<STObject>& execution /* in */, std::vector<STObject>& emission /* in */)
|
||||
{
|
||||
std::copy(hookExecution_.begin(), hookExecution_.end(), std::back_inserter(into));
|
||||
std::copy(hookExecution_.begin(), hookExecution_.end(), std::back_inserter(execution));
|
||||
std::copy(hookEmission_.begin(), hookEmission_.end(), std::back_inserter(emission));
|
||||
}
|
||||
|
||||
uint16_t
|
||||
|
||||
@@ -2582,6 +2582,7 @@ class Import_test : public beast::unit_test::suite
|
||||
|
||||
auto const [signers, signersSle] =
|
||||
signersKeyAndSle(*env.current(), alice);
|
||||
BEAST_REQUIRE(!!signersSle);
|
||||
auto const signerEntries =
|
||||
signersSle->getFieldArray(sfSignerEntries);
|
||||
BEAST_EXPECT(signerEntries.size() == 1);
|
||||
|
||||
Reference in New Issue
Block a user