diff --git a/crates/xrpl-host-functions/src/lib.rs b/crates/xrpl-host-functions/src/lib.rs index 9cb5a1d8b0..74d6e38abf 100644 --- a/crates/xrpl-host-functions/src/lib.rs +++ b/crates/xrpl-host-functions/src/lib.rs @@ -496,11 +496,6 @@ host_functions! { #[wasm_name = "float_div"] fn float_divide(&self, x: &[u8], y: &[u8], mode: i32, out: &mut [u8]) -> HostResult; - /// The `n`-th root of the float `x` under rounding `mode`. - #[gas = 5500] - #[wasm_name = "float_root"] - fn float_root(&self, x: &[u8], n: i32, mode: i32, out: &mut [u8]) -> HostResult; - /// The float `x` raised to the power `n` under rounding `mode`. #[gas = 5500] #[wasm_name = "float_pow"] diff --git a/crates/xrpl-host-functions/tests/generated_abi.rs b/crates/xrpl-host-functions/tests/generated_abi.rs index f2358195cb..b4ea770bb3 100644 --- a/crates/xrpl-host-functions/tests/generated_abi.rs +++ b/crates/xrpl-host-functions/tests/generated_abi.rs @@ -560,14 +560,6 @@ impl HostFunctions for FakeHost { put(out, &[x[0]]) } - /// A one-float-and-integer operator; `InvalidParams` on an empty operand. - fn float_root(&self, x: &[u8], _n: i32, _mode: i32, out: &mut [u8]) -> HostResult { - if x.is_empty() { - return Err(HostError::InvalidParams); - } - put(out, &[x[0]]) - } - /// The same shape, for exponentiation. fn float_power(&self, x: &[u8], _n: i32, _mode: i32, out: &mut [u8]) -> HostResult { if x.is_empty() { @@ -824,7 +816,6 @@ fn the_trait_is_implementable() { assert_eq!(host.float_subtract(&[3; 8], &[4; 8], 0, &mut out), Ok(1)); assert_eq!(host.float_multiply(&[3; 8], &[4; 8], 0, &mut out), Ok(1)); assert_eq!(host.float_divide(&[3; 8], &[4; 8], 0, &mut out), Ok(1)); - assert_eq!(host.float_root(&[3; 8], 2, 0, &mut out), Ok(1)); assert_eq!(host.float_power(&[3; 8], 2, 0, &mut out), Ok(1)); assert_eq!(*host.traced.borrow(), ["hello/AsHex/2"]); @@ -951,7 +942,6 @@ fn the_spec_table_matches_the_declarations() { ("float_sub", 160), ("float_mult", 300), ("float_div", 300), - ("float_root", 5500), ("float_pow", 5500), ] ); diff --git a/crates/xrpl-wasm-vm-ffi/src/lib.rs b/crates/xrpl-wasm-vm-ffi/src/lib.rs index 0b2b965472..4b26ae2f9a 100644 --- a/crates/xrpl-wasm-vm-ffi/src/lib.rs +++ b/crates/xrpl-wasm-vm-ffi/src/lib.rs @@ -514,10 +514,6 @@ mod ffi { #[cxx_name = "floatDivide"] fn float_divide(self: &HostContext, x: &[u8], y: &[u8], mode: i32, out: &mut [u8]) -> i32; - #[namespace = "xrpl"] - #[cxx_name = "floatRoot"] - fn float_root(self: &HostContext, x: &[u8], n: i32, mode: i32, out: &mut [u8]) -> i32; - #[namespace = "xrpl"] #[cxx_name = "floatPower"] fn float_power(self: &HostContext, x: &[u8], n: i32, mode: i32, out: &mut [u8]) -> i32; @@ -880,10 +876,6 @@ impl HostFunctions for CxxHost<'_> { bytes_written(self.ctx.float_divide(x, y, mode, out)) } - fn float_root(&self, x: &[u8], n: i32, mode: i32, out: &mut [u8]) -> HostResult { - bytes_written(self.ctx.float_root(x, n, mode, out)) - } - fn float_power(&self, x: &[u8], n: i32, mode: i32, out: &mut [u8]) -> HostResult { bytes_written(self.ctx.float_power(x, n, mode, out)) } @@ -1279,7 +1271,7 @@ mod tests { } /// A panic during a check is its own status rather than one more malformed - /// module: the far side answers a node-local failure, not `temBAD_WASM`. + /// module: the far side answers a node-local failure, not `temINVALID_BYTECODE`. #[test] fn a_panic_during_a_check_becomes_a_status_instead_of_an_unwind() { let crossed = guarded( diff --git a/crates/xrpl-wasm-vm/src/abi.rs b/crates/xrpl-wasm-vm/src/abi.rs index fc8dbb3859..617131041c 100644 --- a/crates/xrpl-wasm-vm/src/abi.rs +++ b/crates/xrpl-wasm-vm/src/abi.rs @@ -657,9 +657,6 @@ mod tests { ) -> HostResult { unreachable!("no unit test in this module calls the host") } - fn float_root(&self, _x: &[u8], _n: i32, _mode: i32, _out: &mut [u8]) -> HostResult { - unreachable!("no unit test in this module calls the host") - } fn float_power( &self, _x: &[u8], diff --git a/crates/xrpl-wasm-vm/src/register.rs b/crates/xrpl-wasm-vm/src/register.rs index 7a31a34b9c..e69981055f 100644 --- a/crates/xrpl-wasm-vm/src/register.rs +++ b/crates/xrpl-wasm-vm/src/register.rs @@ -1169,26 +1169,6 @@ pub(crate) fn register_host_functions( }) }, ), - HostFunctionSpec::FloatRoot => linker.func_wrap( - HOST_MODULE, - op.wasm_name(), - |mut caller: Caller<'_, VmState<'_>>, - in_ptr: i32, - in_len: i32, - n: i32, - out_ptr: i32, - out_len: i32, - mode: i32| - -> Result { - charged(&mut caller, HostFunctionSpec::FloatRoot, |c| { - let out = Region::new(out_ptr, out_len); - let x = Region::new(in_ptr, in_len); - write_buffered(c, out, |host, data, buf| { - host.float_root(x.read(data)?, n, mode, buf) - }) - }) - }, - ), HostFunctionSpec::FloatPower => linker.func_wrap( HOST_MODULE, op.wasm_name(), diff --git a/crates/xrpl-wasm-vm/tests/budgets.rs b/crates/xrpl-wasm-vm/tests/budgets.rs index 0bbabdb449..f6ed8a8580 100644 --- a/crates/xrpl-wasm-vm/tests/budgets.rs +++ b/crates/xrpl-wasm-vm/tests/budgets.rs @@ -382,11 +382,6 @@ fn call_for(op: HostFunctionSpec) -> Call { "(call $float_div (i32.const 0) (i32.const 8) (i32.const 8) (i32.const 8) (i32.const 16) (i32.const 8) (i32.const 0))", 7, ), - HostFunctionSpec::FloatRoot => ( - import::FLOAT_ROOT, - "(call $float_root (i32.const 0) (i32.const 8) (i32.const 2) (i32.const 8) (i32.const 8) (i32.const 0))", - 6, - ), HostFunctionSpec::FloatPower => ( import::FLOAT_POW, "(call $float_pow (i32.const 0) (i32.const 8) (i32.const 2) (i32.const 8) (i32.const 8) (i32.const 0))", diff --git a/crates/xrpl-wasm-vm/tests/host_calls.rs b/crates/xrpl-wasm-vm/tests/host_calls.rs index 6f2b4010ec..f5dd801c84 100644 --- a/crates/xrpl-wasm-vm/tests/host_calls.rs +++ b/crates/xrpl-wasm-vm/tests/host_calls.rs @@ -1011,23 +1011,6 @@ fn float_add_reads_both_operands_and_the_mode() { ); } -/// A unary operator that reads one float region, an integer, and a mode: all three -/// reach the host, tagged by operator. -#[test] -fn float_root_reads_the_float_the_degree_and_the_mode() { - let host = FakeHost::new().answering_float(support::Answer::filler(8)); - - let wat = module( - &[import::FLOAT_ROOT, ONE_PAGE], - "(call $float_root (i32.const 0) (i32.const 8) (i32.const 3) (i32.const 64) (i32.const 8) (i32.const 1))", - ); - assert_eq!(status(&wat, &host), 8, "the result length"); - assert_eq!( - *host.float_unary_ops_asked.borrow(), - vec![("root", vec![0u8; 8], 3, 1)] - ); -} - /// A leading scalar parameter reaches the host as declared. #[test] fn home_le_field_passes_the_field_selector_through() { diff --git a/crates/xrpl-wasm-vm/tests/preflight.rs b/crates/xrpl-wasm-vm/tests/preflight.rs index a80efbc861..705252e0e9 100644 --- a/crates/xrpl-wasm-vm/tests/preflight.rs +++ b/crates/xrpl-wasm-vm/tests/preflight.rs @@ -98,7 +98,7 @@ fn a_disabled_feature_does_not_pass() { /// Every host function the ABI declares, spelled as a guest imports it. The count /// is asserted against the ABI so a function added to it cannot be left out here. -const ALL_IMPORTS: [&str; 61] = [ +const ALL_IMPORTS: [&str; 60] = [ import::LDGR_INDEX, import::PARENT_LDGR_TIME, import::PARENT_LDGR_HASH, @@ -158,7 +158,6 @@ const ALL_IMPORTS: [&str; 61] = [ import::FLOAT_SUB, import::FLOAT_MULT, import::FLOAT_DIV, - import::FLOAT_ROOT, import::FLOAT_POW, ]; diff --git a/crates/xrpl-wasm-vm/tests/support/mod.rs b/crates/xrpl-wasm-vm/tests/support/mod.rs index 2d0ea923e6..ab52f80c43 100644 --- a/crates/xrpl-wasm-vm/tests/support/mod.rs +++ b/crates/xrpl-wasm-vm/tests/support/mod.rs @@ -122,8 +122,7 @@ pub type PaychannelKey = (Vec, Vec, i32); /// `float_multiply`, `float_divide` — as `(operator, x, y, mode)`. pub type FloatBinaryCall = (&'static str, Vec, Vec, i32); -/// One call to a float operator over a float and an integer — `float_root`, -/// `float_power` — as `(operator, x, n, mode)`. +/// One call to a float operator over a float and an integer — `float_power` — as `(operator, x, n, mode)`. pub type FloatUnaryCall = (&'static str, Vec, i32, i32); /// A `HostFunctions` implementation that answers from what the test put in it and @@ -371,8 +370,7 @@ pub struct FakeHost { /// Every `(x, y, mode)` the four binary float operators were asked for, tagged by /// operator name. pub float_binary_ops_asked: RefCell>, - /// Every `(x, n, mode)` `float_root` and `float_power` were asked for, tagged by - /// operator name. + /// Every `(x, n, mode)` `float_power` was asked for, tagged by operator name. pub float_unary_ops_asked: RefCell>, } @@ -1389,13 +1387,6 @@ impl HostFunctions for FakeHost { self.float_answer.fill(out) } - fn float_root(&self, x: &[u8], n: i32, mode: i32, out: &mut [u8]) -> HostResult { - self.float_unary_ops_asked - .borrow_mut() - .push(("root", x.to_vec(), n, mode)); - self.float_answer.fill(out) - } - fn float_power(&self, x: &[u8], n: i32, mode: i32, out: &mut [u8]) -> HostResult { self.float_unary_ops_asked .borrow_mut() @@ -1488,7 +1479,6 @@ pub mod import { pub const FLOAT_SUB: &str = r#"(import "host_lib" "float_sub" (func $float_sub (param i32 i32 i32 i32 i32 i32 i32) (result i32)))"#; pub const FLOAT_MULT: &str = r#"(import "host_lib" "float_mult" (func $float_mult (param i32 i32 i32 i32 i32 i32 i32) (result i32)))"#; pub const FLOAT_DIV: &str = r#"(import "host_lib" "float_div" (func $float_div (param i32 i32 i32 i32 i32 i32 i32) (result i32)))"#; - pub const FLOAT_ROOT: &str = r#"(import "host_lib" "float_root" (func $float_root (param i32 i32 i32 i32 i32 i32) (result i32)))"#; pub const FLOAT_POW: &str = r#"(import "host_lib" "float_pow" (func $float_pow (param i32 i32 i32 i32 i32 i32) (result i32)))"#; } diff --git a/include/xrpl/protocol/TER.h b/include/xrpl/protocol/TER.h index b2f45b3267..393ea91a78 100644 --- a/include/xrpl/protocol/TER.h +++ b/include/xrpl/protocol/TER.h @@ -132,7 +132,7 @@ enum TEMcodes : TERUnderlyingType { temBAD_MPT, temBAD_CIPHERTEXT, - temBAD_WASM, + temINVALID_BYTECODE, }; //------------------------------------------------------------------------------ diff --git a/include/xrpl/tx/wasm/HostContext.h b/include/xrpl/tx/wasm/HostContext.h index 3ce625181c..0b20fc76f5 100644 --- a/include/xrpl/tx/wasm/HostContext.h +++ b/include/xrpl/tx/wasm/HostContext.h @@ -408,13 +408,6 @@ public: std::int32_t mode, rust::Slice out) const noexcept; - [[nodiscard]] std::int32_t - floatRoot( - rust::Slice x, - std::int32_t n, - std::int32_t mode, - rust::Slice out) const noexcept; - [[nodiscard]] std::int32_t floatPower( rust::Slice x, diff --git a/include/xrpl/tx/wasm/HostFunc.h b/include/xrpl/tx/wasm/HostFunc.h index ae0adcd9be..dae9e89ef9 100644 --- a/include/xrpl/tx/wasm/HostFunc.h +++ b/include/xrpl/tx/wasm/HostFunc.h @@ -57,9 +57,6 @@ floatMultiplyImpl(Slice const& x, Slice const& y, int32_t mode); std::expected floatDivideImpl(Slice const& x, Slice const& y, int32_t mode); -std::expected -floatRootImpl(Slice const& x, int32_t n, int32_t mode); - std::expected floatPowerImpl(Slice const& x, int32_t n, int32_t mode); @@ -454,12 +451,6 @@ public: return std::unexpected(HostFunctionError::Unimplemented); } - [[nodiscard]] [[nodiscard]] virtual std::expected - floatRoot(Slice const& x, int32_t n, int32_t mode) const - { - return std::unexpected(HostFunctionError::Unimplemented); - } - [[nodiscard]] [[nodiscard]] virtual std::expected floatPower(Slice const& x, int32_t n, int32_t mode) const { diff --git a/include/xrpl/tx/wasm/HostFuncImpl.h b/include/xrpl/tx/wasm/HostFuncImpl.h index 569b151e29..403b43659b 100644 --- a/include/xrpl/tx/wasm/HostFuncImpl.h +++ b/include/xrpl/tx/wasm/HostFuncImpl.h @@ -280,9 +280,6 @@ public: std::expected floatDivide(Slice const& x, Slice const& y, int32_t mode) const override; - std::expected - floatRoot(Slice const& x, int32_t n, int32_t mode) const override; - std::expected floatPower(Slice const& x, int32_t n, int32_t mode) const override; }; diff --git a/include/xrpl/tx/wasm/WasmVM.h b/include/xrpl/tx/wasm/WasmVM.h index 99161b93af..51ea24dce1 100644 --- a/include/xrpl/tx/wasm/WasmVM.h +++ b/include/xrpl/tx/wasm/WasmVM.h @@ -37,7 +37,7 @@ runEscrowWasm( // That is what makes this callable from a transactor's `preflight`, which has no view // to build a host over. // -// `temBAD_WASM` for every fault in the module - the transaction carries something this +// `temINVALID_BYTECODE` for every fault in the module - the transaction carries something this // engine cannot run, so it is refused before it can reach the ledger. // `telFAILED_PROCESSING` if the engine itself failed: nothing was learned about the // module, and a defect here is not evidence that the transaction is malformed. diff --git a/src/libxrpl/protocol/TER.cpp b/src/libxrpl/protocol/TER.cpp index 345edc2ee4..b69ecd5612 100644 --- a/src/libxrpl/protocol/TER.cpp +++ b/src/libxrpl/protocol/TER.cpp @@ -205,7 +205,7 @@ transResults() MAKE_ERROR(temBAD_TRANSFER_FEE, "Malformed: Transfer fee is outside valid range."), MAKE_ERROR(temINVALID_INNER_BATCH, "Malformed: Invalid inner batch transaction."), MAKE_ERROR(temBAD_CIPHERTEXT, "Malformed: Invalid ciphertext."), - MAKE_ERROR(temBAD_WASM, "Malformed: Provided WASM code is invalid."), + MAKE_ERROR(temINVALID_BYTECODE, "Malformed: Provided byte code is invalid."), MAKE_ERROR(terRETRY, "Retry transaction."), MAKE_ERROR(terFUNDS_SPENT, "DEPRECATED."), diff --git a/src/libxrpl/tx/wasm/HostContext.cpp b/src/libxrpl/tx/wasm/HostContext.cpp index a67860604a..f37334033d 100644 --- a/src/libxrpl/tx/wasm/HostContext.cpp +++ b/src/libxrpl/tx/wasm/HostContext.cpp @@ -1220,19 +1220,6 @@ HostContext::floatDivide( }); } -std::int32_t -HostContext::floatRoot( - rust::Slice x, - std::int32_t n, - std::int32_t mode, - rust::Slice out) const noexcept -{ - return guarded(hostFunctions_.getJournal(), kHostInternal, [&] { - return invoke( - out, [&] { return hostFunctions_.floatRoot(Slice{x.data(), x.size()}, n, mode); }); - }); -} - std::int32_t HostContext::floatPower( rust::Slice x, diff --git a/src/libxrpl/tx/wasm/HostFuncImplFloat.cpp b/src/libxrpl/tx/wasm/HostFuncImplFloat.cpp index 2abd73d82c..4ec93eb2d9 100644 --- a/src/libxrpl/tx/wasm/HostFuncImplFloat.cpp +++ b/src/libxrpl/tx/wasm/HostFuncImplFloat.cpp @@ -383,32 +383,6 @@ floatDivideImpl(Slice const& x, Slice const& y, int32_t mode) } } -std::expected -floatRootImpl(Slice const& x, int32_t n, int32_t mode) -{ - try - { - if (n < 1) - return std::unexpected(HostFunctionError::FloatInputMalformed); - - detail::FloatState const rm(mode); - if (!rm) - return std::unexpected(HostFunctionError::FloatInputMalformed); - - auto const xx = detail::floatDecode(x); - if (!xx) - return std::unexpected(HostFunctionError::FloatInputMalformed); - - return detail::floatEncode(root(*xx, n)); - } - // LCOV_EXCL_START - catch (...) - { - return std::unexpected(HostFunctionError::FloatComputationError); - } - // LCOV_EXCL_STOP -} - std::expected floatPowerImpl(Slice const& x, int32_t n, int32_t mode) { @@ -515,12 +489,6 @@ WasmHostFunctionsImpl::floatDivide(Slice const& x, Slice const& y, int32_t mode) return wasm_float::floatDivideImpl(x, y, mode); } -std::expected -WasmHostFunctionsImpl::floatRoot(Slice const& x, int32_t n, int32_t mode) const -{ - return wasm_float::floatRootImpl(x, n, mode); -} - std::expected WasmHostFunctionsImpl::floatPower(Slice const& x, int32_t n, int32_t mode) const { diff --git a/src/libxrpl/tx/wasm/WasmVM.cpp b/src/libxrpl/tx/wasm/WasmVM.cpp index 7f05eea138..711a69e9f1 100644 --- a/src/libxrpl/tx/wasm/WasmVM.cpp +++ b/src/libxrpl/tx/wasm/WasmVM.cpp @@ -104,7 +104,7 @@ verdict(CheckStatus status) case CheckStatus::EntryPoint: case CheckStatus::Memory: case CheckStatus::Table: - return temBAD_WASM; + return temINVALID_BYTECODE; // The engine panicked: a defect in the engine, reported rather than fatal to // the node, and not the transaction's fault. diff --git a/src/test/app/TestHostFunctions.h b/src/test/app/TestHostFunctions.h index 252c8c1405..a38e284f40 100644 --- a/src/test/app/TestHostFunctions.h +++ b/src/test/app/TestHostFunctions.h @@ -460,12 +460,6 @@ public: return wasm_float::floatDivideImpl(x, y, mode); } - [[nodiscard]] std::expected - floatRoot(Slice const& x, int32_t n, int32_t mode) const override - { - return wasm_float::floatRootImpl(x, n, mode); - } - [[nodiscard]] std::expected floatPower(Slice const& x, int32_t n, int32_t mode) const override { diff --git a/src/test/app/Wasm_test.cpp b/src/test/app/Wasm_test.cpp index 1ab3289826..360bfed915 100644 --- a/src/test/app/Wasm_test.cpp +++ b/src/test/app/Wasm_test.cpp @@ -498,7 +498,7 @@ struct Wasm_test : public beast::unit_test::Suite auto const codecovWasm = hexToBytes(kCodecovTestsWasmHex); TestHostFunctions hfs(env); - auto const allowance = 129'986; + auto const allowance = 124'173; auto re = runEscrowWasm(codecovWasm, hfs, allowance, escrowFunctionName); checkResult(re, 1, allowance); diff --git a/src/test/app/wasm_fixtures/codecov_tests/Cargo.lock b/src/test/app/wasm_fixtures/codecov_tests/Cargo.lock index 899f278196..6e82e804a7 100644 --- a/src/test/app/wasm_fixtures/codecov_tests/Cargo.lock +++ b/src/test/app/wasm_fixtures/codecov_tests/Cargo.lock @@ -153,24 +153,24 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "xrpl-common-stdlib" -version = "0.8.0" -source = "git+https://github.com/ripple/xrpl-wasm-stdlib.git?branch=error-and-trace#b008b097237ce0d1a2dffc72ba39dd9fc50020a9" +version = "0.9.0" +source = "git+https://github.com/ripple/xrpl-wasm-stdlib.git#e88dc32a48fac9d0eb6e7239c8a38693221657f6" dependencies = [ "xrpl-macros", ] [[package]] name = "xrpl-escrow-stdlib" -version = "0.1.0" -source = "git+https://github.com/ripple/xrpl-wasm-stdlib.git?branch=error-and-trace#b008b097237ce0d1a2dffc72ba39dd9fc50020a9" +version = "0.9.0" +source = "git+https://github.com/ripple/xrpl-wasm-stdlib.git#e88dc32a48fac9d0eb6e7239c8a38693221657f6" dependencies = [ "xrpl-common-stdlib", ] [[package]] name = "xrpl-macros" -version = "0.1.0" -source = "git+https://github.com/ripple/xrpl-wasm-stdlib.git?branch=error-and-trace#b008b097237ce0d1a2dffc72ba39dd9fc50020a9" +version = "0.9.0" +source = "git+https://github.com/ripple/xrpl-wasm-stdlib.git#e88dc32a48fac9d0eb6e7239c8a38693221657f6" dependencies = [ "bs58", "proc-macro2", diff --git a/src/test/app/wasm_fixtures/codecov_tests/Cargo.toml b/src/test/app/wasm_fixtures/codecov_tests/Cargo.toml index 1e388a5154..7a81244620 100644 --- a/src/test/app/wasm_fixtures/codecov_tests/Cargo.toml +++ b/src/test/app/wasm_fixtures/codecov_tests/Cargo.toml @@ -15,5 +15,5 @@ opt-level = 's' panic = "abort" [dependencies] -xrpl-std = { git = "https://github.com/ripple/xrpl-wasm-stdlib.git", package = "xrpl-common-stdlib", branch = "error-and-trace" } -xrpl-escrow = { git = "https://github.com/ripple/xrpl-wasm-stdlib.git", package = "xrpl-escrow-stdlib", branch = "error-and-trace" } +xrpl-std = { git = "https://github.com/ripple/xrpl-wasm-stdlib.git", package = "xrpl-common-stdlib" } +xrpl-escrow = { git = "https://github.com/ripple/xrpl-wasm-stdlib.git", package = "xrpl-escrow-stdlib" } 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 02b38f633e..ef8f7b10de 100644 --- a/src/test/app/wasm_fixtures/codecov_tests/src/lib.rs +++ b/src/test/app/wasm_fixtures/codecov_tests/src/lib.rs @@ -4,7 +4,7 @@ extern crate std; use core::panic; -use xrpl_escrow::current_tx::escrow_finish::{EscrowFinish, get_current_escrow_finish}; +use xrpl_escrow::current_tx::escrow_finish::{get_current_escrow_finish, EscrowFinish}; use xrpl_std::current_tx::traits::TransactionCommonFields; use xrpl_std::fields::locator::Locator; use xrpl_std::host; @@ -977,22 +977,6 @@ pub extern "C" fn escrow_finish() -> i32 { "float_div_oob_slice2", ) }); - with_buffer::<2, _, _>(|ptr, len| { - check_result( - unsafe { - host::float_root( - float.as_ptr().wrapping_add(1_000_000_000), - float.len(), - 3, - ptr, - len, - FLOAT_ROUNDING_MODES_TO_NEAREST, - ) - }, - error_codes::POINTER_OUT_OF_BOUNDS, - "float_root_oob_slice", - ) - }); with_buffer::<2, _, _>(|ptr, len| { check_result( unsafe { diff --git a/src/test/app/wasm_fixtures/fixtures.cpp b/src/test/app/wasm_fixtures/fixtures.cpp index 993e218fee..b65261660c 100644 --- a/src/test/app/wasm_fixtures/fixtures.cpp +++ b/src/test/app/wasm_fixtures/fixtures.cpp @@ -419,7 +419,7 @@ extern std::string const kAllKeyletsWasmHex = extern std::string const kCodecovTestsWasmHex = "0061736d01000000015c0c60067f7f7f7f7f7f017f60027f7f017f60047f7f7f7f017f60037f7f7f017f60077f7f7f" "7f7f7f7f017f60087f7f7f7f7f7f7f7f017f60057f7f7f7f7f017f60017f017f60057f7f7f7f7f0060047f7f7f7f00" - "60017f006000017f02ee093708686f73745f6c6962057472616365000808686f73745f6c69620a6c6467725f696e64" + "60017f006000017f02d8093608686f73745f6c6962057472616365000808686f73745f6c69620a6c6467725f696e64" "6578000108686f73745f6c696210706172656e745f6c6467725f74696d65000108686f73745f6c696210706172656e" "745f6c6467725f68617368000108686f73745f6c696208626173655f666565000108686f73745f6c696211616d656e" "646d656e745f656e61626c6564000108686f73745f6c69620874785f6669656c64000308686f73745f6c69620e6163" @@ -438,212 +438,211 @@ extern std::string const kCodecovTestsWasmHex = "6964000508686f73745f6c696206616d6d5f6964000008686f73745f6c69620d63726564656e7469616c5f69640005" "08686f73745f6c69620a6d70746f6b656e5f6964000008686f73745f6c696209666c6f61745f636d70000208686f73" "745f6c696209666c6f61745f616464000408686f73745f6c696209666c6f61745f737562000408686f73745f6c6962" - "0a666c6f61745f6d756c74000408686f73745f6c696209666c6f61745f646976000408686f73745f6c69620a666c6f" - "61745f726f6f74000008686f73745f6c696209666c6f61745f706f77000008686f73745f6c696209657363726f775f" - "6964000008686f73745f6c69620f6d70745f69737375616e63655f6964000008686f73745f6c69620c6e66745f6f66" - "6665725f6964000008686f73745f6c6962086f666665725f6964000008686f73745f6c6962096f7261636c655f6964" - "000008686f73745f6c69620a7061796368616e5f6964000508686f73745f6c6962167065726d697373696f6e65645f" - "646f6d61696e5f6964000008686f73745f6c6962097469636b65745f6964000008686f73745f6c6962087661756c74" - "5f6964000008686f73745f6c69620b64656c65676174655f6964000008686f73745f6c6962126465706f7369745f70" - "7265617574685f6964000008686f73745f6c6962066469645f6964000208686f73745f6c69620a7369676e6572735f" - "69640002030403090a0b05030100110619037f01418080c0000b7f0041da98c0000b7f0041e098c0000b073504066d" - "656d6f727902000d657363726f775f66696e69736800390a5f5f646174615f656e6403010b5f5f686561705f626173" - "6503020ac32e037201017f230041106b22042400024002402000200147044020022003410741014100100020004100" - "480d0120042000ad3703080c020b20042000ac370308200220034101200441086a41081000200441106a24000f0b20" - "042000ac3703080b418080c000410b4101200441086a41081000000b2801017f230041106b2201240020012000ac37" - "030841be91c000410b4101200141086a41081000000ba42d02087f017e230041a0026b2200240041c991c000412341" - "0741014100100020004100360260200041e0006a220141041001410441a090c000410a103720004100360260200141" - "041002410441908bc00041101037200042003703782000420037037020004200370368200042003703602001412010" - "03412041f180c0004110103720004100360260200141041004410441ff83c000410810372000428182848890a0c080" - "013703202000428182848890a0c080013703182000428182848890a0c080013703102000428182848890a0c0800137" - "030841ec91c000410e1005410141fa91c00041111037200041086a41201005410141fa91c000411110372000410036" - "02702000420037036820004200370360024002404181802020014114100622014100480d00200141144b0440417321" - "010c010b20014114460d0141818080807821010b20011038000b2000200029006c3700fd01200020002900673703f8" - "01200020002d00623a002e200020002f01603b012c2000200028006336002f200020002903f8013700332000200029" - "00fd013700382000420037037820004200370370200042003703682000420037036002402000412c6a4114200041e0" - "006a4120100722014120470440200141004e0d0120011038000b200020002d00623a0042200020002f01603b014020" - "00200029006f22083703800220002000280063360043200020002900673700472000200837004f2000200029007737" - "0057200020002d007f3a005f200041406b4120410010084101418b92c0004108103720004100360270200042003703" - "682000420037036041818020200041e0006a220241141009411441d38dc000410d1037200041003602702000420037" - "03682000420037036041014181802020024114100a4114418784c0004108103702404100200041e4006a22046b4103" - "71220320046a220120044d0d0020030440200321050340200441003a0000200441016a2104200541016b22050d000b" - "0b200341016b4107490d000340200441003a0000200441076a41003a0000200441066a41003a0000200441056a4100" - "3a0000200441046a41003a0000200441036a41003a0000200441026a41003a0000200441016a41003a000020044108" - "6a22042001470d000b0b2001413c20036b2203417c716a220420014b0440034020014100360200200141046a220120" - "04490d000b0b024020042003410371220320046a22054f0d002003220104400340200441003a0000200441016a2104" - "200141016b22010d000b0b200341016b4107490d000340200441003a0000200441076a41003a0000200441066a4100" - "3a0000200441056a41003a0000200441046a41003a0000200441036a41003a0000200441026a41003a000020044101" - "6a41003a0000200441086a22042005470d000b0b200041043602a00120004181802036026020004100360288022000" - "420037038002200042003703f80120024104200041f8016a22014114100b411441a280c00041081037200041003602" - "88022000420037038002200042003703f801200220002802a00120014114100c411441d084c000410d103720004100" - "360288022000420037038002200042003703f8014101200220002802a00120014114100d411441b08dc00041081037" - "4189803c100e4120419392c000410a10374189803c100f4120419d92c000410f103741014189803c1010412041ac92" - "c000410a1037200220002802a0011011412041b692c00041101037200220002802a0011012412041c692c000411510" - "374101200220002802a0011013412041db92c000411010372000412c6a220341141014411441eb92c0004108103720" - "0042003703900220004200370388022000420037038002200042003703f801200220002802a0012001412010154120" - "418f84c000410b103741f392c000410c41ff92c000410b418a93c000410e10164101419893c0004109103720002000" - "2903203703c001200020002903183703b801200020002903103703b001200020002903083703a801200041003b0188" - "022000420037038002200042003703f80120034114200041a8016a22054120200141121017411241d18fc000410710" - "3720004100360288022000420037038002200042003703f80120054120200141141018411441ac8fc000410a103720" - "0041003602f801200541202001410410194104419790c0004109103720054120101a410841a193c000410910372005" - "4120101b410a41aa93c000410c1037200041003602f8012005412020014104101c410441ba83c000410a103741b693" - "c000410d410420034114100041b693c000410d410541c393c0004108100041b693c000410d410541cb93c000410810" - "00417f41041003417141d393c00041181037200041003602f8012001417f1003417141a888c0004118103720004100" - "3a00fa01200041003b01f801200141031003417d41e790c000411e1037200041003602f8012001418094ebdc031003" - "417341bd8ec000411d10374102100e416f41eb93c00041191037417f20002802a00110114171418494c00041181037" - "2002417f10114171419c94c0004118103720024181081011417441b494c00041191037200041e094ebdc036a220420" - "002802a0011011417341cd94c000411810372000420037039002200042003703880220004200370380022000420037" - "03f801200341142004410820014120101d417341cc8cc0004114103720004200370390022000420037038802200042" - "0037038002200042003703f801200341142003411420014120101d417141918ec00041161037200042003703900220" - "004200370388022000420037038002200042003703f80120044108200141204100101e4173418b80c0004117103720" - "0042003703900220004200370388022000420037038002200042003703f801200220002802a001200141204100101e" - "417141a485c00041201037200420002802a00141011008417341e594c00041101037200220002802a0014101100841" - "7141f594c00041121037200042003703900220004200370388022000420037038002200042003703f8012004200028" - "02a001200141201007417341a78ec00041161037200042003703900220004200370388022000420037038002200042" - "003703f801200220002802a0012001412010074171418e83c000411810372000420037039002200042003703880220" - "00420037038002200042003703f8012003411420034114200420002802a00120014120101f4173418591c000411d10" - "37200042003703900220004200370388022000420037038002200042003703f8012003411420034114200220002802" - "a00120014120101f4171419581c000411f103720004200370390022000420037038802200042003703800220004200" - "3703f80141c698c0004114200420002802a001200141201020417341dc8ac000411510372000420037039002200042" - "00370388022000420037038002200042003703f80141c698c0004114200220002802a0012001412010204171418e89" - "c000411b1037200042003703900220004200370388022000420037038002200042003703f80141c698c00041144187" - "95c0004114200141201020417141a38ac0004125103720004200370390022000420037038802200042003703800220" - "0042003703f801419b95c000412841c698c00041142001412010204171418887c000412110372000200028013c3602" - "dc01200020002901343702d4012000200029012c3702cc01200041808080083602c801200041003b01f801200041c8" - "016a2207411841c698c0004114200141021020417141be80c000410a10372000422a3703e001200420002802a00141" - "01200041e0016a41081000200041003b01f8014102200141021006416f41b481c00041171037200041003b01f80141" - "02200141021009416f41f68ec000411c1037200041003b01f8014101410220014102100a416f41b586c00041171037" - "4102100e416f41eb93c000411910374102100f416f41c395c000411e1037410141021010416f41e195c00041191037" - "41ec91c0004181081005417441fa95c000411f103741ec91c00041c10010054174419996c000411a1037200041003b" - "01f801200241810820014102100b417441a987c00041161037200041003b01f801200241810820014102100c417441" - "aa90c000411b1037200041003b01f8014101200241810820014102100d417441db88c0004116103720024181081011" - "417441b396c000411e103720024181081012417441d196c00041231037410120024181081013417441f496c000411e" - "1037200241810810144174419297c0004116103741b693c00041810841ff92c000410b418a93c000410e1016417441" - "9893c0004109103741b693c000410d41ff92c000418108418a93c000410e10164174419893c0004109103741b693c0" - "00410d41ff92c000410b418a93c00041810810164174419893c00041091037200041003b01f8012002418108200141" - "021015417441c483c00041191037200041003b01f80141c698c00041810841c698c0004114200141021020417441dd" - "82c00041141037200041003b01f80120034114200341142002418108200141021021417441cc86c000411b10372000" - "41003b01f801200741810820034114200141021022417441c389c000411e103741b693c000410d4107200420002802" - "a0011000200042d487b6f4c7d4b1c0003700ec0141b693c000410d4103200041ec95ebdc036a22054108100041b693" - "c000410d4105200420002802a001100020054108200041ec016a220441081023417341a897c0004114103720044108" - "200541081023417341bc97c00041141037200041003b01f80120054108200441082001410241001024417341e08dc0" - "0041141037200041003b01f801200441082005410820014102410010244173418181c00041141037200041003b01f8" - "0120054108200441082001410241001025417341aa80c00041141037200041003b01f8012004410820054108200141" - "0241001025417341e08cc00041141037200041003b01f80120054108200441082001410241001026417341bb84c000" - "41151037200041003b01f80120044108200541082001410241001026417341c98bc00041151037200041003b01f801" - "20054108200441082001410241001027417341a683c00041141037200041003b01f801200441082005410820014102" - "41001027417341c88ac00041141037200041003b01f80120054108410320014102410010284173419488c000411410" - "37200041003b01f8012005410841032001410241001029417341ff85c0004113103720004200370390022000420037" - "0388022000420037038002200042003703f801200341142003411420014120102a417141c088c000411b1037200042" - "003703900220004200370388022000420037038002200042003703f801200341142003411420014120102b417141bc" - "82c00041211037200042003703900220004200370388022000420037038002200042003703f8012003411420034114" - "20014120102c417141928dc000411e1037200042003703900220004200370388022000420037038002200042003703" - "f801200341142003411420014120102d417141928fc000411a10372000420037039002200042003703880220004200" - "37038002200042003703f801200341142003411420014120102e417141b88dc000411b103720004200370390022000" - "4200370388022000420037038002200042003703f80120034114200341142003411420014120102f417141a291c000" - "411c1037200042003703900220004200370388022000420037038002200042003703f8012003411420034114200141" - "201030417141ef81c00041281037200042003703900220004200370388022000420037038002200042003703f80120" - "03411420034114200141201031417141b68fc000411b10372000420037039002200042003703880220004200370380" - "02200042003703f8012003411420034114200141201032417141a989c000411a1037200220002802a0014100100841" - "7141d097c000411b1037200041003b01f80120034114200220002802a001200141021017417141de87c000411a1037" - "200041003b01f801200220002802a001200141021018417141e285c000411d1037200041003b01f801200220002802" - "a001200141021019417141da8ec000411c1037200220002802a001101a417141eb97c000411c1037200220002802a0" - "01101b4171418798c000411f1037200041003602f801200220002802a00120014104101c417141f48dc000411d1037" - "200041003b01f801200220002802a001200141021007417141ff89c00041241037200041808080083602f401200041" - "003b01f801200220002802a001200041f4016a2205410420014102101d417141f48cc000411e1037200041003b01f8" - "01200220002802a00122062003411420022006200141021021417141dd84c00041241037200041003b01f801200341" - "14200220002802a001220620022006200141021021417141cb81c00041241037200041003b01f801200220002802a0" - "0120034114200141021033417141dd83c00041221037200041003b01f80120034114200220002802a0012001410210" - "33417141de8bc00041221037200041003b01f801200220002802a00120034114200141021034417141c880c0004129" - "1037200041003b01f80120034114200220002802a001200141021034417141a08bc00041291037200041003b01f801" - "200220002802a001200141021035417141f887c000411c1037200041003b01f801200220002802a001200541042001" - "4102102a417141f18ac000411f1037200041003b01f801200220002802a00120034114418795c00041142001410210" - "1f4171419286c00041231037200041003b01f80120034114200220002802a001418795c000411420014102101f4171" - "418185c00041231037200041003b01f801200220002802a0012005410420014102102b4171419782c0004125103720" - "0041003b01f80120074118200220002802a001200141021022417141ac8cc00041201037200041003b01f801200220" - "002802a0012005410420014102102c417141c590c00041221037200041003b01f801200220002802a0012005410420" - "014102102d417141e189c000411e1037200041003b01f801200220002802a0012005410420014102102e417141bf87" - "c000411f1037200041003b01f801200220002802a001200341142005410420014102102f417141e786c00041211037" - "200041003b01f80120034114200220002802a0012005410420014102102f4171419a84c00041211037200041003b01" - "f801200220002802a00120054104200141021030417141808cc000412c1037200041003b01f801200220002802a001" - "200141021036417141f78fc00041201037200041003b01f801200220002802a00120054104200141021031417141d8" - "8fc000411f1037200041003b01f801200220002802a00120054104200141021032417141c485c000411e1037200041" - "003b01f801200220002802a00141a698c0004120200141021017417141f182c000411d103741b693c000410d410420" - "0220002802a001100041b6a7abdd03410d410741a698c0004120100041b6a7abdd03410d410320044108100041b6a7" - "abdd03410d410420034114100041b6a7abdd03410d410541cb93c00041081000200220002802a00141072002418108" - "1000200042013703f8012002418108410120014108100041b693c000418108410320044108100041b693c000418108" - "410420034114100041b693c000418108410541cb93c0004108100041b693c000410d4105200220002802a001100020" - "0041003b019e02200220002802a001200341142000419e026a41021022417141f188c000411d103741b693c000410d" - "41e300200220002802a0011000410141004104200341141000200041a0026a240041010f0b000b0bb1180200418080" - "c0000b9b1554455354204641494c4544666c6f61745f66726f6d5f75696e745f6c656e5f6f6f6274785f696e6e6572" - "666c6f61745f7375625f6f6f625f736c69636531616d6d5f69645f6d70746465706f7369745f707265617574685f69" - "645f77726f6e675f73697a655f6163636f756e745f696431706172656e745f6c6467725f68617368666c6f61745f61" - "64645f6f6f625f736c6963653274727573746c696e655f69645f77726f6e675f6c656e5f63757272656e637974785f" - "6669656c645f696e76616c69645f736669656c6463726564656e7469616c5f69645f77726f6e675f73697a655f6163" - "636f756e745f6964327065726d697373696f6e65645f646f6d61696e5f69645f77726f6e675f73697a655f75696e74" - "33326d70745f69737375616e63655f69645f77726f6e675f73697a655f6163636f756e745f69646d70745f69737375" - "616e63655f69645f77726f6e675f73697a655f75696e743332616d6d5f69645f746f6f5f6269675f736c6963656e66" - "745f7572695f77726f6e675f73697a655f6163636f756e745f69646163636f756e74726f6f745f69645f77726f6e67" - "5f6c656e666c6f61745f6469765f6f6f625f736c696365316e66745f73657269616c7368613531325f68616c665f74" - "6f6f5f6269675f736c69636564656c65676174655f69645f77726f6e675f73697a655f6163636f756e745f69643162" - "6173655f6665656c655f6669656c647368613531325f68616c667061796368616e5f69645f77726f6e675f73697a65" - "5f6163636f756e745f696432666c6f61745f6d756c745f6f6f625f736c69636531686f6d655f6c655f696e6e657263" - "726564656e7469616c5f69645f77726f6e675f73697a655f6163636f756e745f69643174727573746c696e655f6964" - "5f77726f6e675f73697a655f6163636f756e745f696432666c6f61745f66726f6d5f75696e745f77726f6e675f6c65" - "6e5f75696e7436347661756c745f69645f77726f6e675f73697a655f6163636f756e745f69646e66745f6973737565" - "725f77726f6e675f73697a655f75696e74323536666c6f61745f706f775f6f6f625f736c69636574727573746c696e" - "655f69645f77726f6e675f73697a655f6163636f756e745f6964316c655f6669656c645f696e76616c69645f736669" - "656c6463726564656e7469616c5f69645f746f6f5f6269675f736c6963657061796368616e5f69645f77726f6e675f" - "73697a655f6163636f756e745f696431616d6d5f69645f6c656e5f77726f6e675f7872705f63757272656e63795f6c" - "656e74785f696e6e65725f746f6f5f6269675f736c6963656f7261636c655f69645f77726f6e675f73697a655f6163" - "636f756e745f69646e66745f7572695f77726f6e675f73697a655f75696e743235366469645f69645f77726f6e675f" - "73697a655f6163636f756e745f6964666c6f61745f726f6f745f6f6f625f736c696365706172656e745f6c6467725f" - "686173685f6e65675f6c656e657363726f775f69645f77726f6e675f73697a655f75696e7433326c655f696e6e6572" - "5f746f6f5f6269675f736c6963656d70746f6b656e5f69645f6d707469645f77726f6e675f6c656e677468616d6d5f" - "69645f6c656e5f77726f6e675f6c656e5f6173736574327661756c745f69645f77726f6e675f73697a655f75696e74" - "33326d70746f6b656e5f69645f746f6f5f6269675f736c6963655f6d707469646f666665725f69645f77726f6e675f" - "73697a655f6163636f756e745f69646163636f756e74726f6f745f69645f77726f6e675f73697a655f6163636f756e" - "745f6964616d6d5f69645f6c656e5f77726f6e675f6e6f6e5f7872705f63757272656e63795f6c656e666c6f61745f" - "6469765f6f6f625f736c69636532616d6d5f69645f6c656e5f6f6f625f617373657432657363726f775f69645f7772" - "6f6e675f73697a655f6163636f756e745f6964706172656e745f6c6467725f74696d656465706f7369745f70726561" - "7574685f69645f77726f6e675f73697a655f6163636f756e745f696432666c6f61745f6d756c745f6f6f625f736c69" - "63653264656c65676174655f69645f77726f6e675f73697a655f6163636f756e745f6964327065726d697373696f6e" - "65645f646f6d61696e5f69645f77726f6e675f73697a655f6163636f756e745f69646d70746f6b656e5f69645f7772" - "6f6e675f73697a655f6163636f756e745f6964636865636b5f69645f6f6f625f6c656e5f753332666c6f61745f7375" - "625f6f6f625f736c69636532636865636b5f69645f77726f6e675f73697a655f6163636f756e745f69646e66745f6f" - "666665725f69645f77726f6e675f73697a655f75696e7433326c655f696e6e65726f7261636c655f69645f77726f6e" - "675f73697a655f75696e743332686f6d655f6c655f6669656c64666c6f61745f6164645f6f6f625f736c696365316e" - "66745f73657269616c5f77726f6e675f73697a655f75696e74323536636865636b5f69645f77726f6e675f6c656e5f" - "7533326163636f756e74726f6f745f69645f6c656e5f6f6f62706172656e745f6c6467725f686173685f6c656e5f74" - "6f6f5f6c6f6e676e66745f7461786f6e5f77726f6e675f73697a655f75696e74323536686f6d655f6c655f6669656c" - "645f696e76616c69645f736669656c646f666665725f69645f77726f6e675f73697a655f75696e7433326e66745f69" - "73737565727469636b65745f69645f77726f6e675f73697a655f75696e7433326e66745f7572697469636b65745f69" - "645f77726f6e675f73697a655f6163636f756e745f69647369676e6572735f69645f77726f6e675f73697a655f6163" - "636f756e745f69646e66745f7461786f6e6c6467725f696e646578686f6d655f6c655f696e6e65725f746f6f5f6269" - "675f736c6963656e66745f6f666665725f69645f77726f6e675f73697a655f6163636f756e745f6964706172656e74" - "5f6c6467725f686173685f6275665f746f6f5f736d616c6c74727573746c696e655f69645f6c656e5f6f6f625f6375" - "7272656e63797061796368616e5f69645f77726f6e675f73697a655f75696e7433326572726f725f636f64653d2424" - "242424205354415254494e47205741534d20455845435554494f4e202424242424746573745f616d656e646d656e74" - "616d656e646d656e745f656e61626c656463616368655f6c6574785f6172725f6c656e686f6d655f6c655f6172725f" - "6c656e6c655f6172725f6c656e74785f696e6e65725f6172725f6c656e686f6d655f6c655f696e6e65725f6172725f" - "6c656e6c655f696e6e65725f6172725f6c656e7365745f6461746174657374206d6573736167657465737420707562" - "6b657974657374207369676e6174757265636865636b5f7369676e66745f666c6167736e66745f786665725f666565" - "74657374696e67207472616365400000000000005f4000000000000000706172656e745f6c6467725f686173685f6e" - "65675f70747274785f6172725f6c656e5f696e76616c69645f736669656c6474785f696e6e65725f6172725f6c656e" - "5f6e65675f70747274785f696e6e65725f6172725f6c656e5f6e65675f6c656e74785f696e6e65725f6172725f6c65" - "6e5f746f6f5f6c6f6e6774785f696e6e65725f6172725f6c656e5f7074725f6f6f6263616368655f6c655f7074725f" - "6f6f6263616368655f6c655f77726f6e675f6c656e55534430303030303030303030303030303030300041c395c000" - "0b8303686f6d655f6c655f6172725f6c656e5f696e76616c69645f736669656c646c655f6172725f6c656e5f696e76" - "616c69645f736669656c64616d656e646d656e745f656e61626c65645f746f6f5f6269675f736c696365616d656e64" - "6d656e745f656e61626c65645f746f6f5f6c6f6e6774785f696e6e65725f6172725f6c656e5f746f6f5f6269675f73" - "6c696365686f6d655f6c655f696e6e65725f6172725f6c656e5f746f6f5f6269675f736c6963656c655f696e6e6572" - "5f6172725f6c656e5f746f6f5f6269675f736c6963657365745f646174615f746f6f5f6269675f736c696365666c6f" - "61745f636d705f6f6f625f736c69636531666c6f61745f636d705f6f6f625f736c6963653263616368655f6c655f77" - "726f6e675f73697a655f75696e743235366e66745f666c6167735f77726f6e675f73697a655f75696e743235366e66" - "745f786665725f6665655f77726f6e675f73697a655f75696e74323536303030303030303030303030303030303030" - "3030303030303030303030303031004d0970726f64756365727302086c616e6775616765010452757374000c70726f" - "6365737365642d6279010572757374631d312e39352e30202835393830373631366520323032362d30342d31342900" - "2c0f7461726765745f6665617475726573022b0f6d757461626c652d676c6f62616c732b087369676e2d657874"; + "0a666c6f61745f6d756c74000408686f73745f6c696209666c6f61745f646976000408686f73745f6c696209666c6f" + "61745f706f77000008686f73745f6c696209657363726f775f6964000008686f73745f6c69620f6d70745f69737375" + "616e63655f6964000008686f73745f6c69620c6e66745f6f666665725f6964000008686f73745f6c6962086f666665" + "725f6964000008686f73745f6c6962096f7261636c655f6964000008686f73745f6c69620a7061796368616e5f6964" + "000508686f73745f6c6962167065726d697373696f6e65645f646f6d61696e5f6964000008686f73745f6c69620974" + "69636b65745f6964000008686f73745f6c6962087661756c745f6964000008686f73745f6c69620b64656c65676174" + "655f6964000008686f73745f6c6962126465706f7369745f707265617574685f6964000008686f73745f6c69620664" + "69645f6964000208686f73745f6c69620a7369676e6572735f69640002030403090a0b05030100110619037f014180" + "80c0000b7f0041c698c0000b7f0041d098c0000b073504066d656d6f727902000d657363726f775f66696e69736800" + "380a5f5f646174615f656e6403010b5f5f686561705f6261736503020aa22e037201017f230041106b220424000240" + "02402000200147044020022003410741014100100020004100480d0120042000ad3703080c020b20042000ac370308" + "200220034101200441086a41081000200441106a24000f0b20042000ac3703080b418080c000410b4101200441086a" + "41081000000b2801017f230041106b2201240020012000ac37030841aa91c000410b4101200141086a41081000000b" + "832d02087f017e230041a0026b2200240041b591c0004123410741014100100020004100360260200041e0006a2201" + "41041001410441888ec000410a103620004100360260200141041002410441a683c000411010362000420037037820" + "0042003703702000420037036820004200370360200141201003412041a185c0004110103620004100360260200141" + "041004410441d888c000410810362000428182848890a0c080013703202000428182848890a0c08001370318200042" + "8182848890a0c080013703102000428182848890a0c0800137030841d891c000410e1005410141e691c00041111036" + "200041086a41201005410141e691c00041111036200041003602702000420037036820004200370360024002404181" + "802020014114100622014100480d00200141144b0440417321010c010b20014114460d0141808080807821010b2001" + "1037000b2000200029006c3700fd01200020002900673703f801200020002d00623a002e200020002f01603b012c20" + "00200028006336002f200020002903f801370033200020002900fd0137003820004200370378200042003703702000" + "42003703682000420037036002402000412c6a4114200041e0006a4120100722014120470440200141004e0d012001" + "1037000b200020002d00623a0042200020002f01603b01402000200029006f22083703800220002000280063360043" + "200020002900673700472000200837004f20002000290077370057200020002d007f3a005f200041406b4120410010" + "08410141f791c0004108103620004100360270200042003703682000420037036041818020200041e0006a22024114" + "1009411441a68fc000410d103620004100360270200042003703682000420037036041014181802020024114100a41" + "1441bf8cc0004108103602404100200041e4006a22046b410371220320046a220120044d0d00200304402003210503" + "40200441003a0000200441016a2104200541016b22050d000b0b200341016b4107490d000340200441003a00002004" + "41076a41003a0000200441066a41003a0000200441056a41003a0000200441046a41003a0000200441036a41003a00" + "00200441026a41003a0000200441016a41003a0000200441086a22042001470d000b0b2001413c20036b2203417c71" + "6a220420014b0440034020014100360200200141046a22012004490d000b0b024020042003410371220320046a2205" + "4f0d002003220104400340200441003a0000200441016a2104200141016b22010d000b0b200341016b4107490d0003" + "40200441003a0000200441076a41003a0000200441066a41003a0000200441056a41003a0000200441046a41003a00" + "00200441036a41003a0000200441026a41003a0000200441016a41003a0000200441086a22042005470d000b0b2000" + "41043602a00120004181802036026020004100360288022000420037038002200042003703f80120024104200041f8" + "016a22014114100b4114418388c0004108103620004100360288022000420037038002200042003703f80120022000" + "2802a00120014114100c411441e085c000410d103620004100360288022000420037038002200042003703f8014101" + "200220002802a00120014114100d4114418b86c000410810364189803c100e412041ff91c000410a10364189803c10" + "0f4120418992c000410f103641014189803c10104120419892c000410a1036200220002802a0011011412041a292c0" + "0041101036200220002802a0011012412041b292c000411510364101200220002802a0011013412041c792c0004110" + "10362000412c6a220341141014411441d792c000410810362000420037039002200042003703880220004200370380" + "02200042003703f801200220002802a001200141201015412041db82c000410b103641df92c000410c41eb92c00041" + "0b41f692c000410e10164101418493c00041091036200020002903203703c001200020002903183703b80120002000" + "2903103703b001200020002903083703a801200041003b0188022000420037038002200042003703f8012003411420" + "0041a8016a220541202001411210174112418c84c00041071036200041003602880220004200370380022000420037" + "03f801200541202001411410184114419386c000410a1036200041003602f80120054120200141041019410441c48a" + "c0004109103620054120101a4108418d93c0004109103620054120101b410a419693c000410c1036200041003602f8" + "012005412020014104101c410441818fc000410a103641a293c000410d410420034114100041a293c000410d410541" + "af93c0004108100041a293c000410d410541b793c00041081000417f41041003417141bf93c0004118103620004100" + "3602f8012001417f1003417141e686c00041181036200041003a00fa01200041003b01f801200141031003417d41f8" + "80c000411e1036200041003602f8012001418094ebdc0310034173419790c000411d10364102100e416f41d793c000" + "41191036417f20002802a0011011417141f093c000411810362002417f10114171418894c000411810362002418108" + "1011417441a094c00041191036200041e094ebdc036a220420002802a0011011417341b994c0004118103620004200" + "3703900220004200370388022000420037038002200042003703f801200341142004410820014120101d417341e283" + "c00041141036200042003703900220004200370388022000420037038002200042003703f801200341142003411420" + "014120101d417141eb84c00041161036200042003703900220004200370388022000420037038002200042003703f8" + "0120044108200141204100101e417341ea8ec000411710362000420037039002200042003703880220004200370380" + "02200042003703f801200220002802a001200141204100101e4171418185c00041201036200420002802a001410110" + "08417341d194c00041101036200220002802a00141011008417141e194c00041121036200042003703900220004200" + "370388022000420037038002200042003703f801200420002802a0012001412010074173418b8bc000411610362000" + "42003703900220004200370388022000420037038002200042003703f801200220002802a001200141201007417141" + "b683c00041181036200042003703900220004200370388022000420037038002200042003703f80120034114200341" + "14200420002802a00120014120101f417341c78cc000411d1036200042003703900220004200370388022000420037" + "038002200042003703f8012003411420034114200220002802a00120014120101f417141e489c000411f1036200042" + "003703900220004200370388022000420037038002200042003703f80141b298c0004114200420002802a001200141" + "201020417341a688c00041151036200042003703900220004200370388022000420037038002200042003703f80141" + "b298c0004114200220002802a001200141201020417141c787c000411b103620004200370390022000420037038802" + "2000420037038002200042003703f80141b298c000411441f394c0004114200141201020417141bb85c00041251036" + "200042003703900220004200370388022000420037038002200042003703f801418795c000412841b298c000411420" + "0141201020417141c98bc000412110362000200028013c3602dc01200020002901343702d4012000200029012c3702" + "cc01200041808080083602c801200041003b01f801200041c8016a2207411841b298c0004114200141021020417141" + "b185c000410a10362000422a3703e001200420002802a0014101200041e0016a41081000200041003b01f801410220" + "0141021006416f41af80c00041171036200041003b01f8014102200141021009416f419787c000411c103620004100" + "3b01f8014101410220014102100a416f41e682c000411710364102100e416f41d793c000411910364102100f416f41" + "af95c000411e1036410141021010416f41cd95c0004119103641d891c0004181081005417441e695c000411f103641" + "d891c00041c10010054174418596c000411a1036200041003b01f801200241810820014102100b417441f683c00041" + "161036200041003b01f801200241810820014102100c4174418b88c000411b1036200041003b01f801410120024181" + "0820014102100d4174419384c00041161036200241810810114174419f96c000411e103620024181081012417441bd" + "96c00041231036410120024181081013417441e096c000411e103620024181081014417441fe96c0004116103641a2" + "93c00041810841eb92c000410b41f692c000410e10164174418493c0004109103641a293c000410d41eb92c0004181" + "0841f692c000410e10164174418493c0004109103641a293c000410d41eb92c000410b41f692c00041810810164174" + "418493c00041091036200041003b01f8012002418108200141021015417441fe86c00041191036200041003b01f801" + "41b298c00041810841b298c0004114200141021020417441b58bc00041141036200041003b01f80120034114200341" + "142002418108200141021021417441c082c000411b1036200041003b01f80120074181082003411420014102102241" + "7441da80c000411e103641a293c000410d4107200420002802a0011000200042d487b6f4c7d4b1c0003700ec0141a2" + "93c000410d4103200041ec95ebdc036a22054108100041a293c000410d4105200420002802a0011000200541082000" + "41ec016a2204410810234173419497c0004114103620044108200541081023417341a897c00041141036200041003b" + "01f80120054108200441082001410241001024417341ac82c00041141036200041003b01f801200441082005410820" + "01410241001024417341ce83c00041141036200041003b01f80120054108200441082001410241001025417341a18b" + "c00041141036200041003b01f80120044108200541082001410241001025417341c680c00041141036200041003b01" + "f80120054108200441082001410241001026417341cd8ac00041151036200041003b01f80120044108200541082001" + "410241001026417341c781c00041151036200041003b01f80120054108200441082001410241001027417341b387c0" + "0041141036200041003b01f801200441082005410820014102410010274173419d86c00041141036200041003b01f8" + "0120054108410320014102410010284173419681c00041131036200042003703900220004200370388022000420037" + "038002200042003703f8012003411420034114200141201029417141ea8bc000411b10362000420037039002200042" + "00370388022000420037038002200042003703f801200341142003411420014120102a417141e287c0004121103620" + "0042003703900220004200370388022000420037038002200042003703f801200341142003411420014120102b4171" + "41a981c000411e1036200042003703900220004200370388022000420037038002200042003703f801200341142003" + "411420014120102c417141b48ec000411a103620004200370390022000420037038802200042003703800220004200" + "3703f801200341142003411420014120102d4171418b8fc000411b1036200042003703900220004200370388022000" + "420037038002200042003703f80120034114200341142003411420014120102e417141ce8ec000411c103620004200" + "3703900220004200370388022000420037038002200042003703f801200341142003411420014120102f417141e08d" + "c00041281036200042003703900220004200370388022000420037038002200042003703f801200341142003411420" + "0141201030417141b186c000411b1036200042003703900220004200370388022000420037038002200042003703f8" + "012003411420034114200141201031417141b490c000411a1036200220002802a00141001008417141bc97c000411b" + "1036200041003b01f80120034114200220002802a001200141021017417141cc86c000411a1036200041003b01f801" + "200220002802a001200141021018417141858cc000411d1036200041003b01f801200220002802a001200141021019" + "417141ce90c000411c1036200220002802a001101a417141d797c000411c1036200220002802a001101b417141f397" + "c000411f1036200041003602f801200220002802a00120014104101c417141a28cc000411d1036200041003b01f801" + "200220002802a0012001410210074171418b80c00041241036200041808080083602f401200041003b01f801200220" + "002802a001200041f4016a2205410420014102101d4171419f8dc000411e1036200041003b01f801200220002802a0" + "0122062003411420022006200141021021417141d28fc00041241036200041003b01f80120034114200220002802a0" + "01220620022006200141021021417141dc81c00041241036200041003b01f801200220002802a00120034114200141" + "021032417141838ac00041221036200041003b01f80120034114200220002802a001200141021032417141a984c000" + "41221036200041003b01f801200220002802a00120034114200141021033417141fd82c00041291036200041003b01" + "f80120034114200220002802a001200141021033417141e28ac00041291036200041003b01f801200220002802a001" + "2001410210344171418089c000411c1036200041003b01f801200220002802a00120054104200141021029417141b3" + "8fc000411f1036200041003b01f801200220002802a0012003411441f394c000411420014102101f417141c189c000" + "41231036200041003b01f80120034114200220002802a00141f394c000411420014102101f417141bd8dc000412310" + "36200041003b01f801200220002802a0012005410420014102102a4171419c89c00041251036200041003b01f80120" + "074118200220002802a001200141021022417141cb84c00041201036200041003b01f801200220002802a001200541" + "0420014102102b417141928ec00041221036200041003b01f801200220002802a0012005410420014102102c417141" + "ed85c000411e1036200041003b01f801200220002802a0012005410420014102102d417141a58ac000411f10362000" + "41003b01f801200220002802a001200341142005410420014102102e417141f68fc00041211036200041003b01f801" + "20034114200220002802a0012005410420014102102e417141ea90c00041211036200041003b01f801200220002802" + "a0012005410420014102102f4171418082c000412c1036200041003b01f801200220002802a0012001410210354171" + "41e088c00041201036200041003b01f801200220002802a001200541042001410210304171418b91c000411f103620" + "0041003b01f801200220002802a00120054104200141021031417141818dc000411e1036200041003b01f801200220" + "002802a001419298c0004120200141021017417141e48cc000411d103641a293c000410d4104200220002802a00110" + "0041a2a7abdd03410d4107419298c0004120100041a2a7abdd03410d410320044108100041a2a7abdd03410d410420" + "034114100041a2a7abdd03410d410541b793c00041081000200220002802a001410720024181081000200042013703" + "f8012002418108410120014108100041a293c000418108410320044108100041a293c0004181084104200341141000" + "41a293c000418108410541b793c0004108100041a293c000410d4105200220002802a0011000200041003b019e0220" + "0220002802a001200341142000419e026a41021022417141bb88c000411d103641a293c000410d41e3002002200028" + "02a0011000410141004104200341141000200041a0026a240041010f0b000b0b9d180200418080c0000b8715544553" + "54204641494c45446163636f756e74726f6f745f69645f77726f6e675f73697a655f6163636f756e745f696474785f" + "6669656c645f696e76616c69645f736669656c64666c6f61745f7375625f6f6f625f736c696365326d70746f6b656e" + "5f69645f746f6f5f6269675f736c6963655f6d70746964706172656e745f6c6467725f686173685f6275665f746f6f" + "5f736d616c6c666c6f61745f706f775f6f6f625f736c6963656e66745f6f666665725f69645f77726f6e675f73697a" + "655f75696e743332666c6f61745f6d756c745f6f6f625f736c6963653263726564656e7469616c5f69645f77726f6e" + "675f73697a655f6163636f756e745f6964327065726d697373696f6e65645f646f6d61696e5f69645f77726f6e675f" + "73697a655f6163636f756e745f6964666c6f61745f6164645f6f6f625f736c6963653163726564656e7469616c5f69" + "645f746f6f5f6269675f736c6963657368613531325f68616c666c655f6669656c645f696e76616c69645f73666965" + "6c646465706f7369745f707265617574685f69645f77726f6e675f73697a655f6163636f756e745f69643170617265" + "6e745f6c6467725f74696d656163636f756e74726f6f745f69645f77726f6e675f6c656e666c6f61745f6164645f6f" + "6f625f736c69636532636865636b5f69645f6f6f625f6c656e5f75333274785f696e6e65725f746f6f5f6269675f73" + "6c6963656e66745f7572696c655f696e6e65725f746f6f5f6269675f736c69636564656c65676174655f69645f7772" + "6f6e675f73697a655f6163636f756e745f6964326d70746f6b656e5f69645f77726f6e675f73697a655f6163636f75" + "6e745f6964636865636b5f69645f77726f6e675f6c656e5f753332666c6f61745f66726f6d5f75696e745f77726f6e" + "675f6c656e5f75696e743634706172656e745f6c6467725f68617368616d6d5f69645f6d7074616d6d5f69645f6c65" + "6e5f77726f6e675f6e6f6e5f7872705f63757272656e63795f6c656e686f6d655f6c655f696e6e65726f666665725f" + "69645f77726f6e675f73697a655f6163636f756e745f69646c655f696e6e65726e66745f697373756572666c6f6174" + "5f6469765f6f6f625f736c696365327469636b65745f69645f77726f6e675f73697a655f75696e7433326e66745f75" + "72695f77726f6e675f73697a655f75696e74323536706172656e745f6c6467725f686173685f6e65675f6c656e7368" + "613531325f68616c665f746f6f5f6269675f736c696365686f6d655f6c655f6669656c645f696e76616c69645f7366" + "69656c64666c6f61745f6469765f6f6f625f736c69636531616d6d5f69645f6c656e5f77726f6e675f6c656e5f6173" + "736574326d70745f69737375616e63655f69645f77726f6e675f73697a655f75696e74333274785f696e6e6572686f" + "6d655f6c655f696e6e65725f746f6f5f6269675f736c696365616d6d5f69645f6c656e5f6f6f625f6173736574326d" + "70746f6b656e5f69645f6d707469645f77726f6e675f6c656e677468626173655f6665657369676e6572735f69645f" + "77726f6e675f73697a655f6163636f756e745f69646469645f69645f77726f6e675f73697a655f6163636f756e745f" + "69646d70745f69737375616e63655f69645f77726f6e675f73697a655f6163636f756e745f696474727573746c696e" + "655f69645f77726f6e675f73697a655f6163636f756e745f69643174727573746c696e655f69645f77726f6e675f6c" + "656e5f63757272656e637964656c65676174655f69645f77726f6e675f73697a655f6163636f756e745f6964316f72" + "61636c655f69645f77726f6e675f73697a655f6163636f756e745f69646e66745f7461786f6e666c6f61745f6d756c" + "745f6f6f625f736c696365316465706f7369745f707265617574685f69645f77726f6e675f73697a655f6163636f75" + "6e745f6964326163636f756e74726f6f745f69645f6c656e5f6f6f62666c6f61745f7375625f6f6f625f736c696365" + "31616d6d5f69645f746f6f5f6269675f736c696365616d6d5f69645f6c656e5f77726f6e675f7872705f6375727265" + "6e63795f6c656e657363726f775f69645f77726f6e675f73697a655f75696e7433326e66745f6973737565725f7772" + "6f6e675f73697a655f75696e743235366e66745f73657269616c5f77726f6e675f73697a655f75696e743235366c65" + "5f6669656c6474727573746c696e655f69645f6c656e5f6f6f625f63757272656e63796e66745f7572695f77726f6e" + "675f73697a655f6163636f756e745f69647661756c745f69645f77726f6e675f73697a655f6163636f756e745f6964" + "636865636b5f69645f77726f6e675f73697a655f6163636f756e745f696474727573746c696e655f69645f77726f6e" + "675f73697a655f6163636f756e745f6964327065726d697373696f6e65645f646f6d61696e5f69645f77726f6e675f" + "73697a655f75696e7433326c6467725f696e6465786e66745f6f666665725f69645f77726f6e675f73697a655f6163" + "636f756e745f69646f666665725f69645f77726f6e675f73697a655f75696e7433327061796368616e5f69645f7772" + "6f6e675f73697a655f75696e743332666c6f61745f66726f6d5f75696e745f6c656e5f6f6f626e66745f7365726961" + "6c6f7261636c655f69645f77726f6e675f73697a655f75696e743332686f6d655f6c655f6669656c64657363726f77" + "5f69645f77726f6e675f73697a655f6163636f756e745f696463726564656e7469616c5f69645f77726f6e675f7369" + "7a655f6163636f756e745f6964317061796368616e5f69645f77726f6e675f73697a655f6163636f756e745f696431" + "706172656e745f6c6467725f686173685f6c656e5f746f6f5f6c6f6e677661756c745f69645f77726f6e675f73697a" + "655f75696e7433326e66745f7461786f6e5f77726f6e675f73697a655f75696e743235367061796368616e5f69645f" + "77726f6e675f73697a655f6163636f756e745f6964327469636b65745f69645f77726f6e675f73697a655f6163636f" + "756e745f69646572726f725f636f64653d2424242424205354415254494e47205741534d20455845435554494f4e20" + "2424242424746573745f616d656e646d656e74616d656e646d656e745f656e61626c656463616368655f6c6574785f" + "6172725f6c656e686f6d655f6c655f6172725f6c656e6c655f6172725f6c656e74785f696e6e65725f6172725f6c65" + "6e686f6d655f6c655f696e6e65725f6172725f6c656e6c655f696e6e65725f6172725f6c656e7365745f6461746174" + "657374206d65737361676574657374207075626b657974657374207369676e6174757265636865636b5f7369676e66" + "745f666c6167736e66745f786665725f66656574657374696e67207472616365400000000000005f40000000000000" + "00706172656e745f6c6467725f686173685f6e65675f70747274785f6172725f6c656e5f696e76616c69645f736669" + "656c6474785f696e6e65725f6172725f6c656e5f6e65675f70747274785f696e6e65725f6172725f6c656e5f6e6567" + "5f6c656e74785f696e6e65725f6172725f6c656e5f746f6f5f6c6f6e6774785f696e6e65725f6172725f6c656e5f70" + "74725f6f6f6263616368655f6c655f7074725f6f6f6263616368655f6c655f77726f6e675f6c656e55534430303030" + "303030303030303030303030300041af95c0000b8303686f6d655f6c655f6172725f6c656e5f696e76616c69645f73" + "6669656c646c655f6172725f6c656e5f696e76616c69645f736669656c64616d656e646d656e745f656e61626c6564" + "5f746f6f5f6269675f736c696365616d656e646d656e745f656e61626c65645f746f6f5f6c6f6e6774785f696e6e65" + "725f6172725f6c656e5f746f6f5f6269675f736c696365686f6d655f6c655f696e6e65725f6172725f6c656e5f746f" + "6f5f6269675f736c6963656c655f696e6e65725f6172725f6c656e5f746f6f5f6269675f736c6963657365745f6461" + "74615f746f6f5f6269675f736c696365666c6f61745f636d705f6f6f625f736c69636531666c6f61745f636d705f6f" + "6f625f736c6963653263616368655f6c655f77726f6e675f73697a655f75696e743235366e66745f666c6167735f77" + "726f6e675f73697a655f75696e743235366e66745f786665725f6665655f77726f6e675f73697a655f75696e743235" + "363030303030303030303030303030303030303030303030303030303030303031004d0970726f6475636572730208" + "6c616e6775616765010452757374000c70726f6365737365642d6279010572757374631d312e39352e302028353938" + "30373631366520323032362d30342d313429002c0f7461726765745f6665617475726573022b0f6d757461626c652d" + "676c6f62616c732b087369676e2d657874"; extern std::string const kFloatTestsWasmHex = "0061736d0100000001490960057f7f7f7f7f017f60077f7f7f7f7f7f7f017f60067f7f7f7f7f7f017f60047e7f7f7f" diff --git a/src/tests/libxrpl/tx/wasm/MockHostFunctions.h b/src/tests/libxrpl/tx/wasm/MockHostFunctions.h index b00fd055ae..9910982b4e 100644 --- a/src/tests/libxrpl/tx/wasm/MockHostFunctions.h +++ b/src/tests/libxrpl/tx/wasm/MockHostFunctions.h @@ -398,12 +398,6 @@ struct MockHostFunctions : HostFunctions (Slice const& x, Slice const& y, std::int32_t mode), (const, override)); - MOCK_METHOD( - (std::expected), - floatRoot, - (Slice const& x, std::int32_t n, std::int32_t mode), - (const, override)); - MOCK_METHOD( (std::expected), floatPower, diff --git a/src/tests/libxrpl/tx/wasm/Preflight.cpp b/src/tests/libxrpl/tx/wasm/Preflight.cpp index 24b358b269..2309fafd46 100644 --- a/src/tests/libxrpl/tx/wasm/Preflight.cpp +++ b/src/tests/libxrpl/tx/wasm/Preflight.cpp @@ -62,8 +62,8 @@ TEST_F(PreflightTest, RunnableContractPasses) TEST_F(PreflightTest, GarbageIsRefused) { - EXPECT_EQ(preflightBytes(Bytes{}), temBAD_WASM); - EXPECT_EQ(preflightBytes(Bytes{0x00, 0x61, 0x73, 0x6d}), temBAD_WASM); + EXPECT_EQ(preflightBytes(Bytes{}), temINVALID_BYTECODE); + EXPECT_EQ(preflightBytes(Bytes{0x00, 0x61, 0x73, 0x6d}), temINVALID_BYTECODE); } // The engine takes wasm binaries, and text is not one. The suite writes its modules as text @@ -73,7 +73,7 @@ TEST_F(PreflightTest, TextFormatModuleIsRefused) { Bytes const text{kRunnableWat.begin(), kRunnableWat.end()}; - EXPECT_EQ(preflightBytes(text), temBAD_WASM); + EXPECT_EQ(preflightBytes(text), temINVALID_BYTECODE); EXPECT_EQ(preflight(kRunnableWat), tesSUCCESS) << "the same module, assembled first"; } @@ -86,7 +86,7 @@ TEST_F(PreflightTest, ImportOfAnUnknownHostFunctionIsRefused) (func (export "escrow_finish") (result i32) (call $f (i32.const 0)))) )wat"; - EXPECT_EQ(preflight(wat), temBAD_WASM); + EXPECT_EQ(preflight(wat), temINVALID_BYTECODE); EXPECT_THAT(logged(), testing::HasSubstr("no host function 'no_such_function'")); } @@ -101,7 +101,7 @@ TEST_F(PreflightTest, ImportFromAnotherModuleIsRefused) (func (export "escrow_finish") (result i32) (i32.const 0))) )wat"; - EXPECT_EQ(preflight(wat), temBAD_WASM); + EXPECT_EQ(preflight(wat), temINVALID_BYTECODE); EXPECT_THAT(logged(), testing::HasSubstr("is not from 'host_lib'")); } @@ -115,7 +115,7 @@ TEST_F(PreflightTest, MemoryPastTheCapIsRefused) (func (export "escrow_finish") (result i32) (i32.const 0))) )wat"; - EXPECT_EQ(preflight(tooMuch), temBAD_WASM); + EXPECT_EQ(preflight(tooMuch), temINVALID_BYTECODE); EXPECT_THAT(logged(), testing::HasSubstr("memory: initial memory of 129 pages")); constexpr std::string_view atTheCap = R"wat( @@ -139,7 +139,7 @@ TEST_F(PreflightTest, TablePastTheCapIsRefused) (func (export "escrow_finish") (result i32) (i32.const 0))) )wat"; - EXPECT_EQ(preflight(tooMuch), temBAD_WASM); + EXPECT_EQ(preflight(tooMuch), temINVALID_BYTECODE); EXPECT_THAT(logged(), testing::HasSubstr("table: initial table of 1025 elements")); constexpr std::string_view atTheCap = R"wat( @@ -160,7 +160,7 @@ TEST_F(PreflightTest, MissingEntryPointIsRefused) (func (export "other") (result i32) (i32.const 0))) )wat"; - EXPECT_EQ(preflight(wat), temBAD_WASM); + EXPECT_EQ(preflight(wat), temINVALID_BYTECODE); EXPECT_THAT(logged(), testing::HasSubstr("no entry point 'escrow_finish'")); } @@ -172,7 +172,7 @@ TEST_F(PreflightTest, EntryPointOfTheWrongTypeIsRefused) (func (export "escrow_finish") (result i64) (i64.const 0))) )wat"; - EXPECT_EQ(preflight(wat), temBAD_WASM); + EXPECT_EQ(preflight(wat), temINVALID_BYTECODE); EXPECT_THAT(logged(), testing::HasSubstr("has the wrong signature")); } @@ -187,18 +187,18 @@ TEST_F(PreflightTest, EntryPointIsTheNameTheCallerGives) )wat"; EXPECT_EQ(preflight(wat, "other"), tesSUCCESS); - EXPECT_EQ(preflight(wat), temBAD_WASM); + EXPECT_EQ(preflight(wat), temINVALID_BYTECODE); } // Every refusal is logged with the engine's own description and the TER: without it a node -// operator has a `temBAD_WASM` and no way to tell a contract author which of the three +// operator has a `temINVALID_BYTECODE` and no way to tell a contract author which of the three // stages refused the module. TEST_F(PreflightTest, RefusalNamesTheReasonAndTheTer) { - EXPECT_EQ(preflightBytes(Bytes{0x00, 0x61, 0x73, 0x6d}), temBAD_WASM); + EXPECT_EQ(preflightBytes(Bytes{0x00, 0x61, 0x73, 0x6d}), temINVALID_BYTECODE); EXPECT_THAT(logged(), testing::HasSubstr("compile: ")); - EXPECT_THAT(logged(), testing::HasSubstr(transToken(temBAD_WASM))); + EXPECT_THAT(logged(), testing::HasSubstr(transToken(temINVALID_BYTECODE))); } // A module that passes screening still has to pass the run's own stages, and one that fails diff --git a/src/tests/libxrpl/tx/wasm/WasmVM.cpp b/src/tests/libxrpl/tx/wasm/WasmVM.cpp index 9b1f8fd291..f4c771872a 100644 --- a/src/tests/libxrpl/tx/wasm/WasmVM.cpp +++ b/src/tests/libxrpl/tx/wasm/WasmVM.cpp @@ -136,7 +136,7 @@ TEST_F(WasmVMTest, ModuleThatWillNotInstantiateIsChargedToTheContract) EXPECT_TRUE(outcome.error().cost.has_value()); } -// Preflight is meant to refuse these with `temBAD_WASM`; reaching apply means the screening +// Preflight is meant to refuse these with `temINVALID_BYTECODE`; reaching apply means the screening // did not happen, which is the node's fault and not the transaction's. TEST_F(WasmVMTest, UnrunnableModuleIsNodeSideFault) { diff --git a/src/tests/libxrpl/tx/wasm/host_context/FloatRoot.cpp b/src/tests/libxrpl/tx/wasm/host_context/FloatRoot.cpp deleted file mode 100644 index ae9d6057af..0000000000 --- a/src/tests/libxrpl/tx/wasm/host_context/FloatRoot.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include - -#include -#include -#include -#include - -#include -#include -#include - -namespace xrpl::test { - -// Every input slice passes straight through to the host, unlike `invokeWithAccount`'s -// twenty-byte check or `parseUint64`'s eight: nothing here is validated, so there is no D -// axis. `n` and `mode` carry different values, so a call that swapped them would fail to -// match. -struct FloatRootCall : HostContextTest -{ - Bytes const x{'r', 'o', 'o', 't', '-', 'x'}; - std::int32_t const n = 3; - std::int32_t const mode = 11; -}; - -TEST_F(FloatRootCall, OperandNAndModeAreForwardedResultIsWritten) -{ - Bytes const result{4, 5, 6}; - EXPECT_CALL(host, floatRoot(BytesAre("root-x"), n, mode)).WillOnce(testing::Return(result)); - - OutRegion out{32}; - EXPECT_EQ( - hostContext.floatRoot(bytesOf(x), n, mode, out.slice()), - static_cast(result.size())); - EXPECT_TRUE(out.holds(bytesOf(result))); -} - -TEST_F(FloatRootCall, HostErrorBecomesContractReturnValue) -{ - EXPECT_CALL(host, floatRoot(BytesAre("root-x"), n, mode)) - .WillOnce(testing::Return(std::unexpected(HostFunctionError::FloatComputationError))); - - OutRegion out{32}; - EXPECT_EQ( - hostContext.floatRoot(bytesOf(x), n, mode, out.slice()), - hfErrorToInt(HostFunctionError::FloatComputationError)); - EXPECT_FALSE(out.wasWritten()); -} - -TEST_F(FloatRootCall, HostExceptionBecomesInternalFatalAndIsLogged) -{ - EXPECT_CALL(host, floatRoot(BytesAre("root-x"), n, mode)) - .WillOnce(testing::Throw(std::runtime_error{"float root came apart"})); - - OutRegion out{32}; - EXPECT_EQ( - hostContext.floatRoot(bytesOf(x), n, mode, out.slice()), - hfErrorToInt(HostFunctionError::InternalFatal)); - EXPECT_THAT(logged(), testing::HasSubstr("float root came apart")); - EXPECT_THAT(logged(), testing::HasSubstr("floatRoot")); -} - -// The out-region contract: write only if the whole value fits, and return the true length -// either way. -TEST_F(FloatRootCall, ShortOutRegionWritesNothingAndReturnsTrueLength) -{ - Bytes const result{4, 5, 6}; - EXPECT_CALL(host, floatRoot(BytesAre("root-x"), n, mode)).WillOnce(testing::Return(result)); - - OutRegion out{result.size() - 1}; - EXPECT_EQ( - hostContext.floatRoot(bytesOf(x), n, mode, out.slice()), - static_cast(result.size())); - EXPECT_FALSE(out.wasWritten()); -} - -// No length rule exists at this layer: a differently sized operand still reaches the host -// rather than being refused. -TEST_F(FloatRootCall, OddSizedOperandReachesHostUnchanged) -{ - Bytes const shortX{0x2a}; - EXPECT_CALL(host, floatRoot(testing::_, n, mode)).WillOnce(testing::Return(Bytes{1})); - - OutRegion out{32}; - EXPECT_EQ(hostContext.floatRoot(bytesOf(shortX), n, mode, out.slice()), 1); -} - -} // namespace xrpl::test diff --git a/src/tests/libxrpl/tx/wasm/host_functions/FloatRoot.cpp b/src/tests/libxrpl/tx/wasm/host_functions/FloatRoot.cpp deleted file mode 100644 index dd6a14dee0..0000000000 --- a/src/tests/libxrpl/tx/wasm/host_functions/FloatRoot.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include - -#include -#include -#include - -namespace xrpl::test { - -struct FloatRootImpl : FloatTest -{ -}; - -TEST_F(FloatRootImpl, BadModeIsMalformed) -{ - expectError( - makeHost()->floatRoot(slice(FloatTest::kOne), 2, -1), - HostFunctionError::FloatInputMalformed); -} - -TEST_F(FloatRootImpl, MalformedInput) -{ - expectError(makeHost()->floatRoot(Slice{}, 3, 0), HostFunctionError::FloatInputMalformed); -} - -TEST_F(FloatRootImpl, NegativeDegreeIsMalformed) -{ - expectError( - makeHost()->floatRoot(slice(FloatTest::kOne), -2, 0), - HostFunctionError::FloatInputMalformed); -} - -TEST_F(FloatRootImpl, RootOfZeroIsZero) -{ - expectValue(makeHost()->floatRoot(slice(FloatTest::kIntZero), 2, 0), FloatTest::kIntZero); -} - -TEST_F(FloatRootImpl, FirstRootIsIdentity) -{ - expectValue(makeHost()->floatRoot(slice(FloatTest::kMaxIOU), 1, 0), FloatTest::kMaxIOU); -} - -TEST_F(FloatRootImpl, SquareRootOfHundredIsTen) -{ - auto h = makeHost(); - auto const hundred = h->floatFromMantExp(100, 0, 0); - ASSERT_TRUE(hundred.has_value()); - expectValue(h->floatRoot(slice(*hundred), 2, 0), FloatTest::kTen); -} - -TEST_F(FloatRootImpl, CubeRootOfThousandIsTen) -{ - auto h = makeHost(); - auto const thousand = h->floatFromMantExp(1000, 0, 0); - ASSERT_TRUE(thousand.has_value()); - expectValue(h->floatRoot(slice(*thousand), 3, 0), FloatTest::kTen); -} - -TEST_F(FloatRootImpl, SquareRootOfHundredthIsTenth) -{ - auto h = makeHost(); - auto const hundredth = h->floatFromMantExp(1, -2, 0); - auto const tenth = h->floatFromMantExp(1, -1, 0); - ASSERT_TRUE(hundredth.has_value() && tenth.has_value()); - expectValue(h->floatRoot(slice(*hundredth), 2, 0), *tenth); -} - -} // namespace xrpl::test