fix unit tests failed due to fuel changes (#6174)

* fix unit tests failed due to fuel changes

* fix tests

* fix tests

---------

Co-authored-by: Mayukha Vadari <mvadari@ripple.com>
This commit is contained in:
pwang200
2026-01-13 16:48:25 -05:00
committed by GitHub
parent 845c503ea6
commit fb97f7b596
2 changed files with 9 additions and 9 deletions

View File

@@ -390,7 +390,7 @@ struct EscrowSmart_test : public beast::unit_test::suite
// Tests whether the ledger index is >= 5
// getLedgerSqn() >= 5}
auto const& wasmHex = ledgerSqnWasmHex;
std::uint32_t const allowance = 65;
std::uint32_t const allowance = 178;
auto escrowCreate = escrow::create(alice, carol, XRP(1000));
auto [createFee, finishFee] = [&]() {
Env env(*this, features);
@@ -683,7 +683,7 @@ struct EscrowSmart_test : public beast::unit_test::suite
{
env.require(balance(alice, XRP(4000) - txnFees));
auto const allowance = 1014;
auto const allowance = 1420;
XRPAmount const finishFee = env.current()->fees().base +
(allowance * env.current()->fees().gasPrice) /
MICRO_DROPS_PER_DROP +
@@ -727,7 +727,7 @@ struct EscrowSmart_test : public beast::unit_test::suite
// Tests whether the ledger index is >= 5
// getLedgerSqn() >= 5}
auto const& wasmHex = ledgerSqnWasmHex;
uint64_t const allowance = 65;
uint64_t const allowance = 178;
auto escrowCreate = escrow::create(alice, carol, XRP(1000));
auto createFee = [&]() {
Env env(*this, features);
@@ -873,7 +873,7 @@ struct EscrowSmart_test : public beast::unit_test::suite
auto const txMeta = env.meta();
if (BEAST_EXPECT(txMeta && txMeta->isFieldPresent(sfGasUsed)))
BEAST_EXPECTS(
txMeta->getFieldU32(sfGasUsed) == 38'054,
txMeta->getFieldU32(sfGasUsed) == 62'715,
std::to_string(txMeta->getFieldU32(sfGasUsed)));
if (BEAST_EXPECT(txMeta->isFieldPresent(sfWasmReturnCode)))
BEAST_EXPECT(txMeta->getFieldI32(sfWasmReturnCode) == 1);
@@ -958,7 +958,7 @@ struct EscrowSmart_test : public beast::unit_test::suite
env.close();
env.close();
auto const allowance = 138'485;
auto const allowance = 182'903;
auto const finishFee = env.current()->fees().base +
(allowance * env.current()->fees().gasPrice) /
MICRO_DROPS_PER_DROP +

View File

@@ -328,7 +328,7 @@ struct Wasm_test : public beast::unit_test::suite
if (BEAST_EXPECT(re.has_value()))
{
BEAST_EXPECTS(re->result == 1, std::to_string(re->result));
BEAST_EXPECTS(re->cost == 64'763, std::to_string(re->cost));
BEAST_EXPECTS(re->cost == 64'263, std::to_string(re->cost));
}
env.close();
@@ -377,7 +377,7 @@ struct Wasm_test : public beast::unit_test::suite
if (BEAST_EXPECT(re.has_value()))
{
BEAST_EXPECTS(re->result == 1, std::to_string(re->result));
BEAST_EXPECTS(re->cost == 64'763, std::to_string(re->cost));
BEAST_EXPECTS(re->cost == 64'263, std::to_string(re->cost));
}
}
@@ -388,7 +388,7 @@ struct Wasm_test : public beast::unit_test::suite
if (BEAST_EXPECT(re.has_value()))
{
BEAST_EXPECTS(re->result == 1, std::to_string(re->result));
BEAST_EXPECTS(re->cost == 64'763, std::to_string(re->cost));
BEAST_EXPECTS(re->cost == 64'263, std::to_string(re->cost));
}
}
@@ -703,7 +703,7 @@ struct Wasm_test : public beast::unit_test::suite
Bytes const wasm(wasmStr.begin(), wasmStr.end());
TestHostFunctions hfs(env, 0);
auto const allowance = 189'508;
auto const allowance = 327'308;
auto re = runEscrowWasm(wasm, hfs, ESCROW_FUNCTION_NAME, {}, allowance);
if (BEAST_EXPECT(re.has_value()))