Skip to main content

interstice_sdk_core/host_calls/
module.rs

1use crate::host_calls::host_call;
2use interstice_abi::{HostCall, ModuleCall, NodeSelection};
3
4pub fn publish(node_selection: NodeSelection, wasm_binary: Vec<u8>) {
5    host_call(HostCall::Module(ModuleCall::Publish {
6        node_selection,
7        wasm_binary,
8    }));
9}
10
11pub fn remove(node_selection: NodeSelection, module_name: String) {
12    host_call(HostCall::Module(ModuleCall::Remove {
13        node_selection,
14        module_name,
15    }));
16}
17
18pub struct ModuleAuthority;
19
20impl ModuleAuthority {
21    pub fn publish(&self, node_selection: NodeSelection, wasm_binary: Vec<u8>) {
22        publish(node_selection, wasm_binary);
23    }
24
25    pub fn remove(&self, node_selection: NodeSelection, module_name: String) {
26        remove(node_selection, module_name);
27    }
28}