Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(wasm): upgrade `getrandom` dependency in `euclid_wasm` crate (#11505)

Sayak Bhattacharya8f89f230daf5
diff --git a/.cargo/config.toml b/.cargo/config.toml
new file mode 100644
index 0000000000..7c19b30168
--- /dev/null
+++ b/.cargo/config.toml
@@ -0,0 +1,5 @@
+[target.wasm32-unknown-unknown]
+rustflags = [
+ "--cfg", "getrandom_backend=\"wasm_js\"",
+ "--cfg", "getrandom_backend=\"js\""
+]
diff --git a/Cargo.lock b/Cargo.lock
index 9428bee39d..29a90aa756 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3262,7 +3262,7 @@ dependencies = [
"connector_configs",
"currency_conversion",
"euclid",
- "getrandom 0.2.16",
+ "getrandom 0.3.3",
"hyperswitch_constraint_graph",
"kgraph_utils",
"ron-parser",
diff --git a/crates/euclid_wasm/Cargo.toml b/crates/euclid_wasm/Cargo.toml
index f8c9bbce62..442fbb126f 100644
--- a/crates/euclid_wasm/Cargo.toml
+++ b/crates/euclid_wasm/Cargo.toml
@@ -30,7 +30,7 @@ hyperswitch_constraint_graph = { version = "0.1.0", path = "../hyperswitch_const
kgraph_utils = { version = "0.1.0", path = "../kgraph_utils" }
# Third party crates
-getrandom = { version = "0.2.16", features = ["js"] }
+getrandom = { version = "0.3", features = ["wasm_js"] }
ron-parser = "0.1.4"
serde = { version = "1.0", features = [] }
serde-wasm-bindgen = "0.6.5"