Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
Fixes for golem-services integration
Browse files Browse the repository at this point in the history
  • Loading branch information
vigoo committed Feb 14, 2024
1 parent 79051eb commit 7e31192
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 272 deletions.
3 changes: 2 additions & 1 deletion wasm-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ wit-bindgen = { version = "0.17.0", default-features = false, features = ["reall

arbitrary = { version = "1.3.2", features = ["derive"], optional = true }
bigdecimal = { version = "0.4.2", optional = true }
bincode = { version = "2.0.0-rc.3", optional = true }
golem-wasm-ast = { version = "0.1.4", features = ["analysis"], optional = true }
serde = { version = "1.0.113", optional = true }
serde_json = { version = "1.0.113", optional = true }
Expand All @@ -35,7 +36,7 @@ default = ["host"]
host = ["arbitrary", "json", "protobuf", "typeinfo", "wasmtime"]
arbitrary = ["dep:arbitrary"]
json = ["dep:serde", "dep:serde_json", "dep:bigdecimal", "typeinfo"]
protobuf = ["dep:prost"]
protobuf = ["dep:bincode", "dep:serde", "dep:prost"]
stub = []
typeinfo = ["dep:golem-wasm-ast"]
wasmtime = ["dep:wasmtime", "typeinfo"]
Expand Down
10 changes: 7 additions & 3 deletions wasm-rpc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ use std::io::Result;
fn main() -> Result<()> {
let mut config = prost_build::Config::new();
config.type_attribute(".", "#[cfg(feature = \"protobuf\")]");
config.type_attribute(
".",
"#[derive(bincode::Encode, bincode::Decode, serde::Serialize, serde::Deserialize)]",
);
config.compile_protos(
&[
"proto/type.proto",
"proto/val.proto",
"proto/witvalue.proto",
"proto/wasm/rpc/type.proto",
"proto/wasm/rpc/val.proto",
"proto/wasm/rpc/witvalue.proto",
],
&["proto/"],
)?;
Expand Down
80 changes: 0 additions & 80 deletions wasm-rpc/proto/type.proto

This file was deleted.

65 changes: 0 additions & 65 deletions wasm-rpc/proto/val.proto

This file was deleted.

120 changes: 0 additions & 120 deletions wasm-rpc/proto/witvalue.proto

This file was deleted.

6 changes: 3 additions & 3 deletions wasm-rpc/src/protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,11 @@ impl TryFrom<Val> for Value {

#[cfg(feature = "typeinfo")]
pub fn function_parameters(
parameters: Vec<Val>,
parameters: &[Val],
expected_parameters: Vec<AnalysedFunctionParameter>,
) -> Result<Vec<Val>, Vec<String>> {
) -> Result<(), Vec<String>> {
if parameters.len() == expected_parameters.len() {
Ok(parameters)
Ok(())
} else {
Err(vec![format!(
"Unexpected number of parameters (got {}, expected: {})",
Expand Down

0 comments on commit 7e31192

Please sign in to comment.