mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Connect votable gas limit into VM (#5360)
* [WIP] add gas limit * [WIP] host function escrow tests * finish test * uncomment out tests
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -372,6 +372,32 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct data
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
std::string value_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit data(std::string func) : value_(func)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
explicit data(Slice const& func) : value_(strHex(func))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template <size_t N>
|
||||||
|
explicit data(std::array<std::uint8_t, N> const& f) : data(makeSlice(f))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
operator()(Env&, JTx& jt) const
|
||||||
|
{
|
||||||
|
jt.jv[sfData.jsonName] = value_;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/* Payment Channel */
|
/* Payment Channel */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#ifndef RIPPLE_APP_MISC_AMMUTILS_H_INLCUDED
|
#ifndef RIPPLE_APP_MISC_AMMUTILS_H_INCLUDED
|
||||||
#define RIPPLE_APP_MISC_AMMUTILS_H_INLCUDED
|
#define RIPPLE_APP_MISC_AMMUTILS_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/ledger/View.h>
|
#include <xrpld/ledger/View.h>
|
||||||
|
|
||||||
@@ -127,4 +127,4 @@ isOnlyLiquidityProvider(
|
|||||||
|
|
||||||
} // namespace ripple
|
} // namespace ripple
|
||||||
|
|
||||||
#endif // RIPPLE_APP_MISC_AMMUTILS_H_INLCUDED
|
#endif // RIPPLE_APP_MISC_AMMUTILS_H_INCLUDED
|
||||||
|
|||||||
@@ -17,9 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include "xrpld/app/misc/WasmHostFuncImpl.h"
|
#include <xrpld/app/misc/WasmHostFuncImpl.h>
|
||||||
|
|
||||||
#include "xrpl/protocol/digest.h"
|
#include <xrpl/protocol/digest.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
/*
|
/*
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
This file is part of rippled: https://github.com/ripple/rippled
|
||||||
Copyright (c) 2023 Ripple Labs Inc.
|
Copyright (c) 2025 Ripple Labs Inc.
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|||||||
@@ -588,7 +588,8 @@ EscrowFinish::doApply()
|
|||||||
|
|
||||||
WasmHostFunctionsImpl ledgerDataProvider(ctx_, k);
|
WasmHostFunctionsImpl ledgerDataProvider(ctx_, k);
|
||||||
|
|
||||||
auto re = runEscrowWasm(wasm, funcName, &ledgerDataProvider, 100000);
|
std::uint32_t gasLimit = ctx_.app.config().FEES.extension_compute_limit;
|
||||||
|
auto re = runEscrowWasm(wasm, funcName, &ledgerDataProvider, gasLimit);
|
||||||
JLOG(j_.trace()) << "Escrow WASM ran";
|
JLOG(j_.trace()) << "Escrow WASM ran";
|
||||||
if (re.has_value())
|
if (re.has_value())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user