From abf1d48482db027cc2125f7fff18f8dc75636bb6 Mon Sep 17 00:00:00 2001 From: vms Date: Fri, 12 Jun 2020 02:04:52 +0300 Subject: [PATCH] add core_call method to node service --- examples/ipfs_node/src/node/ipfs_node.rs | 11 +++++++++++ examples/ipfs_node/src/node_wasm_service.rs | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/examples/ipfs_node/src/node/ipfs_node.rs b/examples/ipfs_node/src/node/ipfs_node.rs index 86da79ce..1dfcdb98 100644 --- a/examples/ipfs_node/src/node/ipfs_node.rs +++ b/examples/ipfs_node/src/node/ipfs_node.rs @@ -94,6 +94,17 @@ impl crate::node_wasm_service::NodeWasmService for IpfsNode { Ok(call_result) } + fn core_call( + &mut self, + module_name: &str, + func_name: &str, + args: &[IValue], + ) -> Result, NodeError> { + self.process + .call(module_name, func_name, args) + .map_err(Into::into) + } + fn get_interface(&self) -> NodePublicInterface { let mut modules = Vec::with_capacity(self.module_names.len()); diff --git a/examples/ipfs_node/src/node_wasm_service.rs b/examples/ipfs_node/src/node_wasm_service.rs index e5dc1bcf..d55402cf 100644 --- a/examples/ipfs_node/src/node_wasm_service.rs +++ b/examples/ipfs_node/src/node_wasm_service.rs @@ -27,5 +27,12 @@ pub trait NodeWasmService { args: &[IValue], ) -> Result, NodeError>; + fn core_call( + &mut self, + module_name: &str, + func_name: &str, + args: &[IValue], + ) -> Result, NodeError>; + fn get_interface(&self) -> NodePublicInterface; }