Pre-commit and removed implementation docs

This commit is contained in:
Sergey Kuznetsov
2026-08-04 17:01:54 +01:00
parent 6c02c45cbe
commit ffb2d37d17
10 changed files with 53 additions and 50 deletions

View File

@@ -1,5 +1,3 @@
#include <tx/wasm/WasmFixture.h>
#include <xrpl/basics/Slice.h>
#include <xrpl/basics/base_uint.h>
#include <xrpl/protocol/Protocol.h>
@@ -8,6 +6,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <tx/wasm/WasmFixture.h>
#include <cstdint>
#include <expected>
@@ -294,8 +293,7 @@ protected:
TEST_F(TraceNumCall, I64ArrivesWholeIncludingMostNegativeValue)
{
EXPECT_CALL(
host_,
traceNum(std::string_view("count"), std::numeric_limits<std::int64_t>::min()))
host_, traceNum(std::string_view("count"), std::numeric_limits<std::int64_t>::min()))
.WillOnce(Return(0));
EXPECT_EQ(hostAnswer(), 0);

View File

@@ -1,10 +1,9 @@
#include <tx/wasm/WasmFixture.h>
#include <xrpl/protocol/TER.h>
#include <xrpl/tx/wasm/WasmCommon.h>
#include <xrpl/tx/wasm/WasmVM.h>
#include <gtest/gtest.h>
#include <tx/wasm/WasmFixture.h>
#include <string>
#include <string_view>

View File

@@ -1,15 +1,13 @@
#pragma once
#include <tx/wasm/MockHostFunctions.h>
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/tx/wasm/WasmCommon.h>
#include <xrpl/tx/wasm/WasmVM.h>
#include <xrpl_wasm_testkit_cxxbridge/lib.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <tx/wasm/MockHostFunctions.h>
#include <xrpl_wasm_testkit_cxxbridge/lib.h>
#include <cstdint>
#include <expected>

View File

@@ -1,12 +1,12 @@
#include <tx/wasm/WasmFixture.h>
#include <xrpl/tx/wasm/WasmVM.h>
#include <xrpl/basics/contract.h>
#include <xrpl/protocol/TER.h>
#include <xrpl/tx/wasm/WasmCommon.h>
#include <xrpl/tx/wasm/WasmVM.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <tx/wasm/WasmFixture.h>
#include <cstdint>
#include <stdexcept>
@@ -173,13 +173,9 @@ TEST_F(WasmVMTest, UnrunnableModuleIsNodeSideFault)
Bytes code;
std::string_view entryPoint;
} const cases[] = {
{.what = "not wasm at all",
.code = Bytes{0, 1, 2, 3},
.entryPoint = escrowFunctionName},
{.what = "not wasm at all", .code = Bytes{0, 1, 2, 3}, .entryPoint = escrowFunctionName},
{.what = "empty", .code = Bytes{}, .entryPoint = escrowFunctionName},
{.what = "no such export",
.code = assemble(kEngineWat),
.entryPoint = "no_such_export"},
{.what = "no such export", .code = assemble(kEngineWat), .entryPoint = "no_such_export"},
{.what = "export is not a function",
.code = assemble(kEngineWat),
.entryPoint = "not_a_function"},
@@ -302,9 +298,10 @@ TEST_F(WasmVMTest, FatalHostErrorStopsRun)
// the host, and must not take the node with it.
TEST_F(WasmVMTest, ThrowingHostFunctionBecomesInternal)
{
EXPECT_CALL(host_, getLedgerSqn()).WillOnce([]() -> std::expected<std::uint32_t, HostFunctionError> {
Throw<std::runtime_error>("the ledger came apart");
});
EXPECT_CALL(host_, getLedgerSqn())
.WillOnce([]() -> std::expected<std::uint32_t, HostFunctionError> {
Throw<std::runtime_error>("the ledger came apart");
});
auto const outcome = run(kEngineWat, kAmpleGas, "calls_the_host");