From 597202a6f08641233dc720020a0deba6853d136f Mon Sep 17 00:00:00 2001 From: Olek <115580134+oleks-rip@users.noreply.github.com> Date: Thu, 7 May 2026 12:33:22 -0400 Subject: [PATCH] Refactoring float hostfunctions (#7053) --- include/xrpl/basics/Number.h | 7 - include/xrpl/tx/wasm/HostFunc.h | 35 +- include/xrpl/tx/wasm/HostFuncImpl.h | 13 +- include/xrpl/tx/wasm/HostFuncWrapper.h | 21 +- include/xrpl/tx/wasm/ParamsHelper.h | 8 +- src/libxrpl/basics/Number.cpp | 76 - src/libxrpl/tx/wasm/HostFuncImplFloat.cpp | 103 +- src/libxrpl/tx/wasm/HostFuncWrapper.cpp | 71 +- src/libxrpl/tx/wasm/WasmVM.cpp | 7 +- src/libxrpl/tx/wasm/WasmiVM.cpp | 75 +- src/test/app/HostFuncImpl_test.cpp | 2106 +++++++++++------ src/test/app/TestHostFunctions.h | 26 +- src/test/app/Wasm_test.cpp | 13 +- .../wasm_fixtures/codecov_tests/src/lib.rs | 15 - src/test/app/wasm_fixtures/fixtures.cpp | 1087 +++++---- .../app/wasm_fixtures/float_tests/src/lib.rs | 325 +-- src/test/basics/Number_test.cpp | 73 - 17 files changed, 2030 insertions(+), 2031 deletions(-) diff --git a/include/xrpl/basics/Number.h b/include/xrpl/basics/Number.h index 21fe6a5b3a..c39aae2dd3 100644 --- a/include/xrpl/basics/Number.h +++ b/include/xrpl/basics/Number.h @@ -381,9 +381,6 @@ public: friend Number root2(Number f); - friend Number - log10(Number const&, int); - // Thread local rounding control. Default is to_nearest enum rounding_mode { to_nearest, towards_zero, downward, upward }; static rounding_mode @@ -732,10 +729,6 @@ abs(Number x) noexcept Number power(Number const& f, unsigned n); -// logarithm with base 10 -Number -log10(Number const& value, int iterations = 50); - // Returns f^(1/d) // Uses Newton–Raphson iterations until the result stops changing // to find the root of the polynomial g(x) = x^d - f diff --git a/include/xrpl/tx/wasm/HostFunc.h b/include/xrpl/tx/wasm/HostFunc.h index 1276284c15..b385ab9af6 100644 --- a/include/xrpl/tx/wasm/HostFunc.h +++ b/include/xrpl/tx/wasm/HostFunc.h @@ -66,16 +66,10 @@ Expected floatToIntImpl(Slice const& x, int32_t mode); Expected -floatToMantissaAndExponentImpl(Slice const& x); +floatToMantExpImpl(Slice const& x); Expected -floatNegateImpl(Slice const& x); - -Expected -floatAbsImpl(Slice const& x); - -Expected -floatSetImpl(int64_t mantissa, int32_t exponent, int32_t mode); +floatFromMantExpImpl(int64_t mantissa, int32_t exponent, int32_t mode); Expected floatCompareImpl(Slice const& x, Slice const& y); @@ -98,9 +92,6 @@ floatRootImpl(Slice const& x, int32_t n, int32_t mode); Expected floatPowerImpl(Slice const& x, int32_t n, int32_t mode); -Expected -floatLogImpl(Slice const& x, int32_t mode); - } // namespace wasm_float // Intended to work only through wasm runtime. Don't call them directly, except with unit tests @@ -480,25 +471,13 @@ struct HostFunctions } virtual Expected - floatToMantissaAndExponent(Slice const& x) const + floatToMantExp(Slice const& x) const { return Unexpected(HostFunctionError::INTERNAL); } virtual Expected - floatNegate(Slice const& x) const - { - return Unexpected(HostFunctionError::INTERNAL); - } - - virtual Expected - floatAbs(Slice const& x) const - { - return Unexpected(HostFunctionError::INTERNAL); - } - - virtual Expected - floatSet(int64_t mantissa, int32_t exponent, int32_t mode) const + floatFromMantExp(int64_t mantissa, int32_t exponent, int32_t mode) const { return Unexpected(HostFunctionError::INTERNAL); } @@ -545,12 +524,6 @@ struct HostFunctions return Unexpected(HostFunctionError::INTERNAL); } - virtual Expected - floatLog(Slice const& x, int32_t mode) const - { - return Unexpected(HostFunctionError::INTERNAL); - } - virtual ~HostFunctions() = default; // LCOV_EXCL_STOP }; diff --git a/include/xrpl/tx/wasm/HostFuncImpl.h b/include/xrpl/tx/wasm/HostFuncImpl.h index a8d8e2da64..864416043a 100644 --- a/include/xrpl/tx/wasm/HostFuncImpl.h +++ b/include/xrpl/tx/wasm/HostFuncImpl.h @@ -266,16 +266,10 @@ public: floatToInt(Slice const& x, int32_t mode) const override; Expected - floatToMantissaAndExponent(Slice const& x) const override; + floatToMantExp(Slice const& x) const override; Expected - floatNegate(Slice const& x) const override; - - Expected - floatAbs(Slice const& x) const override; - - Expected - floatSet(int64_t mantissa, int32_t exponent, int32_t mode) const override; + floatFromMantExp(int64_t mantissa, int32_t exponent, int32_t mode) const override; Expected floatCompare(Slice const& x, Slice const& y) const override; @@ -297,9 +291,6 @@ public: Expected floatPower(Slice const& x, int32_t n, int32_t mode) const override; - - Expected - floatLog(Slice const& x, int32_t mode) const override; }; } // namespace xrpl diff --git a/include/xrpl/tx/wasm/HostFuncWrapper.h b/include/xrpl/tx/wasm/HostFuncWrapper.h index ccc4b59173..313fe0b27f 100644 --- a/include/xrpl/tx/wasm/HostFuncWrapper.h +++ b/include/xrpl/tx/wasm/HostFuncWrapper.h @@ -276,22 +276,13 @@ using floatToInt_proto = int32_t(uint8_t const*, int32_t, uint8_t*, int32_t, int wasm_trap_t* floatToInt_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results); -using floatToMantissaAndExponent_proto = - int32_t(uint8_t const*, int32_t, uint8_t*, int32_t, uint8_t*, int32_t); +using floatToMantExp_proto = int32_t(uint8_t const*, int32_t, uint8_t*, int32_t, uint8_t*, int32_t); wasm_trap_t* -floatToMantissaAndExponent_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results); +floatToMantExp_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results); -using floatNegate_proto = int32_t(uint8_t const*, int32_t, uint8_t*, int32_t); +using floatFromMantExp_proto = int32_t(int64_t, int32_t, uint8_t*, int32_t, int32_t); wasm_trap_t* -floatNegate_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results); - -using floatAbs_proto = int32_t(uint8_t const*, int32_t, uint8_t*, int32_t); -wasm_trap_t* -floatAbs_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results); - -using floatSet_proto = int32_t(int32_t, int64_t, uint8_t*, int32_t, int32_t); -wasm_trap_t* -floatSet_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results); +floatFromMantExp_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results); using floatCompare_proto = int32_t(uint8_t const*, int32_t, uint8_t const*, int32_t); wasm_trap_t* @@ -325,8 +316,4 @@ using floatPower_proto = int32_t(uint8_t const*, int32_t, int32_t, uint8_t*, int wasm_trap_t* floatPower_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results); -using floatLog_proto = int32_t(uint8_t const*, int32_t, uint8_t*, int32_t, int32_t); -wasm_trap_t* -floatLog_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results); - } // namespace xrpl diff --git a/include/xrpl/tx/wasm/ParamsHelper.h b/include/xrpl/tx/wasm/ParamsHelper.h index d48663ef23..4d2a1013b6 100644 --- a/include/xrpl/tx/wasm/ParamsHelper.h +++ b/include/xrpl/tx/wasm/ParamsHelper.h @@ -52,7 +52,7 @@ enum WasmTypes { WT_I32, WT_I64 }; struct WasmImportFunc { - std::string name; + std::string_view name; std::optional result; std::vector params; // void* udata = nullptr; @@ -62,11 +62,12 @@ struct WasmImportFunc }; typedef std::pair WasmUserData; -typedef std::vector ImportVec; +typedef std::unordered_map ImportVec; #define WASM_IMPORT_FUNC(v, f, ...) \ WasmImpFunc(v, #f, reinterpret_cast(&f##_wrap), ##__VA_ARGS__) +// n - string literal name, must have static lifetime #define WASM_IMPORT_FUNC2(v, f, n, ...) \ WasmImpFunc(v, n, reinterpret_cast(&f##_wrap), ##__VA_ARGS__) @@ -123,6 +124,7 @@ WasmImpFuncHelper(WasmImportFunc& e) // WasmImpWrap(e, std::forward(f)); } +// imp_name - string literal, must have static lifetime template void WasmImpFunc( @@ -137,7 +139,7 @@ WasmImpFunc( e.wrap = f_wrap; e.gas = gas; WasmImpFuncHelper(e); - v.push_back(std::make_pair(data, std::move(e))); + v.emplace(imp_name, std::make_pair(data, std::move(e))); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/libxrpl/basics/Number.cpp b/src/libxrpl/basics/Number.cpp index e714f6ac91..a8adabd5de 100644 --- a/src/libxrpl/basics/Number.cpp +++ b/src/libxrpl/basics/Number.cpp @@ -945,82 +945,6 @@ power(Number const& f, unsigned n) return r; } -// Series expansion method approximation of ln(x) -static Number -ln(Number const& x, int iterations = 50) -{ - Number const N0(0); - Number const N2(2, 0); - Number const N05(5, -1); - Number const LN2(693'147'180'559'945'309ll, -18); - - if (x <= 0) - { - throw std::runtime_error("Not a positive value"); - } - if (x == 1) - { - return N0; - } - - int exponent = 0; - Number mantissa = x; - - while (mantissa >= N2) - { - mantissa /= 2; - exponent += 1; - } - while (mantissa < N05) - { - mantissa *= 2; - exponent -= 1; - } - - Number z = (mantissa - 1) / (mantissa + 1); - Number const zz = z * z; - Number sum; - - for (int i = 1; i <= iterations; ++i) - { - sum = sum + z / ((2 * i) - 1); - z = z * zz; - } - - return 2 * sum + exponent * LN2; -} - -Number -log10(Number const& x, int iterations) -{ - Number const N0(0); - Number const LN10(2'302'585'092'994'045'684ll, -18); - - if (x <= 0) - { - throw std::runtime_error("Not a positive value"); - } - if (x == 1) - { - return N0; - } - - if (x <= Number(10)) - { - auto const r = ln(x, iterations) / LN10; - return r; - } - - // (1 <= normalX < 10) - // x = normalX * 10^norm - // ln(x) = ln(normalX * 10^norm) = ln(normalX) + norm * ln(10) - int const diffExp = Number::mantissaLog() + x.exponent_; - Number const normalX = x / Number(1, diffExp); - auto const lnX = ln(normalX, iterations) + diffExp * LN10; - auto const lgX = lnX / LN10; - return lgX; -} - // Returns f^(1/d) // Uses Newton–Raphson iterations until the result stops changing // to find the non-negative root of the polynomial g(x) = x^d - f diff --git a/src/libxrpl/tx/wasm/HostFuncImplFloat.cpp b/src/libxrpl/tx/wasm/HostFuncImplFloat.cpp index 5ed9913412..50e972a2da 100644 --- a/src/libxrpl/tx/wasm/HostFuncImplFloat.cpp +++ b/src/libxrpl/tx/wasm/HostFuncImplFloat.cpp @@ -259,7 +259,7 @@ floatToIntImpl(Slice const& x, int32_t mode) } Expected -floatToMantissaAndExponentImpl(Slice const& x) +floatToMantExpImpl(Slice const& x) { try { @@ -282,55 +282,7 @@ floatToMantissaAndExponentImpl(Slice const& x) } Expected -floatNegateImpl(Slice const& x) -{ - try - { - detail::FloatState const rm(Number::rounding_mode::to_nearest); - if (!rm) - return Unexpected(HostFunctionError::FLOAT_INPUT_MALFORMED); - - detail::WasmNumber const num(x); - if (!num) - return Unexpected(HostFunctionError::FLOAT_INPUT_MALFORMED); - - detail::WasmNumber const res = -num; - return res.toBytes(); - } - // LCOV_EXCL_START - catch (...) - { - return Unexpected(HostFunctionError::FLOAT_COMPUTATION_ERROR); - } - // LCOV_EXCL_STOP -} - -Expected -floatAbsImpl(Slice const& x) -{ - try - { - detail::FloatState const rm(Number::rounding_mode::to_nearest); - if (!rm) - return Unexpected(HostFunctionError::FLOAT_INPUT_MALFORMED); - - detail::WasmNumber const num(x); - if (!num) - return Unexpected(HostFunctionError::FLOAT_INPUT_MALFORMED); - - detail::WasmNumber const res = abs(num); - return res.toBytes(); - } - // LCOV_EXCL_START - catch (...) - { - return Unexpected(HostFunctionError::FLOAT_COMPUTATION_ERROR); - } - // LCOV_EXCL_STOP -} - -Expected -floatSetImpl(int64_t mantissa, int32_t exponent, int32_t mode) +floatFromMantExpImpl(int64_t mantissa, int32_t exponent, int32_t mode) { try { @@ -537,31 +489,6 @@ floatPowerImpl(Slice const& x, int32_t n, int32_t mode) // LCOV_EXCL_STOP } -Expected -floatLogImpl(Slice const& x, int32_t mode) -{ - try - { - detail::FloatState const rm(mode); - if (!rm) - return Unexpected(HostFunctionError::FLOAT_INPUT_MALFORMED); - - detail::WasmNumber const xx(x); - if (!xx) - return Unexpected(HostFunctionError::FLOAT_INPUT_MALFORMED); - - detail::WasmNumber const res(log10(xx)); - - return res.toBytes(); - } - // LCOV_EXCL_START - catch (...) - { - return Unexpected(HostFunctionError::FLOAT_COMPUTATION_ERROR); - } - // LCOV_EXCL_STOP -} - } // namespace wasm_float // ========================================================= @@ -599,27 +526,15 @@ WasmHostFunctionsImpl::floatToInt(Slice const& x, int32_t mode) const } Expected -WasmHostFunctionsImpl::floatToMantissaAndExponent(Slice const& x) const +WasmHostFunctionsImpl::floatToMantExp(Slice const& x) const { - return wasm_float::floatToMantissaAndExponentImpl(x); + return wasm_float::floatToMantExpImpl(x); } Expected -WasmHostFunctionsImpl::floatNegate(Slice const& x) const +WasmHostFunctionsImpl::floatFromMantExp(int64_t mantissa, int32_t exponent, int32_t mode) const { - return wasm_float::floatNegateImpl(x); -} - -Expected -WasmHostFunctionsImpl::floatAbs(Slice const& x) const -{ - return wasm_float::floatAbsImpl(x); -} - -Expected -WasmHostFunctionsImpl::floatSet(int64_t mantissa, int32_t exponent, int32_t mode) const -{ - return wasm_float::floatSetImpl(mantissa, exponent, mode); + return wasm_float::floatFromMantExpImpl(mantissa, exponent, mode); } Expected @@ -664,10 +579,4 @@ WasmHostFunctionsImpl::floatPower(Slice const& x, int32_t n, int32_t mode) const return wasm_float::floatPowerImpl(x, n, mode); } -Expected -WasmHostFunctionsImpl::floatLog(Slice const& x, int32_t mode) const -{ - return wasm_float::floatLogImpl(x, mode); -} - } // namespace xrpl diff --git a/src/libxrpl/tx/wasm/HostFuncWrapper.cpp b/src/libxrpl/tx/wasm/HostFuncWrapper.cpp index 3e56c8dad6..a882204f51 100644 --- a/src/libxrpl/tx/wasm/HostFuncWrapper.cpp +++ b/src/libxrpl/tx/wasm/HostFuncWrapper.cpp @@ -1769,7 +1769,7 @@ floatToInt_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results } wasm_trap_t* -floatToMantissaAndExponent_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results) +floatToMantExp_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results) { if (auto g = checkGas(env); !g) return g.error(); // LCOV_EXCL_LINE @@ -1782,11 +1782,11 @@ floatToMantissaAndExponent_wrap(void* env, wasm_val_vec_t const* params, wasm_va return hfResult(results, x.error()); i = 2; - return returnResult(runtime, params, results, hf->floatToMantissaAndExponent(*x), i); + return returnResult(runtime, params, results, hf->floatToMantExp(*x), i); } wasm_trap_t* -floatNegate_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results) +floatFromMantExp_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results) { if (auto g = checkGas(env); !g) return g.error(); // LCOV_EXCL_LINE @@ -1794,55 +1794,22 @@ floatNegate_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* result auto* runtime = reinterpret_cast(hf->getRT()); int i = 0; - auto const x = getDataSlice(runtime, params, i); - if (!x) - return hfResult(results, x.error()); - - i = 2; - return returnResult(runtime, params, results, hf->floatNegate(*x), i); -} - -wasm_trap_t* -floatAbs_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results) -{ - if (auto g = checkGas(env); !g) - return g.error(); // LCOV_EXCL_LINE - auto* hf = getHF(env); - auto* runtime = reinterpret_cast(hf->getRT()); - - int i = 0; - auto const x = getDataSlice(runtime, params, i); - if (!x) - return hfResult(results, x.error()); - - i = 2; - return returnResult(runtime, params, results, hf->floatAbs(*x), i); -} - -wasm_trap_t* -floatSet_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results) -{ - if (auto g = checkGas(env); !g) - return g.error(); // LCOV_EXCL_LINE - auto* hf = getHF(env); - auto* runtime = reinterpret_cast(hf->getRT()); - - int i = 0; - auto const exp = getDataInt32(runtime, params, i); - if (!exp) - return hfResult(results, exp.error()); // LCOV_EXCL_LINE auto const mant = getDataInt64(runtime, params, i); if (!mant) return hfResult(results, mant.error()); // LCOV_EXCL_LINE + auto const exp = getDataInt32(runtime, params, i); + if (!exp) + return hfResult(results, exp.error()); // LCOV_EXCL_LINE + i = 4; auto const rounding = getDataInt32(runtime, params, i); if (!rounding) return hfResult(results, rounding.error()); // LCOV_EXCL_LINE i = 2; - return returnResult(runtime, params, results, hf->floatSet(*mant, *exp, *rounding), i); + return returnResult(runtime, params, results, hf->floatFromMantExp(*mant, *exp, *rounding), i); } wasm_trap_t* @@ -2021,28 +1988,6 @@ floatPower_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results return returnResult(runtime, params, results, hf->floatPower(*x, *n, *rounding), i); } -wasm_trap_t* -floatLog_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results) -{ - if (auto g = checkGas(env); !g) - return g.error(); // LCOV_EXCL_LINE - auto* hf = getHF(env); - auto* runtime = reinterpret_cast(hf->getRT()); - - int i = 0; - auto const x = getDataSlice(runtime, params, i); - if (!x) - return hfResult(results, x.error()); - - i = 4; - auto const rounding = getDataInt32(runtime, params, i); - if (!rounding) - return hfResult(results, rounding.error()); // LCOV_EXCL_LINE - - i = 2; - return returnResult(runtime, params, results, hf->floatLog(*x, *rounding), i); -} - // LCOV_EXCL_START namespace test { diff --git a/src/libxrpl/tx/wasm/WasmVM.cpp b/src/libxrpl/tx/wasm/WasmVM.cpp index d91e6832da..2a2627753f 100644 --- a/src/libxrpl/tx/wasm/WasmVM.cpp +++ b/src/libxrpl/tx/wasm/WasmVM.cpp @@ -79,10 +79,8 @@ setCommonHostFunctions(HostFunctions* hfs, ImportVec& i) WASM_IMPORT_FUNC2(i, floatFromSTAmount, "float_from_stamount", hfs, 150); WASM_IMPORT_FUNC2(i, floatFromSTNumber, "float_from_stnumber", hfs, 150); WASM_IMPORT_FUNC2(i, floatToInt, "float_to_int", hfs, 130); - WASM_IMPORT_FUNC2(i, floatToMantissaAndExponent, "float_to_mantissa_and_exponent", hfs, 130); - WASM_IMPORT_FUNC2(i, floatNegate, "float_negate", hfs, 150); - WASM_IMPORT_FUNC2(i, floatAbs, "float_abs", hfs, 150); - WASM_IMPORT_FUNC2(i, floatSet, "float_set", hfs, 100); + WASM_IMPORT_FUNC2(i, floatToMantExp, "float_to_mant_exp", hfs, 130); + WASM_IMPORT_FUNC2(i, floatFromMantExp, "float_from_mant_exp", hfs, 100); WASM_IMPORT_FUNC2(i, floatCompare, "float_compare", hfs, 80); WASM_IMPORT_FUNC2(i, floatAdd, "float_add", hfs, 160); WASM_IMPORT_FUNC2(i, floatSubtract, "float_subtract", hfs, 160); @@ -90,7 +88,6 @@ setCommonHostFunctions(HostFunctions* hfs, ImportVec& i) WASM_IMPORT_FUNC2(i, floatDivide, "float_divide", hfs, 300); WASM_IMPORT_FUNC2(i, floatRoot, "float_root", hfs, 5'500); WASM_IMPORT_FUNC2(i, floatPower, "float_pow", hfs, 5'500); - WASM_IMPORT_FUNC2(i, floatLog, "float_log", hfs, 12'000); // clang-format on } diff --git a/src/libxrpl/tx/wasm/WasmiVM.cpp b/src/libxrpl/tx/wasm/WasmiVM.cpp index bcdca5c03d..2ea7363fe3 100644 --- a/src/libxrpl/tx/wasm/WasmiVM.cpp +++ b/src/libxrpl/tx/wasm/WasmiVM.cpp @@ -368,7 +368,7 @@ ModuleWrapper::buildImports(StorePtr& s, ImportVec const& imports) const if (importTypes.empty()) return {}; if (imports.empty()) - throw std::runtime_error("Missing imports"); + Throw("Empty imports"); WasmExternVec wimports(importTypes.size()); @@ -385,7 +385,7 @@ ModuleWrapper::buildImports(StorePtr& s, ImportVec const& imports) const wasm_externkind_t const itype = wasm_externtype_kind(wasm_importtype_type(importType)); if ((itype) != WASM_EXTERN_FUNC) { - throw std::runtime_error( + Throw( "Invalid import type " + std::to_string(itype)); // LCOV_EXCL_LINE } @@ -393,46 +393,39 @@ ModuleWrapper::buildImports(StorePtr& s, ImportVec const& imports) const // if ((W_ENV != modName) && (W_HOST_LIB != modName)) // continue; - bool impSet = false; - for (auto const& obj : imports) - { - auto const& imp = obj.second; - if (imp.name != fieldName) - continue; - - WasmValtypeVec params(makeImpParams(imp)); - WasmValtypeVec results(makeImpReturn(imp)); - - std::unique_ptr const ftype( - wasm_functype_new(params.get(), results.get()), &wasm_functype_delete); - - params.release(); - results.release(); - - wasm_func_t* func = wasm_func_new_with_env( - s.get(), - ftype.get(), - reinterpret_cast(imp.wrap), - (void*)&obj, - nullptr); - if (func == nullptr) - { - // LCOV_EXCL_START - throw std::runtime_error("can't create import function " + imp.name); - // LCOV_EXCL_STOP - } - - wimports[i] = wasm_func_as_extern(func); - ++impCnt; - impSet = true; - - break; - } - - if (!impSet) + auto const it = imports.find(fieldName); + if (it == imports.end()) { print_wasm_error("Import not found: " + std::string(fieldName), nullptr, j_); + continue; // print all missed import } + + auto const& obj = it->second; + auto const& imp = obj.second; + + WasmValtypeVec params(makeImpParams(imp)); + WasmValtypeVec results(makeImpReturn(imp)); + + std::unique_ptr const ftype( + wasm_functype_new(params.get(), results.get()), &wasm_functype_delete); + + params.release(); + results.release(); + + wasm_func_t* func = wasm_func_new_with_env( + s.get(), + ftype.get(), + reinterpret_cast(imp.wrap), + (void*)&obj, + nullptr); + if (func == nullptr) + { + Throw( + "can't create import function " + std::string(imp.name)); // LCOV_EXCL_LINE + } + + wimports[i] = wasm_func_as_extern(func); + ++impCnt; } if (impCnt != importTypes.size()) @@ -442,7 +435,7 @@ ModuleWrapper::buildImports(StorePtr& s, ImportVec const& imports) const std::to_string(importTypes.size()), nullptr, j_); - throw std::runtime_error("Missing imports"); + Throw("Missing imports"); } return wimports; @@ -741,7 +734,7 @@ checkImports(ImportVec const& imports, HostFunctions* hfs) { for (auto const& obj : imports) { - if (hfs != obj.first) + if (hfs != obj.second.first) Throw("Imports hf unsync"); } } diff --git a/src/test/app/HostFuncImpl_test.cpp b/src/test/app/HostFuncImpl_test.cpp index 95cdacd5d1..60ba559b76 100644 --- a/src/test/app/HostFuncImpl_test.cpp +++ b/src/test/app/HostFuncImpl_test.cpp @@ -289,7 +289,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getLedgerSqn(); WasmValVec params(2), result(1); auto* trap = - ww(getLedgerSqn_wrap, &import[0], params, result, 0, sizeof(std::uint32_t)); + ww(getLedgerSqn_wrap, + &import.at("get_ledger_sqn"), + params, + result, + 0, + sizeof(std::uint32_t)); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == sizeof(std::uint32_t)) && @@ -317,7 +322,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getParentLedgerTime(); WasmValVec params(2), result(1); auto* trap = - ww(getParentLedgerTime_wrap, &import[1], params, result, 0, sizeof(std::uint32_t)); + ww(getParentLedgerTime_wrap, + &import.at("get_parent_ledger_time"), + params, + result, + 0, + sizeof(std::uint32_t)); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == sizeof(std::uint32_t)) && @@ -347,7 +357,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getParentLedgerHash(); WasmValVec params(2), result(1); auto* trap = - ww(getParentLedgerHash_wrap, &import[2], params, result, 0, uint256::bytes); + ww(getParentLedgerHash_wrap, + &import.at("get_parent_ledger_hash"), + params, + result, + 0, + uint256::bytes); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == uint256::bytes); @@ -378,7 +393,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getBaseFee(); { WasmValVec params(2), result(1); - auto* trap = ww(getBaseFee_wrap, &import[3], params, result, 0, sizeof(std::uint32_t)); + auto* trap = + ww(getBaseFee_wrap, + &import.at("get_base_fee"), + params, + result, + 0, + sizeof(std::uint32_t)); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == sizeof(std::uint32_t)) && @@ -409,7 +430,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(2), result(1); vrt.setBytes(0, amendmentId.data(), uint256::bytes); - auto* trap = ww(isAmendmentEnabled_wrap, &import[4], params, result, 0, uint256::bytes); + auto* trap = + ww(isAmendmentEnabled_wrap, + &import.at("amendment_enabled"), + params, + result, + 0, + uint256::bytes); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 1); @@ -421,7 +448,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(2), result(1); vrt.setBytes(0, amendmentName.data(), amendmentName.size()); auto* trap = - ww(isAmendmentEnabled_wrap, &import[4], params, result, 0, amendmentName.size()); + ww(isAmendmentEnabled_wrap, + &import.at("amendment_enabled"), + params, + result, + 0, + amendmentName.size()); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 1); @@ -432,7 +464,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(2), result(1); vrt.setBytes(0, fakeId.data(), uint256::bytes); - auto* trap = ww(isAmendmentEnabled_wrap, &import[4], params, result, 0, uint256::bytes); + auto* trap = + ww(isAmendmentEnabled_wrap, + &import.at("amendment_enabled"), + params, + result, + 0, + uint256::bytes); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 0); @@ -444,7 +482,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(2), result(1); vrt.setBytes(0, fakeName.data(), fakeName.size()); auto* trap = - ww(isAmendmentEnabled_wrap, &import[4], params, result, 0, fakeName.size()); + ww(isAmendmentEnabled_wrap, + &import.at("amendment_enabled"), + params, + result, + 0, + fakeName.size()); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 0); @@ -474,7 +517,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); vrt.setBytes(0, accountKeylet.key.data(), uint256::bytes); auto* trap = - ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, -1); + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + -1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -487,7 +536,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); vrt.setBytes(0, accountKeylet.key.data(), uint256::bytes); auto* trap = - ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, 257); + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + 257); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -500,7 +555,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); vrt.setBytes(0, dummyEscrow.key.data(), uint256::bytes); auto* trap = - ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, 0); + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -513,7 +574,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); vrt.setBytes(0, accountKeylet.key.data(), uint256::bytes); auto* trap = - ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, 0); + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 1); @@ -526,7 +593,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); vrt.setBytes(0, accountKeylet.key.data(), uint256::bytes); auto* trap = - ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, i); + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + i); if (!(BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECTS( @@ -541,7 +614,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); vrt.setBytes(0, accountKeylet.key.data(), uint256::bytes); auto* trap = - ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, 0); + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -563,7 +642,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); vrt.setBytes(0, accountKeylet.key.data(), uint256::bytes); auto* trap = - ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, 0); + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + 0); if (!(BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECTS( @@ -578,7 +663,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); vrt.setBytes(0, accountKeylet.key.data(), uint256::bytes); auto* trap = - ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, 0); + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -624,7 +715,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); auto* trap = ww(getTxField_wrap, - &import[6], + &import.at("get_tx_field"), params, result, sfAccount.getCode(), @@ -642,7 +733,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); auto* trap = ww(getTxField_wrap, - &import[6], + &import.at("get_tx_field"), params, result, sfOwner.getCode(), @@ -660,7 +751,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); auto* trap = ww(getTxField_wrap, - &import[6], + &import.at("get_tx_field"), params, result, sfTransactionType.getCode(), @@ -677,8 +768,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getTxField(sfOfferSequence); { WasmValVec params(3), result(1); - auto* trap = ww( - getTxField_wrap, &import[6], params, result, sfOfferSequence.getCode(), 0, 256); + auto* trap = + ww(getTxField_wrap, + &import.at("get_tx_field"), + params, + result, + sfOfferSequence.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 > 0); @@ -690,8 +787,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getTxField(sfDestination); { WasmValVec params(3), result(1); - auto* trap = ww( - getTxField_wrap, &import[6], params, result, sfDestination.getCode(), 0, 256); + auto* trap = + ww(getTxField_wrap, + &import.at("get_tx_field"), + params, + result, + sfDestination.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -703,7 +806,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); auto* trap = - ww(getTxField_wrap, &import[6], params, result, sfMemos.getCode(), 0, 256); + ww(getTxField_wrap, + &import.at("get_tx_field"), + params, + result, + sfMemos.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -714,8 +823,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getTxField(sfCredentialIDs); { WasmValVec params(3), result(1); - auto* trap = ww( - getTxField_wrap, &import[6], params, result, sfCredentialIDs.getCode(), 0, 256); + auto* trap = + ww(getTxField_wrap, + &import.at("get_tx_field"), + params, + result, + sfCredentialIDs.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); BEAST_EXPECTS( @@ -727,7 +842,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); auto* trap = - ww(getTxField_wrap, &import[6], params, result, sfInvalid.getCode(), 0, 256); + ww(getTxField_wrap, + &import.at("get_tx_field"), + params, + result, + sfInvalid.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -739,7 +860,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); auto* trap = - ww(getTxField_wrap, &import[6], params, result, sfGeneric.getCode(), 0, 256); + ww(getTxField_wrap, + &import.at("get_tx_field"), + params, + result, + sfGeneric.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -766,7 +893,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); auto* trap = - ww(getTxField_wrap, &import[6], params, result, sfAsset.getCode(), 0, 256); + ww(getTxField_wrap, + &import.at("get_tx_field"), + params, + result, + sfAsset.getCode(), + 0, + 256); std::vector const expectedAsset(20, 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && @@ -780,7 +913,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); auto* trap = - ww(getTxField_wrap, &import[6], params, result, sfAsset2.getCode(), 0, 256); + ww(getTxField_wrap, + &import.at("get_tx_field"), + params, + result, + sfAsset2.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 > 0); @@ -809,7 +948,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); auto* trap = - ww(getTxField_wrap, &import[6], params, result, sfAsset.getCode(), 0, 256); + ww(getTxField_wrap, + &import.at("get_tx_field"), + params, + result, + sfAsset.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); if (BEAST_EXPECT(result[0].of.i32 > 0)) @@ -824,7 +969,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); auto* trap = - ww(getTxField_wrap, &import[6], params, result, sfAsset2.getCode(), 0, 256); + ww(getTxField_wrap, + &import.at("get_tx_field"), + params, + result, + sfAsset2.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); if (BEAST_EXPECT(result[0].of.i32 > 0)) @@ -853,7 +1004,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); auto* trap = - ww(getTxField_wrap, &import[6], params, result, sfAssetScale.getCode(), 0, 256); + ww(getTxField_wrap, + &import.at("get_tx_field"), + params, + result, + sfAssetScale.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); if (BEAST_EXPECT(result[0].of.i32 > 0)) @@ -897,7 +1054,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); auto* trap = ww(getCurrentLedgerObjField_wrap, - &import[7], + &import.at("get_current_ledger_obj_field"), params, result, sfAccount.getCode(), @@ -918,7 +1075,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); auto* trap = ww(getCurrentLedgerObjField_wrap, - &import[7], + &import.at("get_current_ledger_obj_field"), params, result, sfAmount.getCode(), @@ -939,7 +1096,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); auto* trap = ww(getCurrentLedgerObjField_wrap, - &import[7], + &import.at("get_current_ledger_obj_field"), params, result, sfPreviousTxnID.getCode(), @@ -960,7 +1117,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); auto* trap = ww(getCurrentLedgerObjField_wrap, - &import[7], + &import.at("get_current_ledger_obj_field"), params, result, sfOwner.getCode(), @@ -985,7 +1142,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); auto* trap = ww(getCurrentLedgerObjField_wrap, - &import2[7], + &import2.at("get_current_ledger_obj_field"), params, result, sfAccount.getCode(), @@ -1027,7 +1184,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); vrt.setBytes(0, accountKeylet.key.data(), uint256::bytes); - auto* trap = ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, 1); + auto* trap = + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + 1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 1); @@ -1036,8 +1200,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getLedgerObjField(1, sfAccount); { WasmValVec params(4), result(1); - auto* trap = ww( - getLedgerObjField_wrap, &import[8], params, result, 1, sfAccount.getCode(), 0, 256); + auto* trap = + ww(getLedgerObjField_wrap, + &import.at("get_ledger_obj_field"), + params, + result, + 1, + sfAccount.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); if (BEAST_EXPECTS(result[0].of.i32 > 0, std::to_string(result[0].of.i32))) @@ -1051,8 +1222,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getLedgerObjField(1, sfBalance); { WasmValVec params(4), result(1); - auto* trap = ww( - getLedgerObjField_wrap, &import[8], params, result, 1, sfBalance.getCode(), 0, 256); + auto* trap = + ww(getLedgerObjField_wrap, + &import.at("get_ledger_obj_field"), + params, + result, + 1, + sfBalance.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); if (BEAST_EXPECT(result[0].of.i32 > 0)) @@ -1066,8 +1244,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getLedgerObjField(0, sfAccount); { WasmValVec params(4), result(1); - auto* trap = ww( - getLedgerObjField_wrap, &import[8], params, result, 0, sfAccount.getCode(), 0, 256); + auto* trap = + ww(getLedgerObjField_wrap, + &import.at("get_ledger_obj_field"), + params, + result, + 0, + sfAccount.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -1079,7 +1264,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(getLedgerObjField_wrap, - &import[8], + &import.at("get_ledger_obj_field"), params, result, 257, @@ -1095,8 +1280,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getLedgerObjField(2, sfAccount); { WasmValVec params(4), result(1); - auto* trap = ww( - getLedgerObjField_wrap, &import[8], params, result, 2, sfAccount.getCode(), 0, 256); + auto* trap = + ww(getLedgerObjField_wrap, + &import.at("get_ledger_obj_field"), + params, + result, + 2, + sfAccount.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -1106,8 +1298,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getLedgerObjField(1, sfOwner); { WasmValVec params(4), result(1); - auto* trap = ww( - getLedgerObjField_wrap, &import[8], params, result, 1, sfOwner.getCode(), 0, 256); + auto* trap = + ww(getLedgerObjField_wrap, + &import.at("get_ledger_obj_field"), + params, + result, + 1, + sfOwner.getCode(), + 0, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -1161,7 +1360,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(getTxNestedField_wrap, - &import[9], + &import.at("get_tx_nested_field"), params, result, 0, @@ -1191,7 +1390,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(getTxNestedField_wrap, - &import[9], + &import.at("get_tx_nested_field"), params, result, 0, @@ -1218,7 +1417,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(getTxNestedField_wrap, - &import[9], + &import.at("get_tx_nested_field"), params, result, 0, @@ -1244,7 +1443,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = - ww(getTxNestedField_wrap, &import[9], params, result, 0, sizeof(int32_t), 256, 256); + ww(getTxNestedField_wrap, + &import.at("get_tx_nested_field"), + params, + result, + 0, + sizeof(int32_t), + 256, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); if (BEAST_EXPECTS(result[0].of.i32 > 0, std::to_string(result[0].of.i32))) @@ -1263,7 +1469,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getTxNestedField(locator); auto* trap = ww(getTxNestedField_wrap, - &import[9], + &import.at("get_tx_nested_field"), params, result, 0, @@ -1391,7 +1597,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, locatorVec.data(), 3); WasmValVec params(4), result(1); - auto* trap = ww(getTxNestedField_wrap, &import[9], params, result, 0, 3, 256, 256); + auto* trap = + ww(getTxNestedField_wrap, + &import.at("get_tx_nested_field"), + params, + result, + 0, + 3, + 256, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -1433,7 +1647,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(getCurrentLedgerObjNestedField_wrap, - &import[10], + &import.at("get_current_ledger_obj_nested_field"), params, result, 0, @@ -1458,7 +1672,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getCurrentLedgerObjNestedField(locator); auto* trap = ww(getCurrentLedgerObjNestedField_wrap, - &import[10], + &import.at("get_current_ledger_obj_nested_field"), params, result, 0, @@ -1491,8 +1705,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite // Locator for empty locator { WasmValVec params(4), result(1); - auto* trap = ww( - getCurrentLedgerObjNestedField_wrap, &import[10], params, result, 0, 0, 256, 256); + auto* trap = + ww(getCurrentLedgerObjNestedField_wrap, + &import.at("get_current_ledger_obj_nested_field"), + params, + result, + 0, + 0, + 256, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -1506,8 +1727,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, malformedLocatorVec.data(), 3); WasmValVec params(4), result(1); - auto* trap = ww( - getCurrentLedgerObjNestedField_wrap, &import[10], params, result, 0, 3, 256, 256); + auto* trap = + ww(getCurrentLedgerObjNestedField_wrap, + &import.at("get_current_ledger_obj_nested_field"), + params, + result, + 0, + 3, + 256, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -1529,7 +1757,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(getCurrentLedgerObjNestedField_wrap, - &import2[10], + &import2.at("get_current_ledger_obj_nested_field"), params, result, 0, @@ -1573,7 +1801,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); vrt.setBytes(0, signerListKeylet.key.data(), uint256::bytes); - auto* trap = ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, 1); + auto* trap = + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + 1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 1); } @@ -1587,7 +1822,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(getLedgerObjNestedField_wrap, - &import[11], + &import.at("get_ledger_obj_nested_field"), params, result, 1, @@ -1614,7 +1849,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(getLedgerObjNestedField_wrap, - &import[11], + &import.at("get_ledger_obj_nested_field"), params, result, 1, @@ -1641,7 +1876,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(getLedgerObjNestedField_wrap, - &import[11], + &import.at("get_ledger_obj_nested_field"), params, result, 1, @@ -1669,7 +1904,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(getLedgerObjNestedField_wrap, - &import[11], + &import.at("get_ledger_obj_nested_field"), params, result, 1, @@ -1697,7 +1932,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(getLedgerObjNestedField_wrap, - &import[11], + &import.at("get_ledger_obj_nested_field"), params, result, slot, @@ -1768,7 +2003,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, locatorVec.data(), 3); WasmValVec params(5), result(1); auto* trap = - ww(getLedgerObjNestedField_wrap, &import[11], params, result, 1, 0, 3, 256, 256); + ww(getLedgerObjNestedField_wrap, + &import.at("get_ledger_obj_nested_field"), + params, + result, + 1, + 0, + 3, + 256, + 256); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -1822,7 +2065,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getTxArrayLen(sfMemos); { WasmValVec params(1), result(1); - auto* trap = ww(getTxArrayLen_wrap, &import[12], params, result, sfMemos.fieldCode); + auto* trap = + ww(getTxArrayLen_wrap, + &import.at("get_tx_array_len"), + params, + result, + sfMemos.fieldCode); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); if (BEAST_EXPECT(result[0].of.i32 > 0)) @@ -1833,7 +2081,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getTxArrayLen(sfAccount); { WasmValVec params(1), result(1); - auto* trap = ww(getTxArrayLen_wrap, &import[12], params, result, sfAccount.fieldCode); + auto* trap = + ww(getTxArrayLen_wrap, + &import.at("get_tx_array_len"), + params, + result, + sfAccount.fieldCode); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); BEAST_EXPECT(result[0].of.i32 == static_cast(HostFunctionError::NO_ARRAY)); @@ -1843,7 +2096,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getTxArrayLen(sfSigners); { WasmValVec params(1), result(1); - auto* trap = ww(getTxArrayLen_wrap, &import[12], params, result, sfSigners.fieldCode); + auto* trap = + ww(getTxArrayLen_wrap, + &import.at("get_tx_array_len"), + params, + result, + sfSigners.fieldCode); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); BEAST_EXPECT( @@ -1855,7 +2113,11 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(1), result(1); auto* trap = - ww(getTxArrayLen_wrap, &import[12], params, result, sfCredentialIDs.fieldCode); + ww(getTxArrayLen_wrap, + &import.at("get_tx_array_len"), + params, + result, + sfCredentialIDs.fieldCode); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); if (BEAST_EXPECT(result[0].of.i32 > 0)) @@ -1891,7 +2153,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(1), result(1); auto* trap = ww(getCurrentLedgerObjArrayLen_wrap, - &import[13], + &import.at("get_current_ledger_obj_array_len"), params, result, sfSignerEntries.fieldCode); @@ -1904,8 +2166,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getCurrentLedgerObjArrayLen(sfMemos); { WasmValVec params(1), result(1); - auto* trap = ww( - getCurrentLedgerObjArrayLen_wrap, &import[13], params, result, sfMemos.fieldCode); + auto* trap = + ww(getCurrentLedgerObjArrayLen_wrap, + &import.at("get_current_ledger_obj_array_len"), + params, + result, + sfMemos.fieldCode); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); BEAST_EXPECT( @@ -1916,8 +2182,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getCurrentLedgerObjArrayLen(sfAccount); { WasmValVec params(1), result(1); - auto* trap = ww( - getCurrentLedgerObjArrayLen_wrap, &import[13], params, result, sfAccount.fieldCode); + auto* trap = + ww(getCurrentLedgerObjArrayLen_wrap, + &import.at("get_current_ledger_obj_array_len"), + params, + result, + sfAccount.fieldCode); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); BEAST_EXPECT(result[0].of.i32 == static_cast(HostFunctionError::NO_ARRAY)); @@ -1933,8 +2203,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite // auto const len = dummyHfs.getCurrentLedgerObjArrayLen(sfMemos); WasmValVec params(1), result(1); - auto* trap = ww( - getCurrentLedgerObjArrayLen_wrap, &import2[13], params, result, sfMemos.fieldCode); + auto* trap = + ww(getCurrentLedgerObjArrayLen_wrap, + &import2.at("get_current_ledger_obj_array_len"), + params, + result, + sfMemos.fieldCode); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); BEAST_EXPECT( @@ -1970,7 +2244,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); vrt.setBytes(0, signerListKeylet.key.data(), uint256::bytes); - auto* trap = ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, 1); + auto* trap = + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + 1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 1); } @@ -1980,7 +2261,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(2), result(1); auto* trap = ww(getLedgerObjArrayLen_wrap, - &import[14], + &import.at("get_ledger_obj_array_len"), params, result, 1, @@ -1998,7 +2279,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(2), result(1); auto* trap = ww(getLedgerObjArrayLen_wrap, - &import[14], + &import.at("get_ledger_obj_array_len"), params, result, 0, @@ -2014,7 +2295,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getLedgerObjArrayLen(1, sfAccount); WasmValVec params(2), result(1); auto* trap = - ww(getLedgerObjArrayLen_wrap, &import[14], params, result, 1, sfAccount.fieldCode); + ww(getLedgerObjArrayLen_wrap, + &import.at("get_ledger_obj_array_len"), + params, + result, + 1, + sfAccount.fieldCode); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); BEAST_EXPECT(result[0].of.i32 == static_cast(HostFunctionError::NO_ARRAY)); @@ -2026,7 +2312,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(2), result(1); auto* trap = ww(getLedgerObjArrayLen_wrap, - &import[14], + &import.at("get_ledger_obj_array_len"), params, result, 2, @@ -2041,7 +2327,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getLedgerObjArrayLen(1, sfMemos); WasmValVec params(2), result(1); auto* trap = - ww(getLedgerObjArrayLen_wrap, &import[14], params, result, 1, sfMemos.fieldCode); + ww(getLedgerObjArrayLen_wrap, + &import.at("get_ledger_obj_array_len"), + params, + result, + 1, + sfMemos.fieldCode); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32); BEAST_EXPECT( @@ -2082,7 +2373,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(2), result(1); auto* trap = ww(getTxNestedArrayLen_wrap, - &import[15], + &import.at("get_tx_nested_array_len"), params, result, 0, @@ -2102,7 +2393,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(2), result(1); auto* trap = ww(getTxNestedArrayLen_wrap, - &import[15], + &import.at("get_tx_nested_array_len"), params, result, 0, @@ -2150,7 +2441,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(2), result(1); auto* trap = ww(getCurrentLedgerObjNestedArrayLen_wrap, - &import[16], + &import.at("get_current_ledger_obj_nested_array_len"), params, result, 0, @@ -2170,7 +2461,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(2), result(1); auto* trap = ww(getCurrentLedgerObjNestedArrayLen_wrap, - &import[16], + &import.at("get_current_ledger_obj_nested_array_len"), params, result, 0, @@ -2200,7 +2491,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(2), result(1); auto* trap = ww(getCurrentLedgerObjNestedArrayLen_wrap, - &import2[16], + &import2.at("get_current_ledger_obj_nested_array_len"), params, result, 0, @@ -2240,7 +2531,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite { WasmValVec params(3), result(1); vrt.setBytes(0, signerListKeylet.key.data(), uint256::bytes); - auto* trap = ww(cacheLedgerObj_wrap, &import[5], params, result, 0, uint256::bytes, 1); + auto* trap = + ww(cacheLedgerObj_wrap, + &import.at("cache_ledger_obj"), + params, + result, + 0, + uint256::bytes, + 1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 1); } @@ -2253,7 +2551,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); auto* trap = ww(getLedgerObjNestedArrayLen_wrap, - &import[17], + &import.at("get_ledger_obj_nested_array_len"), params, result, 1, @@ -2274,7 +2572,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(3), result(1); auto* trap = ww(getLedgerObjNestedArrayLen_wrap, - &import[17], + &import.at("get_ledger_obj_nested_array_len"), params, result, slot, @@ -2308,7 +2606,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getLedgerObjNestedArrayLen(1, malformedLocator); vrt.setBytes(0, locatorVec.data(), 3); WasmValVec params(3), result(1); - auto* trap = ww(getLedgerObjNestedArrayLen_wrap, &import[17], params, result, 1, 0, 3); + auto* trap = + ww(getLedgerObjNestedArrayLen_wrap, + &import.at("get_ledger_obj_nested_array_len"), + params, + result, + 1, + 0, + 3); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -2348,7 +2653,8 @@ struct HostFuncImpl_test : public beast::unit_test::suite { vrt.setBytes(0, data.data(), data.size()); WasmValVec params(2), result(1); - auto* trap = ww(updateData_wrap, &import[67], params, result, 0, data.size()); + auto* trap = + ww(updateData_wrap, &import.at("update_data"), params, result, 0, data.size()); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == data.size()); @@ -2361,7 +2667,8 @@ struct HostFuncImpl_test : public beast::unit_test::suite { vrt.setBytes(0, bigData.data(), bigData.size()); WasmValVec params(2), result(1); - auto* trap = ww(updateData_wrap, &import[67], params, result, 0, bigData.size()); + auto* trap = + ww(updateData_wrap, &import.at("update_data"), params, result, 0, bigData.size()); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -2405,7 +2712,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(checkSignature_wrap, - &import[18], + &import.at("check_sig"), params, result, 0, @@ -2432,7 +2739,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(checkSignature_wrap, - &import[18], + &import.at("check_sig"), params, result, 0, @@ -2459,7 +2766,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(checkSignature_wrap, - &import[18], + &import.at("check_sig"), params, result, 0, @@ -2484,7 +2791,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(checkSignature_wrap, - &import[18], + &import.at("check_sig"), params, result, 0, @@ -2509,7 +2816,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(checkSignature_wrap, - &import[18], + &import.at("check_sig"), params, result, 0, @@ -2532,7 +2839,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(checkSignature_wrap, - &import[18], + &import.at("check_sig"), params, result, 0, @@ -2571,7 +2878,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(computeSha512HalfHash_wrap, - &import[19], + &import.at("compute_sha512_half"), params, result, 0, @@ -2618,14 +2925,22 @@ struct HostFuncImpl_test : public beast::unit_test::suite { auto const expected = keylet::account(masterID); WasmValVec params(4), result(1); - auto* trap = ww(accountKeylet_wrap, &imp[20], params, result, masterID, 1024, 32); + auto* trap = ww( + accountKeylet_wrap, &imp.at("account_keylet"), params, result, masterID, 1024, 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 2); BEAST_EXPECT(compareKeylet(actual, expected)); } - auto* trap2 = ww(accountKeylet_wrap, &imp[20], params, result, xrpAccount(), 1024, 32); + auto* trap2 = + ww(accountKeylet_wrap, + &imp.at("account_keylet"), + params, + result, + xrpAccount(), + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); @@ -2636,7 +2951,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = - ww(ammKeylet_wrap, &imp[21], params, result, xrpIssue(), usdIssue, 1024, 32); + ww(ammKeylet_wrap, + &imp.at("amm_keylet"), + params, + result, + xrpIssue(), + usdIssue, + 1024, + 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 4); @@ -2644,13 +2966,27 @@ struct HostFuncImpl_test : public beast::unit_test::suite } auto* trap2 = - ww(ammKeylet_wrap, &imp[21], params, result, xrpIssue(), xrpIssue(), 1024, 32); + ww(ammKeylet_wrap, + &imp.at("amm_keylet"), + params, + result, + xrpIssue(), + xrpIssue(), + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_PARAMS)); auto* trap3 = - ww(ammKeylet_wrap, &imp[21], params, result, baseMpt, xrpIssue(), 1024, 32); + ww(ammKeylet_wrap, + &imp.at("amm_keylet"), + params, + result, + baseMpt, + xrpIssue(), + 1024, + 32); BEAST_EXPECT( !trap3 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_PARAMS)); @@ -2660,7 +2996,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const expected = keylet::check(masterID, 1u); WasmValVec params(6), result(1); auto* trap = - ww(checkKeylet_wrap, &imp[22], params, result, masterID, toBytes(1u), 1024, 32); + ww(checkKeylet_wrap, + &imp.at("check_keylet"), + params, + result, + masterID, + toBytes(1u), + 1024, + 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 4); @@ -2668,7 +3011,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite } auto* trap2 = - ww(checkKeylet_wrap, &imp[22], params, result, xrpAccount(), toBytes(1u), 1024, 32); + ww(checkKeylet_wrap, + &imp.at("check_keylet"), + params, + result, + xrpAccount(), + toBytes(1u), + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); @@ -2682,7 +3032,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(8), result(1); auto* trap = ww(credentialKeylet_wrap, - &imp[23], + &imp.at("credential_keylet"), params, result, masterID, @@ -2703,7 +3053,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite static_assert(longCredTypeStr.size() > maxCredentialTypeLength); auto* trap2 = ww(credentialKeylet_wrap, - &imp[23], + &imp.at("credential_keylet"), params, result, masterID, @@ -2717,7 +3067,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto* trap3 = ww(credentialKeylet_wrap, - &imp[23], + &imp.at("credential_keylet"), params, result, xrpAccount(), @@ -2731,7 +3081,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto* trap4 = ww(credentialKeylet_wrap, - &imp[23], + &imp.at("credential_keylet"), params, result, masterID, @@ -2747,14 +3097,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite { auto const expected = keylet::did(masterID); WasmValVec params(4), result(1); - auto* trap = ww(didKeylet_wrap, &imp[26], params, result, masterID, 1024, 32); + auto* trap = + ww(didKeylet_wrap, &imp.at("did_keylet"), params, result, masterID, 1024, 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 2); BEAST_EXPECT(compareKeylet(actual, expected)); } - auto* trap2 = ww(didKeylet_wrap, &imp[26], params, result, xrpAccount(), 1024, 32); + auto* trap2 = + ww(didKeylet_wrap, &imp.at("did_keylet"), params, result, xrpAccount(), 1024, 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); @@ -2764,38 +3116,8 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const expected = keylet::delegate(masterID, alice.id()); WasmValVec params(6), result(1); auto* trap = - ww(delegateKeylet_wrap, &imp[24], params, result, masterID, alice.id(), 1024, 32); - if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) - { - auto const actual = vrt.getBytes(params, 4); - BEAST_EXPECT(compareKeylet(actual, expected)); - } - - auto* trap2 = - ww(delegateKeylet_wrap, &imp[24], params, result, masterID, masterID, 1024, 32); - BEAST_EXPECT( - !trap2 && result[0].kind == WASM_I32 && - result[0].of.i32 == static_cast(HostFunctionError::INVALID_PARAMS)); - - auto* trap3 = - ww(delegateKeylet_wrap, &imp[24], params, result, masterID, xrpAccount(), 1024, 32); - BEAST_EXPECT( - !trap3 && result[0].kind == WASM_I32 && - result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); - - auto* trap4 = - ww(delegateKeylet_wrap, &imp[24], params, result, xrpAccount(), masterID, 1024, 32); - BEAST_EXPECT( - !trap4 && result[0].kind == WASM_I32 && - result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); - } - - { - auto const expected = keylet::depositPreauth(masterID, alice.id()); - WasmValVec params(6), result(1); - auto* trap = - ww(depositPreauthKeylet_wrap, - &imp[25], + ww(delegateKeylet_wrap, + &imp.at("delegate_keylet"), params, result, masterID, @@ -2808,15 +3130,80 @@ struct HostFuncImpl_test : public beast::unit_test::suite BEAST_EXPECT(compareKeylet(actual, expected)); } - auto* trap2 = ww( - depositPreauthKeylet_wrap, &imp[25], params, result, masterID, masterID, 1024, 32); + auto* trap2 = + ww(delegateKeylet_wrap, + &imp.at("delegate_keylet"), + params, + result, + masterID, + masterID, + 1024, + 32); + BEAST_EXPECT( + !trap2 && result[0].kind == WASM_I32 && + result[0].of.i32 == static_cast(HostFunctionError::INVALID_PARAMS)); + + auto* trap3 = + ww(delegateKeylet_wrap, + &imp.at("delegate_keylet"), + params, + result, + masterID, + xrpAccount(), + 1024, + 32); + BEAST_EXPECT( + !trap3 && result[0].kind == WASM_I32 && + result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); + + auto* trap4 = + ww(delegateKeylet_wrap, + &imp.at("delegate_keylet"), + params, + result, + xrpAccount(), + masterID, + 1024, + 32); + BEAST_EXPECT( + !trap4 && result[0].kind == WASM_I32 && + result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); + } + + { + auto const expected = keylet::depositPreauth(masterID, alice.id()); + WasmValVec params(6), result(1); + auto* trap = + ww(depositPreauthKeylet_wrap, + &imp.at("deposit_preauth_keylet"), + params, + result, + masterID, + alice.id(), + 1024, + 32); + if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) + { + auto const actual = vrt.getBytes(params, 4); + BEAST_EXPECT(compareKeylet(actual, expected)); + } + + auto* trap2 = + ww(depositPreauthKeylet_wrap, + &imp.at("deposit_preauth_keylet"), + params, + result, + masterID, + masterID, + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_PARAMS)); auto* trap3 = ww(depositPreauthKeylet_wrap, - &imp[25], + &imp.at("deposit_preauth_keylet"), params, result, masterID, @@ -2829,7 +3216,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto* trap4 = ww(depositPreauthKeylet_wrap, - &imp[25], + &imp.at("deposit_preauth_keylet"), params, result, xrpAccount(), @@ -2845,15 +3232,29 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const expected = keylet::escrow(masterID, 1u); WasmValVec params(6), result(1); auto* trap = - ww(escrowKeylet_wrap, &imp[27], params, result, masterID, toBytes(1u), 1024, 32); + ww(escrowKeylet_wrap, + &imp.at("escrow_keylet"), + params, + result, + masterID, + toBytes(1u), + 1024, + 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 4); BEAST_EXPECT(compareKeylet(actual, expected)); } - auto* trap2 = ww( - escrowKeylet_wrap, &imp[27], params, result, xrpAccount(), toBytes(1u), 1024, 32); + auto* trap2 = + ww(escrowKeylet_wrap, + &imp.at("escrow_keylet"), + params, + result, + xrpAccount(), + toBytes(1u), + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); @@ -2864,7 +3265,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const expected = keylet::line(masterID, alice.id(), usd); WasmValVec params(8), result(1); auto* trap = - ww(lineKeylet_wrap, &imp[28], params, result, masterID, alice.id(), usd, 1024, 32); + ww(lineKeylet_wrap, + &imp.at("line_keylet"), + params, + result, + masterID, + alice.id(), + usd, + 1024, + 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 6); @@ -2872,26 +3281,50 @@ struct HostFuncImpl_test : public beast::unit_test::suite } auto* trap2 = - ww(lineKeylet_wrap, &imp[28], params, result, masterID, masterID, usd, 1024, 32); + ww(lineKeylet_wrap, + &imp.at("line_keylet"), + params, + result, + masterID, + masterID, + usd, + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_PARAMS)); - auto* trap3 = ww( - lineKeylet_wrap, &imp[28], params, result, masterID, xrpAccount(), usd, 1024, 32); + auto* trap3 = + ww(lineKeylet_wrap, + &imp.at("line_keylet"), + params, + result, + masterID, + xrpAccount(), + usd, + 1024, + 32); BEAST_EXPECT( !trap3 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); - auto* trap4 = ww( - lineKeylet_wrap, &imp[28], params, result, xrpAccount(), masterID, usd, 1024, 32); + auto* trap4 = + ww(lineKeylet_wrap, + &imp.at("line_keylet"), + params, + result, + xrpAccount(), + masterID, + usd, + 1024, + 32); BEAST_EXPECT( !trap4 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); auto* trap5 = ww(lineKeylet_wrap, - &imp[28], + &imp.at("line_keylet"), params, result, masterID, @@ -2907,8 +3340,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite { auto const expected = keylet::mptIssuance(1u, masterID); WasmValVec params(6), result(1); - auto* trap = ww( - mptIssuanceKeylet_wrap, &imp[29], params, result, masterID, toBytes(1u), 1024, 32); + auto* trap = + ww(mptIssuanceKeylet_wrap, + &imp.at("mpt_issuance_keylet"), + params, + result, + masterID, + toBytes(1u), + 1024, + 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 4); @@ -2917,7 +3357,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto* trap2 = ww(mptIssuanceKeylet_wrap, - &imp[29], + &imp.at("mpt_issuance_keylet"), params, result, xrpAccount(), @@ -2933,7 +3373,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const expected = keylet::mptoken(baseMpt, alice.id()); WasmValVec params(6), result(1); auto* trap = - ww(mptokenKeylet_wrap, &imp[30], params, result, baseMpt, alice.id(), 1024, 32); + ww(mptokenKeylet_wrap, + &imp.at("mptoken_keylet"), + params, + result, + baseMpt, + alice.id(), + 1024, + 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 4); @@ -2941,13 +3388,27 @@ struct HostFuncImpl_test : public beast::unit_test::suite } auto* trap2 = - ww(mptokenKeylet_wrap, &imp[30], params, result, MPTID{}, alice.id(), 1024, 32); + ww(mptokenKeylet_wrap, + &imp.at("mptoken_keylet"), + params, + result, + MPTID{}, + alice.id(), + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_PARAMS)); auto* trap3 = - ww(mptokenKeylet_wrap, &imp[30], params, result, baseMpt, xrpAccount(), 1024, 32); + ww(mptokenKeylet_wrap, + &imp.at("mptoken_keylet"), + params, + result, + baseMpt, + xrpAccount(), + 1024, + 32); BEAST_EXPECT( !trap3 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); @@ -2957,15 +3418,29 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const expected = keylet::nftoffer(masterID, 1u); WasmValVec params(6), result(1); auto* trap = - ww(nftOfferKeylet_wrap, &imp[31], params, result, masterID, toBytes(1u), 1024, 32); + ww(nftOfferKeylet_wrap, + &imp.at("nft_offer_keylet"), + params, + result, + masterID, + toBytes(1u), + 1024, + 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 4); BEAST_EXPECT(compareKeylet(actual, expected)); } - auto* trap2 = ww( - nftOfferKeylet_wrap, &imp[31], params, result, xrpAccount(), toBytes(1u), 1024, 32); + auto* trap2 = + ww(nftOfferKeylet_wrap, + &imp.at("nft_offer_keylet"), + params, + result, + xrpAccount(), + toBytes(1u), + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); @@ -2975,7 +3450,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const expected = keylet::offer(masterID, 1u); WasmValVec params(6), result(1); auto* trap = - ww(offerKeylet_wrap, &imp[32], params, result, masterID, toBytes(1u), 1024, 32); + ww(offerKeylet_wrap, + &imp.at("offer_keylet"), + params, + result, + masterID, + toBytes(1u), + 1024, + 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 4); @@ -2983,7 +3465,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite } auto* trap2 = - ww(offerKeylet_wrap, &imp[32], params, result, xrpAccount(), toBytes(1u), 1024, 32); + ww(offerKeylet_wrap, + &imp.at("offer_keylet"), + params, + result, + xrpAccount(), + toBytes(1u), + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); @@ -2993,15 +3482,29 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const expected = keylet::oracle(masterID, 1u); WasmValVec params(6), result(1); auto* trap = - ww(oracleKeylet_wrap, &imp[33], params, result, masterID, toBytes(1u), 1024, 32); + ww(oracleKeylet_wrap, + &imp.at("oracle_keylet"), + params, + result, + masterID, + toBytes(1u), + 1024, + 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 4); BEAST_EXPECT(compareKeylet(actual, expected)); } - auto* trap2 = ww( - oracleKeylet_wrap, &imp[33], params, result, xrpAccount(), toBytes(1u), 1024, 32); + auto* trap2 = + ww(oracleKeylet_wrap, + &imp.at("oracle_keylet"), + params, + result, + xrpAccount(), + toBytes(1u), + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); @@ -3012,7 +3515,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(8), result(1); auto* trap = ww(paychanKeylet_wrap, - &imp[34], + &imp.at("paychan_keylet"), params, result, masterID, @@ -3028,7 +3531,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto* trap2 = ww(paychanKeylet_wrap, - &imp[34], + &imp.at("paychan_keylet"), params, result, masterID, @@ -3042,7 +3545,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto* trap3 = ww(paychanKeylet_wrap, - &imp[34], + &imp.at("paychan_keylet"), params, result, masterID, @@ -3056,7 +3559,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto* trap4 = ww(paychanKeylet_wrap, - &imp[34], + &imp.at("paychan_keylet"), params, result, xrpAccount(), @@ -3074,7 +3577,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(permissionedDomainKeylet_wrap, - &imp[35], + &imp.at("permissioned_domain_keylet"), params, result, masterID, @@ -3089,7 +3592,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto* trap2 = ww(permissionedDomainKeylet_wrap, - &imp[35], + &imp.at("permissioned_domain_keylet"), params, result, xrpAccount(), @@ -3104,14 +3607,22 @@ struct HostFuncImpl_test : public beast::unit_test::suite { auto const expected = keylet::signers(masterID); WasmValVec params(4), result(1); - auto* trap = ww(signersKeylet_wrap, &imp[36], params, result, masterID, 1024, 32); + auto* trap = ww( + signersKeylet_wrap, &imp.at("signers_keylet"), params, result, masterID, 1024, 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 2); BEAST_EXPECT(compareKeylet(actual, expected)); } - auto* trap2 = ww(signersKeylet_wrap, &imp[36], params, result, xrpAccount(), 1024, 32); + auto* trap2 = + ww(signersKeylet_wrap, + &imp.at("signers_keylet"), + params, + result, + xrpAccount(), + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); @@ -3121,15 +3632,29 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const expected = keylet::ticket(masterID, 1u); WasmValVec params(6), result(1); auto* trap = - ww(ticketKeylet_wrap, &imp[37], params, result, masterID, toBytes(1u), 1024, 32); + ww(ticketKeylet_wrap, + &imp.at("ticket_keylet"), + params, + result, + masterID, + toBytes(1u), + 1024, + 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 4); BEAST_EXPECT(compareKeylet(actual, expected)); } - auto* trap2 = ww( - ticketKeylet_wrap, &imp[37], params, result, xrpAccount(), toBytes(1u), 1024, 32); + auto* trap2 = + ww(ticketKeylet_wrap, + &imp.at("ticket_keylet"), + params, + result, + xrpAccount(), + toBytes(1u), + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); @@ -3139,7 +3664,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const expected = keylet::vault(masterID, 1u); WasmValVec params(6), result(1); auto* trap = - ww(vaultKeylet_wrap, &imp[38], params, result, masterID, toBytes(1u), 1024, 32); + ww(vaultKeylet_wrap, + &imp.at("vault_keylet"), + params, + result, + masterID, + toBytes(1u), + 1024, + 32); if (BEAST_EXPECT(!trap && result[0].kind == WASM_I32 && result[0].of.i32 == 32)) { auto const actual = vrt.getBytes(params, 4); @@ -3147,7 +3679,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite } auto* trap2 = - ww(vaultKeylet_wrap, &imp[38], params, result, xrpAccount(), toBytes(1u), 1024, 32); + ww(vaultKeylet_wrap, + &imp.at("vault_keylet"), + params, + result, + xrpAccount(), + toBytes(1u), + 1024, + 32); BEAST_EXPECT( !trap2 && result[0].kind == WASM_I32 && result[0].of.i32 == static_cast(HostFunctionError::INVALID_ACCOUNT)); @@ -3192,7 +3731,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(getNFT_wrap, - &import[39], + &import.at("get_nft"), params, result, 0, @@ -3219,7 +3758,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(getNFT_wrap, - &import[39], + &import.at("get_nft"), params, result, 0, @@ -3242,7 +3781,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(getNFT_wrap, - &import[39], + &import.at("get_nft"), params, result, 0, @@ -3265,7 +3804,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(getNFT_wrap, - &import[39], + &import.at("get_nft"), params, result, 0, @@ -3287,7 +3826,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(6), result(1); auto* trap = ww(getNFT_wrap, - &import[39], + &import.at("get_nft"), params, result, 0, @@ -3332,7 +3871,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(getNFTIssuer_wrap, - &import[40], + &import.at("get_nft_issuer"), params, result, 0, @@ -3356,7 +3895,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(getNFTIssuer_wrap, - &import[40], + &import.at("get_nft_issuer"), params, result, 0, @@ -3397,7 +3936,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(getNFTTaxon_wrap, - &import[41], + &import.at("get_nft_taxon"), params, result, 0, @@ -3439,7 +3978,8 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getNFTFlags(nftId); vrt.setBytes(0, nftId.data(), uint256::bytes); WasmValVec params(2), result(1); - auto* trap = ww(getNFTFlags_wrap, &import[42], params, result, 0, uint256::bytes); + auto* trap = ww( + getNFTFlags_wrap, &import.at("get_nft_flags"), params, result, 0, uint256::bytes); if (BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32)) BEAST_EXPECT(result[0].of.i32 == tfTransferable); @@ -3451,7 +3991,8 @@ struct HostFuncImpl_test : public beast::unit_test::suite uint256 zeroId; vrt.setBytes(0, zeroId.data(), uint256::bytes); WasmValVec params(2), result(1); - auto* trap = ww(getNFTFlags_wrap, &import[42], params, result, 0, uint256::bytes); + auto* trap = ww( + getNFTFlags_wrap, &import.at("get_nft_flags"), params, result, 0, uint256::bytes); if (BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32)) BEAST_EXPECT(result[0].of.i32 == 0); @@ -3485,7 +4026,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.getNFTTransferFee(nftId); vrt.setBytes(0, nftId.data(), uint256::bytes); WasmValVec params(2), result(1); - auto* trap = ww(getNFTTransferFee_wrap, &import[43], params, result, 0, uint256::bytes); + auto* trap = + ww(getNFTTransferFee_wrap, + &import.at("get_nft_transfer_fee"), + params, + result, + 0, + uint256::bytes); if (BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32)) BEAST_EXPECT(result[0].of.i32 == transferFee); @@ -3497,7 +4044,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite uint256 zeroId; vrt.setBytes(0, zeroId.data(), uint256::bytes); WasmValVec params(2), result(1); - auto* trap = ww(getNFTTransferFee_wrap, &import[43], params, result, 0, uint256::bytes); + auto* trap = + ww(getNFTTransferFee_wrap, + &import.at("get_nft_transfer_fee"), + params, + result, + 0, + uint256::bytes); if (BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32)) BEAST_EXPECT(result[0].of.i32 == 0); @@ -3534,7 +4087,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(getNFTSerial_wrap, - &import[44], + &import.at("get_nft_serial"), params, result, 0, @@ -3557,7 +4110,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(getNFTSerial_wrap, - &import[44], + &import.at("get_nft_serial"), params, result, 0, @@ -3602,8 +4155,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, reinterpret_cast(msg.data()), msg.size()); vrt.setBytes(256, slice.data(), slice.size()); WasmValVec params(5), result(1); - auto* trap = ww( - trace_wrap, &import[45], params, result, 0, msg.size(), 256, slice.size(), 0); + auto* trap = + ww(trace_wrap, + &import.at("trace"), + params, + result, + 0, + msg.size(), + 256, + slice.size(), + 0); if (BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 0)) @@ -3618,8 +4179,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, reinterpret_cast(msg.data()), msg.size()); vrt.setBytes(256, slice.data(), slice.size()); WasmValVec params(5), result(1); - auto* trap = ww( - trace_wrap, &import[45], params, result, 0, msg.size(), 256, slice.size(), 1); + auto* trap = + ww(trace_wrap, + &import.at("trace"), + params, + result, + 0, + msg.size(), + 256, + slice.size(), + 1); if (BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 0)) @@ -3658,7 +4227,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(256, slice.data(), slice.size()); WasmValVec params(5), result(1); auto* trap = - ww(trace_wrap, &import[45], params, result, 0, msg.size(), 256, slice.size(), 0); + ww(trace_wrap, + &import.at("trace"), + params, + result, + 0, + msg.size(), + 256, + slice.size(), + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 0); @@ -3693,7 +4270,8 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.traceNum(msg, num); vrt.setBytes(0, reinterpret_cast(msg.data()), msg.size()); WasmValVec params(3), result(1); - auto* trap = ww(traceNum_wrap, &import[46], params, result, 0, msg.size(), num); + auto* trap = + ww(traceNum_wrap, &import.at("trace_num"), params, result, 0, msg.size(), num); if (BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 0)) @@ -3725,7 +4303,8 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.traceNum(msg, num); vrt.setBytes(0, reinterpret_cast(msg.data()), msg.size()); WasmValVec params(3), result(1); - auto* trap = ww(traceNum_wrap, &import[46], params, result, 0, msg.size(), num); + auto* trap = + ww(traceNum_wrap, &import.at("trace_num"), params, result, 0, msg.size(), num); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 0); @@ -3763,7 +4342,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(traceAccount_wrap, - &import[47], + &import.at("trace_account"), params, result, 0, @@ -3804,7 +4383,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(traceAccount_wrap, - &import[47], + &import.at("trace_account"), params, result, 0, @@ -3849,7 +4428,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(traceAmount_wrap, - &import[49], + &import.at("trace_amount"), params, result, 0, @@ -3879,7 +4458,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(traceAmount_wrap, - &import[49], + &import.at("trace_amount"), params, result, 0, @@ -3904,7 +4483,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(traceAmount_wrap, - &import[49], + &import.at("trace_amount"), params, result, 0, @@ -3942,7 +4521,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(traceAmount_wrap, - &import[49], + &import.at("trace_amount"), params, result, 0, @@ -4070,7 +4649,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(traceFloat_wrap, - &import[48], + &import.at("trace_opaque_float"), params, result, 0, @@ -4089,7 +4668,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(4), result(1); auto* trap = ww(traceFloat_wrap, - &import[48], + &import.at("trace_opaque_float"), params, result, 0, @@ -4123,8 +4702,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, reinterpret_cast(msg.data()), msg.size()); vrt.setBytes(256, reinterpret_cast(invalid.data()), invalid.size()); WasmValVec params(4), result(1); - auto* trap = ww( - traceFloat_wrap, &import[48], params, result, 0, msg.size(), 256, invalid.size()); + auto* trap = + ww(traceFloat_wrap, + &import.at("trace_opaque_float"), + params, + result, + 0, + msg.size(), + 256, + invalid.size()); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 0); @@ -4153,7 +4739,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatFromInt(min64, -1); WasmValVec params(4), result(1); auto* trap = - ww(floatFromInt_wrap, &import[50], params, result, min64, 0, FLOAT_SIZE, -1); + ww(floatFromInt_wrap, + &import.at("float_from_int"), + params, + result, + min64, + 0, + FLOAT_SIZE, + -1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4165,7 +4758,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatFromInt(min64, 4); WasmValVec params(4), result(1); auto* trap = - ww(floatFromInt_wrap, &import[50], params, result, min64, 0, FLOAT_SIZE, 4); + ww(floatFromInt_wrap, + &import.at("float_from_int"), + params, + result, + min64, + 0, + FLOAT_SIZE, + 4); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4177,7 +4777,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatFromInt(min64, 0); WasmValVec params(4), result(1); auto* trap = - ww(floatFromInt_wrap, &import[50], params, result, min64, 0, FLOAT_SIZE, 0); + ww(floatFromInt_wrap, + &import.at("float_from_int"), + params, + result, + min64, + 0, + FLOAT_SIZE, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); @@ -4188,7 +4795,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite { // hfs.floatFromInt(0, 0); WasmValVec params(4), result(1); - auto* trap = ww(floatFromInt_wrap, &import[50], params, result, 0ll, 0, FLOAT_SIZE, 0); + auto* trap = + ww(floatFromInt_wrap, + &import.at("float_from_int"), + params, + result, + 0ll, + 0, + FLOAT_SIZE, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); @@ -4200,7 +4815,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatFromInt(max64, 0); WasmValVec params(4), result(1); auto* trap = - ww(floatFromInt_wrap, &import[50], params, result, max64, 0, FLOAT_SIZE, 0); + ww(floatFromInt_wrap, + &import.at("float_from_int"), + params, + result, + max64, + 0, + FLOAT_SIZE, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); @@ -4231,7 +4853,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite uint64_t val = std::numeric_limits::min(); vrt.setBytes(0, &val, sizeof(val)); auto* trap = - ww(floatFromUint_wrap, &import[51], params, result, 0, 8, 16, FLOAT_SIZE, -1); + ww(floatFromUint_wrap, + &import.at("float_from_uint"), + params, + result, + 0, + 8, + 16, + FLOAT_SIZE, + -1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4245,7 +4875,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite uint64_t val = std::numeric_limits::min(); vrt.setBytes(0, &val, sizeof(val)); auto* trap = - ww(floatFromUint_wrap, &import[51], params, result, 0, 8, 16, FLOAT_SIZE, 4); + ww(floatFromUint_wrap, + &import.at("float_from_uint"), + params, + result, + 0, + 8, + 16, + FLOAT_SIZE, + 4); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4259,7 +4897,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite uint64_t val = 0; vrt.setBytes(0, &val, sizeof(val)); auto* trap = - ww(floatFromUint_wrap, &import[51], params, result, 0, 8, 16, FLOAT_SIZE, 0); + ww(floatFromUint_wrap, + &import.at("float_from_uint"), + params, + result, + 0, + 8, + 16, + FLOAT_SIZE, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); @@ -4273,7 +4919,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite uint64_t val = std::numeric_limits::max(); vrt.setBytes(0, &val, sizeof(val)); auto* trap = - ww(floatFromUint_wrap, &import[51], params, result, 0, 8, 16, FLOAT_SIZE, 0); + ww(floatFromUint_wrap, + &import.at("float_from_uint"), + params, + result, + 0, + 8, + 16, + FLOAT_SIZE, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); @@ -4283,9 +4937,9 @@ struct HostFuncImpl_test : public beast::unit_test::suite } void - testFloatSet() + testfloatFromMantExp() { - testcase("floatSet"); + testcase("floatFromMantExp"); using namespace test::jtx; using namespace wasm_float; @@ -4300,38 +4954,56 @@ struct HostFuncImpl_test : public beast::unit_test::suite hfs.setRT(&vrt); { - // hfs.floatSet(1, 0, -1); - WasmValVec params(5), result(1); - auto* trap = ww(floatSet_wrap, &import[58], params, result, 0, 1ll, 0, FLOAT_SIZE, -1); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT( - result[0].of.i32 == - static_cast(HostFunctionError::FLOAT_INPUT_MALFORMED)); - } - - { - // hfs.floatSet(1, 0, 4); - WasmValVec params(5), result(1); - auto* trap = ww(floatSet_wrap, &import[58], params, result, 0, 1ll, 0, FLOAT_SIZE, 4); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT( - result[0].of.i32 == - static_cast(HostFunctionError::FLOAT_INPUT_MALFORMED)); - } - - { - // hfs.floatSet(1, Number::maxExponent + normalExp + 1, 0); + // hfs.floatFromMantExp(1, 0, -1); WasmValVec params(5), result(1); auto* trap = - ww(floatSet_wrap, - &import[58], + ww(floatFromMantExp_wrap, + &import.at("float_compare"), params, result, - Number::maxExponent + normalExp + 1, 1ll, 0, + 0, + FLOAT_SIZE, + -1); + + BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && + BEAST_EXPECT( + result[0].of.i32 == + static_cast(HostFunctionError::FLOAT_INPUT_MALFORMED)); + } + + { + // hfs.floatFromMantExp(1, 0, 4); + WasmValVec params(5), result(1); + auto* trap = + ww(floatFromMantExp_wrap, + &import.at("float_compare"), + params, + result, + 1ll, + 0, + 0, + FLOAT_SIZE, + 4); + + BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && + BEAST_EXPECT( + result[0].of.i32 == + static_cast(HostFunctionError::FLOAT_INPUT_MALFORMED)); + } + + { + // hfs.floatFromMantExp(1, Number::maxExponent + normalExp + 1, 0); + WasmValVec params(5), result(1); + auto* trap = + ww(floatFromMantExp_wrap, + &import.at("float_compare"), + params, + result, + 1ll, + Number::maxExponent + normalExp + 1, + 0, FLOAT_SIZE, 0); @@ -4342,15 +5014,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite } { - // hfs.floatSet(1, Number::minExponent + normalExp - 1, 0); + // hfs.floatFromMantExp(1, Number::minExponent + normalExp - 1, 0); WasmValVec params(5), result(1); auto* trap = - ww(floatSet_wrap, - &import[58], + ww(floatFromMantExp_wrap, + &import.at("float_compare"), params, result, - Number::minExponent + normalExp - 1, 1ll, + Number::minExponent + normalExp - 1, 0, FLOAT_SIZE, 0); @@ -4362,15 +5034,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite } { - // hfs.floatSet(1, Number::maxExponent + normalExp, 0); + // hfs.floatFromMantExp(1, Number::maxExponent + normalExp, 0); WasmValVec params(5), result(1); auto* trap = - ww(floatSet_wrap, - &import[58], + ww(floatFromMantExp_wrap, + &import.at("float_compare"), params, result, - Number::maxExponent + normalExp, 1ll, + Number::maxExponent + normalExp, 0, FLOAT_SIZE, 0); @@ -4382,15 +5054,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite } { - // hfs.floatSet(-1, Number::maxExponent + normalExp, 0); + // hfs.floatFromMantExp(-1, Number::maxExponent + normalExp, 0); WasmValVec params(5), result(1); auto* trap = - ww(floatSet_wrap, - &import[58], + ww(floatFromMantExp_wrap, + &import.at("float_compare"), params, result, - Number::maxExponent + normalExp, -1ll, + Number::maxExponent + normalExp, 0, FLOAT_SIZE, 0); @@ -4402,15 +5074,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite } { - // hfs.floatSet(1, Number::maxExponent + normalExp - 1, 0); + // hfs.floatFromMantExp(1, Number::maxExponent + normalExp - 1, 0); WasmValVec params(5), result(1); auto* trap = - ww(floatSet_wrap, - &import[58], + ww(floatFromMantExp_wrap, + &import.at("float_compare"), params, result, - Number::maxExponent + normalExp - 1, 1ll, + Number::maxExponent + normalExp - 1, 0, FLOAT_SIZE, 0); @@ -4422,15 +5094,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite } { - // hfs.floatSet(STAmount::cMaxValue, STAmount::cMaxOffset, 0); + // hfs.floatFromMantExp(STAmount::cMaxValue, STAmount::cMaxOffset, 0); WasmValVec params(5), result(1); auto* trap = - ww(floatSet_wrap, - &import[58], + ww(floatFromMantExp_wrap, + &import.at("float_compare"), params, result, - STAmount::cMaxOffset, static_cast(STAmount::cMaxValue), + STAmount::cMaxOffset, 0, FLOAT_SIZE, 0); @@ -4442,15 +5114,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite } { - // hfs.floatSet(1, Number::minExponent + normalExp, 0); + // hfs.floatFromMantExp(1, Number::minExponent + normalExp, 0); WasmValVec params(5), result(1); auto* trap = - ww(floatSet_wrap, - &import[58], + ww(floatFromMantExp_wrap, + &import.at("float_compare"), params, result, - Number::minExponent - normalExp, 1ll, + Number::minExponent - normalExp, 0, FLOAT_SIZE, 0); @@ -4462,9 +5134,18 @@ struct HostFuncImpl_test : public beast::unit_test::suite } { - // hfs.floatSet(10, -1, 0); + // hfs.floatFromMantExp(10, -1, 0); WasmValVec params(5), result(1); - auto* trap = ww(floatSet_wrap, &import[58], params, result, -1, 10ll, 0, FLOAT_SIZE, 0); + auto* trap = + ww(floatFromMantExp_wrap, + &import.at("float_compare"), + params, + result, + 10ll, + -1, + 0, + FLOAT_SIZE, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); @@ -4473,15 +5154,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite } { - // hfs.floatSet(1, Number::maxExponent + normalExp + 1, 0); + // hfs.floatFromMantExp(1, Number::maxExponent + normalExp + 1, 0); WasmValVec params(5), result(1); auto* trap = - ww(floatSet_wrap, - &import[58], + ww(floatFromMantExp_wrap, + &import.at("float_compare"), params, result, - Number::maxExponent + normalExp + 1, 1ll, + Number::maxExponent + normalExp + 1, 0, FLOAT_SIZE, 0); @@ -4512,7 +5193,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite { // hfs.floatCompare(Slice(), Slice()); WasmValVec params(4), result(1); - auto* trap = ww(floatCompare_wrap, &import[59], params, result, 0, 0, 0, 0); + auto* trap = ww(floatCompare_wrap, &import.at("float_add"), params, result, 0, 0, 0, 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4524,7 +5205,8 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatCompare(makeSlice(floatInvalidZero), Slice()); WasmValVec params(4), result(1); vrt.setBytes(0, floatInvalidZero.data(), floatInvalidZero.size()); - auto* trap = ww(floatCompare_wrap, &import[59], params, result, 0, FLOAT_SIZE, 0, 0); + auto* trap = + ww(floatCompare_wrap, &import.at("float_add"), params, result, 0, FLOAT_SIZE, 0, 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4539,7 +5221,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, invalid.data(), invalid.size()); auto* trap = ww(floatCompare_wrap, - &import[59], + &import.at("float_add"), params, result, 0, @@ -4560,7 +5242,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, floatIntZero.data(), floatIntZero.size()); auto* trap = ww(floatCompare_wrap, - &import[59], + &import.at("float_add"), params, result, 0, @@ -4579,7 +5261,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, floatIntZero.data(), floatIntZero.size()); auto* trap = ww(floatCompare_wrap, - &import[59], + &import.at("float_add"), params, result, 0, @@ -4598,7 +5280,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, float1.data(), float1.size()); auto* trap = ww(floatCompare_wrap, - &import[59], + &import.at("float_add"), params, result, 0, @@ -4631,7 +5313,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatAdd(Slice(), Slice(), -1); WasmValVec params(7), result(1); auto* trap = - ww(floatAdd_wrap, &import[60], params, result, 0, 0, 0, 0, 0, FLOAT_SIZE, -1); + ww(floatAdd_wrap, + &import.at("float_subtract"), + params, + result, + 0, + 0, + 0, + 0, + 0, + FLOAT_SIZE, + -1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4643,7 +5335,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatAdd(Slice(), Slice(), 0); WasmValVec params(7), result(1); auto* trap = - ww(floatAdd_wrap, &import[60], params, result, 0, 0, 0, 0, 0, FLOAT_SIZE, 0); + ww(floatAdd_wrap, + &import.at("float_subtract"), + params, + result, + 0, + 0, + 0, + 0, + 0, + FLOAT_SIZE, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4658,7 +5360,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, invalid.data(), invalid.size()); auto* trap = ww(floatAdd_wrap, - &import[60], + &import.at("float_subtract"), params, result, 0, @@ -4683,7 +5385,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, floatMaxExp.data(), floatMaxExp.size()); auto* trap = ww(floatAdd_wrap, - &import[60], + &import.at("float_subtract"), params, result, 0, @@ -4707,7 +5409,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, floatIntZero.data(), floatIntZero.size()); auto* trap = ww(floatAdd_wrap, - &import[60], + &import.at("float_subtract"), params, result, 0, @@ -4732,7 +5434,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, floatIntMin.data(), floatIntMin.size()); auto* trap = ww(floatAdd_wrap, - &import[60], + &import.at("float_subtract"), params, result, 0, @@ -4770,7 +5472,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatSubtract(Slice(), Slice(), -1); WasmValVec params(7), result(1); auto* trap = - ww(floatSubtract_wrap, &import[61], params, result, 0, 0, 0, 0, 0, FLOAT_SIZE, -1); + ww(floatSubtract_wrap, + &import.at("float_from_mant_exp"), + params, + result, + 0, + 0, + 0, + 0, + 0, + FLOAT_SIZE, + -1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4782,7 +5494,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatSubtract(Slice(), Slice(), 0); WasmValVec params(7), result(1); auto* trap = - ww(floatSubtract_wrap, &import[61], params, result, 0, 0, 0, 0, 0, FLOAT_SIZE, 0); + ww(floatSubtract_wrap, + &import.at("float_from_mant_exp"), + params, + result, + 0, + 0, + 0, + 0, + 0, + FLOAT_SIZE, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4797,7 +5519,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, invalid.data(), invalid.size()); auto* trap = ww(floatSubtract_wrap, - &import[61], + &import.at("float_from_mant_exp"), params, result, 0, @@ -4821,7 +5543,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, floatMaxIOU.data(), floatMaxIOU.size()); auto* trap = ww(floatSubtract_wrap, - &import[61], + &import.at("float_from_mant_exp"), params, result, 0, @@ -4845,7 +5567,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, floatIntZero.data(), floatIntZero.size()); auto* trap = ww(floatSubtract_wrap, - &import[61], + &import.at("float_from_mant_exp"), params, result, 0, @@ -4869,7 +5591,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, float1.data(), float1.size()); auto* trap = ww(floatSubtract_wrap, - &import[61], + &import.at("float_from_mant_exp"), params, result, 0, @@ -4907,7 +5629,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatMultiply(Slice(), Slice(), -1); WasmValVec params(7), result(1); auto* trap = - ww(floatMultiply_wrap, &import[62], params, result, 0, 0, 0, 0, 0, FLOAT_SIZE, -1); + ww(floatMultiply_wrap, + &import.at("float_multiply"), + params, + result, + 0, + 0, + 0, + 0, + 0, + FLOAT_SIZE, + -1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4919,7 +5651,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatMultiply(Slice(), Slice(), 0); WasmValVec params(7), result(1); auto* trap = - ww(floatMultiply_wrap, &import[62], params, result, 0, 0, 0, 0, 0, FLOAT_SIZE, 0); + ww(floatMultiply_wrap, + &import.at("float_multiply"), + params, + result, + 0, + 0, + 0, + 0, + 0, + FLOAT_SIZE, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -4934,7 +5676,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, invalid.data(), invalid.size()); auto* trap = ww(floatMultiply_wrap, - &import[62], + &import.at("float_multiply"), params, result, 0, @@ -4958,7 +5700,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, float1More.data(), float1More.size()); auto* trap = ww(floatMultiply_wrap, - &import[62], + &import.at("float_multiply"), params, result, 0, @@ -4982,7 +5724,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, float1.data(), float1.size()); auto* trap = ww(floatMultiply_wrap, - &import[62], + &import.at("float_multiply"), params, result, 0, @@ -5006,7 +5748,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, floatMaxIOU.data(), floatMaxIOU.size()); auto* trap = ww(floatMultiply_wrap, - &import[62], + &import.at("float_multiply"), params, result, 0, @@ -5030,7 +5772,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, floatPreMaxExp.data(), floatPreMaxExp.size()); auto* trap = ww(floatMultiply_wrap, - &import[62], + &import.at("float_multiply"), params, result, 0, @@ -5068,7 +5810,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatDivide(Slice(), Slice(), -1); WasmValVec params(7), result(1); auto* trap = - ww(floatDivide_wrap, &import[63], params, result, 0, 0, 0, 0, 0, FLOAT_SIZE, -1); + ww(floatDivide_wrap, + &import.at("float_divide"), + params, + result, + 0, + 0, + 0, + 0, + 0, + FLOAT_SIZE, + -1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -5080,7 +5832,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatDivide(Slice(), Slice(), 0); WasmValVec params(7), result(1); auto* trap = - ww(floatDivide_wrap, &import[63], params, result, 0, 0, 0, 0, 0, FLOAT_SIZE, 0); + ww(floatDivide_wrap, + &import.at("float_divide"), + params, + result, + 0, + 0, + 0, + 0, + 0, + FLOAT_SIZE, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -5094,7 +5856,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, invalid.data(), invalid.size()); auto* trap = ww(floatDivide_wrap, - &import[63], + &import.at("float_divide"), params, result, 0, @@ -5117,7 +5879,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, floatIntZero.data(), floatIntZero.size()); auto* trap = ww(floatDivide_wrap, - &import[63], + &import.at("float_divide"), params, result, 0, @@ -5135,7 +5897,8 @@ struct HostFuncImpl_test : public beast::unit_test::suite } { // hfs.floatDivide(makeSlice(floatMax), makeSlice(*y), 0); - auto const y = hfs.floatSet(STAmount::cMaxValue, -normalExp - 1, 0); // 0.9999999... + auto const y = + hfs.floatFromMantExp(STAmount::cMaxValue, -normalExp - 1, 0); // 0.9999999... if (BEAST_EXPECT(y)) { WasmValVec params(7), result(1); @@ -5143,7 +5906,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, y->data(), y->size()); auto* trap = ww(floatDivide_wrap, - &import[63], + &import.at("float_divide"), params, result, 0, @@ -5167,7 +5930,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, float1.data(), float1.size()); auto* trap = ww(floatDivide_wrap, - &import[63], + &import.at("float_divide"), params, result, 0, @@ -5190,7 +5953,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(FLOAT_SIZE, float10.data(), float10.size()); auto* trap = ww(floatDivide_wrap, - &import[63], + &import.at("float_divide"), params, result, 0, @@ -5227,7 +5990,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite { // hfs.floatRoot(Slice(), 2, -1); WasmValVec params(6), result(1); auto* trap = - ww(floatRoot_wrap, &import[64], params, result, 0, 0, 2, 0, FLOAT_SIZE, -1); + ww(floatRoot_wrap, + &import.at("float_root"), + params, + result, + 0, + 0, + 2, + 0, + FLOAT_SIZE, + -1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -5240,7 +6012,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, invalid.data(), invalid.size()); auto* trap = ww(floatRoot_wrap, - &import[64], + &import.at("float_root"), params, result, 0, @@ -5261,7 +6033,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, float1.data(), float1.size()); auto* trap = ww(floatRoot_wrap, - &import[64], + &import.at("float_root"), params, result, 0, @@ -5282,7 +6054,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, floatIntZero.data(), floatIntZero.size()); auto* trap = ww(floatRoot_wrap, - &import[64], + &import.at("float_root"), params, result, 0, @@ -5303,7 +6075,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, floatMaxIOU.data(), floatMaxIOU.size()); auto* trap = ww(floatRoot_wrap, - &import[64], + &import.at("float_root"), params, result, 0, @@ -5321,14 +6093,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite { // hfs.floatRoot(makeSlice(*x), 2, 0); - auto const x = hfs.floatSet(100, 0, 0); // 100 + auto const x = hfs.floatFromMantExp(100, 0, 0); // 100 if (BEAST_EXPECT(x)) { WasmValVec params(6), result(1); vrt.setBytes(0, x->data(), x->size()); auto* trap = ww(floatRoot_wrap, - &import[64], + &import.at("float_root"), params, result, 0, @@ -5347,14 +6119,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite { // hfs.floatRoot(makeSlice(*x), 3, 0); - auto const x = hfs.floatSet(1000, 0, 0); // 1000 + auto const x = hfs.floatFromMantExp(1000, 0, 0); // 1000 if (BEAST_EXPECT(x)) { WasmValVec params(6), result(1); vrt.setBytes(0, x->data(), x->size()); auto* trap = ww(floatRoot_wrap, - &import[64], + &import.at("float_root"), params, result, 0, @@ -5373,15 +6145,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite { // hfs.floatRoot(makeSlice(*x), 2, 0); - auto const x = hfs.floatSet(1, -2, 0); // 0.01 - auto const y = hfs.floatSet(1, -1, 0); // 0.1 + auto const x = hfs.floatFromMantExp(1, -2, 0); // 0.01 + auto const y = hfs.floatFromMantExp(1, -1, 0); // 0.1 if (BEAST_EXPECT(x && y)) { WasmValVec params(6), result(1); vrt.setBytes(0, x->data(), x->size()); auto* trap = ww(floatRoot_wrap, - &import[64], + &import.at("float_root"), params, result, 0, @@ -5418,7 +6190,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite { // hfs.floatPower(Slice(), 2, -1); WasmValVec params(6), result(1); auto* trap = - ww(floatPower_wrap, &import[65], params, result, 0, 0, 2, 0, FLOAT_SIZE, -1); + ww(floatPower_wrap, + &import.at("float_pow"), + params, + result, + 0, + 0, + 2, + 0, + FLOAT_SIZE, + -1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -5431,7 +6212,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, invalid.data(), invalid.size()); auto* trap = ww(floatPower_wrap, - &import[65], + &import.at("float_pow"), params, result, 0, @@ -5452,7 +6233,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, float1.data(), float1.size()); auto* trap = ww(floatPower_wrap, - &import[65], + &import.at("float_pow"), params, result, 0, @@ -5474,7 +6255,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, floatMax.data(), floatMax.size()); auto* trap = ww(floatPower_wrap, - &import[65], + &import.at("float_pow"), params, result, 0, @@ -5496,7 +6277,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, floatMax.data(), floatMax.size()); auto* trap = ww(floatPower_wrap, - &import[65], + &import.at("float_pow"), params, result, 0, @@ -5518,7 +6299,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, floatMaxIOU.data(), floatMaxIOU.size()); auto* trap = ww(floatPower_wrap, - &import[65], + &import.at("float_pow"), params, result, 0, @@ -5539,7 +6320,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, floatMaxIOU.data(), floatMaxIOU.size()); auto* trap = ww(floatPower_wrap, - &import[65], + &import.at("float_pow"), params, result, 0, @@ -5557,14 +6338,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite { // hfs.floatPower(makeSlice(float10), 2, 0); - auto const x = hfs.floatSet(100, 0, 0); // 100 + auto const x = hfs.floatFromMantExp(100, 0, 0); // 100 if (BEAST_EXPECT(x)) { WasmValVec params(6), result(1); vrt.setBytes(0, float10.data(), float10.size()); auto* trap = ww(floatPower_wrap, - &import[65], + &import.at("float_pow"), params, result, 0, @@ -5581,16 +6362,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite } } - { // hfs.floatPower(makeSlice(*x), 2, 0); - auto const x = hfs.floatSet(1, -1, 0); // 0.1 - auto const y = hfs.floatSet(1, -2, 0); // 0.01 + { + // hfs.floatPower(makeSlice(*x), 2, 0); + auto const x = hfs.floatFromMantExp(1, -1, 0); // 0.1 + auto const y = hfs.floatFromMantExp(1, -2, 0); // 0.01 if (BEAST_EXPECT(x && y)) { WasmValVec params(6), result(1); vrt.setBytes(0, x->data(), x->size()); auto* trap = ww(floatPower_wrap, - &import[65], + &import.at("float_pow"), params, result, 0, @@ -5608,134 +6390,6 @@ struct HostFuncImpl_test : public beast::unit_test::suite } } - void - testFloatLog() - { - testcase("floatLog"); - using namespace test::jtx; - - Env env{*this}; - OpenView ov{*env.current()}; - ApplyContext ac = createApplyContext(env, ov); - auto const dummyEscrow = keylet::escrow(env.master, env.seq(env.master)); - VirtualRuntime vrt; - WasmHostFunctionsImpl hfs(ac, dummyEscrow); - - auto import = xrpl::createWasmImport(hfs); - hfs.setRT(&vrt); - - { // hfs.floatLog(Slice(), -1); - WasmValVec params(5), result(1); - auto* trap = ww(floatLog_wrap, &import[66], params, result, 0, 0, 0, FLOAT_SIZE, -1); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT( - result[0].of.i32 == - static_cast(HostFunctionError::FLOAT_INPUT_MALFORMED)); - } - - { - auto const x = hfs.floatSet(32'786, 0, 0); - if (BEAST_EXPECT(x)) - { - WasmValVec params(5), result(1); - vrt.setBytes(0, floatMaxExp.data(), floatMaxExp.size()); - auto* trap = - ww(floatLog_wrap, - &import[66], - params, - result, - 0, - FLOAT_SIZE, - 2 * FLOAT_SIZE, - FLOAT_SIZE, - 0); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == *x); - } - } - - { - // hfs.floatLog(makeSlice(*x), 0); - auto const x = hfs.floatSet(100, 0, 0); // 100 - if (BEAST_EXPECT(x)) - { - WasmValVec params(5), result(1); - vrt.setBytes(0, x->data(), x->size()); - auto* trap = - ww(floatLog_wrap, - &import[66], - params, - result, - 0, - FLOAT_SIZE, - 2 * FLOAT_SIZE, - FLOAT_SIZE, - 0); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == float2); - } - } - - { - // hfs.floatLog(makeSlice(*x), 0); - auto const x = hfs.floatSet(1000, 0, 0); // 1000 - auto const y = hfs.floatSet(3, 0, 0); // 3 - if (BEAST_EXPECT(x && y)) - { - WasmValVec params(5), result(1); - vrt.setBytes(0, x->data(), x->size()); - auto* trap = - ww(floatLog_wrap, - &import[66], - params, - result, - 0, - FLOAT_SIZE, - 2 * FLOAT_SIZE, - FLOAT_SIZE, - 0); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == *y); - } - } - - { - // hfs.floatLog(makeSlice(*x), 0); - auto const x = hfs.floatSet(1, -2, 0); // 0.01 - auto const y = hfs.floatSet(-1'999'999'999'999'999'999, -normalExp, 0); // -2 - if (BEAST_EXPECT(x && y)) - { - WasmValVec params(5), result(1); - vrt.setBytes(0, x->data(), x->size()); - auto* trap = - ww(floatLog_wrap, - &import[66], - params, - result, - 0, - FLOAT_SIZE, - 2 * FLOAT_SIZE, - FLOAT_SIZE, - 0); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == *y); - } - } - } - void testFloatSpecialCases() { @@ -5781,7 +6435,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(floatFromSTAmount_wrap, - &import[52], + &import.at("float_from_stamount"), params, result, 0, @@ -5804,7 +6458,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(floatFromSTAmount_wrap, - &import[52], + &import.at("float_from_stamount"), params, result, 0, @@ -5827,7 +6481,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(floatFromSTAmount_wrap, - &import[52], + &import.at("float_from_stamount"), params, result, 0, @@ -5845,7 +6499,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite { // hfs.floatFromSTAmount(amount, 0); STAmount const amount = XRP(-1); - auto const y = hfs.floatSet(-1 * 1'000'000, 0, 0); + auto const y = hfs.floatFromMantExp(-1 * 1'000'000, 0, 0); if (BEAST_EXPECT(y)) { Bytes amountBytes = toBytes(amount); @@ -5853,7 +6507,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(floatFromSTAmount_wrap, - &import[52], + &import.at("float_from_stamount"), params, result, 0, @@ -5871,14 +6525,14 @@ struct HostFuncImpl_test : public beast::unit_test::suite { // hfs.floatFromSTAmount(amount, 0); - auto const y = hfs.floatSet(9223372036854776, 3, 0); + auto const y = hfs.floatFromMantExp(9223372036854776, 3, 0); STAmount const amount(noIssue(), std::numeric_limits::max()); Bytes amountBytes = toBytes(amount); vrt.setBytes(0, amountBytes.data(), amountBytes.size()); WasmValVec params(5), result(1); auto* trap = ww(floatFromSTAmount_wrap, - &import[52], + &import.at("float_from_stamount"), params, result, 0, @@ -5918,7 +6572,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(floatFromSTAmount_wrap, - &import[52], + &import.at("float_from_stamount"), params, result, 0, @@ -5942,7 +6596,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(floatFromSTAmount_wrap, - &import[52], + &import.at("float_from_stamount"), params, result, 0, @@ -5983,7 +6637,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(floatFromSTNumber_wrap, - &import[53], + &import.at("float_from_stnumber"), params, result, 0, @@ -6006,7 +6660,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(floatFromSTNumber_wrap, - &import[53], + &import.at("float_from_stnumber"), params, result, 0, @@ -6030,7 +6684,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(floatFromSTNumber_wrap, - &import[53], + &import.at("float_from_stnumber"), params, result, 0, @@ -6053,7 +6707,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(5), result(1); auto* trap = ww(floatFromSTNumber_wrap, - &import[53], + &import.at("float_from_stnumber"), params, result, 0, @@ -6090,7 +6744,15 @@ struct HostFuncImpl_test : public beast::unit_test::suite vrt.setBytes(0, float1.data(), float1.size()); WasmValVec params(5), result(1); auto* trap = - ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, -1); + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + -1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -6102,7 +6764,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(float1), 4); vrt.setBytes(0, float1.data(), float1.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 4); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 4); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -6113,7 +6784,8 @@ struct HostFuncImpl_test : public beast::unit_test::suite { // hfs.floatToInt(Slice(), 0); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, 0, 256, 8, 0); + auto* trap = + ww(floatToInt_wrap, &import.at("float_to_int"), params, result, 0, 0, 256, 8, 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -6125,7 +6797,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(invalid), 0); vrt.setBytes(0, invalid.data(), invalid.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 0); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -6137,7 +6818,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(floatIntZero), 0); vrt.setBytes(0, floatIntZero.data(), floatIntZero.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 0); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 8); @@ -6153,7 +6843,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(float1), 0); vrt.setBytes(0, float1.data(), float1.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 0); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 8); @@ -6169,7 +6868,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(floatMinus1), 0); vrt.setBytes(0, floatMinus1.data(), floatMinus1.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 0); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 8); @@ -6185,7 +6893,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(floatIntMax), 0); vrt.setBytes(0, floatIntMax.data(), floatIntMax.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 0); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 8); @@ -6203,7 +6920,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(floatIntMin), 0); vrt.setBytes(0, floatIntMin.data(), floatIntMin.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 0); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -6215,7 +6941,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(floatUIntMax), 0); vrt.setBytes(0, floatUIntMax.data(), floatUIntMax.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 0); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT( @@ -6229,7 +6964,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(floatPi), 0); vrt.setBytes(0, floatPi.data(), floatPi.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 0); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 0); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 8); @@ -6242,7 +6986,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(floatPi), 1); vrt.setBytes(0, floatPi.data(), floatPi.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 1); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 8); @@ -6255,7 +7008,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(floatPi), 2); vrt.setBytes(0, floatPi.data(), floatPi.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 2); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 2); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 8); @@ -6268,7 +7030,16 @@ struct HostFuncImpl_test : public beast::unit_test::suite // hfs.floatToInt(makeSlice(floatPi), 3); vrt.setBytes(0, floatPi.data(), floatPi.size()); WasmValVec params(5), result(1); - auto* trap = ww(floatToInt_wrap, &import[54], params, result, 0, FLOAT_SIZE, 256, 8, 3); + auto* trap = + ww(floatToInt_wrap, + &import.at("float_to_int"), + params, + result, + 0, + FLOAT_SIZE, + 256, + 8, + 3); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == 8); @@ -6278,9 +7049,9 @@ struct HostFuncImpl_test : public beast::unit_test::suite } void - testFloatToMantissaAndExponent() + testFloatToMantExp() { - testcase("floatToMantissaAndExponent"); + testcase("floatToMantExp"); using namespace test::jtx; Env env{*this}; @@ -6294,12 +7065,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite hfs.setRT(&vrt); { - // hfs.floatToMantissaAndExponent(makeSlice(invalid)); + // hfs.floatToMantExp(makeSlice(invalid)); vrt.setBytes(0, invalid.data(), invalid.size()); WasmValVec params(6), result(1); auto* trap = - ww(floatToMantissaAndExponent_wrap, - &import[55], + ww(floatToMantExp_wrap, + &import.at("float_to_mant_exp"), params, result, 0, @@ -6316,12 +7087,12 @@ struct HostFuncImpl_test : public beast::unit_test::suite } { - // hfs.floatToMantissaAndExponent(makeSlice(floatIntZero)); + // hfs.floatToMantExp(makeSlice(floatIntZero)); vrt.setBytes(0, floatIntZero.data(), floatIntZero.size()); WasmValVec params(6), result(1); auto* trap = - ww(floatToMantissaAndExponent_wrap, - &import[55], + ww(floatToMantExp_wrap, + &import.at("float_to_mant_exp"), params, result, 0, @@ -6339,17 +7110,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite BEAST_EXPECT(exponent == std::numeric_limits::min()); // roundtrip - auto const result2 = hfs.floatSet(mantissa, exponent, 0); + auto const result2 = hfs.floatFromMantExp(mantissa, exponent, 0); BEAST_EXPECT(result2) && BEAST_EXPECT(*result2 == floatIntZero); } { - // hfs.floatToMantissaAndExponent(makeSlice(float1)); + // hfs.floatToMantExp(makeSlice(float1)); vrt.setBytes(0, float1.data(), float1.size()); WasmValVec params(6), result(1); auto* trap = - ww(floatToMantissaAndExponent_wrap, - &import[55], + ww(floatToMantExp_wrap, + &import.at("float_to_mant_exp"), params, result, 0, @@ -6366,17 +7137,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite BEAST_EXPECT(mantissa == 1000000000000000000) && BEAST_EXPECT(exponent == -normalExp); // roundtrip - auto const result2 = hfs.floatSet(mantissa, exponent, 0); + auto const result2 = hfs.floatFromMantExp(mantissa, exponent, 0); BEAST_EXPECT(result2) && BEAST_EXPECT(*result2 == float1); } { - // hfs.floatToMantissaAndExponent(makeSlice(floatMinus1)); + // hfs.floatToMantExp(makeSlice(floatMinus1)); vrt.setBytes(0, floatMinus1.data(), floatMinus1.size()); WasmValVec params(6), result(1); auto* trap = - ww(floatToMantissaAndExponent_wrap, - &import[55], + ww(floatToMantExp_wrap, + &import.at("float_to_mant_exp"), params, result, 0, @@ -6393,17 +7164,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite BEAST_EXPECT(mantissa == -1000000000000000000) && BEAST_EXPECT(exponent == -normalExp); // roundtrip - auto const result2 = hfs.floatSet(mantissa, exponent, 0); + auto const result2 = hfs.floatFromMantExp(mantissa, exponent, 0); BEAST_EXPECT(result2) && BEAST_EXPECT(*result2 == floatMinus1); } { - // hfs.floatToMantissaAndExponent(makeSlice(float10)); + // hfs.floatToMantExp(makeSlice(float10)); vrt.setBytes(0, float10.data(), float10.size()); WasmValVec params(6), result(1); auto* trap = - ww(floatToMantissaAndExponent_wrap, - &import[55], + ww(floatToMantExp_wrap, + &import.at("float_to_mant_exp"), params, result, 0, @@ -6421,17 +7192,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite BEAST_EXPECT(exponent == -normalExp + 1); // roundtrip - auto const result2 = hfs.floatSet(mantissa, exponent, 0); + auto const result2 = hfs.floatFromMantExp(mantissa, exponent, 0); BEAST_EXPECT(result2) && BEAST_EXPECT(*result2 == float10); } { - // hfs.floatToMantissaAndExponent(makeSlice(floatPi)); + // hfs.floatToMantExp(makeSlice(floatPi)); vrt.setBytes(0, floatPi.data(), floatPi.size()); WasmValVec params(6), result(1); auto* trap = - ww(floatToMantissaAndExponent_wrap, - &import[55], + ww(floatToMantExp_wrap, + &import.at("float_to_mant_exp"), params, result, 0, @@ -6448,17 +7219,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite BEAST_EXPECT(mantissa == 3141592653589793000) && BEAST_EXPECT(exponent == -normalExp); // roundtrip - auto const result2 = hfs.floatSet(mantissa, exponent, 0); + auto const result2 = hfs.floatFromMantExp(mantissa, exponent, 0); BEAST_EXPECT(result2) && BEAST_EXPECT(*result2 == floatPi); } { - // hfs.floatToMantissaAndExponent(makeSlice(floatIntMax)); + // hfs.floatToMantExp(makeSlice(floatIntMax)); vrt.setBytes(0, floatIntMax.data(), floatIntMax.size()); WasmValVec params(6), result(1); auto* trap = - ww(floatToMantissaAndExponent_wrap, - &import[55], + ww(floatToMantExp_wrap, + &import.at("float_to_mant_exp"), params, result, 0, @@ -6476,17 +7247,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite BEAST_EXPECT(exponent == 0); // roundtrip - auto const result2 = hfs.floatSet(mantissa, exponent, 0); + auto const result2 = hfs.floatFromMantExp(mantissa, exponent, 0); BEAST_EXPECT(result2) && BEAST_EXPECT(*result2 == floatIntMax); } { - // hfs.floatToMantissaAndExponent(makeSlice(floatIntMin)); + // hfs.floatToMantExp(makeSlice(floatIntMin)); vrt.setBytes(0, floatIntMin.data(), floatIntMin.size()); WasmValVec params(6), result(1); auto* trap = - ww(floatToMantissaAndExponent_wrap, - &import[55], + ww(floatToMantExp_wrap, + &import.at("float_to_mant_exp"), params, result, 0, @@ -6504,17 +7275,17 @@ struct HostFuncImpl_test : public beast::unit_test::suite BEAST_EXPECT(exponent == 1); // roundtrip - auto const result2 = hfs.floatSet(mantissa, exponent, 0); + auto const result2 = hfs.floatFromMantExp(mantissa, exponent, 0); BEAST_EXPECT(result2) && BEAST_EXPECT(*result2 == floatIntMin); } { - // hfs.floatToMantissaAndExponent(makeSlice(floatMax)); + // hfs.floatToMantExp(makeSlice(floatMax)); vrt.setBytes(0, floatMax.data(), floatMax.size()); WasmValVec params(6), result(1); auto* trap = - ww(floatToMantissaAndExponent_wrap, - &import[55], + ww(floatToMantExp_wrap, + &import.at("float_to_mant_exp"), params, result, 0, @@ -6532,253 +7303,11 @@ struct HostFuncImpl_test : public beast::unit_test::suite BEAST_EXPECT(exponent == Number::maxExponent); // roundtrip - auto const result2 = hfs.floatSet(mantissa, exponent, 0); + auto const result2 = hfs.floatFromMantExp(mantissa, exponent, 0); BEAST_EXPECT(result2) && BEAST_EXPECT(*result2 == floatMax); } } - void - testFloatNegate() - { - testcase("floatNegate"); - using namespace test::jtx; - - Env env{*this}; - OpenView ov{*env.current()}; - ApplyContext ac = createApplyContext(env, ov); - auto const dummyEscrow = keylet::escrow(env.master, env.seq(env.master)); - VirtualRuntime vrt; - WasmHostFunctionsImpl hfs(ac, dummyEscrow); - - auto import = xrpl::createWasmImport(hfs); - hfs.setRT(&vrt); - - { - // hfs.floatNegate(makeSlice(invalid)); - vrt.setBytes(0, invalid.data(), invalid.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatNegate_wrap, &import[56], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT( - result[0].of.i32 == - static_cast(HostFunctionError::FLOAT_INPUT_MALFORMED)); - } - - { - // hfs.floatNegate(makeSlice(floatIntZero)); - vrt.setBytes(0, floatIntZero.data(), floatIntZero.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatNegate_wrap, &import[56], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == floatIntZero); - } - - { - // hfs.floatNegate(makeSlice(float1)); - vrt.setBytes(0, float1.data(), float1.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatNegate_wrap, &import[56], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == floatMinus1); - } - - { - // hfs.floatNegate(makeSlice(floatMinus1)); - vrt.setBytes(0, floatMinus1.data(), floatMinus1.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatNegate_wrap, &import[56], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == float1); - } - - { - // hfs.floatNegate(makeSlice(floatIntMax)); - auto const expected = hfs.floatFromInt(std::numeric_limits::min() + 1, 0); - vrt.setBytes(0, floatIntMax.data(), floatIntMax.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatNegate_wrap, &import[56], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(expected) && BEAST_EXPECT(resultBytes == *expected); - } - - { - // hfs.floatNegate(makeSlice(floatMaxExp)); - vrt.setBytes(0, floatMaxExp.data(), floatMaxExp.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatNegate_wrap, &import[56], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == floatMinusMaxExp); - } - - { - // hfs.floatNegate(makeSlice(floatPi)); - vrt.setBytes(0, floatPi.data(), floatPi.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatNegate_wrap, &import[56], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - - // hfs.floatNegate(makeSlice(*result)); - vrt.setBytes(512, resultBytes.data(), resultBytes.size()); - WasmValVec params2(4), result2(1); - auto* trap2 = ww( - floatNegate_wrap, &import[56], params2, result2, 512, FLOAT_SIZE, 768, FLOAT_SIZE); - - BEAST_EXPECT(!trap2) && BEAST_EXPECT(result2[0].kind == WASM_I32) && - BEAST_EXPECT(result2[0].of.i32 == FLOAT_SIZE); - auto const negPiBytes = vrt.getBytes(params2, 2); - BEAST_EXPECT(negPiBytes == floatPi); - } - } - - void - testFloatAbs() - { - testcase("floatAbs"); - using namespace test::jtx; - - Env env{*this}; - OpenView ov{*env.current()}; - ApplyContext ac = createApplyContext(env, ov); - auto const dummyEscrow = keylet::escrow(env.master, env.seq(env.master)); - VirtualRuntime vrt; - WasmHostFunctionsImpl hfs(ac, dummyEscrow); - - auto import = xrpl::createWasmImport(hfs); - hfs.setRT(&vrt); - - { - // hfs.floatAbs(makeSlice(invalid)); - vrt.setBytes(0, invalid.data(), invalid.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatAbs_wrap, &import[57], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT( - result[0].of.i32 == - static_cast(HostFunctionError::FLOAT_INPUT_MALFORMED)); - } - - { - // hfs.floatAbs(makeSlice(floatIntZero)); - vrt.setBytes(0, floatIntZero.data(), floatIntZero.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatAbs_wrap, &import[57], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == floatIntZero); - } - - { - // hfs.floatAbs(makeSlice(float1)); - vrt.setBytes(0, float1.data(), float1.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatAbs_wrap, &import[57], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == float1); - } - - { - // hfs.floatAbs(makeSlice(floatMinus1)); - vrt.setBytes(0, floatMinus1.data(), floatMinus1.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatAbs_wrap, &import[57], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == float1); - } - - { - // hfs.floatAbs(makeSlice(floatIntMax)); - vrt.setBytes(0, floatIntMax.data(), floatIntMax.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatAbs_wrap, &import[57], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == floatIntMax); - } - - { - // hfs.floatAbs(makeSlice(floatIntMin)); - auto const negated = hfs.floatNegate(makeSlice(floatIntMin)); - vrt.setBytes(0, floatIntMin.data(), floatIntMin.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatAbs_wrap, &import[57], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(negated) && BEAST_EXPECT(resultBytes == *negated); - } - - { - // hfs.floatAbs(makeSlice(floatMinusMaxExp)); - vrt.setBytes(0, floatMinusMaxExp.data(), floatMinusMaxExp.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatAbs_wrap, &import[57], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(resultBytes == floatMaxExp); - } - - { - // hfs.floatAbs(makeSlice(floatMinus3)); - auto const expected = hfs.floatFromInt(3, 0); - vrt.setBytes(0, floatMinus3.data(), floatMinus3.size()); - WasmValVec params(4), result(1); - auto* trap = - ww(floatAbs_wrap, &import[57], params, result, 0, FLOAT_SIZE, 256, FLOAT_SIZE); - - BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && - BEAST_EXPECT(result[0].of.i32 == FLOAT_SIZE); - auto const resultBytes = vrt.getBytes(params, 2); - BEAST_EXPECT(expected) && BEAST_EXPECT(resultBytes == *expected); - } - } - void testFloats() { @@ -6791,10 +7320,8 @@ struct HostFuncImpl_test : public beast::unit_test::suite testFloatFromSTAmount(); testFloatFromSTNumber(); testFloatToInt(); - testFloatToMantissaAndExponent(); - testFloatNegate(); - testFloatAbs(); - testFloatSet(); + testFloatToMantExp(); + testfloatFromMantExp(); testFloatCompare(); testFloatAdd(); testFloatSubtract(); @@ -6802,7 +7329,6 @@ struct HostFuncImpl_test : public beast::unit_test::suite testFloatDivide(); testFloatRoot(); testFloatPower(); - testFloatLog(); testFloatSpecialCases(); } @@ -6829,7 +7355,13 @@ struct HostFuncImpl_test : public beast::unit_test::suite WasmValVec params(2), result(1); // 3 parameters instead of 2 auto* trap = - ww(getLedgerSqn_wrap, &import[0], params, result, 0, sizeof(std::uint32_t), 1); + ww(getLedgerSqn_wrap, + &import.at("get_ledger_sqn"), + params, + result, + 0, + sizeof(std::uint32_t), + 1); BEAST_EXPECT(!trap) && BEAST_EXPECT(result[0].kind == WASM_I32) && BEAST_EXPECT(result[0].of.i32 == sizeof(std::uint32_t)) && diff --git a/src/test/app/TestHostFunctions.h b/src/test/app/TestHostFunctions.h index 2f5740dca2..1a0d640522 100644 --- a/src/test/app/TestHostFunctions.h +++ b/src/test/app/TestHostFunctions.h @@ -477,27 +477,15 @@ public: } virtual Expected - floatToMantissaAndExponent(Slice const& x) const override + floatToMantExp(Slice const& x) const override { - return wasm_float::floatToMantissaAndExponentImpl(x); + return wasm_float::floatToMantExpImpl(x); } Expected - floatNegate(Slice const& x) const override + floatFromMantExp(int64_t mantissa, int32_t exponent, int32_t mode) const override { - return wasm_float::floatNegateImpl(x); - } - - Expected - floatAbs(Slice const& x) const override - { - return wasm_float::floatAbsImpl(x); - } - - Expected - floatSet(int64_t mantissa, int32_t exponent, int32_t mode) const override - { - return wasm_float::floatSetImpl(mantissa, exponent, mode); + return wasm_float::floatFromMantExpImpl(mantissa, exponent, mode); } Expected @@ -541,12 +529,6 @@ public: { return wasm_float::floatPowerImpl(x, n, mode); } - - Expected - floatLog(Slice const& x, int32_t mode) const override - { - return wasm_float::floatLogImpl(x, mode); - } }; struct TestHostFunctionsSink : public TestHostFunctions diff --git a/src/test/app/Wasm_test.cpp b/src/test/app/Wasm_test.cpp index e96ff5b89a..1582c2c809 100644 --- a/src/test/app/Wasm_test.cpp +++ b/src/test/app/Wasm_test.cpp @@ -154,7 +154,7 @@ struct Wasm_test : public beast::unit_test::suite void testWasmLib() { - testcase("wasmtime lib test"); + testcase("wasm lib test"); // clang-format off /* The WASM module buffer. */ Bytes const wasm = {/* WASM header */ @@ -369,7 +369,7 @@ struct Wasm_test : public beast::unit_test::suite TestHostFunctions hfs(env, 0); auto imp = createWasmImport(hfs); for (auto& i : imp) - i.second.gas = 0; + i.second.second.gas = 0; auto re = engine.run( allHostFuncWasm, hfs, 1'000'000, ESCROW_FUNCTION_NAME, {}, imp, env.journal); @@ -498,6 +498,8 @@ struct Wasm_test : public beast::unit_test::suite checkResult(re, -201, 28'965); } +// This test use log output, so DEBUG_OUTPUT must be disabled. +#ifndef DEBUG_OUTPUT { // fail because recursion too deep auto const deepWasm = hexToBytes(deepRecursionHex); @@ -525,6 +527,7 @@ struct Wasm_test : public beast::unit_test::suite BEAST_EXPECT(countSubstr(s, "WASMI Error: failure to call func") == 1); BEAST_EXPECT(countSubstr(s, "exception: failure") > 0); } +#endif { // infinite loop auto const infiniteLoopWasm = hexToBytes(infiniteLoopWasmHex); @@ -560,7 +563,7 @@ struct Wasm_test : public beast::unit_test::suite TestLedgerDataProvider hfs(env); ImportVec imports; WASM_IMPORT_FUNC2(imports, getLedgerSqn, "get_ledger_sqn", &hfs); - imports[0].first = nullptr; + imports["get_ledger_sqn"].first = nullptr; auto& engine = WasmEngine::instance(); @@ -599,7 +602,7 @@ struct Wasm_test : public beast::unit_test::suite TestHostFunctions hfs(env, 0); auto re = runEscrowWasm(floatTestWasm, hfs, 200'000, funcName, {}); - checkResult(re, 1, 167'965); + checkResult(re, 1, 134'938); env.close(); } @@ -625,7 +628,7 @@ struct Wasm_test : public beast::unit_test::suite auto const codecovWasm = hexToBytes(codecovTestsWasmHex); TestHostFunctions hfs(env, 0); - auto const allowance = 202'724; + auto const allowance = 208'169; auto re = runEscrowWasm(codecovWasm, hfs, allowance, ESCROW_FUNCTION_NAME, {}); checkResult(re, 1, allowance); diff --git a/src/test/app/wasm_fixtures/codecov_tests/src/lib.rs b/src/test/app/wasm_fixtures/codecov_tests/src/lib.rs index 918bbb5f09..239728575a 100644 --- a/src/test/app/wasm_fixtures/codecov_tests/src/lib.rs +++ b/src/test/app/wasm_fixtures/codecov_tests/src/lib.rs @@ -1042,21 +1042,6 @@ pub extern "C" fn finish() -> i32 { "float_pow_oob_slice", ) }); - with_buffer::<2, _, _>(|ptr, len| { - check_result( - unsafe { - host::float_log( - float.as_ptr().wrapping_add(1_000_000_000), - float.len(), - ptr, - len, - FLOAT_ROUNDING_MODES_TO_NEAREST, - ) - }, - error_codes::POINTER_OUT_OF_BOUNDS, - "float_log_oob_slice", - ) - }); // invalid UInt32 diff --git a/src/test/app/wasm_fixtures/fixtures.cpp b/src/test/app/wasm_fixtures/fixtures.cpp index a3906e52dd..95656161b9 100644 --- a/src/test/app/wasm_fixtures/fixtures.cpp +++ b/src/test/app/wasm_fixtures/fixtures.cpp @@ -396,492 +396,611 @@ extern std::string const allKeyletsWasmHex = "732b087369676e2d657874"; extern std::string const codecovTestsWasmHex = - "0061736d0100000001570b60067f7f7f7f7f7f017f60047f7f7f7f017f60027f7f017f60057f7f7f7f7f017f60037f" - "7f7f017f60077f7f7f7f7f7f7f017f60087f7f7f7f7f7f7f7f017f60017f017f60037f7f7e017f60047f7f7f7f0060" - "00017f02990d3c08686f73745f6c6962057472616365000308686f73745f6c69620974726163655f6e756d00080868" - "6f73745f6c69620e6765745f6c65646765725f73716e000208686f73745f6c6962166765745f706172656e745f6c65" - "646765725f74696d65000208686f73745f6c6962166765745f706172656e745f6c65646765725f6861736800020868" - "6f73745f6c69620c6765745f626173655f666565000208686f73745f6c696211616d656e646d656e745f656e61626c" - "6564000208686f73745f6c69620c6765745f74785f6669656c64000408686f73745f6c69620e6163636f756e745f6b" - "65796c6574000108686f73745f6c69621063616368655f6c65646765725f6f626a000408686f73745f6c69621c6765" - "745f63757272656e745f6c65646765725f6f626a5f6669656c64000408686f73745f6c6962146765745f6c65646765" - "725f6f626a5f6669656c64000108686f73745f6c6962136765745f74785f6e65737465645f6669656c64000108686f" - "73745f6c6962236765745f63757272656e745f6c65646765725f6f626a5f6e65737465645f6669656c64000108686f" - "73745f6c69621b6765745f6c65646765725f6f626a5f6e65737465645f6669656c64000308686f73745f6c69621067" - "65745f74785f61727261795f6c656e000708686f73745f6c6962206765745f63757272656e745f6c65646765725f6f" - "626a5f61727261795f6c656e000708686f73745f6c6962186765745f6c65646765725f6f626a5f61727261795f6c65" - "6e000208686f73745f6c6962176765745f74785f6e65737465645f61727261795f6c656e000208686f73745f6c6962" - "276765745f63757272656e745f6c65646765725f6f626a5f6e65737465645f61727261795f6c656e000208686f7374" - "5f6c69621f6765745f6c65646765725f6f626a5f6e65737465645f61727261795f6c656e000408686f73745f6c6962" - "0b7570646174655f64617461000208686f73745f6c696213636f6d707574655f7368613531325f68616c6600010868" - "6f73745f6c696209636865636b5f736967000008686f73745f6c6962076765745f6e6674000008686f73745f6c6962" - "0e6765745f6e66745f697373756572000108686f73745f6c69620d6765745f6e66745f7461786f6e000108686f7374" - "5f6c69620d6765745f6e66745f666c616773000208686f73745f6c6962146765745f6e66745f7472616e736665725f" - "666565000208686f73745f6c69620e6765745f6e66745f73657269616c000108686f73745f6c69620d74726163655f" - "6163636f756e74000108686f73745f6c69620c74726163655f616d6f756e74000108686f73745f6c69620c63686563" - "6b5f6b65796c6574000008686f73745f6c69620f666c6f61745f66726f6d5f75696e74000308686f73745f6c69620b" - "6c696e655f6b65796c6574000608686f73745f6c69620a616d6d5f6b65796c6574000008686f73745f6c6962116372" - "6564656e7469616c5f6b65796c6574000608686f73745f6c69620e6d70746f6b656e5f6b65796c6574000008686f73" - "745f6c69621274726163655f6f70617175655f666c6f6174000108686f73745f6c69620d666c6f61745f636f6d7061" - "7265000108686f73745f6c696209666c6f61745f616464000508686f73745f6c69620e666c6f61745f737562747261" - "6374000508686f73745f6c69620e666c6f61745f6d756c7469706c79000508686f73745f6c69620c666c6f61745f64" - "6976696465000508686f73745f6c69620a666c6f61745f726f6f74000008686f73745f6c696209666c6f61745f706f" - "77000008686f73745f6c696209666c6f61745f6c6f67000308686f73745f6c69620d657363726f775f6b65796c6574" - "000008686f73745f6c6962136d70745f69737375616e63655f6b65796c6574000008686f73745f6c6962106e66745f" - "6f666665725f6b65796c6574000008686f73745f6c69620c6f666665725f6b65796c6574000008686f73745f6c6962" - "0d6f7261636c655f6b65796c6574000008686f73745f6c69620e7061796368616e5f6b65796c6574000608686f7374" - "5f6c69621a7065726d697373696f6e65645f646f6d61696e5f6b65796c6574000008686f73745f6c69620d7469636b" - "65745f6b65796c6574000008686f73745f6c69620c7661756c745f6b65796c6574000008686f73745f6c69620f6465" - "6c65676174655f6b65796c6574000008686f73745f6c6962166465706f7369745f707265617574685f6b65796c6574" - "000008686f73745f6c69620a6469645f6b65796c6574000108686f73745f6c69620e7369676e6572735f6b65796c65" - "740001030302090a05030100110619037f01418080c0000b7f0041bba1c0000b7f0041c0a1c0000b072e04066d656d" - "6f727902000666696e697368003d0a5f5f646174615f656e6403010b5f5f686561705f6261736503020abf2c024600" - "0240200020014704402002200341014100410010001a20004100480d01418b80c000410b2000ad1001000b20022003" - "2000ac10011a0f0b418b80c000410b2000ac1001000bf52b020a7f017e23004190026b22002400419680c000412341" - "014100410010001a20004100360260200041e0006a220241041002410441bd8cc000410e103c200041003602602002" - "41041003410441cb8cc0004116103c200041f8006a22044200370300200041f0006a22014200370300200041e8006a" - "2205420037030020004200370360200241201004412041e18cc0004116103c20004100360260200241041005410441" - "f78cc000410c103c200041106a2207428182848890a0c08001370300200041186a2206428182848890a0c080013703" - "00200041206a2209428182848890a0c080013703002000428182848890a0c0800137030841b980c000410e10064101" - "41c780c0004111103c200041086a41201006410141c780c0004111103c418180202002411410072203411446044002" - "402000412e6a200041e2006a2d00003a0000200020002900673703e8012000200041ec006a2900003700ed01200020" - "002f00603b012c200020002903e8013703a801200020002900ed013700ad012000200028006336002f200041386a20" - "002900ad01370000200020002903a80137003320044200370300200142003703002005420037030020004200370360" - "2000412c6a2204411420024120100822034120470d00200041c2006a20002d00623a0000200041f0016a2203200041" - "ef006a290000220a370300200041cf006a200a370000200041d7006a200041f7006a290000370000200041df006a20" - "0041ff006a2d00003a0000200020002f01603b01402000200028006336004320002000290067370047200041406b41" - "2041001009410141d880c0004110103c2001410036020020054200370300200042003703604181802020024114100a" - "411441838dc000411c103c20014100360200200542003703002000420037036041014181802020024114100b411441" - "9f8dc0004114103c200041043602a001200041818020360260200041f8016a22054100360200200342003703002000" - "42003703e80120024104200041e8016a22014114100c411441b38dc0004113103c2005410036020020034200370300" - "200042003703e801200220002802a00120014114100d411441c68dc0004123103c2005410036020020034200370300" - "200042003703e8014101200220002802a00120014114100e411441e98dc000411b103c4189803c100f412041e880c0" - "004110103c4189803c1010412041f880c0004120103c41014189803c10114120419881c0004118103c200220002802" - "a0011012412041b081c0004117103c200220002802a0011013412041c781c0004127103c4101200220002802a00110" - "14412041ee81c000411f103c2004411410154114418d82c000410b103c20004180026a220842003703002005420037" - "030020034200370300200042003703e801200220002802a001200141201016412041848ec0004113103c419882c000" - "410c41a482c000410b41af82c000410e1017410141bd82c0004109103c200041c0016a2009290300370300200041b8" - "016a2006290300370300200041b0016a2007290300370300200020002903083703a801200541003b01002003420037" - "0300200042003703e80120044114200041a8016a22074120200141121018411241978ec0004107103c200541003602" - "0020034200370300200042003703e801200741202001411410194114419e8ec000410e103c200041003602e8012007" - "412020014104101a410441ac8ec000410d103c20074120101b410841c682c000410d103c20074120101c410a41d382" - "c0004114103c200041003602e8012007412020014104101d410441b98ec000410e103c41e782c000410d2004411410" - "1e410041f482c000410d103c41e782c000410d418183c0004108101f4100418983c000410c103c41e782c000410d41" - "9583c0004108101f4100419d83c0004111103c417f41041004417141ae83c000411e103c200041003602e801200141" - "7f1004417141c78ec000411e103c200041ea016a41003a0000200041003b01e801200141031004417d41e58ec00041" - "24103c200041003602e8012001418094ebdc031004417341898fc0004123103c4102100f416f41cc83c000411f103c" - "417f20002802a0011012417141eb83c000411f103c2002417f10124171418a84c000411f103c200241810810124174" - "41a984c0004120103c200041e094ebdc036a220620002802a0011012417341c984c000411f103c2008420037030020" - "05420037030020034200370300200042003703e8012004411420064108200141201020417341ac8fc0004118103c20" - "0842003703002005420037030020034200370300200042003703e8012004411420044114200141201020417141c48f" - "c000411a103c200842003703002005420037030020034200370300200042003703e801200641082001412041001021" - "417341de8fc0004117103c200842003703002005420037030020034200370300200042003703e801200220002802a0" - "012001412041001021417141f58fc0004120103c200620002802a00141011009417341e884c0004118103c20022000" - "2802a001410110094171418085c000411a103c200842003703002005420037030020034200370300200042003703e8" - "01200620002802a0012001412010084173419590c0004116103c200842003703002005420037030020034200370300" - "200042003703e801200220002802a001200141201008417141ab90c0004118103c2008420037030020054200370300" - "20034200370300200042003703e8012004411420044114200620002802a001200141201022417341c390c000411c10" - "3c200842003703002005420037030020034200370300200042003703e8012004411420044114200220002802a00120" - "0141201022417141df90c000411e103c200842003703002005420037030020034200370300200042003703e80141a7" - "a1c0004114200620002802a001200141201023417341fd90c0004119103c2008420037030020054200370300200342" - "00370300200042003703e80141a7a1c0004114200220002802a0012001412010234171419691c000411f103c200842" - "003703002005420037030020034200370300200042003703e80141a7a1c0004114419a85c000411420014120102341" - "7141b591c0004129103c200842003703002005420037030020034200370300200042003703e80141ae85c000412841" - "a7a1c0004114200141201023417141de91c0004125103c200041dc016a2000413c6a280100360200200041d4016a20" - "0041346a2901003702002000200029012c3702cc01200041808080083602c801200041003b01e801200041c8016a22" - "09411841a7a1c00041142001410210234171418392c000410e103c200620002802a001422a1001417341d685c00041" - "11103c200041003b01e8014102200141021007416f419192c000411b103c200041003b01e801410220014102100a41" - "6f41ac92c000412b103c200041003b01e8014101410220014102100b416f41d792c0004123103c4102100f416f41cc" - "83c000411f103c41021010416f41e785c000412f103c410141021011416f419686c0004127103c41b980c000418108" - "1006417441bd86c000411f103c41b980c00041c1001006417441dc86c000411a103c200041003b01e8012002418108" - "20014102100c417441fa92c0004121103c200041003b01e801200241810820014102100d4174419b93c0004131103c" - "200041003b01e8014101200241810820014102100e417441cc93c0004129103c20024181081012417441f686c00041" - "25103c200241810810134174419b87c0004135103c410120024181081014417441d087c000412d103c200241812010" - "15417441fd87c0004119103c41e782c00041810841a482c000410b41af82c000410e1017417441bd82c0004109103c" - "41e782c000410d41a482c00041810841af82c000410e1017417441bd82c0004109103c41e782c000410d41a482c000" - "410b41af82c0004181081017417441bd82c0004109103c200041003b01e8012002418108200141021016417441f593" - "c0004121103c200041003b01e80141a7a1c00041810841a7a1c00041142001410210234174419694c0004118103c20" - "0041003b01e80120044114200441142002418108200141021024417441ae94c000411f103c200041003b01e8012009" - "41810820044114200141021025417441cd94c0004122103c41e782c000410d200620002802a0014100100041734196" - "88c000410f103c200042d487b6f4c7d4b1c0003700e00141e782c000410d200041e095ebdc036a2207410810264173" - "41a588c000411c103c41e782c000410d200620002802a001101f417341c188c0004116103c20074108200041e0016a" - "220641081027417341d788c0004118103c20064108200741081027417341ef88c0004118103c200041003b01e80120" - "074108200641082001410241001028417341ef94c0004114103c200041003b01e80120064108200741082001410241" - "0010284173418395c0004114103c200041003b01e801200741082006410820014102410010294173419795c0004119" - "103c200041003b01e80120064108200741082001410241001029417341b095c0004119103c200041003b01e8012007" - "410820064108200141024100102a417341c995c0004119103c200041003b01e8012006410820074108200141024100" - "102a417341e295c0004119103c200041003b01e8012007410820064108200141024100102b417341fb95c000411710" - "3c200041003b01e8012006410820074108200141024100102b4173419296c0004117103c200041003b01e801200741" - "084103200141024100102c417341a996c0004114103c200041003b01e801200741084103200141024100102d417341" - "bd96c0004113103c200041003b01e80120074108200141024100102e417341d096c0004113103c2008420037030020" - "05420037030020034200370300200042003703e801200441142004411420014120102f417141e396c000411f103c20" - "0842003703002005420037030020034200370300200042003703e80120044114200441142001412010304171418297" - "c0004125103c200842003703002005420037030020034200370300200042003703e801200441142004411420014120" - "1031417141a797c0004122103c200842003703002005420037030020034200370300200042003703e8012004411420" - "044114200141201032417141c997c000411e103c200842003703002005420037030020034200370300200042003703" - "e8012004411420044114200141201033417141e797c000411f103c2008420037030020054200370300200342003703" - "00200042003703e8012004411420044114200441142001412010344171418698c0004120103c200842003703002005" - "420037030020034200370300200042003703e8012004411420044114200141201035417141a698c000412c103c2008" - "42003703002005420037030020034200370300200042003703e8012004411420044114200141201036417141d298c0" - "00411f103c200842003703002005420037030020034200370300200042003703e80120044114200441142001412010" - "37417141f198c000411e103c200220002802a001410010094171418789c0004123103c200041003b01e80120044114" - "200220002802a0012001410210184171418f99c000411a103c200041003b01e801200220002802a001200141021019" - "417141a999c0004121103c200041003b01e801200220002802a00120014102101a417141ca99c0004120103c200220" - "002802a001101b417141aa89c0004120103c200220002802a001101c417141ca89c0004127103c200041003602e801" - "200220002802a00120014104101d417141ea99c0004121103c200041003b01e801200220002802a001200141021008" - "4171418b9ac0004124103c200041808080083602e801200041003b018e02200220002802a001200141042000418e02" - "6a220341021020417141af9ac0004122103c200041003b018e02200220002802a00122052004411420022005200341" - "021024417141d19ac0004128103c200041003b018e0220044114200220002802a00122052002200520034102102441" - "7141f99ac0004128103c200041003b018e02200220002802a00120044114200341021038417141a19bc0004126103c" - "200041003b018e0220044114200220002802a001200341021038417141c79bc0004126103c200041003b018e022002" - "20002802a00120044114200341021039417141ed9bc000412d103c200041003b018e0220044114200220002802a001" - "2003410210394171419a9cc000412d103c200041003b018e02200220002802a00120034102103a417141c79cc00041" - "20103c200041003b018e02200220002802a0012001410420034102102f417141e79cc0004123103c200041003b018e" - "02200220002802a00120044114419a85c00041142003410210224171418a9dc0004122103c200041003b018e022004" - "4114200220002802a001419a85c0004114200341021022417141ac9dc0004122103c200041003b018e022002200028" - "02a00120014104200341021030417141ce9dc0004129103c200041003b018e0220094118200220002802a001200341" - "021025417141f79dc0004124103c200041003b018e02200220002802a001200141042003410210314171419b9ec000" - "4126103c200041003b018e02200220002802a00120014104200341021032417141c19ec0004122103c200041003b01" - "8e02200220002802a00120014104200341021033417141e39ec0004123103c200041003b018e02200220002802a001" - "2004411420014104200341021034417141869fc0004125103c200041003b018e0220044114200220002802a0012001" - "4104200341021034417141ab9fc0004125103c200041003b018e02200220002802a001200141042003410210354171" - "41d09fc0004130103c200041003b018e02200220002802a00120034102103b41714180a0c0004124103c200041003b" - "018e02200220002802a00120014104200341021036417141a4a0c0004123103c200041003b018e02200220002802a0" - "0120014104200341021037417141c7a0c0004122103c200041003b018e02200220002802a00141f189c00041202003" - "41021018417141e9a0c000411d103c41e782c000410d200220002802a001101e417141918ac0004123103c41e796ab" - "dd03410d41f189c000412041001000417341b48ac0004110103c41e796abdd03410d200641081026417341c48ac000" - "411d103c41e796abdd03410d20044114101e417341e18ac0004118103c41e796abdd03410d419583c0004108101f41" - "7341f98ac0004117103c200220002802a001200241810841001000417441908bc000410e103c200241810842011001" - "4174419e8bc0004112103c41e782c000418108200641081026417441b08bc000411b103c41e782c000418108200441" - "14101e417441cb8bc0004116103c41e782c000418108419583c0004108101f417441e18bc0004115103c41e782c000" - "410d200220002802a001101f417141f68bc0004119103c200041003b018e02200220002802a0012004411420034102" - "102541714186a1c0004121103c41e782c000410d200220002802a001410210004171418f8cc0004114103c41014100" - "20044114101e410041a38cc000411a103c20004190026a240041010f0b0b418080c000410b417f20032003417f4e1b" - "ac1001000b0b92210200418080c0000bae056572726f725f636f64653d54455354204641494c454424242424242053" - "54415254494e47205741534d20455845435554494f4e202424242424746573745f616d656e646d656e74616d656e64" - "6d656e745f656e61626c656463616368655f6c65646765725f6f626a6765745f74785f61727261795f6c656e676574" - "5f63757272656e745f6c65646765725f6f626a5f61727261795f6c656e6765745f6c65646765725f6f626a5f617272" - "61795f6c656e6765745f74785f6e65737465645f61727261795f6c656e6765745f63757272656e745f6c6564676572" - "5f6f626a5f6e65737465645f61727261795f6c656e6765745f6c65646765725f6f626a5f6e65737465645f61727261" - "795f6c656e7570646174655f6461746174657374206d65737361676574657374207075626b65797465737420736967" - "6e6174757265636865636b5f7369676765745f6e66745f666c6167736765745f6e66745f7472616e736665725f6665" - "6574657374696e6720747261636574726163655f6163636f756e74400000000000005f74726163655f616d6f756e74" - "400000000000000074726163655f616d6f756e745f7a65726f6765745f706172656e745f6c65646765725f68617368" - "5f6e65675f7074726765745f74785f61727261795f6c656e5f696e76616c69645f736669656c646765745f74785f6e" - "65737465645f61727261795f6c656e5f6e65675f7074726765745f74785f6e65737465645f61727261795f6c656e5f" - "6e65675f6c656e6765745f74785f6e65737465645f61727261795f6c656e5f746f6f5f6c6f6e676765745f74785f6e" - "65737465645f61727261795f6c656e5f7074725f6f6f6263616368655f6c65646765725f6f626a5f7074725f6f6f62" - "63616368655f6c65646765725f6f626a5f77726f6e675f6c656e555344303030303030303030303030303030303000" - "41d685c0000bd11b74726163655f6e756d5f6f6f625f7374726765745f63757272656e745f6c65646765725f6f626a" - "5f61727261795f6c656e5f696e76616c69645f736669656c646765745f6c65646765725f6f626a5f61727261795f6c" - "656e5f696e76616c69645f736669656c64616d656e646d656e745f656e61626c65645f746f6f5f6269675f736c6963" - "65616d656e646d656e745f656e61626c65645f746f6f5f6c6f6e676765745f74785f6e65737465645f61727261795f" - "6c656e5f746f6f5f6269675f736c6963656765745f63757272656e745f6c65646765725f6f626a5f6e65737465645f" - "61727261795f6c656e5f746f6f5f6269675f736c6963656765745f6c65646765725f6f626a5f6e65737465645f6172" - "7261795f6c656e5f746f6f5f6269675f736c6963657570646174655f646174615f746f6f5f6269675f736c69636574" - "726163655f6f6f625f736c69636574726163655f6f70617175655f666c6f61745f6f6f625f736c6963657472616365" - "5f616d6f756e745f6f6f625f736c696365666c6f61745f636f6d706172655f6f6f625f736c69636531666c6f61745f" - "636f6d706172655f6f6f625f736c6963653263616368655f6c65646765725f6f626a5f77726f6e675f73697a655f75" - "696e743235366765745f6e66745f666c6167735f77726f6e675f73697a655f75696e743235366765745f6e66745f74" - "72616e736665725f6665655f77726f6e675f73697a655f75696e743235363030303030303030303030303030303030" - "30303030303030303030303030303174726163655f6163636f756e745f77726f6e675f73697a655f6163636f756e74" - "5f696474726163655f6f6f625f737472696e6774726163655f6f70617175655f666c6f61745f6f6f625f737472696e" - "6774726163655f6163636f756e745f6f6f625f737472696e6774726163655f616d6f756e745f6f6f625f737472696e" - "6774726163655f746f6f5f6c6f6e6774726163655f6e756d5f746f6f5f6c6f6e6774726163655f6f70617175655f66" - "6c6f61745f746f6f5f6c6f6e6774726163655f6163636f756e745f746f6f5f6c6f6e6774726163655f616d6f756e74" - "5f746f6f5f6c6f6e6774726163655f616d6f756e745f77726f6e675f6c656e67746874726163655f696e76616c6964" - "5f61735f68657874726163655f6163636f756e745f636865636b5f646573796e636765745f6c65646765725f73716e" - "6765745f706172656e745f6c65646765725f74696d656765745f706172656e745f6c65646765725f68617368676574" - "5f626173655f6665656765745f63757272656e745f6c65646765725f6f626a5f6669656c646765745f6c6564676572" - "5f6f626a5f6669656c646765745f74785f6e65737465645f6669656c646765745f63757272656e745f6c6564676572" - "5f6f626a5f6e65737465645f6669656c646765745f6c65646765725f6f626a5f6e65737465645f6669656c64636f6d" - "707574655f7368613531325f68616c666765745f6e66746765745f6e66745f6973737565726765745f6e66745f7461" - "786f6e6765745f6e66745f73657269616c6765745f706172656e745f6c65646765725f686173685f6e65675f6c656e" - "6765745f706172656e745f6c65646765725f686173685f6275665f746f6f5f736d616c6c6765745f706172656e745f" - "6c65646765725f686173685f6c656e5f746f6f5f6c6f6e67636865636b5f6b65796c65745f6f6f625f6c656e5f7533" - "32636865636b5f6b65796c65745f77726f6e675f6c656e5f753332666c6f61745f66726f6d5f75696e745f6c656e5f" - "6f6f62666c6f61745f66726f6d5f75696e745f77726f6e675f6c656e5f75696e7436346163636f756e745f6b65796c" - "65745f6c656e5f6f6f626163636f756e745f6b65796c65745f77726f6e675f6c656e6c696e655f6b65796c65745f6c" - "656e5f6f6f625f63757272656e63796c696e655f6b65796c65745f77726f6e675f6c656e5f63757272656e6379616d" - "6d5f6b65796c65745f6c656e5f6f6f625f617373657432616d6d5f6b65796c65745f6c656e5f77726f6e675f6c656e" - "5f617373657432616d6d5f6b65796c65745f6c656e5f77726f6e675f6e6f6e5f7872705f63757272656e63795f6c65" - "6e616d6d5f6b65796c65745f6c656e5f77726f6e675f7872705f63757272656e63795f6c656e616d6d5f6b65796c65" - "745f6d70746765745f74785f6669656c645f696e76616c69645f736669656c646765745f63757272656e745f6c6564" - "6765725f6f626a5f6669656c645f696e76616c69645f736669656c646765745f6c65646765725f6f626a5f6669656c" - "645f696e76616c69645f736669656c646765745f74785f6e65737465645f6669656c645f746f6f5f6269675f736c69" - "63656765745f63757272656e745f6c65646765725f6f626a5f6e65737465645f6669656c645f746f6f5f6269675f73" - "6c6963656765745f6c65646765725f6f626a5f6e65737465645f6669656c645f746f6f5f6269675f736c696365636f" - "6d707574655f7368613531325f68616c665f746f6f5f6269675f736c696365616d6d5f6b65796c65745f746f6f5f62" - "69675f736c69636563726564656e7469616c5f6b65796c65745f746f6f5f6269675f736c6963656d70746f6b656e5f" - "6b65796c65745f746f6f5f6269675f736c6963655f6d70746964666c6f61745f6164645f6f6f625f736c6963653166" - "6c6f61745f6164645f6f6f625f736c69636532666c6f61745f73756274726163745f6f6f625f736c69636531666c6f" - "61745f73756274726163745f6f6f625f736c69636532666c6f61745f6d756c7469706c795f6f6f625f736c69636531" - "666c6f61745f6d756c7469706c795f6f6f625f736c69636532666c6f61745f6469766964655f6f6f625f736c696365" - "31666c6f61745f6469766964655f6f6f625f736c69636532666c6f61745f726f6f745f6f6f625f736c696365666c6f" - "61745f706f775f6f6f625f736c696365666c6f61745f6c6f675f6f6f625f736c696365657363726f775f6b65796c65" - "745f77726f6e675f73697a655f75696e7433326d70745f69737375616e63655f6b65796c65745f77726f6e675f7369" - "7a655f75696e7433326e66745f6f666665725f6b65796c65745f77726f6e675f73697a655f75696e7433326f666665" - "725f6b65796c65745f77726f6e675f73697a655f75696e7433326f7261636c655f6b65796c65745f77726f6e675f73" - "697a655f75696e7433327061796368616e5f6b65796c65745f77726f6e675f73697a655f75696e7433327065726d69" - "7373696f6e65645f646f6d61696e5f6b65796c65745f77726f6e675f73697a655f75696e7433327469636b65745f6b" - "65796c65745f77726f6e675f73697a655f75696e7433327661756c745f6b65796c65745f77726f6e675f73697a655f" - "75696e7433326765745f6e66745f77726f6e675f73697a655f75696e743235366765745f6e66745f6973737565725f" - "77726f6e675f73697a655f75696e743235366765745f6e66745f7461786f6e5f77726f6e675f73697a655f75696e74" - "3235366765745f6e66745f73657269616c5f77726f6e675f73697a655f75696e743235366163636f756e745f6b6579" - "6c65745f77726f6e675f73697a655f6163636f756e745f6964636865636b5f6b65796c65745f77726f6e675f73697a" - "655f6163636f756e745f696463726564656e7469616c5f6b65796c65745f77726f6e675f73697a655f6163636f756e" - "745f69643163726564656e7469616c5f6b65796c65745f77726f6e675f73697a655f6163636f756e745f6964326465" - "6c65676174655f6b65796c65745f77726f6e675f73697a655f6163636f756e745f69643164656c65676174655f6b65" - "796c65745f77726f6e675f73697a655f6163636f756e745f6964326465706f7369745f707265617574685f6b65796c" - "65745f77726f6e675f73697a655f6163636f756e745f6964316465706f7369745f707265617574685f6b65796c6574" - "5f77726f6e675f73697a655f6163636f756e745f6964326469645f6b65796c65745f77726f6e675f73697a655f6163" - "636f756e745f6964657363726f775f6b65796c65745f77726f6e675f73697a655f6163636f756e745f69646c696e65" - "5f6b65796c65745f77726f6e675f73697a655f6163636f756e745f6964316c696e655f6b65796c65745f77726f6e67" - "5f73697a655f6163636f756e745f6964326d70745f69737375616e63655f6b65796c65745f77726f6e675f73697a65" - "5f6163636f756e745f69646d70746f6b656e5f6b65796c65745f77726f6e675f73697a655f6163636f756e745f6964" - "6e66745f6f666665725f6b65796c65745f77726f6e675f73697a655f6163636f756e745f69646f666665725f6b6579" - "6c65745f77726f6e675f73697a655f6163636f756e745f69646f7261636c655f6b65796c65745f77726f6e675f7369" - "7a655f6163636f756e745f69647061796368616e5f6b65796c65745f77726f6e675f73697a655f6163636f756e745f" - "6964317061796368616e5f6b65796c65745f77726f6e675f73697a655f6163636f756e745f6964327065726d697373" - "696f6e65645f646f6d61696e5f6b65796c65745f77726f6e675f73697a655f6163636f756e745f69647369676e6572" - "735f6b65796c65745f77726f6e675f73697a655f6163636f756e745f69647469636b65745f6b65796c65745f77726f" - "6e675f73697a655f6163636f756e745f69647661756c745f6b65796c65745f77726f6e675f73697a655f6163636f75" - "6e745f69646765745f6e66745f77726f6e675f73697a655f6163636f756e745f69646d70746f6b656e5f6b65796c65" - "745f6d707469645f77726f6e675f6c656e677468004d0970726f64756365727302086c616e67756167650104527573" - "74000c70726f6365737365642d6279010572757374631d312e38372e30202831373036376539616320323032352d30" - "352d303929002c0f7461726765745f6665617475726573022b0f6d757461626c652d676c6f62616c732b087369676e" - "2d657874"; + "0061736d01000000015a0c60057f7f7f7f7f017f60037f7f7e017f60027f7f017f60037f7f7f017f60047f7f7f7f01" + "7f60017f017f60067f7f7f7f7f7f017f60087f7f7f7f7f7f7f7f017f60077f7f7f7f7f7f7f017f60047f7f7f7f0060" + "00006000017f02840d3b08686f73745f6c6962057472616365000008686f73745f6c69620974726163655f6e756d00" + "0108686f73745f6c69620e6765745f6c65646765725f73716e000208686f73745f6c6962166765745f706172656e74" + "5f6c65646765725f74696d65000208686f73745f6c6962166765745f706172656e745f6c65646765725f6861736800" + "0208686f73745f6c69620c6765745f626173655f666565000208686f73745f6c696211616d656e646d656e745f656e" + "61626c6564000208686f73745f6c69620c6765745f74785f6669656c64000308686f73745f6c69620e6163636f756e" + "745f6b65796c6574000408686f73745f6c69621063616368655f6c65646765725f6f626a000308686f73745f6c6962" + "1c6765745f63757272656e745f6c65646765725f6f626a5f6669656c64000308686f73745f6c6962146765745f6c65" + "646765725f6f626a5f6669656c64000408686f73745f6c6962136765745f74785f6e65737465645f6669656c640004" + "08686f73745f6c6962236765745f63757272656e745f6c65646765725f6f626a5f6e65737465645f6669656c640004" + "08686f73745f6c69621b6765745f6c65646765725f6f626a5f6e65737465645f6669656c64000008686f73745f6c69" + "62106765745f74785f61727261795f6c656e000508686f73745f6c6962206765745f63757272656e745f6c65646765" + "725f6f626a5f61727261795f6c656e000508686f73745f6c6962186765745f6c65646765725f6f626a5f6172726179" + "5f6c656e000208686f73745f6c6962176765745f74785f6e65737465645f61727261795f6c656e000208686f73745f" + "6c6962276765745f63757272656e745f6c65646765725f6f626a5f6e65737465645f61727261795f6c656e00020868" + "6f73745f6c69621f6765745f6c65646765725f6f626a5f6e65737465645f61727261795f6c656e000308686f73745f" + "6c69620b7570646174655f64617461000208686f73745f6c696213636f6d707574655f7368613531325f68616c6600" + "0408686f73745f6c696209636865636b5f736967000608686f73745f6c6962076765745f6e6674000608686f73745f" + "6c69620e6765745f6e66745f697373756572000408686f73745f6c69620d6765745f6e66745f7461786f6e00040868" + "6f73745f6c69620d6765745f6e66745f666c616773000208686f73745f6c6962146765745f6e66745f7472616e7366" + "65725f666565000208686f73745f6c69620e6765745f6e66745f73657269616c000408686f73745f6c69620d747261" + "63655f6163636f756e74000408686f73745f6c69620c74726163655f616d6f756e74000408686f73745f6c69620c63" + "6865636b5f6b65796c6574000608686f73745f6c69620f666c6f61745f66726f6d5f75696e74000008686f73745f6c" + "69620b6c696e655f6b65796c6574000708686f73745f6c69620a616d6d5f6b65796c6574000608686f73745f6c6962" + "1163726564656e7469616c5f6b65796c6574000708686f73745f6c69620e6d70746f6b656e5f6b65796c6574000608" + "686f73745f6c69621274726163655f6f70617175655f666c6f6174000408686f73745f6c69620d666c6f61745f636f" + "6d70617265000408686f73745f6c696209666c6f61745f616464000808686f73745f6c69620e666c6f61745f737562" + "7472616374000808686f73745f6c69620e666c6f61745f6d756c7469706c79000808686f73745f6c69620c666c6f61" + "745f646976696465000808686f73745f6c69620a666c6f61745f726f6f74000608686f73745f6c696209666c6f6174" + "5f706f77000608686f73745f6c69620d657363726f775f6b65796c6574000608686f73745f6c6962136d70745f6973" + "7375616e63655f6b65796c6574000608686f73745f6c6962106e66745f6f666665725f6b65796c6574000608686f73" + "745f6c69620c6f666665725f6b65796c6574000608686f73745f6c69620d6f7261636c655f6b65796c657400060868" + "6f73745f6c69620e7061796368616e5f6b65796c6574000708686f73745f6c69621a7065726d697373696f6e65645f" + "646f6d61696e5f6b65796c6574000608686f73745f6c69620d7469636b65745f6b65796c6574000608686f73745f6c" + "69620c7661756c745f6b65796c6574000608686f73745f6c69620f64656c65676174655f6b65796c6574000608686f" + "73745f6c6962166465706f7369745f707265617574685f6b65796c6574000608686f73745f6c69620a6469645f6b65" + "796c6574000408686f73745f6c69620e7369676e6572735f6b65796c65740004030403090a0b05030100110619037f" + "01418080c0000b7f0041a8a1c0000b7f0041b0a1c0000b072e04066d656d6f727902000666696e697368003d0a5f5f" + "646174615f656e6403010b5f5f686561705f6261736503020aa43f0368000240024020002001460d00200220034101" + "410041001080808080001a2000417f4c0d01418b80c08000410b2000ad1081808080001a10bc80808000000b200220" + "032000ac1081808080001a0f0b418b80c08000410b2000ac1081808080001a10bc80808000000b0300000bb43e0305" + "7f017e017f2380808080004190026b2200248080808000419680c0800041234101410041001080808080001a200041" + "00360260200041e0006a4104108280808000410441bd8cc08000410e10bb8080800020004100360260200041e0006a" + "4104108380808000410441cb8cc08000411610bb80808000200041e0006a41186a22014200370300200041e0006a41" + "106a22024200370300200041e0006a41086a2203420037030020004200370360200041e0006a412010848080800041" + "2041e18cc08000411610bb8080800020004100360260200041e0006a4104108580808000410441f78cc08000410c10" + "bb80808000200041086a41186a428182848890a0c08001370300200041086a41106a428182848890a0c08001370300" + "200041086a41086a428182848890a0c080013703002000428182848890a0c0800137030841b980c08000410e108680" + "808000410141c780c08000411110bb80808000200041086a4120108680808000410141c780c08000411110bb808080" + "000240024041818020200041e0006a411410878080800022044114470d002000412c6a41026a200041e0006a41026a" + "2d00003a0000200020002900673703e8012000200041e0006a410c6a2900003700ed01200020002f00603b012c2000" + "20002903e8013703a801200020002900ed013700ad012000200028006336002f2000412c6a410c6a20002900ad0137" + "0000200020002903a801370033200142003703002002420037030020034200370300200042003703602000412c6a41" + "14200041e0006a412010888080800022014120470d01200041c0006a41026a20002d00623a0000200041e8016a4108" + "6a2201200041e0006a410f6a2900002205370300200041c0006a410f6a2005370000200041c0006a41176a200041e0" + "006a41176a290000370000200041c0006a411f6a200041e0006a411f6a2d00003a0000200020002f01603b01402000" + "200028006336004320002000290067370047200041c0006a41204100108980808000410141d880c08000411010bb80" + "808000200041e0006a41106a22024100360200200041e0006a41086a22034200370300200042003703604181802020" + "0041e0006a4114108a80808000411441838dc08000411c10bb80808000200241003602002003420037030020004200" + "370360410141818020200041e0006a4114108b808080004114419f8dc08000411410bb80808000200041043602a001" + "200041818020360260200041e8016a41106a2202410036020020014200370300200042003703e801200041e0006a41" + "04200041e8016a4114108c80808000411441b38dc08000411310bb8080800020024100360200200142003703002000" + "42003703e801200041e0006a20002802a001200041e8016a4114108d80808000411441c68dc08000412310bb808080" + "002002410036020020014200370300200042003703e8014101200041e0006a20002802a001200041e8016a4114108e" + "80808000411441e98dc08000411b10bb808080004189803c108f80808000412041e880c08000411010bb8080800041" + "89803c109080808000412041f880c08000412010bb8080800041014189803c1091808080004120419881c080004118" + "10bb80808000200041e0006a20002802a001109280808000412041b081c08000411710bb80808000200041e0006a20" + "002802a001109380808000412041c781c08000412710bb808080004101200041e0006a20002802a001109480808000" + "412041ee81c08000411f10bb808080002000412c6a41141095808080004114418d82c08000410b10bb808080002000" + "41e8016a41186a220342003703002002420037030020014200370300200042003703e801200041e0006a20002802a0" + "01200041e8016a4120109680808000412041848ec08000411310bb80808000419882c08000410c41a482c08000410b" + "41af82c08000410e109780808000410141bd82c08000410910bb80808000200041a8016a41186a200041086a41186a" + "290300370300200041a8016a41106a200041086a41106a290300370300200041a8016a41086a200041086a41086a29" + "0300370300200020002903083703a801200241003b010020014200370300200042003703e8012000412c6a41142000" + "41a8016a4120200041e8016a4112109880808000411241978ec08000410710bb808080002002410036020020014200" + "370300200042003703e801200041a8016a4120200041e8016a41141099808080004114419e8ec08000410e10bb8080" + "8000200041003602e801200041a8016a4120200041e8016a4104109a80808000410441ac8ec08000410d10bb808080" + "00200041a8016a4120109b80808000410841c682c08000410d10bb80808000200041a8016a4120109c80808000410a" + "41d382c08000411410bb80808000200041003602e801200041a8016a4120200041e8016a4104109d80808000410441" + "b98ec08000410e10bb8080800041e782c08000410d2000412c6a4114109e80808000410041f482c08000410d10bb80" + "80800041e782c08000410d418183c080004108109f808080004100418983c08000410c10bb8080800041e782c08000" + "410d419583c080004108109f808080004100419d83c08000411110bb80808000417f4104108480808000417141ae83" + "c08000411e10bb80808000200041003602e801200041e8016a417f108480808000417141c78ec08000411e10bb8080" + "8000200041e8016a41026a41003a0000200041003b01e801200041e8016a4103108480808000417d41e58ec0800041" + "2410bb80808000200041003602e801200041e8016a418094ebdc03108480808000417341898fc08000412310bb8080" + "80004102108f80808000416f41cc83c08000411f10bb80808000417f20002802a001109280808000417141eb83c080" + "00411f10bb80808000200041e0006a417f1092808080004171418a84c08000411f10bb80808000200041e0006a4181" + "08109280808000417441a984c08000412010bb80808000200041e0006a418094ebdc036a220620002802a001109280" + "808000417341c984c08000411f10bb80808000200342003703002002420037030020014200370300200042003703e8" + "012000412c6a411420064108200041e8016a412010a080808000417341ac8fc08000411810bb808080002003420037" + "03002002420037030020014200370300200042003703e8012000412c6a41142000412c6a4114200041e8016a412010" + "a080808000417141c48fc08000411a10bb808080002003420037030020024200370300200142003703002000420037" + "03e80120064108200041e8016a4120410010a180808000417341de8fc08000411710bb808080002003420037030020" + "02420037030020014200370300200042003703e801200041e0006a20002802a001200041e8016a4120410010a18080" + "8000417141f58fc08000412010bb80808000200620002802a0014101108980808000417341e884c08000411810bb80" + "808000200041e0006a20002802a00141011089808080004171418085c08000411a10bb808080002003420037030020" + "02420037030020014200370300200042003703e801200620002802a001200041e8016a412010888080800041734195" + "90c08000411610bb80808000200342003703002002420037030020014200370300200042003703e801200041e0006a" + "20002802a001200041e8016a4120108880808000417141ab90c08000411810bb808080002003420037030020024200" + "37030020014200370300200042003703e8012000412c6a41142000412c6a4114200620002802a001200041e8016a41" + "2010a280808000417341c390c08000411c10bb80808000200342003703002002420037030020014200370300200042" + "003703e8012000412c6a41142000412c6a4114200041e0006a20002802a001200041e8016a412010a2808080004171" + "41df90c08000411e10bb80808000200342003703002002420037030020014200370300200042003703e8014194a1c0" + "80004114200620002802a001200041e8016a412010a380808000417341fd90c08000411910bb808080002003420037" + "03002002420037030020014200370300200042003703e8014194a1c080004114200041e0006a20002802a001200041" + "e8016a412010a3808080004171419691c08000411f10bb808080002003420037030020024200370300200142003703" + "00200042003703e8014194a1c080004114419a85c080004114200041e8016a412010a380808000417141b591c08000" + "412910bb80808000200342003703002002420037030020014200370300200042003703e80141ae85c0800041284194" + "a1c080004114200041e8016a412010a380808000417141de91c08000412510bb80808000200041c8016a41146a2000" + "412c6a41106a280100360200200041c8016a410c6a2000412c6a41086a2901003702002000200029012c3702cc0120" + "0041808080083602c801200041003b01e801200041c8016a41184194a1c080004114200041e8016a410210a3808080" + "004171418392c08000410e10bb80808000200620002802a001422a108180808000417341d685c08000411110bb8080" + "8000200041003b01e8014102200041e8016a4102108780808000416f419192c08000411b10bb80808000200041003b" + "01e8014102200041e8016a4102108a80808000416f41ac92c08000412b10bb80808000200041003b01e80141014102" + "200041e8016a4102108b80808000416f41d792c08000412310bb808080004102108f80808000416f41cc83c0800041" + "1f10bb808080004102109080808000416f41e785c08000412f10bb8080800041014102109180808000416f419686c0" + "8000412710bb8080800041b980c08000418108108680808000417441bd86c08000411f10bb8080800041b980c08000" + "41c100108680808000417441dc86c08000411a10bb80808000200041003b01e801200041e0006a418108200041e801" + "6a4102108c80808000417441fa92c08000412110bb80808000200041003b01e801200041e0006a418108200041e801" + "6a4102108d808080004174419b93c08000413110bb80808000200041003b01e8014101200041e0006a418108200041" + "e8016a4102108e80808000417441cc93c08000412910bb80808000200041e0006a418108109280808000417441f686" + "c08000412510bb80808000200041e0006a4181081093808080004174419b87c08000413510bb808080004101200041" + "e0006a418108109480808000417441d087c08000412d10bb80808000200041e0006a418120109580808000417441fd" + "87c08000411910bb8080800041e782c0800041810841a482c08000410b41af82c08000410e109780808000417441bd" + "82c08000410910bb8080800041e782c08000410d41a482c0800041810841af82c08000410e109780808000417441bd" + "82c08000410910bb8080800041e782c08000410d41a482c08000410b41af82c08000418108109780808000417441bd" + "82c08000410910bb80808000200041003b01e801200041e0006a418108200041e8016a4102109680808000417441f5" + "93c08000412110bb80808000200041003b01e8014194a1c080004181084194a1c080004114200041e8016a410210a3" + "808080004174419694c08000411810bb80808000200041003b01e8012000412c6a41142000412c6a4114200041e000" + "6a418108200041e8016a410210a480808000417441ae94c08000411f10bb80808000200041003b01e801200041c801" + "6a4181082000412c6a4114200041e8016a410210a580808000417441cd94c08000412210bb8080800041e782c08000" + "410d200620002802a00141001080808080004173419688c08000410f10bb80808000200042d487b6f4c7d4b1c00037" + "00e00141e782c08000410d200041e0016a418094ebdc036a2204410810a680808000417341a588c08000411c10bb80" + "80800041e782c08000410d200620002802a001109f80808000417341c188c08000411610bb80808000200441082000" + "41e0016a410810a780808000417341d788c08000411810bb80808000200041e0016a41082004410810a78080800041" + "7341ef88c08000411810bb80808000200041003b01e80120044108200041e0016a4108200041e8016a4102410010a8" + "80808000417341ef94c08000411410bb80808000200041003b01e801200041e0016a410820044108200041e8016a41" + "02410010a8808080004173418395c08000411410bb80808000200041003b01e80120044108200041e0016a41082000" + "41e8016a4102410010a9808080004173419795c08000411910bb80808000200041003b01e801200041e0016a410820" + "044108200041e8016a4102410010a980808000417341b095c08000411910bb80808000200041003b01e80120044108" + "200041e0016a4108200041e8016a4102410010aa80808000417341c995c08000411910bb80808000200041003b01e8" + "01200041e0016a410820044108200041e8016a4102410010aa80808000417341e295c08000411910bb808080002000" + "41003b01e80120044108200041e0016a4108200041e8016a4102410010ab80808000417341fb95c08000411710bb80" + "808000200041003b01e801200041e0016a410820044108200041e8016a4102410010ab808080004173419296c08000" + "411710bb80808000200041003b01e801200441084103200041e8016a4102410010ac80808000417341a996c0800041" + "1410bb80808000200041003b01e801200441084103200041e8016a4102410010ad80808000417341bd96c080004113" + "10bb80808000200342003703002002420037030020014200370300200042003703e8012000412c6a41142000412c6a" + "4114200041e8016a412010ae80808000417141d096c08000411f10bb80808000200342003703002002420037030020" + "014200370300200042003703e8012000412c6a41142000412c6a4114200041e8016a412010af80808000417141ef96" + "c08000412510bb80808000200342003703002002420037030020014200370300200042003703e8012000412c6a4114" + "2000412c6a4114200041e8016a412010b0808080004171419497c08000412210bb8080800020034200370300200242" + "0037030020014200370300200042003703e8012000412c6a41142000412c6a4114200041e8016a412010b180808000" + "417141b697c08000411e10bb80808000200342003703002002420037030020014200370300200042003703e8012000" + "412c6a41142000412c6a4114200041e8016a412010b280808000417141d497c08000411f10bb808080002003420037" + "03002002420037030020014200370300200042003703e8012000412c6a41142000412c6a41142000412c6a41142000" + "41e8016a412010b380808000417141f397c08000412010bb8080800020034200370300200242003703002001420037" + "0300200042003703e8012000412c6a41142000412c6a4114200041e8016a412010b4808080004171419398c0800041" + "2c10bb80808000200342003703002002420037030020014200370300200042003703e8012000412c6a41142000412c" + "6a4114200041e8016a412010b580808000417141bf98c08000411f10bb808080002003420037030020024200370300" + "20014200370300200042003703e8012000412c6a41142000412c6a4114200041e8016a412010b680808000417141de" + "98c08000411e10bb80808000200041e0006a20002802a00141001089808080004171418789c08000412310bb808080" + "00200041003b01e8012000412c6a4114200041e0006a20002802a001200041e8016a4102109880808000417141fc98" + "c08000411a10bb80808000200041003b01e801200041e0006a20002802a001200041e8016a41021099808080004171" + "419699c08000412110bb80808000200041003b01e801200041e0006a20002802a001200041e8016a4102109a808080" + "00417141b799c08000412010bb80808000200041e0006a20002802a001109b80808000417141aa89c08000412010bb" + "80808000200041e0006a20002802a001109c80808000417141ca89c08000412710bb80808000200041003602e80120" + "0041e0006a20002802a001200041e8016a4104109d80808000417141d799c08000412110bb80808000200041003b01" + "e801200041e0006a20002802a001200041e8016a4102108880808000417141f899c08000412410bb80808000200041" + "808080083602e801200041003b018e02200041e0006a20002802a001200041e8016a41042000418e026a410210a080" + "8080004171419c9ac08000412210bb80808000200041003b018e02200041e0006a20002802a00122012000412c6a41" + "14200041e0006a20012000418e026a410210a480808000417141be9ac08000412810bb80808000200041003b018e02" + "2000412c6a4114200041e0006a20002802a0012201200041e0006a20012000418e026a410210a480808000417141e6" + "9ac08000412810bb80808000200041003b018e02200041e0006a20002802a0012000412c6a41142000418e026a4102" + "10b7808080004171418e9bc08000412610bb80808000200041003b018e022000412c6a4114200041e0006a20002802" + "a0012000418e026a410210b780808000417141b49bc08000412610bb80808000200041003b018e02200041e0006a20" + "002802a0012000412c6a41142000418e026a410210b880808000417141da9bc08000412d10bb80808000200041003b" + "018e022000412c6a4114200041e0006a20002802a0012000418e026a410210b880808000417141879cc08000412d10" + "bb80808000200041003b018e02200041e0006a20002802a0012000418e026a410210b980808000417141b49cc08000" + "412010bb80808000200041003b018e02200041e0006a20002802a001200041e8016a41042000418e026a410210ae80" + "808000417141d49cc08000412310bb80808000200041003b018e02200041e0006a20002802a0012000412c6a411441" + "9a85c0800041142000418e026a410210a280808000417141f79cc08000412210bb80808000200041003b018e022000" + "412c6a4114200041e0006a20002802a001419a85c0800041142000418e026a410210a280808000417141999dc08000" + "412210bb80808000200041003b018e02200041e0006a20002802a001200041e8016a41042000418e026a410210af80" + "808000417141bb9dc08000412910bb80808000200041003b018e02200041c8016a4118200041e0006a20002802a001" + "2000418e026a410210a580808000417141e49dc08000412410bb80808000200041003b018e02200041e0006a200028" + "02a001200041e8016a41042000418e026a410210b080808000417141889ec08000412610bb80808000200041003b01" + "8e02200041e0006a20002802a001200041e8016a41042000418e026a410210b180808000417141ae9ec08000412210" + "bb80808000200041003b018e02200041e0006a20002802a001200041e8016a41042000418e026a410210b280808000" + "417141d09ec08000412310bb80808000200041003b018e02200041e0006a20002802a0012000412c6a4114200041e8" + "016a41042000418e026a410210b380808000417141f39ec08000412510bb80808000200041003b018e022000412c6a" + "4114200041e0006a20002802a001200041e8016a41042000418e026a410210b380808000417141989fc08000412510" + "bb80808000200041003b018e02200041e0006a20002802a001200041e8016a41042000418e026a410210b480808000" + "417141bd9fc08000413010bb80808000200041003b018e02200041e0006a20002802a0012000418e026a410210ba80" + "808000417141ed9fc08000412410bb80808000200041003b018e02200041e0006a20002802a001200041e8016a4104" + "2000418e026a410210b58080800041714191a0c08000412310bb80808000200041003b018e02200041e0006a200028" + "02a001200041e8016a41042000418e026a410210b680808000417141b4a0c08000412210bb80808000200041003b01" + "8e02200041e0006a20002802a00141f189c0800041202000418e026a4102109880808000417141d6a0c08000411d10" + "bb8080800041e782c08000410d200041e0006a20002802a001109e80808000417141918ac08000412310bb80808000" + "41e796abdd03410d41f189c0800041204100108080808000417341b48ac08000411010bb8080800041e796abdd0341" + "0d200041e0016a410810a680808000417341c48ac08000411d10bb8080800041e796abdd03410d2000412c6a411410" + "9e80808000417341e18ac08000411810bb8080800041e796abdd03410d419583c080004108109f80808000417341f9" + "8ac08000411710bb80808000200041e0006a20002802a001200041e0006a4181084100108080808000417441908bc0" + "8000410e10bb80808000200041e0006a41810842011081808080004174419e8bc08000411210bb8080800041e782c0" + "8000418108200041e0016a410810a680808000417441b08bc08000411b10bb8080800041e782c08000418108200041" + "2c6a4114109e80808000417441cb8bc08000411610bb8080800041e782c08000418108419583c080004108109f8080" + "8000417441e18bc08000411510bb8080800041e782c08000410d200041e0006a20002802a001109f80808000417141" + "f68bc08000411910bb80808000200041003b018e02200041e0006a20002802a0012000412c6a41142000418e026a41" + "0210a580808000417141f3a0c08000412110bb8080800041e782c08000410d200041e0006a20002802a00141021080" + "808080004171418f8cc08000411410bb80808000410141002000412c6a4114109e80808000410041a38cc08000411a" + "10bb8080800020004190026a24808080800041010f0b418080c08000410b2004417f2004417f481bac108180808000" + "1a10bc80808000000b418080c08000410b2001417f2001417f481bac1081808080001a10bc80808000000b0bb22101" + "00418080c0000ba8216572726f725f636f64653d54455354204641494c45442424242424205354415254494e472057" + "41534d20455845435554494f4e202424242424746573745f616d656e646d656e74616d656e646d656e745f656e6162" + "6c656463616368655f6c65646765725f6f626a6765745f74785f61727261795f6c656e6765745f63757272656e745f" + "6c65646765725f6f626a5f61727261795f6c656e6765745f6c65646765725f6f626a5f61727261795f6c656e676574" + "5f74785f6e65737465645f61727261795f6c656e6765745f63757272656e745f6c65646765725f6f626a5f6e657374" + "65645f61727261795f6c656e6765745f6c65646765725f6f626a5f6e65737465645f61727261795f6c656e75706461" + "74655f6461746174657374206d65737361676574657374207075626b657974657374207369676e6174757265636865" + "636b5f7369676765745f6e66745f666c6167736765745f6e66745f7472616e736665725f66656574657374696e6720" + "747261636574726163655f6163636f756e74400000000000005f74726163655f616d6f756e74400000000000000074" + "726163655f616d6f756e745f7a65726f6765745f706172656e745f6c65646765725f686173685f6e65675f70747267" + "65745f74785f61727261795f6c656e5f696e76616c69645f736669656c646765745f74785f6e65737465645f617272" + "61795f6c656e5f6e65675f7074726765745f74785f6e65737465645f61727261795f6c656e5f6e65675f6c656e6765" + "745f74785f6e65737465645f61727261795f6c656e5f746f6f5f6c6f6e676765745f74785f6e65737465645f617272" + "61795f6c656e5f7074725f6f6f6263616368655f6c65646765725f6f626a5f7074725f6f6f6263616368655f6c6564" + "6765725f6f626a5f77726f6e675f6c656e555344303030303030303030303030303030303000000000000000000000" + "00000000000000000000000000000000000000000000000000000000000074726163655f6e756d5f6f6f625f737472" + "6765745f63757272656e745f6c65646765725f6f626a5f61727261795f6c656e5f696e76616c69645f736669656c64" + "6765745f6c65646765725f6f626a5f61727261795f6c656e5f696e76616c69645f736669656c64616d656e646d656e" + "745f656e61626c65645f746f6f5f6269675f736c696365616d656e646d656e745f656e61626c65645f746f6f5f6c6f" + "6e676765745f74785f6e65737465645f61727261795f6c656e5f746f6f5f6269675f736c6963656765745f63757272" + "656e745f6c65646765725f6f626a5f6e65737465645f61727261795f6c656e5f746f6f5f6269675f736c6963656765" + "745f6c65646765725f6f626a5f6e65737465645f61727261795f6c656e5f746f6f5f6269675f736c69636575706461" + "74655f646174615f746f6f5f6269675f736c69636574726163655f6f6f625f736c69636574726163655f6f70617175" + "655f666c6f61745f6f6f625f736c69636574726163655f616d6f756e745f6f6f625f736c696365666c6f61745f636f" + "6d706172655f6f6f625f736c69636531666c6f61745f636f6d706172655f6f6f625f736c6963653263616368655f6c" + "65646765725f6f626a5f77726f6e675f73697a655f75696e743235366765745f6e66745f666c6167735f77726f6e67" + "5f73697a655f75696e743235366765745f6e66745f7472616e736665725f6665655f77726f6e675f73697a655f7569" + "6e74323536303030303030303030303030303030303030303030303030303030303030303174726163655f6163636f" + "756e745f77726f6e675f73697a655f6163636f756e745f696474726163655f6f6f625f737472696e6774726163655f" + "6f70617175655f666c6f61745f6f6f625f737472696e6774726163655f6163636f756e745f6f6f625f737472696e67" + "74726163655f616d6f756e745f6f6f625f737472696e6774726163655f746f6f5f6c6f6e6774726163655f6e756d5f" + "746f6f5f6c6f6e6774726163655f6f70617175655f666c6f61745f746f6f5f6c6f6e6774726163655f6163636f756e" + "745f746f6f5f6c6f6e6774726163655f616d6f756e745f746f6f5f6c6f6e6774726163655f616d6f756e745f77726f" + "6e675f6c656e67746874726163655f696e76616c69645f61735f68657874726163655f6163636f756e745f63686563" + "6b5f646573796e636765745f6c65646765725f73716e6765745f706172656e745f6c65646765725f74696d65676574" + "5f706172656e745f6c65646765725f686173686765745f626173655f6665656765745f63757272656e745f6c656467" + "65725f6f626a5f6669656c646765745f6c65646765725f6f626a5f6669656c646765745f74785f6e65737465645f66" + "69656c646765745f63757272656e745f6c65646765725f6f626a5f6e65737465645f6669656c646765745f6c656467" + "65725f6f626a5f6e65737465645f6669656c64636f6d707574655f7368613531325f68616c666765745f6e66746765" + "745f6e66745f6973737565726765745f6e66745f7461786f6e6765745f6e66745f73657269616c6765745f70617265" + "6e745f6c65646765725f686173685f6e65675f6c656e6765745f706172656e745f6c65646765725f686173685f6275" + "665f746f6f5f736d616c6c6765745f706172656e745f6c65646765725f686173685f6c656e5f746f6f5f6c6f6e6763" + "6865636b5f6b65796c65745f6f6f625f6c656e5f753332636865636b5f6b65796c65745f77726f6e675f6c656e5f75" + "3332666c6f61745f66726f6d5f75696e745f6c656e5f6f6f62666c6f61745f66726f6d5f75696e745f77726f6e675f" + "6c656e5f75696e7436346163636f756e745f6b65796c65745f6c656e5f6f6f626163636f756e745f6b65796c65745f" + "77726f6e675f6c656e6c696e655f6b65796c65745f6c656e5f6f6f625f63757272656e63796c696e655f6b65796c65" + "745f77726f6e675f6c656e5f63757272656e6379616d6d5f6b65796c65745f6c656e5f6f6f625f617373657432616d" + "6d5f6b65796c65745f6c656e5f77726f6e675f6c656e5f617373657432616d6d5f6b65796c65745f6c656e5f77726f" + "6e675f6e6f6e5f7872705f63757272656e63795f6c656e616d6d5f6b65796c65745f6c656e5f77726f6e675f787270" + "5f63757272656e63795f6c656e616d6d5f6b65796c65745f6d70746765745f74785f6669656c645f696e76616c6964" + "5f736669656c646765745f63757272656e745f6c65646765725f6f626a5f6669656c645f696e76616c69645f736669" + "656c646765745f6c65646765725f6f626a5f6669656c645f696e76616c69645f736669656c646765745f74785f6e65" + "737465645f6669656c645f746f6f5f6269675f736c6963656765745f63757272656e745f6c65646765725f6f626a5f" + "6e65737465645f6669656c645f746f6f5f6269675f736c6963656765745f6c65646765725f6f626a5f6e6573746564" + "5f6669656c645f746f6f5f6269675f736c696365636f6d707574655f7368613531325f68616c665f746f6f5f626967" + "5f736c696365616d6d5f6b65796c65745f746f6f5f6269675f736c69636563726564656e7469616c5f6b65796c6574" + "5f746f6f5f6269675f736c6963656d70746f6b656e5f6b65796c65745f746f6f5f6269675f736c6963655f6d707469" + "64666c6f61745f6164645f6f6f625f736c69636531666c6f61745f6164645f6f6f625f736c69636532666c6f61745f" + "73756274726163745f6f6f625f736c69636531666c6f61745f73756274726163745f6f6f625f736c69636532666c6f" + "61745f6d756c7469706c795f6f6f625f736c69636531666c6f61745f6d756c7469706c795f6f6f625f736c69636532" + "666c6f61745f6469766964655f6f6f625f736c69636531666c6f61745f6469766964655f6f6f625f736c6963653266" + "6c6f61745f726f6f745f6f6f625f736c696365666c6f61745f706f775f6f6f625f736c696365657363726f775f6b65" + "796c65745f77726f6e675f73697a655f75696e7433326d70745f69737375616e63655f6b65796c65745f77726f6e67" + "5f73697a655f75696e7433326e66745f6f666665725f6b65796c65745f77726f6e675f73697a655f75696e7433326f" + "666665725f6b65796c65745f77726f6e675f73697a655f75696e7433326f7261636c655f6b65796c65745f77726f6e" + "675f73697a655f75696e7433327061796368616e5f6b65796c65745f77726f6e675f73697a655f75696e7433327065" + "726d697373696f6e65645f646f6d61696e5f6b65796c65745f77726f6e675f73697a655f75696e7433327469636b65" + "745f6b65796c65745f77726f6e675f73697a655f75696e7433327661756c745f6b65796c65745f77726f6e675f7369" + "7a655f75696e7433326765745f6e66745f77726f6e675f73697a655f75696e743235366765745f6e66745f69737375" + "65725f77726f6e675f73697a655f75696e743235366765745f6e66745f7461786f6e5f77726f6e675f73697a655f75" + "696e743235366765745f6e66745f73657269616c5f77726f6e675f73697a655f75696e743235366163636f756e745f" + "6b65796c65745f77726f6e675f73697a655f6163636f756e745f6964636865636b5f6b65796c65745f77726f6e675f" + "73697a655f6163636f756e745f696463726564656e7469616c5f6b65796c65745f77726f6e675f73697a655f616363" + "6f756e745f69643163726564656e7469616c5f6b65796c65745f77726f6e675f73697a655f6163636f756e745f6964" + "3264656c65676174655f6b65796c65745f77726f6e675f73697a655f6163636f756e745f69643164656c6567617465" + "5f6b65796c65745f77726f6e675f73697a655f6163636f756e745f6964326465706f7369745f707265617574685f6b" + "65796c65745f77726f6e675f73697a655f6163636f756e745f6964316465706f7369745f707265617574685f6b6579" + "6c65745f77726f6e675f73697a655f6163636f756e745f6964326469645f6b65796c65745f77726f6e675f73697a65" + "5f6163636f756e745f6964657363726f775f6b65796c65745f77726f6e675f73697a655f6163636f756e745f69646c" + "696e655f6b65796c65745f77726f6e675f73697a655f6163636f756e745f6964316c696e655f6b65796c65745f7772" + "6f6e675f73697a655f6163636f756e745f6964326d70745f69737375616e63655f6b65796c65745f77726f6e675f73" + "697a655f6163636f756e745f69646d70746f6b656e5f6b65796c65745f77726f6e675f73697a655f6163636f756e74" + "5f69646e66745f6f666665725f6b65796c65745f77726f6e675f73697a655f6163636f756e745f69646f666665725f" + "6b65796c65745f77726f6e675f73697a655f6163636f756e745f69646f7261636c655f6b65796c65745f77726f6e67" + "5f73697a655f6163636f756e745f69647061796368616e5f6b65796c65745f77726f6e675f73697a655f6163636f75" + "6e745f6964317061796368616e5f6b65796c65745f77726f6e675f73697a655f6163636f756e745f6964327065726d" + "697373696f6e65645f646f6d61696e5f6b65796c65745f77726f6e675f73697a655f6163636f756e745f6964736967" + "6e6572735f6b65796c65745f77726f6e675f73697a655f6163636f756e745f69647469636b65745f6b65796c65745f" + "77726f6e675f73697a655f6163636f756e745f69647661756c745f6b65796c65745f77726f6e675f73697a655f6163" + "636f756e745f69646765745f6e66745f77726f6e675f73697a655f6163636f756e745f69646d70746f6b656e5f6b65" + "796c65745f6d707469645f77726f6e675f6c656e677468000000000000000000000000000000000000000000ea2a04" + "6e616d65001312636f6465636f765f74657374732e7761736d01ad2a3e004c5f5a4e31367872706c5f7761736d5f73" + "74646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e7335747261636531376834623431" + "6663626133633836323862394501505f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f7374" + "5f646566696e65645f66756e6374696f6e733974726163655f6e756d31376836346562613963306665666435626361" + "4502565f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e" + "6374696f6e7331346765745f6c65646765725f73716e3137686633313635393261626131346636336345035e5f5a4e" + "31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e73" + "32326765745f706172656e745f6c65646765725f74696d653137686662373635613064613335336631323445045e5f" + "5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f" + "6e7332326765745f706172656e745f6c65646765725f68617368313768656335313634326538353530626434354505" + "545f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374" + "696f6e7331326765745f626173655f666565313768386466356664653831663063326161614506595f5a4e31367872" + "706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e733137616d" + "656e646d656e745f656e61626c6564313768363461346434383031333165333235354507545f5a4e31367872706c5f" + "7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e7331326765745f74" + "785f6669656c64313768373037373835623434663266363639304508565f5a4e31367872706c5f7761736d5f737464" + "6c696234686f73743232686f73745f646566696e65645f66756e6374696f6e7331346163636f756e745f6b65796c65" + "74313768616538373566373066646637336635354509585f5a4e31367872706c5f7761736d5f7374646c696234686f" + "73743232686f73745f646566696e65645f66756e6374696f6e73313663616368655f6c65646765725f6f626a313768" + "65313634313265303433666362643861450a645f5a4e31367872706c5f7761736d5f7374646c696234686f73743232" + "686f73745f646566696e65645f66756e6374696f6e7332386765745f63757272656e745f6c65646765725f6f626a5f" + "6669656c6431376833636338656464626163373139323234450b5c5f5a4e31367872706c5f7761736d5f7374646c69" + "6234686f73743232686f73745f646566696e65645f66756e6374696f6e7332306765745f6c65646765725f6f626a5f" + "6669656c6431376830626137333839346464356334633338450c5b5f5a4e31367872706c5f7761736d5f7374646c69" + "6234686f73743232686f73745f646566696e65645f66756e6374696f6e7331396765745f74785f6e65737465645f66" + "69656c6431376864353730336462646161303438633238450d6b5f5a4e31367872706c5f7761736d5f7374646c6962" + "34686f73743232686f73745f646566696e65645f66756e6374696f6e7333356765745f63757272656e745f6c656467" + "65725f6f626a5f6e65737465645f6669656c6431376864336565353939316537306235386130450e635f5a4e313678" + "72706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e73323767" + "65745f6c65646765725f6f626a5f6e65737465645f6669656c6431376837363831323438326638333433326235450f" + "585f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374" + "696f6e7331366765745f74785f61727261795f6c656e313768663061333731366132373864633663614510685f5a4e" + "31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e73" + "33326765745f63757272656e745f6c65646765725f6f626a5f61727261795f6c656e31376863396662303730623337" + "6461323866314511605f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e" + "65645f66756e6374696f6e7332346765745f6c65646765725f6f626a5f61727261795f6c656e313768383061616437" + "6664343136616664636545125f5f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f64" + "6566696e65645f66756e6374696f6e7332336765745f74785f6e65737465645f61727261795f6c656e313768353234" + "6130613261303566656465376545136f5f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73" + "745f646566696e65645f66756e6374696f6e7333396765745f63757272656e745f6c65646765725f6f626a5f6e6573" + "7465645f61727261795f6c656e313768353139623331663261303939353035644514675f5a4e31367872706c5f7761" + "736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e7333316765745f6c6564" + "6765725f6f626a5f6e65737465645f61727261795f6c656e313768316633646533393861653331306533394515535f" + "5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f" + "6e7331317570646174655f646174613137683662383232316465393861626630393745165b5f5a4e31367872706c5f" + "7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e733139636f6d7075" + "74655f7368613531325f68616c66313768303565356531613863653833646338364517505f5a4e31367872706c5f77" + "61736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e7339636865636b5f73" + "69673137686532323034393665326136363839373945184e5f5a4e31367872706c5f7761736d5f7374646c69623468" + "6f73743232686f73745f646566696e65645f66756e6374696f6e73376765745f6e6674313768643131643234633637" + "393530306236354519565f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f64656669" + "6e65645f66756e6374696f6e7331346765745f6e66745f697373756572313768316137353534643533316537636564" + "65451a555f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f6675" + "6e6374696f6e7331336765745f6e66745f7461786f6e31376830636664373337653333393261616434451b555f5a4e" + "31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e73" + "31336765745f6e66745f666c61677331376863336437633739326262303834353636451c5c5f5a4e31367872706c5f" + "7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e7332306765745f6e" + "66745f7472616e736665725f66656531376834343230383233633838623738666630451d565f5a4e31367872706c5f" + "7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e7331346765745f6e" + "66745f73657269616c31376834326337303332393835666339343130451e555f5a4e31367872706c5f7761736d5f73" + "74646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e73313374726163655f6163636f75" + "6e7431376831393931636463666337663234366131451f545f5a4e31367872706c5f7761736d5f7374646c69623468" + "6f73743232686f73745f646566696e65645f66756e6374696f6e73313274726163655f616d6f756e74313768313231" + "643430646438643439623064344520545f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73" + "745f646566696e65645f66756e6374696f6e733132636865636b5f6b65796c65743137686135376564303837636165" + "39393136384521575f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65" + "645f66756e6374696f6e733135666c6f61745f66726f6d5f75696e7431376866363961343162303366323839346262" + "4522485f5a4e3133636f6465636f765f74657374733139686f73745f62696e64696e67735f6c6f6f736531316c696e" + "655f6b65796c6574313768336166313834353162626362653062384523525f5a4e31367872706c5f7761736d5f7374" + "646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e733130616d6d5f6b65796c65743137" + "68353565333961626264346262323336324524595f5a4e31367872706c5f7761736d5f7374646c696234686f737432" + "32686f73745f646566696e65645f66756e6374696f6e73313763726564656e7469616c5f6b65796c65743137686365" + "61323561633261373035393863664525565f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f" + "73745f646566696e65645f66756e6374696f6e7331346d70746f6b656e5f6b65796c65743137686231363964636462" + "623234623033663445265a5f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566" + "696e65645f66756e6374696f6e73313874726163655f6f70617175655f666c6f617431376839313533356463633336" + "3764323938334527555f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e" + "65645f66756e6374696f6e733133666c6f61745f636f6d706172653137683134653662643136643762313235373745" + "28505f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e63" + "74696f6e7339666c6f61745f616464313768316162653839663139373139373431644529565f5a4e31367872706c5f" + "7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e733134666c6f6174" + "5f737562747261637431376830316661353561663438653963663837452a565f5a4e31367872706c5f7761736d5f73" + "74646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e733134666c6f61745f6d756c7469" + "706c7931376836633665366239643935636234643561452b545f5a4e31367872706c5f7761736d5f7374646c696234" + "686f73743232686f73745f646566696e65645f66756e6374696f6e733132666c6f61745f6469766964653137686132" + "3932613963396261323535623238452c525f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f" + "73745f646566696e65645f66756e6374696f6e733130666c6f61745f726f6f74313768393330313037316165376337" + "33393261452d505f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e6564" + "5f66756e6374696f6e7339666c6f61745f706f7731376830326133343235636131653666656531452e555f5a4e3136" + "7872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e733133" + "657363726f775f6b65796c657431376830326161316365326263346330373539452f5b5f5a4e31367872706c5f7761" + "736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e7331396d70745f697373" + "75616e63655f6b65796c6574313768666539386161613762313632343765314530585f5a4e31367872706c5f776173" + "6d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e7331366e66745f6f666665" + "725f6b65796c6574313768353930313839656564373166613435364531545f5a4e31367872706c5f7761736d5f7374" + "646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e7331326f666665725f6b65796c6574" + "313768353830376537393161346361613163634532555f5a4e31367872706c5f7761736d5f7374646c696234686f73" + "743232686f73745f646566696e65645f66756e6374696f6e7331336f7261636c655f6b65796c657431376866343831" + "3166343862643266326530344533565f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f7374" + "5f646566696e65645f66756e6374696f6e7331347061796368616e5f6b65796c657431376837386265393931643265" + "3436613339634534625f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e" + "65645f66756e6374696f6e7332367065726d697373696f6e65645f646f6d61696e5f6b65796c657431376837663334" + "3362646335656663326630624535555f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f7374" + "5f646566696e65645f66756e6374696f6e7331337469636b65745f6b65796c65743137686435666532636466326537" + "33393962374536545f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65" + "645f66756e6374696f6e7331327661756c745f6b65796c657431376830386639346132656161383335373835453757" + "5f5a4e31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e637469" + "6f6e73313564656c65676174655f6b65796c65743137686162396339646561393364663265636245385e5f5a4e3136" + "7872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e733232" + "6465706f7369745f707265617574685f6b65796c6574313768313962303532623237653238313139384539525f5a4e" + "31367872706c5f7761736d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e73" + "31306469645f6b65796c657431376838323331376636646338353661383533453a565f5a4e31367872706c5f776173" + "6d5f7374646c696234686f73743232686f73745f646566696e65645f66756e6374696f6e7331347369676e6572735f" + "6b65796c657431376833626636666236363561643432333563453b345f5a4e3133636f6465636f765f746573747331" + "32636865636b5f726573756c7431376830613536316462313034376266626561453c305f5a4e34636f72653970616e" + "69636b696e673970616e69635f666d7431376864333035326133363632643530633935453d0666696e697368071201" + "000f5f5f737461636b5f706f696e746572090a0100072e726f64617461004d0970726f64756365727302086c616e67" + "75616765010452757374000c70726f6365737365642d6279010572757374631d312e38392e30202832393438333838" + "336520323032352d30382d3034290094010f7461726765745f6665617475726573082b0b62756c6b2d6d656d6f7279" + "2b0f62756c6b2d6d656d6f72792d6f70742b1663616c6c2d696e6469726563742d6f7665726c6f6e672b0a6d756c74" + "6976616c75652b0f6d757461626c652d676c6f62616c732b136e6f6e7472617070696e672d6670746f696e742b0f72" + "65666572656e63652d74797065732b087369676e2d657874"; extern std::string const floatTestsWasmHex = - "0061736d01000000014f0a60057f7f7f7f7f017f60077f7f7f7f7f7f7f017f60047f7f7f7f017f60067f7f7f7f7f7f" - "017f60047e7f7f7f017f60057f7e7f7f7f017f60037f7f7e017f60037f7f7f006000017f60027f7f017f02ba031308" - "686f73745f6c6962057472616365000008686f73745f6c69620e666c6f61745f66726f6d5f696e74000408686f7374" - "5f6c69620f666c6f61745f66726f6d5f75696e74000008686f73745f6c696209666c6f61745f736574000508686f73" - "745f6c69620d666c6f61745f636f6d70617265000208686f73745f6c696209666c6f61745f616464000108686f7374" - "5f6c69620e666c6f61745f7375627472616374000108686f73745f6c69620e666c6f61745f6d756c7469706c790001" - "08686f73745f6c69620c666c6f61745f646976696465000108686f73745f6c696209666c6f61745f706f7700030868" - "6f73745f6c69620974726163655f6e756d000608686f73745f6c69620a666c6f61745f726f6f74000308686f73745f" - "6c696209666c6f61745f6c6f67000003656e760c666c6f61745f746f5f696e74000003656e761e666c6f61745f746f" - "5f6d616e74697373615f616e645f6578706f6e656e74000303656e760c666c6f61745f6e6567617465000203656e76" - "09666c6f61745f616273000203656e7613666c6f61745f66726f6d5f7374616d6f756e74000003656e7613666c6f61" - "745f66726f6d5f73746e756d626572000003040307080905030100110619037f01418080c0000b7f0041a0a1c0000b" - "7f0041a0a1c0000b072e04066d656d6f727902000666696e69736800140a5f5f646174615f656e6403010b5f5f6865" - "61705f6261736503020ae52c031f002000200141014100410010001a418080c00041022002410c410110001a0bff2b" - "020f7f017e23004180016b22002400418280c000411d41014100410010001a200041f8006a41003602002000420037" - "03700240428ce000200041f0006a2202410c410010012201410c460440419f80c00041172002101341b680c000411e" - "2002410c410110001a0c010b41d480c000411e41014100410010001a0b2000428ce0003703600240200041e0006a41" - "08200041f0006a2202410c41001002410c4604402001410c46210841f280c0004117200210130c010b418981c00041" - "1e41014100410010001a0b0240410242fb00200041f0006a2201410c41001003410c46044041a781c0004121200110" - "130c010b41c881c000412641014100410010001a410021080b41ee81c0004115418382c0001013418f82c000411641" - "a582c000101341b182c000411b41014100410010001a200041f8006a41003602002000420037037002404201200041" - "f0006a2202410c410010012201410c46044041cc82c000410f200210130c010b41db82c00041164101410041001000" - "1a0b027f200041f0006a410c418382c000410c100445044041f182c000411b41014100410010001a2001410c460c01" - "0b418c83c000412341014100410010001a41000b21090240200041f0006a410c41a582c000410c1004410146044041" - "af83c000412341014100410010001a0c010b4100210941d283c000412c41014100410010001a0b024041a582c00041" - "0c200041f0006a410c1004410246044041fe83c000412341014100410010001a0c010b4100210941a184c000412c41" - "014100410010001a0b41cd84c000412041014100410010001a200041e8006a418b82c0002800003602002000418382" - "c000290000370360410921040340200041e0006a2201410c418382c000410c2001410c410010051a200441016b2204" - "0d000b200041f8006a410036020020004200370370420a200041f0006a410c41001001410c46220a45044041ed84c0" - "00411741014100410010001a0b0240200041f0006a410c200041e0006a410c1004450440418485c000411441014100" - "410010001a0c010b4100210a419885c000411641014100410010001a0b410b21040340200041e0006a2201410c4183" - "82c000410c2001410c410010061a200441016b22040d000b02402001410c41a582c000410c100445044041ae85c000" - "411941014100410010001a0c010b4100210a41c785c000411b41014100410010001a0b41e285c00041234101410041" - "0010001a200041c8006a410036020020004200370340420a200041406b410c410010011a200041d8006a418b82c000" - "2800003602002000418382c000290000370350410621040340200041d0006a2201410c200041406b410c2001410c41" - "0010071a200441016b22040d000b200041e8006a41003602002000420037036042c0843d200041e0006a2202410c41" - "0010011a02402002410c2001410c10042201450440418586c000411941014100410010001a0c010b419e86c000411b" - "41014100410010001a0b200145210c410721040340200041d0006a2201410c200041406b410c2001410c410010081a" - "200441016b22040d000b200041f8006a410036020020004200370370417f4201200041f0006a2202410c410010031a" - "02402001410c2002410c100445044041b986c000411741014100410010001a0c010b41d086c0004119410141004100" - "10001a4100210c0b41e986c000411741014100410010001a200041d8006a2202410036020020004200370350418382" - "c000410c4103200041d0006a2204410c410010091a418087c00041122004101341a582c000410c41062004410c4100" - "10091a419287c000411820041013200041e8006a22064100360200200042003703604209200041e0006a2203410c41" - "0010011a2003410c41022004410c410010091a41aa87c0004114200410132003410c41002004410c410010091a41be" - "87c000411720041013200041f8006a22014100360200200042003703704200200041f0006a2205410c410010011a20" - "05410c41022004410c410010091a41d587c00041142004101341e987c00041382005410c41002004410c41001009ac" - "100a1a41a188c000411841014100410010001a200241003602002000420037035042092004410c410010011a200641" - "00360200200042003703602004410c41022003410c4100100b1a41b988c0004112200310132004410c41032003410c" - "4100100b1a41cb88c000411220031013200141003602002000420037037042c0843d2005410c410010011a2005410c" - "41032003410c4100100b1a41dd88c0004118200310132005410c41062003410c4100100b1a41f588c000411c200310" - "13419189c000411741014100410010001a200641003602002000420037036042c0843d2003410c410010011a200141" - "00360200200042003703702003410c2005410c4100100c1a41a889c00041142005101341bc89c000411a4101410041" - "0010001a2001410036020020004200370370418382c000410c41a582c000410c2005410c410010071a024041a582c0" - "00410c2005410c1004220145044041d689c000411641014100410010001a0c010b41ec89c000411841014100410010" - "001a0b41a582c000410c41a582c000410c200041f0006a2202410c410010071a0240418382c000410c2002410c1004" - "450440200145210d41848ac000411741014100410010001a0c010b419b8ac000411941014100410010001a0b41b48a" - "c000411a41014100410010001a200041e8006a410036020020004200370360200041f8006a41003602002000420037" - "0370420a200041f0006a2202410c410010011a418382c000410c2002410c200041e0006a2201410c410010081a41ce" - "8ac000411920011013418382c000410c2001410c2001410c410010081a41e78ac000410f2001101302402002410c20" - "01410c1004220e45044041f68ac000411441014100410010001a0c010b418a8bc000411641014100410010001a0b41" - "00210141a08bc000411a41014100410010001a200042003703400240418382c000410c200041406b41084100100d22" - "0641084604402000290340220f42015104404101210141ba8bc000411741014100410010001a0c020b41d18bc00041" - "1941014100410010001a41ea8bc0004108200f100a1a0c010b41f28bc000412441014100410010001a41968cc00041" - "0f2006ac100a1a0b41002104024041a582c000410c200041406b41084100100d220641084604402000290340220f42" - "7f51044041a58cc000411841014100410010001a200121040c020b41bd8cc000411a41014100410010001a41ea8bc0" - "004108200f100a1a0c010b41d78cc000412541014100410010001a41968cc000410f2006ac100a1a0b410021012000" - "41d8006a41003602002000420037035042ffffffffffffffffff00200041d0006a2202410c410010011a0240200241" - "0c200041406b41084100100d220641084604402000290340220f42ffffffffffffffffff0051044041fc8cc000411e" - "41014100410010001a200421010c020b419a8dc000412041014100410010001a41ba8dc000410d42ffffffffffffff" - "ffff00100a1a41ea8bc0004108200f100a1a0c010b41c78dc000412b41014100410010001a41968cc000410f2006ac" - "100a1a0b41002106200041e8006a4100360200200042003703604200200041e0006a2202410c410010011a02402002" - "410c200041406b41084100100d220241084604402000290340220f50044041f28dc000411741014100410010001a20" - "0121060c020b41898ec000411941014100410010001a41ea8bc0004108200f100a1a0c010b41a28ec0004124410141" - "00410010001a41968cc000410f2002ac100a1a0b41002104200041f8006a410036020020004200370370417f420120" - "0041f0006a2201410c410010031a02402001410c200041406b41084100100d220141084604402000290340220f5004" - "4041c68ec000412541014100410010001a200621040c020b41eb8ec000412741014100410010001a41ea8bc0004108" - "200f100a1a0c010b41928fc000413241014100410010001a41968cc000410f2001ac100a1a0b0240200041f0006a41" - "0c200041406b41084101100d220141084604402000290340220f50044041c48fc000412741014100410010001a0c02" - "0b4100210441eb8fc000412941014100410010001a41ea8bc0004108200f100a1a0c010b41002104419490c0004134" - "41014100410010001a41968cc000410f2001ac100a1a0b4100210141c890c000412c41014100410010001a20004200" - "370320200041003602040240418382c000410c200041206a4108200041046a4104100e2206410c4604402000280204" - "2206416e462000290320220f42808090bbbad6adf00d5171450440419d91c000412b41014100410010001a41c891c0" - "00412f200f100a1a41f791c000411f2006ac100a1a0c020b4101210141f490c000412941014100410010001a0c010b" - "419692c000413641014100410010001a41968cc000410f2006ac100a1a0b2000420037033041002106200041003602" - "08024041a582c000410c200041306a4108200041086a4104100e2202410c46044020002802082202416e4620002903" - "30220f428080f0c4c5a9d28f72517145044041f692c000412c41014100410010001a41a293c0004130200f100a1a41" - "f791c000411f2002ac100a1a0c020b41cc92c000412a41014100410010001a200121060c010b41d293c00041374101" - "4100410010001a41968cc000410f2002ac100a1a0b41002101200041e8006a410036020020004200370360420a2000" - "41e0006a2202410c410010011a200042003703402000410036020c02402002410c200041406b41082000410c6a4104" - "100e2202410c460440200028020c2202416f462000290340220f42808090bbbad6adf00d517145044041b394c00041" - "2c41014100410010001a41c891c000412f200f100a1a41df94c000411f2002ac100a1a0c020b418994c000412a4101" - "4100410010001a200621010c010b41fe94c000413741014100410010001a41968cc000410f2002ac100a1a0b410021" - "06200041f8006a4100360200200042003703704200200041f0006a2202410c410010011a2000420037035020004100" - "36021002402002410c200041d0006a4108200041106a4104100e2202410c4604402000290350220f50200028021022" - "02418080808078467145044041de95c000412b41014100410010001a418996c000411d200f100a1a41a696c0004127" - "2002ac100a1a0c020b41b595c000412941014100410010001a200121060c010b41cd96c00041364101410041001000" - "1a41968cc000410f2002ac100a1a0b4100210141bc89c000411a41014100410010001a200041c8006a410036020020" - "0042003703400240418382c000410c200041406b2203410c100f2202410c460440200341a582c00010150440418397" - "c000412b41014100410010001a0c020b4101210141ae97c000411741014100410010001a0c010b41c597c000412441" - "014100410010001a41968cc000410f2002ac100a1a0b41002102200041d8006a410036020020004200370350024041" - "a582c000410c200041d0006a2205410c100f2203410c4604402005418382c0001015044041e997c000412c41014100" - "410010001a0c020b419598c000411841014100410010001a200121020c010b41ad98c000412541014100410010001a" - "41968cc000410f2003ac100a1a0b200041e8006a4100360200200042003703604200200041e0006a2203410c410010" - "011a200041f8006a41003602002000420037037002402003410c200041f0006a2205410c100f2201410c4604402005" - "20031015044041d298c000412b41014100410010001a0c020b41fd98c000411741014100410010001a2002210b0c01" - "0b419499c000412441014100410010001a41968cc000410f2001ac100a1a0b4100210141b899c00041174101410041" - "0010001a200041186a4100360200200042003703100240418382c000410c200041106a2203410c10102202410c4604" - "402003418382c0001015044041cf99c000412841014100410010001a0c020b4101210141f799c00041144101410041" - "0010001a0c010b418b9ac000412141014100410010001a41968cc000410f2002ac100a1a0b41002102200041286a41" - "0036020020004200370320024041a582c000410c200041206a2205410c10102203410c4604402005418382c0001015" - "044041ac9ac000412941014100410010001a0c020b41d59ac000411541014100410010001a200121020c010b41ea9a" - "c000412241014100410010001a41968cc000410f2003ac100a1a0b41002101200041386a4100360200200042003703" - "304200200041306a2205410c410010011a200041c8006a41003602002000420037034002402005410c200041406b22" - "07410c10102203410c4604402007200510150440418c9bc000412841014100410010001a0c020b41b49bc000411441" - "014100410010001a200221010c010b41c89bc000412141014100410010001a41968cc000410f2003ac100a1a0b4100" - "2102200041d8006a4100360200200042003703504276200041d0006a2203410c410010011a200041e8006a41003602" - "0020004200370360420a200041e0006a2205410c410010011a200041f8006a41003602002000420037037002402003" - "410c200041f0006a2207410c10102203410c460440200720051015044041e99bc000412a41014100410010001a0c02" - "0b41939cc000411641014100410010001a200121020c010b41a99cc000412341014100410010001a41968cc000410f" - "2003ac100a1a0b4100210141cc9cc000412141014100410010001a200042c0808080d0a0fdf000370050200041f800" - "6a41003602002000420037037002400240200041d0006a4108200041f0006a2205410c410010112203410c46044041" - "ed9cc000412220051013200042003703602005410c200041e0006a41084100100d22034108470d012000290360220f" - "4280c2d72f51044041012101418f9dc000411d41014100410010001a0c030b41ac9dc000411f41014100410010001a" - "41cb9dc000411c200f100a1a0c020b419b9ec000411f41014100410010001a41ba9ec00041102003ac100a1a0c010b" - "41e79dc000413441014100410010001a41968cc000410f2003ac100a1a0b4100210341ca9ec0004121410141004100" - "10001a200041ffffff8f7f36006820004281eceedce494ccf9c000370060200041f8006a4100360200200042003703" - "7002400240200041e0006a410c200041f0006a2207410c410010122205410c46044041eb9ec000411c200710132000" - "42003703502007410c200041d0006a41084100100d22054108470d012000290350220f42fb00510440410121034187" - "9fc000411b41014100410010001a0c030b41a29fc000411d41014100410010001a41bf9fc0004116200f100a1a0c02" - "0b4187a0c000411d41014100410010001a41ba9ec00041102005ac100a1a0c010b41d59fc000413241014100410010" - "001a41968cc000410f2005ac100a1a0b410021050240418382c000410c200041f0006a2207410c41001012410c4604" - "4041a4a0c000411a200710132007410c418382c000410c100445044041bea0c000412041014100410010001a200321" - "050c020b41dea0c000412241014100410010001a0c010b4180a1c000412041014100410010001a0b20004180016a24" - "00200e452008200971200a71200c71200d71200471200671200b71200271200171200571710b4201047f410c210202" - "40034020002d0000220320012d00002204460440200041016a2100200141016a2101200241016b22020d010c020b0b" - "200320046b21050b20050b0baa210100418080c0000ba02120200a24242420746573745f666c6f61745f66726f6d5f" - "7761736d202424242020666c6f61742066726f6d206936342031323330303a2020666c6f61742066726f6d20693634" - "203132333030206173204845583a2020666c6f61742066726f6d206936342031323330303a206661696c6564202066" - "6c6f61742066726f6d207536342031323330303a2020666c6f61742066726f6d207536342031323330303a20666169" - "6c65642020666c6f61742066726f6d2065787020322c206d616e7469737361203132333a2020666c6f61742066726f" - "6d2065787020322c206d616e746973736120333a206661696c65642020666c6f61742066726f6d20636f6e73742031" - "3a0de0b6b3a7640000ffffffee2020666c6f61742066726f6d20636f6e7374202d313af21f494c589c0000ffffffee" - "0a24242420746573745f666c6f61745f636f6d70617265202424242020666c6f61742066726f6d20313a2020666c6f" - "61742066726f6d20313a206661696c65642020666c6f61742066726f6d2031203d3d20464c4f41545f4f4e45202066" - "6c6f61742066726f6d203120213d20464c4f41545f4f4e452c206661696c65642020666c6f61742066726f6d203120" - "3e20464c4f41545f4e454741544956455f4f4e452020666c6f61742066726f6d203120213e20464c4f41545f4e4547" - "41544956455f4f4e452c206661696c65642020464c4f41545f4e454741544956455f4f4e45203c20666c6f61742066" - "726f6d20312020464c4f41545f4e454741544956455f4f4e4520213c20666c6f61742066726f6d20312c206661696c" - "65640a24242420746573745f666c6f61745f6164645f7375627472616374202424242020666c6f61742066726f6d20" - "31303a206661696c656420207265706561746564206164643a20676f6f6420207265706561746564206164643a2066" - "61696c6564202072657065617465642073756274726163743a20676f6f642020726570656174656420737562747261" - "63743a206661696c65640a24242420746573745f666c6f61745f6d756c7469706c795f646976696465202424242020" - "7265706561746564206d756c7469706c793a20676f6f6420207265706561746564206d756c7469706c793a20666169" - "6c656420207265706561746564206469766964653a20676f6f6420207265706561746564206469766964653a206661" - "696c65640a24242420746573745f666c6f61745f706f77202424242020666c6f61742063756265206f6620313a2020" - "666c6f61742036746820706f776572206f66202d313a2020666c6f617420737175617265206f6620393a2020666c6f" - "61742030746820706f776572206f6620393a2020666c6f617420737175617265206f6620303a2020666c6f61742030" - "746820706f776572206f6620302028657870656374696e6720494e56414c49445f504152414d53206572726f72293a" - "0a24242420746573745f666c6f61745f726f6f74202424242020666c6f61742073717274206f6620393a2020666c6f" - "61742063627274206f6620393a2020666c6f61742063627274206f6620313030303030303a2020666c6f6174203674" - "6820726f6f74206f6620313030303030303a0a24242420746573745f666c6f61745f6c6f672024242420206c6f675f" - "3130206f6620313030303030303a0a24242420746573745f666c6f61745f6e65676174652024242420206e65676174" - "6520636f6e737420313a20676f6f6420206e656761746520636f6e737420313a206661696c656420206e6567617465" - "20636f6e7374202d313a20676f6f6420206e656761746520636f6e7374202d313a206661696c65640a242424207465" - "73745f666c6f61745f696e76657274202424242020696e76657274206120666c6f61742066726f6d2031303a202069" - "6e7665727420616761696e3a2020696e766572742074776963653a20676f6f642020696e766572742074776963653a" - "206661696c65640a24242420746573745f666c6f61745f746f5f696e74202424242020666c6f61745f746f5f696e74" - "2831293a20676f6f642020666c6f61745f746f5f696e742831293a206661696c656420202020676f743a2020666c6f" - "61745f746f5f696e742831293a206661696c65642077697468206572726f72202020206572726f7220636f64653a20" - "20666c6f61745f746f5f696e74282d31293a20676f6f642020666c6f61745f746f5f696e74282d31293a206661696c" - "65642020666c6f61745f746f5f696e74282d31293a206661696c65642077697468206572726f722020666c6f61745f" - "746f5f696e74286936343a3a4d4158293a20676f6f642020666c6f61745f746f5f696e74286936343a3a4d4158293a" - "206661696c65642020202065787065637465643a2020666c6f61745f746f5f696e74286936343a3a4d4158293a2066" - "61696c65642077697468206572726f722020666c6f61745f746f5f696e742830293a20676f6f642020666c6f61745f" - "746f5f696e742830293a206661696c65642020666c6f61745f746f5f696e742830293a206661696c65642077697468" - "206572726f722020666c6f61745f746f5f696e7428302e312c20746f5f6e656172657374293a20676f6f642020666c" - "6f61745f746f5f696e7428302e312c20746f5f6e656172657374293a206661696c65642020666c6f61745f746f5f69" - "6e7428302e312c20746f5f6e656172657374293a206661696c65642077697468206572726f722020666c6f61745f74" - "6f5f696e7428302e312c20746f77617264735f7a65726f293a20676f6f642020666c6f61745f746f5f696e7428302e" - "312c20746f77617264735f7a65726f293a206661696c65642020666c6f61745f746f5f696e7428302e312c20746f77" - "617264735f7a65726f293a206661696c65642077697468206572726f720a24242420746573745f666c6f61745f746f" - "5f6d616e74697373615f616e645f6578706f6e656e74202424242020666c6f61745f746f5f6d616e74697373615f61" - "6e645f6578706f6e656e742831293a20676f6f642020666c6f61745f746f5f6d616e74697373615f616e645f657870" - "6f6e656e742831293a206661696c6564202020206578706563746564206d616e746973736120313030303030303030" - "303030303030303030302c20676f743a202020206578706563746564206578706f6e656e74202d31382c20676f743a" - "2020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e742831293a206661696c656420776974" - "68206572726f722020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e74282d31293a20676f" - "6f642020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e74282d31293a206661696c656420" - "2020206578706563746564206d616e7469737361202d313030303030303030303030303030303030302c20676f743a" - "2020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e74282d31293a206661696c6564207769" - "7468206572726f722020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e74283130293a2067" - "6f6f642020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e74283130293a206661696c6564" - "202020206578706563746564206578706f6e656e74202d31372c20676f743a2020666c6f61745f746f5f6d616e7469" - "7373615f616e645f6578706f6e656e74283130293a206661696c65642077697468206572726f722020666c6f61745f" - "746f5f6d616e74697373615f616e645f6578706f6e656e742830293a20676f6f642020666c6f61745f746f5f6d616e" - "74697373615f616e645f6578706f6e656e742830293a206661696c6564202020206578706563746564206d616e7469" - "73736120302c20676f743a202020206578706563746564206578706f6e656e74202d323134373438333634382c2067" - "6f743a2020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e742830293a206661696c656420" - "77697468206572726f722020666c6f61745f6e65676174652831293a206661696c6564202d20726573756c74206d69" - "736d617463682020666c6f61745f6e65676174652831293a20676f6f642020666c6f61745f6e65676174652831293a" - "206661696c65642077697468206572726f722020666c6f61745f6e6567617465282d31293a206661696c6564202d20" - "726573756c74206d69736d617463682020666c6f61745f6e6567617465282d31293a20676f6f642020666c6f61745f" - "6e6567617465282d31293a206661696c65642077697468206572726f722020666c6f61745f6e65676174652830293a" - "206661696c6564202d20726573756c74206d69736d617463682020666c6f61745f6e65676174652830293a20676f6f" - "642020666c6f61745f6e65676174652830293a206661696c65642077697468206572726f720a24242420746573745f" - "666c6f61745f616273202424242020666c6f61745f6162732831293a206661696c6564202d20726573756c74206d69" - "736d617463682020666c6f61745f6162732831293a20676f6f642020666c6f61745f6162732831293a206661696c65" - "642077697468206572726f722020666c6f61745f616273282d31293a206661696c6564202d20726573756c74206d69" - "736d617463682020666c6f61745f616273282d31293a20676f6f642020666c6f61745f616273282d31293a20666169" - "6c65642077697468206572726f722020666c6f61745f6162732830293a206661696c6564202d20726573756c74206d" - "69736d617463682020666c6f61745f6162732830293a20676f6f642020666c6f61745f6162732830293a206661696c" - "65642077697468206572726f722020666c6f61745f616273282d3130293a206661696c6564202d20726573756c7420" - "6d69736d617463682020666c6f61745f616273282d3130293a20676f6f642020666c6f61745f616273282d3130293a" - "206661696c65642077697468206572726f720a24242420746573745f666c6f61745f66726f6d5f7374616d6f756e74" - "202424242020666c6f61742066726f6d2058525020616d6f756e74202831303020585250293a202058525020616d6f" - "756e7420636f6e76657273696f6e3a20676f6f64202058525020616d6f756e7420636f6e76657273696f6e3a206661" - "696c6564202020206578706563746564203130303030303030302c20676f743a202058525020616d6f756e7420636f" - "6e76657273696f6e3a206661696c6564202d20666c6f61745f746f5f696e74206572726f722020666c6f6174206672" - "6f6d2058525020616d6f756e743a206661696c656420202020726573756c745f73697a653a0a24242420746573745f" - "666c6f61745f66726f6d5f73746e756d626572202424242020666c6f61742066726f6d2053544e756d626572202831" - "3233293a202053544e756d62657220636f6e76657273696f6e3a20676f6f64202053544e756d62657220636f6e7665" - "7273696f6e3a206661696c6564202020206578706563746564203132332c20676f743a202053544e756d6265722063" - "6f6e76657273696f6e3a206661696c6564202d20666c6f61745f746f5f696e74206572726f722020666c6f61742066" - "726f6d2053544e756d6265723a206661696c65642020666c6f61742066726f6d2053544e756d626572202831293a20" - "2053544e756d626572283129203d3d20464c4f41545f4f4e453a20676f6f64202053544e756d626572283129203d3d" - "20464c4f41545f4f4e453a206661696c65642020666c6f61742066726f6d2053544e756d6265722831293a20666169" - "6c6564004d0970726f64756365727302086c616e6775616765010452757374000c70726f6365737365642d62790105" - "72757374631d312e38392e30202832393438333838336520323032352d30382d303429002c0f7461726765745f6665" - "617475726573022b0f6d757461626c652d676c6f62616c732b087369676e2d657874"; + "0061736d0100000001490960057f7f7f7f7f017f60077f7f7f7f7f7f7f017f60067f7f7f7f7f7f017f60047e7f7f7f" + "017f60057e7f7f7f7f017f60047f7f7f7f017f60037f7f7e017f60037f7f7f006000017f02fa021008686f73745f6c" + "6962057472616365000008686f73745f6c69620e666c6f61745f66726f6d5f696e74000308686f73745f6c69620f66" + "6c6f61745f66726f6d5f75696e74000003656e7613666c6f61745f66726f6d5f6d616e745f657870000408686f7374" + "5f6c69620d666c6f61745f636f6d70617265000508686f73745f6c696209666c6f61745f616464000108686f73745f" + "6c69620e666c6f61745f7375627472616374000108686f73745f6c69620e666c6f61745f6d756c7469706c79000108" + "686f73745f6c69620c666c6f61745f646976696465000108686f73745f6c696209666c6f61745f706f77000208686f" + "73745f6c69620974726163655f6e756d000608686f73745f6c69620a666c6f61745f726f6f74000203656e760c666c" + "6f61745f746f5f696e74000003656e7611666c6f61745f746f5f6d616e745f657870000203656e7613666c6f61745f" + "66726f6d5f7374616d6f756e74000003656e7613666c6f61745f66726f6d5f73746e756d6265720000030302070805" + "030100110619037f01418080c0000b7f0041b49ac0000b7f0041c09ac0000b072e04066d656d6f727902000666696e" + "69736800110a5f5f646174615f656e6403010b5f5f686561705f6261736503020ab621021f00200020014101410041" + "0010001a418080c00041022002410c410110001a0b9321020c7f017e230041f0006b22002400418280c000411d4101" + "4100410010001a200041e8006a4100360200200042003703600240428ce000200041e0006a2203410c410010012201" + "410c460440419f80c00041172003101041b680c000411e2003410c410110001a0c010b41d480c000411e4101410041" + "0010001a0b2000428ce0003703500240200041d0006a4108200041e0006a2203410c41001002410c4604402001410c" + "46210741f280c0004117200310100c010b418981c000411e41014100410010001a0b024042fb004102200041e0006a" + "2201410c41001003410c46044041a781c0004121200110100c010b41c881c000412641014100410010001a41002107" + "0b41ee81c0004115418382c0001010418f82c000411641a582c000101041b182c000411b41014100410010001a2000" + "41e8006a41003602002000420037036002404201200041e0006a2203410c410010012201410c46044041cc82c00041" + "0f200310100c010b41db82c000411641014100410010001a0b027f200041e0006a410c418382c000410c1004450440" + "41f182c000411b41014100410010001a2001410c460c010b418c83c000412341014100410010001a41000b21080240" + "200041e0006a410c41a582c000410c1004410146044041af83c000412341014100410010001a0c010b4100210841d2" + "83c000412c41014100410010001a0b024041a582c000410c200041e0006a410c1004410246044041fe83c000412341" + "014100410010001a0c010b4100210841a184c000412c41014100410010001a0b41cd84c00041204101410041001000" + "1a200041d8006a418b82c0002800003602002000418382c000290000370350410921040340200041d0006a2201410c" + "418382c000410c2001410c410010051a200441016b22040d000b200041e8006a410036020020004200370360420a20" + "0041e0006a410c41001001410c46220945044041ed84c000411741014100410010001a0b0240200041e0006a410c20" + "0041d0006a410c1004450440418485c000411441014100410010001a0c010b41002109419885c00041164101410041" + "0010001a0b410b21040340200041d0006a2201410c418382c000410c2001410c410010061a200441016b22040d000b" + "02402001410c41a582c000410c100445044041ae85c000411941014100410010001a0c010b4100210941c785c00041" + "1b41014100410010001a0b41e285c000412341014100410010001a200041106a410036020020004200370308420a20" + "0041086a410c410010011a200041206a418b82c0002800003602002000418382c00029000037031841062104034020" + "0041186a2201410c200041086a410c2001410c410010071a200441016b22040d000b200041d8006a41003602002000" + "420037035042c0843d200041d0006a2203410c410010011a02402003410c2001410c10042201450440418586c00041" + "1941014100410010001a0c010b419e86c000411b41014100410010001a0b200145210a410721040340200041186a22" + "01410c200041086a410c2001410c410010081a200441016b22040d000b200041e8006a410036020020004200370360" + "4201417f200041e0006a2203410c410010031a02402001410c2003410c100445044041b986c0004117410141004100" + "10001a0c010b41d086c000411941014100410010001a4100210a0b41e986c000411741014100410010001a20004120" + "6a2204410036020020004200370318418382c000410c4103200041186a2205410c410010091a418087c00041122005" + "101041a582c000410c41062005410c410010091a419287c000411820051010200041d8006a22014100360200200042" + "003703504209200041d0006a2202410c410010011a2002410c41022005410c410010091a41aa87c000411420051010" + "2002410c41002005410c410010091a41be87c000411720051010200041e8006a220341003602002000420037036042" + "00200041e0006a2206410c410010011a2006410c41022005410c410010091a41d587c00041142005101041e987c000" + "41382006410c41002005410c41001009ac100a1a41a188c000411841014100410010001a2004410036020020004200" + "37031842092005410c410010011a20014100360200200042003703502005410c41022002410c4100100b1a41b988c0" + "004112200210102005410c41032002410c4100100b1a41cb88c0004112200210102003410036020020004200370360" + "42c0843d2006410c410010011a2006410c41032002410c4100100b1a41dd88c0004118200210102006410c41062002" + "410c4100100b1a41f588c000411c20021010419189c000411a41014100410010001a20014100360200200042003703" + "502003410036020020004200370360420a2006410c410010011a418382c000410c2006410c2002410c410010081a41" + "ab89c000411920021010418382c000410c2002410c2002410c410010081a41c489c000410f2002101002402006410c" + "2002410c1004220b45044041d389c000411441014100410010001a0c010b41e789c000411641014100410010001a0b" + "4100210141fd89c000411a41014100410010001a200042003703080240418382c000410c200041086a41084100100c" + "220341084604402000290308220c42015104404101210141978ac000411741014100410010001a0c020b41ae8ac000" + "411941014100410010001a41c78ac0004108200c100a1a0c010b41cf8ac000412441014100410010001a41f38ac000" + "410f2003ac100a1a0b41002104024041a582c000410c200041086a41084100100c220341084604402000290308220c" + "427f51044041828bc000411841014100410010001a200121040c020b419a8bc000411a41014100410010001a41c78a" + "c0004108200c100a1a0c010b41b48bc000412541014100410010001a41f38ac000410f2003ac100a1a0b4100210120" + "0041206a41003602002000420037031842ffffffffffffffffff00200041186a2203410c410010011a02402003410c" + "200041086a41084100100c220341084604402000290308220c42ffffffffffffffffff0051044041d98bc000411e41" + "014100410010001a200421010c020b41f78bc000412041014100410010001a41978cc000410d42ffffffffffffffff" + "ff00100a1a41c78ac0004108200c100a1a0c010b41a48cc000412b41014100410010001a41f38ac000410f2003ac10" + "0a1a0b41002103200041d8006a4100360200200042003703504200200041d0006a2204410c410010011a0240200441" + "0c200041086a41084100100c220441084604402000290308220c50044041cf8cc000411741014100410010001a2001" + "21030c020b41e68cc000411941014100410010001a41c78ac0004108200c100a1a0c010b41ff8cc000412441014100" + "410010001a41f38ac000410f2004ac100a1a0b41002104200041e8006a4100360200200042003703604201417f2000" + "41e0006a2201410c410010031a02402001410c200041086a41084100100c220141084604402000290308220c500440" + "41a38dc000412541014100410010001a200321040c020b41c88dc000412741014100410010001a41c78ac000410820" + "0c100a1a0c010b41ef8dc000413241014100410010001a41f38ac000410f2001ac100a1a0b0240200041e0006a410c" + "200041086a41084101100c220141084604402000290308220c50044041a18ec000412741014100410010001a0c020b" + "4100210441c88ec000412941014100410010001a41c78ac0004108200c100a1a0c010b4100210441f18ec000413441" + "014100410010001a41f38ac000410f2001ac100a1a0b4100210141a58fc000412c41014100410010001a2000420037" + "0328200041003602340240418382c000410c200041286a4108200041346a4104100d2203410c460440200028023422" + "03416e462000290328220c42808090bbbad6adf00d517145044041fa8fc000412b41014100410010001a41a590c000" + "412f200c100a1a41d490c000411f2003ac100a1a0c020b4101210141d18fc000412941014100410010001a0c010b41" + "f390c000413641014100410010001a41f38ac000410f2003ac100a1a0b200042003703384100210320004100360244" + "024041a582c000410c200041386a4108200041c4006a4104100d2202410c46044020002802442202416e4620002903" + "38220c428080f0c4c5a9d28f72517145044041d391c000412c41014100410010001a41ff91c0004130200c100a1a41" + "d490c000411f2002ac100a1a0c020b41a991c000412a41014100410010001a200121030c010b41af92c00041374101" + "4100410010001a41f38ac000410f2002ac100a1a0b41002101200041d8006a410036020020004200370350420a2000" + "41d0006a2202410c410010011a200042003703082000410036024802402002410c200041086a4108200041c8006a41" + "04100d2202410c46044020002802482202416f462000290308220c42808090bbbad6adf00d5171450440419093c000" + "412c41014100410010001a41a590c000412f200c100a1a41bc93c000411f2002ac100a1a0c020b41e692c000412a41" + "014100410010001a200321010c010b41db93c000413741014100410010001a41f38ac000410f2002ac100a1a0b4100" + "2103200041e8006a4100360200200042003703604200200041e0006a2202410c410010011a20004200370318200041" + "0036024c02402002410c200041186a4108200041cc006a4104100d2202410c4604402000290318220c50200028024c" + "2202418080808078467145044041bb94c000412b41014100410010001a41e694c000411d200c100a1a418395c00041" + "272002ac100a1a0c020b419294c000412941014100410010001a200121030c010b41aa95c000413641014100410010" + "001a41f38ac000410f2002ac100a1a0b4100210141e095c000412141014100410010001a200042c0808080d0a0fdf0" + "00370018200041e8006a41003602002000420037036002400240200041186a4108200041e0006a2205410c4100100e" + "2202410c460440418196c000412220051010200042003703502005410c200041d0006a41084100100c22024108470d" + "012000290350220c4280c2d72f5104404101210141a396c000411d41014100410010001a0c030b41c096c000411f41" + "014100410010001a41df96c000411c200c100a1a0c020b41af97c000411f41014100410010001a41ce97c000411020" + "02ac100a1a0c010b41fb96c000413441014100410010001a41f38ac000410f2002ac100a1a0b4100210241de97c000" + "412141014100410010001a200041ffffff8f7f36005820004281eceedce494ccf9c000370050200041e8006a410036" + "02002000420037036002400240200041d0006a410c200041e0006a2206410c4100100f2205410c46044041ff97c000" + "411c20061010200042003703182006410c200041186a41084100100c22054108470d012000290318220c42fb005104" + "4041012102419b98c000411b41014100410010001a0c030b41b698c000411d41014100410010001a41d398c0004116" + "200c100a1a0c020b419b99c000411d41014100410010001a41ce97c00041102005ac100a1a0c010b41e998c0004132" + "41014100410010001a41f38ac000410f2005ac100a1a0b410021050240418382c000410c200041e0006a2206410c41" + "00100f410c46044041b899c000411a200610102006410c418382c000410c100445044041d299c00041204101410041" + "0010001a200221050c020b41f299c000412241014100410010001a0c010b41949ac000412041014100410010001a0b" + "200041f0006a2400200b452007200871200971200a71200471200371200171200571710b0bbe1a0100418080c0000b" + "b41a20200a24242420746573745f666c6f61745f66726f6d5f7761736d202424242020666c6f61742066726f6d2069" + "36342031323330303a2020666c6f61742066726f6d20693634203132333030206173204845583a2020666c6f617420" + "66726f6d206936342031323330303a206661696c65642020666c6f61742066726f6d207536342031323330303a2020" + "666c6f61742066726f6d207536342031323330303a206661696c65642020666c6f61742066726f6d2065787020322c" + "206d616e7469737361203132333a2020666c6f61742066726f6d2065787020322c206d616e746973736120333a2066" + "61696c65642020666c6f61742066726f6d20636f6e737420313a0de0b6b3a7640000ffffffee2020666c6f61742066" + "726f6d20636f6e7374202d313af21f494c589c0000ffffffee0a24242420746573745f666c6f61745f636f6d706172" + "65202424242020666c6f61742066726f6d20313a2020666c6f61742066726f6d20313a206661696c65642020666c6f" + "61742066726f6d2031203d3d20464c4f41545f4f4e452020666c6f61742066726f6d203120213d20464c4f41545f4f" + "4e452c206661696c65642020666c6f61742066726f6d2031203e20464c4f41545f4e454741544956455f4f4e452020" + "666c6f61742066726f6d203120213e20464c4f41545f4e454741544956455f4f4e452c206661696c65642020464c4f" + "41545f4e454741544956455f4f4e45203c20666c6f61742066726f6d20312020464c4f41545f4e454741544956455f" + "4f4e4520213c20666c6f61742066726f6d20312c206661696c65640a24242420746573745f666c6f61745f6164645f" + "7375627472616374202424242020666c6f61742066726f6d2031303a206661696c6564202072657065617465642061" + "64643a20676f6f6420207265706561746564206164643a206661696c65642020726570656174656420737562747261" + "63743a20676f6f64202072657065617465642073756274726163743a206661696c65640a24242420746573745f666c" + "6f61745f6d756c7469706c795f6469766964652024242420207265706561746564206d756c7469706c793a20676f6f" + "6420207265706561746564206d756c7469706c793a206661696c656420207265706561746564206469766964653a20" + "676f6f6420207265706561746564206469766964653a206661696c65640a24242420746573745f666c6f61745f706f" + "77202424242020666c6f61742063756265206f6620313a2020666c6f61742036746820706f776572206f66202d313a" + "2020666c6f617420737175617265206f6620393a2020666c6f61742030746820706f776572206f6620393a2020666c" + "6f617420737175617265206f6620303a2020666c6f61742030746820706f776572206f662030202865787065637469" + "6e6720494e56414c49445f504152414d53206572726f72293a0a24242420746573745f666c6f61745f726f6f742024" + "24242020666c6f61742073717274206f6620393a2020666c6f61742063627274206f6620393a2020666c6f61742063" + "627274206f6620313030303030303a2020666c6f61742036746820726f6f74206f6620313030303030303a0a242424" + "20746573745f666c6f61745f696e76657274202424242020696e76657274206120666c6f61742066726f6d2031303a" + "2020696e7665727420616761696e3a2020696e766572742074776963653a20676f6f642020696e7665727420747769" + "63653a206661696c65640a24242420746573745f666c6f61745f746f5f696e74202424242020666c6f61745f746f5f" + "696e742831293a20676f6f642020666c6f61745f746f5f696e742831293a206661696c656420202020676f743a2020" + "666c6f61745f746f5f696e742831293a206661696c65642077697468206572726f72202020206572726f7220636f64" + "653a2020666c6f61745f746f5f696e74282d31293a20676f6f642020666c6f61745f746f5f696e74282d31293a2066" + "61696c65642020666c6f61745f746f5f696e74282d31293a206661696c65642077697468206572726f722020666c6f" + "61745f746f5f696e74286936343a3a4d4158293a20676f6f642020666c6f61745f746f5f696e74286936343a3a4d41" + "58293a206661696c65642020202065787065637465643a2020666c6f61745f746f5f696e74286936343a3a4d415829" + "3a206661696c65642077697468206572726f722020666c6f61745f746f5f696e742830293a20676f6f642020666c6f" + "61745f746f5f696e742830293a206661696c65642020666c6f61745f746f5f696e742830293a206661696c65642077" + "697468206572726f722020666c6f61745f746f5f696e7428302e312c20746f5f6e656172657374293a20676f6f6420" + "20666c6f61745f746f5f696e7428302e312c20746f5f6e656172657374293a206661696c65642020666c6f61745f74" + "6f5f696e7428302e312c20746f5f6e656172657374293a206661696c65642077697468206572726f722020666c6f61" + "745f746f5f696e7428302e312c20746f77617264735f7a65726f293a20676f6f642020666c6f61745f746f5f696e74" + "28302e312c20746f77617264735f7a65726f293a206661696c65642020666c6f61745f746f5f696e7428302e312c20" + "746f77617264735f7a65726f293a206661696c65642077697468206572726f720a24242420746573745f666c6f6174" + "5f746f5f6d616e74697373615f616e645f6578706f6e656e74202424242020666c6f61745f746f5f6d616e74697373" + "615f616e645f6578706f6e656e742831293a20676f6f642020666c6f61745f746f5f6d616e74697373615f616e645f" + "6578706f6e656e742831293a206661696c6564202020206578706563746564206d616e746973736120313030303030" + "303030303030303030303030302c20676f743a202020206578706563746564206578706f6e656e74202d31382c2067" + "6f743a2020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e742831293a206661696c656420" + "77697468206572726f722020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e74282d31293a" + "20676f6f642020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e74282d31293a206661696c" + "6564202020206578706563746564206d616e7469737361202d313030303030303030303030303030303030302c2067" + "6f743a2020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e74282d31293a206661696c6564" + "2077697468206572726f722020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e7428313029" + "3a20676f6f642020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e74283130293a20666169" + "6c6564202020206578706563746564206578706f6e656e74202d31372c20676f743a2020666c6f61745f746f5f6d61" + "6e74697373615f616e645f6578706f6e656e74283130293a206661696c65642077697468206572726f722020666c6f" + "61745f746f5f6d616e74697373615f616e645f6578706f6e656e742830293a20676f6f642020666c6f61745f746f5f" + "6d616e74697373615f616e645f6578706f6e656e742830293a206661696c6564202020206578706563746564206d61" + "6e746973736120302c20676f743a202020206578706563746564206578706f6e656e74202d32313437343833363438" + "2c20676f743a2020666c6f61745f746f5f6d616e74697373615f616e645f6578706f6e656e742830293a206661696c" + "65642077697468206572726f720a24242420746573745f666c6f61745f66726f6d5f7374616d6f756e742024242420" + "20666c6f61742066726f6d2058525020616d6f756e74202831303020585250293a202058525020616d6f756e742063" + "6f6e76657273696f6e3a20676f6f64202058525020616d6f756e7420636f6e76657273696f6e3a206661696c656420" + "2020206578706563746564203130303030303030302c20676f743a202058525020616d6f756e7420636f6e76657273" + "696f6e3a206661696c6564202d20666c6f61745f746f5f696e74206572726f722020666c6f61742066726f6d205852" + "5020616d6f756e743a206661696c656420202020726573756c745f73697a653a0a24242420746573745f666c6f6174" + "5f66726f6d5f73746e756d626572202424242020666c6f61742066726f6d2053544e756d6265722028313233293a20" + "2053544e756d62657220636f6e76657273696f6e3a20676f6f64202053544e756d62657220636f6e76657273696f6e" + "3a206661696c6564202020206578706563746564203132332c20676f743a202053544e756d62657220636f6e766572" + "73696f6e3a206661696c6564202d20666c6f61745f746f5f696e74206572726f722020666c6f61742066726f6d2053" + "544e756d6265723a206661696c65642020666c6f61742066726f6d2053544e756d626572202831293a202053544e75" + "6d626572283129203d3d20464c4f41545f4f4e453a20676f6f64202053544e756d626572283129203d3d20464c4f41" + "545f4f4e453a206661696c65642020666c6f61742066726f6d2053544e756d6265722831293a206661696c6564004d" + "0970726f64756365727302086c616e6775616765010452757374000c70726f6365737365642d627901057275737463" + "1d312e38392e30202832393438333838336520323032352d30382d303429002c0f7461726765745f66656174757265" + "73022b0f6d757461626c652d676c6f62616c732b087369676e2d657874"; extern std::string const float0Hex = "0061736d0100000001290560057f7f7f7f7f017f60047e7f7f7f017f60077f7f7f7f7f7f7f017f60047f7f7f7f017f" diff --git a/src/test/app/wasm_fixtures/float_tests/src/lib.rs b/src/test/app/wasm_fixtures/float_tests/src/lib.rs index 5e4ac5ef7d..559ecc22a5 100644 --- a/src/test/app/wasm_fixtures/float_tests/src/lib.rs +++ b/src/test/app/wasm_fixtures/float_tests/src/lib.rs @@ -11,7 +11,7 @@ use xrpl_std::host::trace::DataRepr::AsHex; use xrpl_std::host::trace::{trace, trace_data, trace_num, DataRepr}; use xrpl_std::host::{ cache_ledger_obj, float_add, float_compare, float_divide, float_from_int, float_from_uint, - float_log, float_multiply, float_pow, float_root, float_set, float_subtract, + float_multiply, float_pow, float_root, float_subtract, get_ledger_obj_array_len, get_ledger_obj_field, get_ledger_obj_nested_field, FLOAT_ROUNDING_MODES_TO_NEAREST, }; @@ -50,8 +50,8 @@ unsafe extern "C" { rounding: i32, ) -> i32; - #[link_name = "float_to_mantissa_and_exponent"] - fn float_to_mantissa_and_exponent( + #[link_name = "float_to_mant_exp"] + fn float_to_mant_exp( float_ptr: *const u8, float_len: i32, mantissa_ptr: *mut u8, @@ -60,16 +60,14 @@ unsafe extern "C" { exponent_len: i32, ) -> i32; - #[link_name = "float_negate"] - fn float_negate( - float_ptr: *const u8, - float_len: i32, + #[link_name = "float_from_mant_exp"] + fn float_from_mant_exp( + mantissa: i64, + exponent: i32, out_ptr: *mut u8, out_len: i32, + rounding: i32, ) -> i32; - - #[link_name = "float_abs"] - fn float_abs(float_ptr: *const u8, float_len: i32, out_ptr: *mut u8, out_len: i32) -> i32; } // Float size constant (8 bytes mantissa + 4 bytes exponent) @@ -116,10 +114,10 @@ fn test_float_from_wasm() -> bool { all_pass = false; } - if FLOAT_SIZE as i32 == unsafe { float_set(2, 123, f.as_mut_ptr(), FLOAT_SIZE, FLOAT_ROUNDING_MODES_TO_NEAREST) } { + if FLOAT_SIZE as i32 == unsafe { float_from_mant_exp(123, 2, f.as_mut_ptr(), FLOAT_SIZE as i32, FLOAT_ROUNDING_MODES_TO_NEAREST) } { let _ = trace_float(" float from exp 2, mantissa 123:", &f); } else { - let _ = trace(" float from exp 2, mantissa 3: failed"); + let _ = trace(" float from exp 2, mantissa 123: failed"); all_pass = false; } @@ -272,7 +270,7 @@ fn test_float_multiply_divide() -> bool { }; } let mut f01: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - unsafe { float_set(-1, 1, f01.as_mut_ptr(), FLOAT_SIZE, FLOAT_ROUNDING_MODES_TO_NEAREST) }; + unsafe { float_from_mant_exp(1, -1, f01.as_mut_ptr(), FLOAT_SIZE as i32, FLOAT_ROUNDING_MODES_TO_NEAREST) }; if 0 == unsafe { float_compare(f_compute.as_ptr(), FLOAT_SIZE, f01.as_ptr(), FLOAT_SIZE) } { let _ = trace(" repeated divide: good"); @@ -436,80 +434,6 @@ fn test_float_root() -> bool { all_pass } -fn test_float_log() -> bool { - let _ = trace("\n$$$ test_float_log $$$"); - let mut all_pass = true; - - let mut f1000000: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - unsafe { - float_from_int( - 1000000, - f1000000.as_mut_ptr(), - FLOAT_SIZE, - FLOAT_ROUNDING_MODES_TO_NEAREST, - ) - }; - let mut f_compute: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - unsafe { - float_log( - f1000000.as_ptr(), - FLOAT_SIZE, - f_compute.as_mut_ptr(), - FLOAT_SIZE, - FLOAT_ROUNDING_MODES_TO_NEAREST, - ) - }; - let _ = trace_float(" log_10 of 1000000:", &f_compute); - - all_pass -} - -fn test_float_negate() -> bool { - let _ = trace("\n$$$ test_float_negate $$$"); - let mut all_pass = true; - - let mut f_compute: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - unsafe { - float_multiply( - FLOAT_ONE.as_ptr(), - FLOAT_SIZE, - FLOAT_NEGATIVE_ONE.as_ptr(), - FLOAT_SIZE, - f_compute.as_mut_ptr(), - FLOAT_SIZE, - FLOAT_ROUNDING_MODES_TO_NEAREST, - ) - }; - // let _ = trace_float(" float:", &f_compute); - if 0 == unsafe { float_compare(FLOAT_NEGATIVE_ONE.as_ptr(), FLOAT_SIZE, f_compute.as_ptr(), FLOAT_SIZE) } { - let _ = trace(" negate const 1: good"); - } else { - let _ = trace(" negate const 1: failed"); - all_pass = false; - } - - unsafe { - float_multiply( - FLOAT_NEGATIVE_ONE.as_ptr(), - FLOAT_SIZE, - FLOAT_NEGATIVE_ONE.as_ptr(), - FLOAT_SIZE, - f_compute.as_mut_ptr(), - FLOAT_SIZE, - FLOAT_ROUNDING_MODES_TO_NEAREST, - ) - }; - // let _ = trace_float(" float:", &f_compute); - if 0 == unsafe { float_compare(FLOAT_ONE.as_ptr(), FLOAT_SIZE, f_compute.as_ptr(), FLOAT_SIZE) } { - let _ = trace(" negate const -1: good"); - } else { - let _ = trace(" negate const -1: failed"); - all_pass = false; - } - - all_pass -} - fn test_float_invert() -> bool { let _ = trace("\n$$$ test_float_invert $$$"); let mut all_pass = true; @@ -666,7 +590,7 @@ fn test_float_to_int() -> bool { // Test rounding with fractional value (0.1) let mut f01: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - unsafe { float_set(-1, 1, f01.as_mut_ptr(), FLOAT_SIZE, FLOAT_ROUNDING_MODES_TO_NEAREST) }; + unsafe { float_from_mant_exp(1, -1, f01.as_mut_ptr(), FLOAT_SIZE as i32, FLOAT_ROUNDING_MODES_TO_NEAREST) }; let ret = unsafe { float_to_int( f01.as_ptr(), @@ -719,15 +643,15 @@ fn test_float_to_int() -> bool { all_pass } -fn test_float_to_mantissa_and_exponent() -> bool { - let _ = trace("\n$$$ test_float_to_mantissa_and_exponent $$$"); +fn test_float_to_mant_exp() -> bool { + let _ = trace("\n$$$ test_float_to_mant_exp $$$"); let mut all_pass = true; // Test with FLOAT_ONE (value 1) let mut mantissa_bytes: [u8; 8] = [0u8; 8]; let mut exponent_bytes: [u8; 4] = [0u8; 4]; let result = unsafe { - float_to_mantissa_and_exponent( + float_to_mant_exp( FLOAT_ONE.as_ptr(), FLOAT_SIZE as i32, mantissa_bytes.as_mut_ptr(), @@ -741,15 +665,15 @@ fn test_float_to_mantissa_and_exponent() -> bool { let mantissa = i64::from_le_bytes(mantissa_bytes); let exponent = i32::from_le_bytes(exponent_bytes); if mantissa == 1000000000000000000 && exponent == -18 { - let _ = trace(" float_to_mantissa_and_exponent(1): good"); + let _ = trace(" float_to_mant_exp(1): good"); } else { - let _ = trace(" float_to_mantissa_and_exponent(1): failed"); + let _ = trace(" float_to_mant_exp(1): failed"); let _ = trace_num(" expected mantissa 1000000000000000000, got:", mantissa); let _ = trace_num(" expected exponent -18, got:", exponent as i64); all_pass = false; } } else { - let _ = trace(" float_to_mantissa_and_exponent(1): failed with error"); + let _ = trace(" float_to_mant_exp(1): failed with error"); let _ = trace_num(" error code:", result as i64); all_pass = false; } @@ -758,7 +682,7 @@ fn test_float_to_mantissa_and_exponent() -> bool { let mut mantissa_bytes: [u8; 8] = [0u8; 8]; let mut exponent_bytes: [u8; 4] = [0u8; 4]; let result = unsafe { - float_to_mantissa_and_exponent( + float_to_mant_exp( FLOAT_NEGATIVE_ONE.as_ptr(), FLOAT_SIZE as i32, mantissa_bytes.as_mut_ptr(), @@ -772,15 +696,15 @@ fn test_float_to_mantissa_and_exponent() -> bool { let mantissa = i64::from_le_bytes(mantissa_bytes); let exponent = i32::from_le_bytes(exponent_bytes); if mantissa == -1000000000000000000 && exponent == -18 { - let _ = trace(" float_to_mantissa_and_exponent(-1): good"); + let _ = trace(" float_to_mant_exp(-1): good"); } else { - let _ = trace(" float_to_mantissa_and_exponent(-1): failed"); + let _ = trace(" float_to_mant_exp(-1): failed"); let _ = trace_num(" expected mantissa -1000000000000000000, got:", mantissa); let _ = trace_num(" expected exponent -18, got:", exponent as i64); all_pass = false; } } else { - let _ = trace(" float_to_mantissa_and_exponent(-1): failed with error"); + let _ = trace(" float_to_mant_exp(-1): failed with error"); let _ = trace_num(" error code:", result as i64); all_pass = false; } @@ -792,7 +716,7 @@ fn test_float_to_mantissa_and_exponent() -> bool { let mut mantissa_bytes: [u8; 8] = [0u8; 8]; let mut exponent_bytes: [u8; 4] = [0u8; 4]; let result = unsafe { - float_to_mantissa_and_exponent( + float_to_mant_exp( f10.as_ptr(), FLOAT_SIZE as i32, mantissa_bytes.as_mut_ptr(), @@ -806,15 +730,15 @@ fn test_float_to_mantissa_and_exponent() -> bool { let mantissa = i64::from_le_bytes(mantissa_bytes); let exponent = i32::from_le_bytes(exponent_bytes); if mantissa == 1000000000000000000 && exponent == -17 { - let _ = trace(" float_to_mantissa_and_exponent(10): good"); + let _ = trace(" float_to_mant_exp(10): good"); } else { - let _ = trace(" float_to_mantissa_and_exponent(10): failed"); + let _ = trace(" float_to_mant_exp(10): failed"); let _ = trace_num(" expected mantissa 1000000000000000000, got:", mantissa); let _ = trace_num(" expected exponent -17, got:", exponent as i64); all_pass = false; } } else { - let _ = trace(" float_to_mantissa_and_exponent(10): failed with error"); + let _ = trace(" float_to_mant_exp(10): failed with error"); let _ = trace_num(" error code:", result as i64); all_pass = false; } @@ -826,7 +750,7 @@ fn test_float_to_mantissa_and_exponent() -> bool { let mut mantissa_bytes: [u8; 8] = [0u8; 8]; let mut exponent_bytes: [u8; 4] = [0u8; 4]; let result = unsafe { - float_to_mantissa_and_exponent( + float_to_mant_exp( f0.as_ptr(), FLOAT_SIZE as i32, mantissa_bytes.as_mut_ptr(), @@ -840,15 +764,15 @@ fn test_float_to_mantissa_and_exponent() -> bool { let mantissa = i64::from_le_bytes(mantissa_bytes); let exponent = i32::from_le_bytes(exponent_bytes); if mantissa == 0 && exponent == -2147483648 { - let _ = trace(" float_to_mantissa_and_exponent(0): good"); + let _ = trace(" float_to_mant_exp(0): good"); } else { - let _ = trace(" float_to_mantissa_and_exponent(0): failed"); + let _ = trace(" float_to_mant_exp(0): failed"); let _ = trace_num(" expected mantissa 0, got:", mantissa); let _ = trace_num(" expected exponent -2147483648, got:", exponent as i64); all_pass = false; } } else { - let _ = trace(" float_to_mantissa_and_exponent(0): failed with error"); + let _ = trace(" float_to_mant_exp(0): failed with error"); let _ = trace_num(" error code:", result as i64); all_pass = false; } @@ -856,189 +780,6 @@ fn test_float_to_mantissa_and_exponent() -> bool { all_pass } -fn test_float_negate_host() -> bool { - let _ = trace("\n$$$ test_float_negate $$$"); - let mut all_pass = true; - - // Test with FLOAT_ONE (value 1) -> should become -1 - let mut result: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - let ret = unsafe { - float_negate( - FLOAT_ONE.as_ptr(), - FLOAT_SIZE as i32, - result.as_mut_ptr(), - FLOAT_SIZE as i32, - ) - }; - - if ret == FLOAT_SIZE as i32 { - if result == FLOAT_NEGATIVE_ONE { - let _ = trace(" float_negate(1): good"); - } else { - let _ = trace(" float_negate(1): failed - result mismatch"); - all_pass = false; - } - } else { - let _ = trace(" float_negate(1): failed with error"); - let _ = trace_num(" error code:", ret as i64); - all_pass = false; - } - - // Test with FLOAT_NEGATIVE_ONE (value -1) -> should become 1 - let mut result: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - let ret = unsafe { - float_negate( - FLOAT_NEGATIVE_ONE.as_ptr(), - FLOAT_SIZE as i32, - result.as_mut_ptr(), - FLOAT_SIZE as i32, - ) - }; - - if ret == FLOAT_SIZE as i32 { - if result == FLOAT_ONE { - let _ = trace(" float_negate(-1): good"); - } else { - let _ = trace(" float_negate(-1): failed - result mismatch"); - all_pass = false; - } - } else { - let _ = trace(" float_negate(-1): failed with error"); - let _ = trace_num(" error code:", ret as i64); - all_pass = false; - } - - // Test with zero -> should remain zero - let mut f0: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - unsafe { float_from_int(0, f0.as_mut_ptr(), FLOAT_SIZE, FLOAT_ROUNDING_MODES_TO_NEAREST) }; - - let mut result: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - let ret = unsafe { - float_negate(f0.as_ptr(), FLOAT_SIZE as i32, result.as_mut_ptr(), FLOAT_SIZE as i32) - }; - - if ret == FLOAT_SIZE as i32 { - if result == f0 { - let _ = trace(" float_negate(0): good"); - } else { - let _ = trace(" float_negate(0): failed - result mismatch"); - all_pass = false; - } - } else { - let _ = trace(" float_negate(0): failed with error"); - let _ = trace_num(" error code:", ret as i64); - all_pass = false; - } - - all_pass -} - -fn test_float_abs_host() -> bool { - let _ = trace("\n$$$ test_float_abs $$$"); - let mut all_pass = true; - - // Test with FLOAT_ONE (value 1) -> should remain 1 - let mut result: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - let ret = unsafe { - float_abs( - FLOAT_ONE.as_ptr(), - FLOAT_SIZE as i32, - result.as_mut_ptr(), - FLOAT_SIZE as i32, - ) - }; - - if ret == FLOAT_SIZE as i32 { - if result == FLOAT_ONE { - let _ = trace(" float_abs(1): good"); - } else { - let _ = trace(" float_abs(1): failed - result mismatch"); - all_pass = false; - } - } else { - let _ = trace(" float_abs(1): failed with error"); - let _ = trace_num(" error code:", ret as i64); - all_pass = false; - } - - // Test with FLOAT_NEGATIVE_ONE (value -1) -> should become 1 - let mut result: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - let ret = unsafe { - float_abs( - FLOAT_NEGATIVE_ONE.as_ptr(), - FLOAT_SIZE as i32, - result.as_mut_ptr(), - FLOAT_SIZE as i32, - ) - }; - - if ret == FLOAT_SIZE as i32 { - if result == FLOAT_ONE { - let _ = trace(" float_abs(-1): good"); - } else { - let _ = trace(" float_abs(-1): failed - result mismatch"); - all_pass = false; - } - } else { - let _ = trace(" float_abs(-1): failed with error"); - let _ = trace_num(" error code:", ret as i64); - all_pass = false; - } - - // Test with zero -> should remain zero - let mut f0: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - unsafe { float_from_int(0, f0.as_mut_ptr(), FLOAT_SIZE, FLOAT_ROUNDING_MODES_TO_NEAREST) }; - - let mut result: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - let ret = - unsafe { float_abs(f0.as_ptr(), FLOAT_SIZE as i32, result.as_mut_ptr(), FLOAT_SIZE as i32) }; - - if ret == FLOAT_SIZE as i32 { - if result == f0 { - let _ = trace(" float_abs(0): good"); - } else { - let _ = trace(" float_abs(0): failed - result mismatch"); - all_pass = false; - } - } else { - let _ = trace(" float_abs(0): failed with error"); - let _ = trace_num(" error code:", ret as i64); - all_pass = false; - } - - // Test with negative value -> should become positive - let mut f_neg10: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - unsafe { float_from_int(-10, f_neg10.as_mut_ptr(), FLOAT_SIZE, FLOAT_ROUNDING_MODES_TO_NEAREST) }; - - let mut f_pos10: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - unsafe { float_from_int(10, f_pos10.as_mut_ptr(), FLOAT_SIZE, FLOAT_ROUNDING_MODES_TO_NEAREST) }; - - let mut result: [u8; FLOAT_SIZE] = [0u8; FLOAT_SIZE]; - let ret = unsafe { - float_abs( - f_neg10.as_ptr(), - FLOAT_SIZE as i32, - result.as_mut_ptr(), - FLOAT_SIZE as i32, - ) - }; - - if ret == FLOAT_SIZE as i32 { - if result == f_pos10 { - let _ = trace(" float_abs(-10): good"); - } else { - let _ = trace(" float_abs(-10): failed - result mismatch"); - all_pass = false; - } - } else { - let _ = trace(" float_abs(-10): failed with error"); - let _ = trace_num(" error code:", ret as i64); - all_pass = false; - } - - all_pass -} - fn test_float_from_stamount() -> bool { let _ = trace("\n$$$ test_float_from_stamount $$$"); let mut all_pass = true; @@ -1203,13 +944,9 @@ pub extern "C" fn finish() -> i32 { all_pass &= test_float_multiply_divide(); all_pass &= test_float_pow(); all_pass &= test_float_root(); - all_pass &= test_float_log(); - all_pass &= test_float_negate(); all_pass &= test_float_invert(); all_pass &= test_float_to_int(); - all_pass &= test_float_to_mantissa_and_exponent(); - all_pass &= test_float_negate_host(); - all_pass &= test_float_abs_host(); + all_pass &= test_float_to_mant_exp(); all_pass &= test_float_from_stamount(); all_pass &= test_float_from_stnumber(); diff --git a/src/test/basics/Number_test.cpp b/src/test/basics/Number_test.cpp index 0540c13afd..856b379533 100644 --- a/src/test/basics/Number_test.cpp +++ b/src/test/basics/Number_test.cpp @@ -1542,78 +1542,6 @@ public: } } - void - test_log10() - { - auto const scale = Number::getMantissaScale(); - testcase << "test_lg " << to_string(scale); - - using Case = std::tuple; - auto test = [this](auto const& c) { - for (auto const& [x, z] : c) - { - auto const result = log10(x); - std::stringstream ss; - ss << "lg(" << x << ") = " << result << ". Expected: " << z; - // std::cout << ss.str() << std::endl; - BEAST_EXPECTS(result == z, ss.str()); - } - }; - - auto const cSmall = std::to_array( - {{Number{2}, Number{3'010'299'956'639'811ll, -16}}, - {Number{2'000'000}, Number{6'301'029'995'663'985ll, -15}}, - {Number{2, -30}, Number{-2'969'897'000'433'602ll, -14}}, - {Number{1}, Number{0}}, - {Number{1'000'000'000'000'000ll}, Number{15}}, - {Number{5625, -4}, Number{-2'498'774'732'165'998, -16}}}); - - auto const cLarge = std::to_array({ - {Number{Number::maxMantissa() - 9, -1, Number::normalized{}}, - Number{1'799'999'999'999'999'999ll, -17}}, - {Number{Number::maxMantissa() - 9, 0, Number::normalized{}}, - Number{1'899'999'999'999'999'999ll, -17}}, - {Number{Number::maxRep, 0, Number::normalized{}}, - Number{1'896'488'972'683'081'529ll, -17}}, - {Number{999'999'999'999'999'999ll}, Number{1'799'999'999'999'999'999, -17}}, - }); - - if (Number::getMantissaScale() == MantissaRange::small) - { - test(cSmall); - } - else - { - NumberRoundModeGuard const mg(Number::towards_zero); - test(cLarge); - } - - { - bool caught = false; - try - { - log10(Number{-2}); - } - catch (std::runtime_error const&) - { - caught = true; - } - BEAST_EXPECT(caught); - caught = false; - - try - { - log10(Number()); - } - catch (std::runtime_error const&) - { - caught = true; - } - BEAST_EXPECT(caught); - caught = false; - } - } - void run() override { @@ -1641,7 +1569,6 @@ public: test_truncate(); testRounding(); testInt64(); - test_log10(); } } };