Files
rippled/src/benchmarks/libxrpl/wasm/host_functions/CredentialKeylet.cpp
2026-09-02 17:03:47 -04:00

33 lines
901 B
C++

#include <xrpl/basics/Slice.h>
#include <benchmark/benchmark.h>
#include <benchmarks/libxrpl/wasm/BenchFixtures.h>
#include <benchmarks/libxrpl/wasm/WasmBench.h>
#include <string_view>
namespace xrpl::test::bench {
namespace {
void
credentialKeyletImpl(benchmark::State& state)
{
static constexpr auto kWasmName = std::string_view{"credential_id"};
static constexpr auto kType = std::string_view{"termsandconditions"};
benchmarkImpl(
state,
kWasmName,
[] { return Fixtures::instance().host(); },
[](auto& host) {
return host.credentialKeylet(
Fixtures::instance().alice().id(),
Fixtures::instance().bob().id(),
Slice{kType.data(), kType.size()});
});
}
BENCHMARK(credentialKeyletImpl)->UseManualTime()->Iterations(kBenchIterations);
} // namespace
} // namespace xrpl::test::bench