feat: Wasm Module Versioning

This commit is contained in:
TimothyBanks
2026-07-17 09:39:38 -04:00
parent f16fc10903
commit 8403958e3d
2 changed files with 6 additions and 1 deletions

View File

@@ -830,6 +830,11 @@ readLEB128(Bytes const& wasmCode, size_t& offset)
shift += 7;
if (shift >= 32)
{
// Drain the rest of the bytes for this leb.
while (offset < wasmCode.size() && (wasmCode[offset] & 0x80) != 0)
{
++offset;
}
break;
}
}

View File

@@ -249,7 +249,7 @@ struct Wasm_test : public beast::unit_test::Suite
auto imports = ImportVec{};
WasmImpFunc<Add_proto>(imports, "func-add", reinterpret_cast<void*>(&add), &hfs);
auto _ = vm.run(kWasmModule, hfs, 10'000'000, "finish", wasmParams(1234), imports, journal);
auto _ = vm.run(kWasmModule, hfs, 10'000'000, "finish", wasmParams(), imports, journal);
auto const logged = sink.messages().str();
BEAST_EXPECT(logged.find("Module version: xrpl-escrow-stdlib 4.5.6") != std::string::npos);