diff --git a/Cargo.lock b/Cargo.lock index 2674306bf..24507edaa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4505,6 +4505,7 @@ version = "0.0.0" dependencies = [ "anyhow", "async-trait", + "bigdecimal", "bincode", "bytes 1.8.0", "chrono", diff --git a/golem-worker-service-base/Cargo.toml b/golem-worker-service-base/Cargo.toml index a74a1e94b..55d7ce6aa 100644 --- a/golem-worker-service-base/Cargo.toml +++ b/golem-worker-service-base/Cargo.toml @@ -29,6 +29,7 @@ golem-wasm-rpc = { workspace = true } anyhow = { workspace = true } async-trait = { workspace = true } bincode = { workspace = true } +bigdecimal = { workspace = true } bytes = { workspace = true } chrono = { workspace = true } conditional-trait-gen = { workspace = true } diff --git a/golem-worker-service-base/src/gateway_binding/worker_binding.rs b/golem-worker-service-base/src/gateway_binding/worker_binding.rs index 1a33cdb98..19471148d 100644 --- a/golem-worker-service-base/src/gateway_binding/worker_binding.rs +++ b/golem-worker-service-base/src/gateway_binding/worker_binding.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use bincode::{Decode, Encode}; use serde::{Deserialize, Serialize}; use crate::gateway_binding::WorkerBindingCompiled; @@ -28,7 +27,7 @@ pub struct WorkerBinding { } // ResponseMapping will consist of actual logic such as invoking worker functions -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Encode, Decode)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ResponseMapping(pub Expr); impl From for WorkerBinding { diff --git a/golem-worker-service-base/src/gateway_binding/worker_binding_compiled.rs b/golem-worker-service-base/src/gateway_binding/worker_binding_compiled.rs index e6684d31e..a3040b742 100644 --- a/golem-worker-service-base/src/gateway_binding/worker_binding_compiled.rs +++ b/golem-worker-service-base/src/gateway_binding/worker_binding_compiled.rs @@ -14,7 +14,6 @@ use crate::gateway_binding::{ResponseMapping, WorkerBinding}; use crate::gateway_rib_compiler::{DefaultWorkerServiceRibCompiler, WorkerServiceRibCompiler}; -use bincode::{Decode, Encode}; use golem_service_base::model::VersionedComponentId; use golem_wasm_ast::analysis::AnalysedExport; use rib::{Expr, RibByteCode, RibInputTypeInfo, RibOutputTypeInfo, WorkerFunctionsInRib}; @@ -61,7 +60,7 @@ impl WorkerBindingCompiled { } } -#[derive(Debug, Clone, PartialEq, Encode, Decode)] +#[derive(Debug, Clone, PartialEq)] pub struct WorkerNameCompiled { pub worker_name: Expr, pub compiled_worker_name: RibByteCode, @@ -83,7 +82,7 @@ impl WorkerNameCompiled { } } -#[derive(Debug, Clone, PartialEq, Encode, Decode)] +#[derive(Debug, Clone, PartialEq)] pub struct IdempotencyKeyCompiled { pub idempotency_key: Expr, pub compiled_idempotency_key: RibByteCode, diff --git a/golem-worker-service-base/src/gateway_middleware/http/cors.rs b/golem-worker-service-base/src/gateway_middleware/http/cors.rs index 46305d531..e56061abe 100644 --- a/golem-worker-service-base/src/gateway_middleware/http/cors.rs +++ b/golem-worker-service-base/src/gateway_middleware/http/cors.rs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +use bigdecimal::BigDecimal; use http::header::*; use poem_openapi::Object; use rib::{Expr, GetLiteralValue, RibInput, TypeName}; @@ -285,7 +286,7 @@ impl CorsPreflightExpr { if let Some(max_age) = &cors.max_age { cors_parameters.push(( ACCESS_CONTROL_MAX_AGE.to_string(), - Expr::untyped_number_with_type_name(*max_age as f64, TypeName::U64), + Expr::untyped_number_with_type_name(BigDecimal::from(*max_age), TypeName::U64), )); }