Skip to content

Commit

Permalink
fix return type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Aideepakchaudhary committed Nov 26, 2024
1 parent 40e93da commit 8d3853c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ clap = { version = "4.2.5", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = ["derive", "max-encoded-len"] }
futures = { version = "0.3.30" }
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
anyhow = { version = "1.0.81", default-features = false }
wasmtime = { version = "8.0.1", default-features = false }
hex-literal = { version = "^0.4.1", default-features = false }
jsonrpsee = { version = "0.24.3", default-features = false, features = ["server"] }
lazy_static = { version = "1.5.0", default-features = false }
Expand Down Expand Up @@ -202,7 +204,7 @@ cere-rpc = { path = "node/rpc" }
cere-runtime = { path = "runtime/cere" }
cere-runtime-common = { path = "runtime/common", default-features = false }
cere-runtime-interfaces = { path = "node/runtime-interfaces" }
cere-wasm-interface = { path = "node/runtime-interface-macro/cere-wasm-interface" }
cere-wasm-interface = { path = "node/runtime-interface-macro/cere-wasm-interface"}
cere-service = { path = "node/service" }
ddc-primitives = { path = "primitives", default-features = false }
pallet-chainbridge = { path = "pallets/chainbridge", default-features = false }
Expand Down
12 changes: 12 additions & 0 deletions node/runtime-interface-macro/cere-wasm-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ quote = { workspace = true }
expander = { workspace = true }
syn = { features = ["extra-traits", "fold", "full", "visit"], workspace = true }
sp-wasm-interface = { workspace = true }
anyhow = { optional = true, workspace = true }
log = { optional = true, workspace = true, default-features = true }
wasmtime = { optional = true, workspace = true }

[features]
default = ["std"]
std = [
"anyhow?/std",
"codec/std",
"log/std",
]
wasmtime = ["anyhow", "dep:wasmtime"]
14 changes: 7 additions & 7 deletions node/runtime-interface-macro/cere-wasm-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ use core::{iter::Iterator, marker::PhantomData, mem, result};
use sp_wasm_interface::{Function, Result as WResult, Pointer};


// #[cfg(not(all(feature = "std", feature = "wasmtime")))]
// #[macro_export]
// macro_rules! if_wasmtime_is_enabled {
// ($($token:tt)*) => {};
// }
#[cfg(not(all(feature = "std", feature = "wasmtime")))]
#[macro_export]
macro_rules! if_wasmtime_is_enabled {
($($token:tt)*) => {};
}

/// Sandbox memory identifier.
pub type MemoryId = u32;

/// Result type used by traits in this crate.
#[cfg(feature = "std")]
pub type Result<T> = result::Result<T, String>;
#[cfg(not(feature = "std"))]
pub type Result<T> = result::Result<T, &'static str>;
// #[cfg(not(feature = "std"))]
// pub type Result<T> = result::Result<T, &'static str>;

/// Value types supported by Substrate on the boundary between host/Wasm.
#[derive(Copy, Clone, PartialEq, Debug, Eq)]
Expand Down

0 comments on commit 8d3853c

Please sign in to comment.