mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-25 08:00:22 +00:00
feat: Add version information to wasm module
This commit is contained in:
@@ -909,8 +909,8 @@ filterCustomSections(Bytes const& wasmCode, Filter&& filter)
|
||||
std::vector<Version>
|
||||
extractVersionInfo(Bytes const& wasmCode)
|
||||
{
|
||||
static constexpr auto kCommonLib = "xrpl-common-stdlib";
|
||||
static constexpr auto kEscrowLib = "xrpl-escrow-stdlib";
|
||||
static constexpr auto kCommonLib = "xrpl-common-stdlib-version";
|
||||
static constexpr auto kEscrowLib = "xrpl-escrow-stdlib-version";
|
||||
|
||||
auto versions = std::vector<Version>{};
|
||||
filterCustomSections(wasmCode, [&](auto const& section) {
|
||||
|
||||
@@ -253,8 +253,10 @@ struct Wasm_test : public beast::unit_test::Suite
|
||||
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);
|
||||
BEAST_EXPECT(logged.find("Module version: xrpl-common-stdlib 1.2.3") != std::string::npos);
|
||||
BEAST_EXPECT(
|
||||
logged.find("Module version: xrpl-escrow-stdlib-version 4.5.6") != std::string::npos);
|
||||
BEAST_EXPECT(
|
||||
logged.find("Module version: xrpl-common-stdlib-version 1.2.3") != std::string::npos);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
)
|
||||
(export "finish" (func $finish))
|
||||
|
||||
(@custom "xrpl-escrow-stdlib" "4.5.6")
|
||||
(@custom "xrpl-common-stdlib" "1.2.3")
|
||||
(@custom "xrpl-escrow-stdlib-version" "4.5.6")
|
||||
(@custom "xrpl-common-stdlib-version" "1.2.3")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user