diff --git a/Cargo.lock b/Cargo.lock index a6a3244b367..aecfd360c87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4104,8 +4104,14 @@ dependencies = [ "near-primitives", "near-stable-hasher", "near-test-contracts", + "near-vm-compiler", + "near-vm-compiler-singlepass", + "near-vm-engine", + "near-vm-engine-universal", "near-vm-errors", "near-vm-logic", + "near-vm-types", + "near-vm-vm", "once_cell", "parity-wasm 0.41.0", "parity-wasm 0.42.2", diff --git a/Cargo.toml b/Cargo.toml index 27ca776c67d..4cacd325b55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -203,9 +203,15 @@ near-state-viewer = { path = "tools/state-viewer", package = "state-viewer" } near-store = { path = "core/store" } near-telemetry = { path = "chain/telemetry" } near-test-contracts = { path = "runtime/near-test-contracts" } +near-vm-compiler = { path = "runtime/near-vm/lib/compiler"} +near-vm-compiler-singlepass = { path = "runtime/near-vm/lib/compiler-singlepass" } +near-vm-engine = { path = "runtime/near-vm/lib/engine" } +near-vm-engine-universal = { path = "runtime/near-vm/lib/engine-universal" } near-vm-errors = { path = "runtime/near-vm-errors" } -near-vm-logic = {path = "runtime/near-vm-logic" } +near-vm-logic = { path = "runtime/near-vm-logic" } near-vm-runner = { path = "runtime/near-vm-runner"} +near-vm-types = { path = "runtime/near-vm/lib/types" } +near-vm-vm = { path = "runtime/near-vm/lib/vm" } nearcore = { path = "nearcore" } nix = "0.24" node-runtime = { path = "runtime/runtime" } diff --git a/runtime/near-vm-runner/Cargo.toml b/runtime/near-vm-runner/Cargo.toml index 9cdc861c9f2..129a3ec2eb2 100644 --- a/runtime/near-vm-runner/Cargo.toml +++ b/runtime/near-vm-runner/Cargo.toml @@ -44,6 +44,12 @@ wasmer-engine = { workspace = true, optional = true } wasmer-engine-universal = { workspace = true, optional = true } wasmer-types = { workspace = true, optional = true } wasmer-vm = { workspace = true, optional = true } +near-vm-compiler = { workspace = true, optional = true } +near-vm-compiler-singlepass = { workspace = true, optional = true } +near-vm-engine = { workspace = true, optional = true } +near-vm-engine-universal = { workspace = true, features = ["compiler"], optional = true } +near-vm-types = { workspace = true, optional = true } +near-vm-vm = { workspace = true, optional = true } [dev-dependencies] arbitrary.workspace = true @@ -64,6 +70,7 @@ default = [ "wasmer0_vm", "wasmtime_vm", "wasmer2_vm", + "near_vm", ] wasmer0_vm = [ "wasmer-runtime", "wasmer-runtime-core" ] wasmtime_vm = [ "wasmtime", "anyhow"] @@ -75,11 +82,20 @@ wasmer2_vm = [ "wasmer-types", "wasmer-vm" ] +near_vm = [ + "near-vm-compiler", + "near-vm-compiler-singlepass", + "near-vm-engine", + "near-vm-engine-universal", + "near-vm-types", + "near-vm-vm" +] # Force usage of a specific wasm vm irrespective of protocol version. force_wasmer0 = ["wasmer0_vm"] force_wasmtime = ["wasmtime_vm"] force_wasmer2 = ["wasmer2_vm"] +force_near_vm = ["near_vm"] no_cpu_compatibility_checks = [] diff --git a/runtime/near-vm-runner/README.md b/runtime/near-vm-runner/README.md index 945f5fa43f8..96b92cc93e1 100644 --- a/runtime/near-vm-runner/README.md +++ b/runtime/near-vm-runner/README.md @@ -29,7 +29,7 @@ The entry point is the `runner::run` function. There's a bunch of unit-tests in this crate. You can run them with ```console -$ cargo t -p near-vm-runner --features wasmer0_vm,wasmer2_vm,wasmtime_vm +$ cargo t -p near-vm-runner --features wasmer0_vm,wasmer2_vm,wasmtime_vm,near_vm ``` The tests use either a short wasm snippets specified inline, or a couple of diff --git a/runtime/near-vm/lib/api/Cargo.toml b/runtime/near-vm/lib/api/Cargo.toml index b1d8c4ff11a..67e6addd86d 100644 --- a/runtime/near-vm/lib/api/Cargo.toml +++ b/runtime/near-vm/lib/api/Cargo.toml @@ -12,9 +12,6 @@ edition = "2021" publish = true rust-version.workspace = true -[lib] -name = "wasmer" - # Shared dependencies. [dependencies] # - Mandatory shared dependencies. diff --git a/runtime/near-vm/lib/api/README.md b/runtime/near-vm/lib/api/README.md index d330c51ea20..c48f3b2c7f6 100644 --- a/runtime/near-vm/lib/api/README.md +++ b/runtime/near-vm/lib/api/README.md @@ -16,7 +16,7 @@ Here is a small example of using Wasmer to run a WebAssembly module written with its WAT format (textual format): ```rust -use wasmer::{Store, Module, Instance, Value, imports}; +use near_vm::{Store, Module, Instance, Value, imports}; fn main() -> anyhow::Result<()> { let module_wat = r#" diff --git a/runtime/near-vm/lib/api/src/lib.rs b/runtime/near-vm/lib/api/src/lib.rs index 2d279867bfa..ea2cd2ea9a9 100644 --- a/runtime/near-vm/lib/api/src/lib.rs +++ b/runtime/near-vm/lib/api/src/lib.rs @@ -33,7 +33,7 @@ //! written with its WAT format (textual format): //! //! ```rust -//! use wasmer::{Store, Module, Instance, InstanceConfig, Value, Export, imports}; +//! use near_vm::{Store, Module, Instance, InstanceConfig, Value, Export, imports}; //! //! fn main() -> anyhow::Result<()> { //! let module_wat = r#" @@ -144,7 +144,7 @@ //! [`imports`] macro: //! //! ``` -//! # use wasmer::{imports, Function, Memory, MemoryType, Store, ImportObject}; +//! # use near_vm::{imports, Function, Memory, MemoryType, Store, ImportObject}; //! # fn imports_example(store: &Store) -> ImportObject { //! let memory = Memory::new(&store, MemoryType::new(1, None, false)).unwrap(); //! imports! { @@ -160,7 +160,7 @@ //! from any instance via `instance.exports`: //! //! ``` -//! # use wasmer::{imports, Instance, Function, Memory, NativeFunc}; +//! # use near_vm::{imports, Instance, Function, Memory, NativeFunc}; //! # fn exports_example(instance: &Instance) -> anyhow::Result<()> { //! let memory = instance.lookup("memory").unwrap(); //! let memory = instance.lookup("some_other_memory").unwrap(); diff --git a/runtime/near-vm/lib/api/src/sys/cell.rs b/runtime/near-vm/lib/api/src/sys/cell.rs index 4540c2b305c..fdba34486a7 100644 --- a/runtime/near-vm/lib/api/src/sys/cell.rs +++ b/runtime/near-vm/lib/api/src/sys/cell.rs @@ -17,7 +17,7 @@ impl<'a, T> WasmCell<'a, T> { /// /// ``` /// use std::cell::Cell; - /// use wasmer::WasmCell; + /// use near_vm::WasmCell; /// /// let cell = Cell::new(5); /// let wasm_cell = WasmCell::new(&cell); diff --git a/runtime/near-vm/lib/api/src/sys/env.rs b/runtime/near-vm/lib/api/src/sys/env.rs index 6ef6528c164..fcb74717f00 100644 --- a/runtime/near-vm/lib/api/src/sys/env.rs +++ b/runtime/near-vm/lib/api/src/sys/env.rs @@ -29,7 +29,7 @@ impl From for HostEnvInitError { /// /// This trait may also be implemented manually: /// ``` -/// # use wasmer::{WasmerEnv, LazyInit, Memory, Instance, HostEnvInitError}; +/// # use near_vm::{WasmerEnv, LazyInit, Memory, Instance, HostEnvInitError}; /// #[derive(Clone)] /// pub struct MyEnv { /// memory: LazyInit, diff --git a/runtime/near-vm/lib/api/src/sys/exports.rs b/runtime/near-vm/lib/api/src/sys/exports.rs index 764efd0c99c..69ca7076d2b 100644 --- a/runtime/near-vm/lib/api/src/sys/exports.rs +++ b/runtime/near-vm/lib/api/src/sys/exports.rs @@ -15,7 +15,7 @@ use wasmer_vm::Export; /// ## Incompatible export type /// /// ```should_panic -/// # use wasmer::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value, ExportError}; +/// # use near_vm::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value, ExportError}; /// # let store = Store::default(); /// # let wasm_bytes = wat2wasm(r#" /// # (module @@ -32,7 +32,7 @@ use wasmer_vm::Export; /// ## Missing export /// /// ```should_panic -/// # use wasmer::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value, ExportError}; +/// # use near_vm::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value, ExportError}; /// # let store = Store::default(); /// # let wasm_bytes = wat2wasm("(module)".as_bytes()).unwrap(); /// # let module = Module::new(&store, wasm_bytes).unwrap(); diff --git a/runtime/near-vm/lib/api/src/sys/externals/function.rs b/runtime/near-vm/lib/api/src/sys/externals/function.rs index 6e457ec0615..ed4180e93fe 100644 --- a/runtime/near-vm/lib/api/src/sys/externals/function.rs +++ b/runtime/near-vm/lib/api/src/sys/externals/function.rs @@ -155,7 +155,7 @@ impl Function { /// # Examples /// /// ``` - /// # use wasmer::{Function, FunctionType, Type, Store, Value}; + /// # use near_vm::{Function, FunctionType, Type, Store, Value}; /// # let store = Store::default(); /// # /// let signature = FunctionType::new(vec![Type::I32, Type::I32], vec![Type::I32]); @@ -169,7 +169,7 @@ impl Function { /// With constant signature: /// /// ``` - /// # use wasmer::{Function, FunctionType, Type, Store, Value}; + /// # use near_vm::{Function, FunctionType, Type, Store, Value}; /// # let store = Store::default(); /// # /// const I32_I32_TO_I32: ([Type; 2], [Type; 1]) = ([Type::I32, Type::I32], [Type::I32]); @@ -199,7 +199,7 @@ impl Function { /// # Examples /// /// ``` - /// # use wasmer::{Function, FunctionType, Type, Store, Value, WasmerEnv}; + /// # use near_vm::{Function, FunctionType, Type, Store, Value, WasmerEnv}; /// # let store = Store::default(); /// # /// #[derive(Clone)] @@ -220,7 +220,7 @@ impl Function { /// With constant signature: /// /// ``` - /// # use wasmer::{Function, FunctionType, Type, Store, Value, WasmerEnv}; + /// # use near_vm::{Function, FunctionType, Type, Store, Value, WasmerEnv}; /// # let store = Store::default(); /// const I32_I32_TO_I32: ([Type; 2], [Type; 1]) = ([Type::I32, Type::I32], [Type::I32]); /// @@ -296,7 +296,7 @@ impl Function { /// # Example /// /// ``` - /// # use wasmer::{Store, Function}; + /// # use near_vm::{Store, Function}; /// # let store = Store::default(); /// # /// fn sum(a: i32, b: i32) -> i32 { @@ -349,7 +349,7 @@ impl Function { /// # Example /// /// ``` - /// # use wasmer::{Store, Function, WasmerEnv}; + /// # use near_vm::{Store, Function, WasmerEnv}; /// # let store = Store::default(); /// # /// #[derive(Clone)] @@ -404,7 +404,7 @@ impl Function { /// # Example /// /// ``` - /// # use wasmer::{Function, Store, Type}; + /// # use near_vm::{Function, Store, Type}; /// # let store = Store::default(); /// # /// fn sum(a: i32, b: i32) -> i32 { @@ -498,7 +498,7 @@ impl Function { /// # Example /// /// ``` - /// # use wasmer::{Function, Store, Type}; + /// # use near_vm::{Function, Store, Type}; /// # let store = Store::default(); /// # /// fn sum(a: i32, b: i32) -> i32 { @@ -518,7 +518,7 @@ impl Function { /// # Example /// /// ``` - /// # use wasmer::{Function, Store, Type}; + /// # use near_vm::{Function, Store, Type}; /// # let store = Store::default(); /// # /// fn sum(a: i32, b: i32) -> i32 { @@ -544,7 +544,7 @@ impl Function { /// # Examples /// /// ``` - /// # use wasmer::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value}; + /// # use near_vm::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value}; /// # let store = Store::default(); /// # let wasm_bytes = wat2wasm(r#" /// # (module @@ -604,7 +604,7 @@ impl Function { /// # Examples /// /// ``` - /// # use wasmer::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value}; + /// # use near_vm::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value}; /// # let store = Store::default(); /// # let wasm_bytes = wat2wasm(r#" /// # (module @@ -630,7 +630,7 @@ impl Function { /// an error will be raised: /// /// ```should_panic - /// # use wasmer::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value}; + /// # use near_vm::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value}; /// # let store = Store::default(); /// # let wasm_bytes = wat2wasm(r#" /// # (module @@ -654,7 +654,7 @@ impl Function { /// an error will be raised: /// /// ```should_panic - /// # use wasmer::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value}; + /// # use near_vm::{imports, wat2wasm, Function, Instance, InstanceConfig, Module, Store, Type, Value}; /// # let store = Store::default(); /// # let wasm_bytes = wat2wasm(r#" /// # (module diff --git a/runtime/near-vm/lib/api/src/sys/externals/global.rs b/runtime/near-vm/lib/api/src/sys/externals/global.rs index c1fcab567dc..196794c9e76 100644 --- a/runtime/near-vm/lib/api/src/sys/externals/global.rs +++ b/runtime/near-vm/lib/api/src/sys/externals/global.rs @@ -25,7 +25,7 @@ impl Global { /// # Example /// /// ``` - /// # use wasmer::{Global, Mutability, Store, Value}; + /// # use near_vm::{Global, Mutability, Store, Value}; /// # let store = Store::default(); /// # /// let g = Global::new(&store, Value::I32(1)); @@ -42,7 +42,7 @@ impl Global { /// # Example /// /// ``` - /// # use wasmer::{Global, Mutability, Store, Value}; + /// # use near_vm::{Global, Mutability, Store, Value}; /// # let store = Store::default(); /// # /// let g = Global::new_mut(&store, Value::I32(1)); @@ -77,7 +77,7 @@ impl Global { /// # Example /// /// ``` - /// # use wasmer::{Global, Mutability, Store, Type, Value, GlobalType}; + /// # use near_vm::{Global, Mutability, Store, Type, Value, GlobalType}; /// # let store = Store::default(); /// # /// let c = Global::new(&store, Value::I32(1)); @@ -95,7 +95,7 @@ impl Global { /// # Example /// /// ``` - /// # use wasmer::{Global, Store, Value}; + /// # use near_vm::{Global, Store, Value}; /// # let store = Store::default(); /// # /// let g = Global::new(&store, Value::I32(1)); @@ -111,7 +111,7 @@ impl Global { /// # Example /// /// ``` - /// # use wasmer::{Global, Store, Value}; + /// # use near_vm::{Global, Store, Value}; /// # let store = Store::default(); /// # /// let g = Global::new(&store, Value::I32(1)); @@ -127,7 +127,7 @@ impl Global { /// # Example /// /// ``` - /// # use wasmer::{Global, Store, Value}; + /// # use near_vm::{Global, Store, Value}; /// # let store = Store::default(); /// # /// let g = Global::new_mut(&store, Value::I32(1)); @@ -144,7 +144,7 @@ impl Global { /// Trying to mutate a immutable global will raise an error: /// /// ```should_panic - /// # use wasmer::{Global, Store, Value}; + /// # use near_vm::{Global, Store, Value}; /// # let store = Store::default(); /// # /// let g = Global::new(&store, Value::I32(1)); @@ -155,7 +155,7 @@ impl Global { /// Trying to set a value of a incompatible type will raise an error: /// /// ```should_panic - /// # use wasmer::{Global, Store, Value}; + /// # use near_vm::{Global, Store, Value}; /// # let store = Store::default(); /// # /// let g = Global::new(&store, Value::I32(1)); diff --git a/runtime/near-vm/lib/api/src/sys/externals/memory.rs b/runtime/near-vm/lib/api/src/sys/externals/memory.rs index 7e8cf073b65..479e61ef07c 100644 --- a/runtime/near-vm/lib/api/src/sys/externals/memory.rs +++ b/runtime/near-vm/lib/api/src/sys/externals/memory.rs @@ -35,7 +35,7 @@ impl Memory { /// # Example /// /// ``` - /// # use wasmer::{Memory, MemoryType, Pages, Store, Type, Value}; + /// # use near_vm::{Memory, MemoryType, Pages, Store, Type, Value}; /// # let store = Store::default(); /// # /// let m = Memory::new(&store, MemoryType::new(1, None, false)).unwrap(); @@ -66,7 +66,7 @@ impl Memory { /// # Example /// /// ``` - /// # use wasmer::{Memory, MemoryType, Pages, Store, Type, Value}; + /// # use near_vm::{Memory, MemoryType, Pages, Store, Type, Value}; /// # let store = Store::default(); /// # /// let mt = MemoryType::new(1, None, false); @@ -83,7 +83,7 @@ impl Memory { /// # Example /// /// ``` - /// # use wasmer::{Memory, MemoryType, Pages, Store, Type, Value}; + /// # use near_vm::{Memory, MemoryType, Pages, Store, Type, Value}; /// # let store = Store::default(); /// # /// let m = Memory::new(&store, MemoryType::new(1, None, false)).unwrap(); @@ -140,7 +140,7 @@ impl Memory { /// # Example /// /// ``` - /// # use wasmer::{Memory, MemoryType, Pages, Store, Type, Value}; + /// # use near_vm::{Memory, MemoryType, Pages, Store, Type, Value}; /// # let store = Store::default(); /// # /// let m = Memory::new(&store, MemoryType::new(1, None, false)).unwrap(); @@ -166,7 +166,7 @@ impl Memory { /// # Usage: /// /// ``` - /// # use wasmer::{Memory, MemoryView}; + /// # use near_vm::{Memory, MemoryView}; /// # use std::{cell::Cell, sync::atomic::Ordering}; /// # fn view_memory(memory: Memory) { /// // Without synchronization. diff --git a/runtime/near-vm/lib/api/src/sys/import_object.rs b/runtime/near-vm/lib/api/src/sys/import_object.rs index 1a138468594..7779a4899f8 100644 --- a/runtime/near-vm/lib/api/src/sys/import_object.rs +++ b/runtime/near-vm/lib/api/src/sys/import_object.rs @@ -27,7 +27,7 @@ pub trait LikeNamespace { /// /// # Usage: /// ```ignore -/// use wasmer::{Exports, ImportObject, Function}; +/// use near_vm::{Exports, ImportObject, Function}; /// /// let mut import_object = ImportObject::new(); /// let mut env = Exports::new(); @@ -182,9 +182,9 @@ impl fmt::Debug for ImportObject { /// # Usage /// /// ``` -/// # use wasmer::{Function, Store}; +/// # use near_vm::{Function, Store}; /// # let store = Store::default(); -/// use wasmer::imports; +/// use near_vm::imports; /// /// let import_object = imports! { /// "env" => { diff --git a/runtime/near-vm/lib/api/src/sys/instance.rs b/runtime/near-vm/lib/api/src/sys/instance.rs index d8e67cd12b5..d003dcb164e 100644 --- a/runtime/near-vm/lib/api/src/sys/instance.rs +++ b/runtime/near-vm/lib/api/src/sys/instance.rs @@ -92,7 +92,7 @@ impl Instance { /// [`ImportObject`]: crate::ImportObject /// /// ``` - /// # use wasmer::{imports, Store, Module, Global, Value, Instance, InstanceConfig}; + /// # use near_vm::{imports, Store, Module, Global, Value, Instance, InstanceConfig}; /// # fn main() -> anyhow::Result<()> { /// let store = Store::default(); /// let module = Module::new(&store, "(module)")?; diff --git a/runtime/near-vm/lib/api/src/sys/module.rs b/runtime/near-vm/lib/api/src/sys/module.rs index f155ba57570..87f9157bd00 100644 --- a/runtime/near-vm/lib/api/src/sys/module.rs +++ b/runtime/near-vm/lib/api/src/sys/module.rs @@ -61,7 +61,7 @@ impl Module { /// Reading from a WAT file. /// /// ``` - /// use wasmer::*; + /// use near_vm::*; /// # fn main() -> anyhow::Result<()> { /// # let store = Store::default(); /// let wat = "(module)"; @@ -73,7 +73,7 @@ impl Module { /// Reading from bytes: /// /// ``` - /// use wasmer::*; + /// use near_vm::*; /// # fn main() -> anyhow::Result<()> { /// # let store = Store::default(); /// // The following is the same as: diff --git a/runtime/near-vm/lib/compiler-singlepass/Cargo.toml b/runtime/near-vm/lib/compiler-singlepass/Cargo.toml index c5e3cd461fb..2b244ba2a45 100644 --- a/runtime/near-vm/lib/compiler-singlepass/Cargo.toml +++ b/runtime/near-vm/lib/compiler-singlepass/Cargo.toml @@ -12,9 +12,6 @@ edition = "2021" publish = true rust-version.workspace = true -[lib] -name = "wasmer_compiler_singlepass" - [dependencies] finite-wasm.workspace = true wasmer-compiler = { path = "../compiler", package = "near-vm-compiler", features = ["translator"], default-features = false } diff --git a/runtime/near-vm/lib/compiler/Cargo.toml b/runtime/near-vm/lib/compiler/Cargo.toml index 8c893a9627a..1222c453fdc 100644 --- a/runtime/near-vm/lib/compiler/Cargo.toml +++ b/runtime/near-vm/lib/compiler/Cargo.toml @@ -12,9 +12,6 @@ edition = "2021" publish = true rust-version.workspace = true -[lib] -name = "wasmer_compiler" - [dependencies] finite-wasm.workspace = true wasmer-vm = { path = "../vm", package = "near-vm-vm" } diff --git a/runtime/near-vm/lib/engine-universal/Cargo.toml b/runtime/near-vm/lib/engine-universal/Cargo.toml index d8d1c5d45ba..bb0847fcd23 100644 --- a/runtime/near-vm/lib/engine-universal/Cargo.toml +++ b/runtime/near-vm/lib/engine-universal/Cargo.toml @@ -12,9 +12,6 @@ edition = "2021" publish = true rust-version.workspace = true -[lib] -name = "wasmer_engine_universal" - [dependencies] finite-wasm.workspace = true wasmer-compiler = { path = "../compiler", package = "near-vm-compiler", features = ["translator"] } diff --git a/runtime/near-vm/lib/engine/Cargo.toml b/runtime/near-vm/lib/engine/Cargo.toml index 8856ad0f120..9f3cf8d4b44 100644 --- a/runtime/near-vm/lib/engine/Cargo.toml +++ b/runtime/near-vm/lib/engine/Cargo.toml @@ -12,9 +12,6 @@ edition = "2021" publish = true rust-version.workspace = true -[lib] -name = "wasmer_engine" - [dependencies] finite-wasm.workspace = true wasmer-types = { path = "../types", package = "near-vm-types" } diff --git a/runtime/near-vm/lib/engine/src/trap/error.rs b/runtime/near-vm/lib/engine/src/trap/error.rs index c1a8b440c20..cb2d772d4b3 100644 --- a/runtime/near-vm/lib/engine/src/trap/error.rs +++ b/runtime/near-vm/lib/engine/src/trap/error.rs @@ -50,7 +50,7 @@ impl RuntimeError { /// /// # Example /// ``` - /// let trap = wasmer_engine::RuntimeError::new("unexpected error"); + /// let trap = near_vm_engine::RuntimeError::new("unexpected error"); /// assert_eq!("unexpected error", trap.message()); /// ``` pub fn new>(message: I) -> Self { diff --git a/runtime/near-vm/lib/types/Cargo.toml b/runtime/near-vm/lib/types/Cargo.toml index 15f276a6b69..4a83b774ec3 100644 --- a/runtime/near-vm/lib/types/Cargo.toml +++ b/runtime/near-vm/lib/types/Cargo.toml @@ -12,9 +12,6 @@ edition = "2021" publish = true rust-version.workspace = true -[lib] -name = "wasmer_types" - [dependencies] thiserror.workspace = true indexmap.workspace = true diff --git a/runtime/near-vm/lib/types/src/native.rs b/runtime/near-vm/lib/types/src/native.rs index f5759b3645b..e1de7e9b4a4 100644 --- a/runtime/near-vm/lib/types/src/native.rs +++ b/runtime/near-vm/lib/types/src/native.rs @@ -13,7 +13,7 @@ use crate::values::{Value, WasmValueType}; /// Wasm type associated with a native Rust type. /// /// ``` -/// use wasmer_types::{NativeWasmType, Type}; +/// use near_vm_types::{NativeWasmType, Type}; /// /// let wasm_type = i32::WASM_TYPE; /// assert_eq!(wasm_type, Type::I32); diff --git a/runtime/near-vm/lib/types/src/types.rs b/runtime/near-vm/lib/types/src/types.rs index 32436779914..ab6210de112 100644 --- a/runtime/near-vm/lib/types/src/types.rs +++ b/runtime/near-vm/lib/types/src/types.rs @@ -308,7 +308,7 @@ impl GlobalType { /// Create a new Global variable /// # Usage: /// ``` - /// use wasmer_types::{GlobalType, Type, Mutability, Value}; + /// use near_vm_types::{GlobalType, Type, Mutability, Value}; /// /// // An I32 constant global /// let global = GlobalType::new(Type::I32, Mutability::Const); diff --git a/runtime/near-vm/lib/types/tests/partial-sum-map/main.rs b/runtime/near-vm/lib/types/tests/partial-sum-map/main.rs index be98f5ac2d2..92d58a8aaf0 100644 --- a/runtime/near-vm/lib/types/tests/partial-sum-map/main.rs +++ b/runtime/near-vm/lib/types/tests/partial-sum-map/main.rs @@ -1,4 +1,4 @@ -use wasmer_types::partial_sum_map::{Error, PartialSumMap}; +use near_vm_types::partial_sum_map::{Error, PartialSumMap}; fn main() { bolero::check!().with_type::<(Vec<(u32, u32)>, Vec)>().for_each(|input| { diff --git a/runtime/near-vm/lib/vm/Cargo.toml b/runtime/near-vm/lib/vm/Cargo.toml index 33fbc86aaae..0f69791d463 100644 --- a/runtime/near-vm/lib/vm/Cargo.toml +++ b/runtime/near-vm/lib/vm/Cargo.toml @@ -12,9 +12,6 @@ edition = "2021" publish = true rust-version.workspace = true -[lib] -name = "wasmer_vm" - [dependencies] backtrace.workspace = true cfg-if.workspace = true diff --git a/runtime/near-vm/lib/vm/src/resolver.rs b/runtime/near-vm/lib/vm/src/resolver.rs index 7883d23549f..33aec14eb30 100644 --- a/runtime/near-vm/lib/vm/src/resolver.rs +++ b/runtime/near-vm/lib/vm/src/resolver.rs @@ -244,7 +244,7 @@ pub struct NamedResolverChain(imports1: A, imports2: B) /// # where A: NamedResolver + Sized + Send + Sync, /// # B: NamedResolver + Sized + Send + Sync, @@ -259,7 +259,7 @@ pub trait ChainableNamedResolver: NamedResolver + Sized + Send + Sync { /// This will cause the second resolver to override the first. /// /// ``` - /// # use wasmer_vm::{ChainableNamedResolver, NamedResolver}; + /// # use near_vm_vm::{ChainableNamedResolver, NamedResolver}; /// # fn chainable_test(imports1: A, imports2: B) /// # where A: NamedResolver + Sized + Send + Sync, /// # B: NamedResolver + Sized + Send + Sync, @@ -280,7 +280,7 @@ pub trait ChainableNamedResolver: NamedResolver + Sized + Send + Sync { /// This will cause the first resolver to override the second. /// /// ``` - /// # use wasmer_vm::{ChainableNamedResolver, NamedResolver}; + /// # use near_vm_vm::{ChainableNamedResolver, NamedResolver}; /// # fn chainable_test(imports1: A, imports2: B) /// # where A: NamedResolver + Sized + Send + Sync, /// # B: NamedResolver + Sized + Send + Sync, diff --git a/runtime/near-vm/rust-toolchain b/runtime/near-vm/rust-toolchain deleted file mode 100644 index 9cf4011bde7..00000000000 --- a/runtime/near-vm/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -1.66