Skip to content

Commit f3fef42

Browse files
Merge branch 'sdk-bindings' into feat/more-bindings
2 parents 659e368 + 824210f commit f3fef42

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This is required to enable running wasm tests
2+
[target.wasm32-unknown-unknown]
3+
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ jobs:
6565

6666
- name: rust version
6767
run: |
68-
rustup default 1.86.0
6968
rustc --version
7069
cargo --version
7170
@@ -75,7 +74,7 @@ jobs:
7574
run: sudo apt-get install -y clang
7675

7776
- name: Run tests in wasm
78-
run: make wasm
77+
run: RUSTFLAGS='-Dwarnings --cfg getrandom_backend="wasm_js"' make wasm
7978

8079
run_tests_with_network:
8180
runs-on: ubuntu-latest

crates/iota-crypto/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ test-strategy = "0.4.0"
100100

101101
[target.wasm32-unknown-unknown.dev-dependencies]
102102
wasm-bindgen-test = "0.3"
103-
getrandom = { version = "0.2", features = ["js"] }
103+
# `getrandom` renamed the WebAssembly support feature from "js" to "wasm_js"
104+
# Since both versions are in our dependency tree, we need to overwrite them with the proper feature
105+
getrandom_2 = { version = "0.2", package = "getrandom", features = ["js"] }
106+
getrandom_3 = { version = "0.3", package = "getrandom", features = ["wasm_js"] }
104107

105108
[lints.rust]
106109
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_cfg)'] }

crates/iota-sdk-types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ serde_json = "1.0.128"
7979

8080
[target.wasm32-unknown-unknown.dev-dependencies]
8181
wasm-bindgen-test = "0.3"
82-
getrandom = { version = "0.2", features = ["js"] }
82+
getrandom = { version = "0.3", features = ["wasm_js"] }
8383

8484
[lints.rust]
8585
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_cfg)'] }

crates/iota-sdk-types/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ test:
1515
cargo nextest run --all-features
1616
cargo test --all-features --doc
1717

18+
# --all-features except `uniffi`
1819
.PHONY: wasm
1920
wasm:
20-
CC=clang wasm-pack test --node --all-features
21+
CC=clang wasm-pack test --node -F serde,schemars,rand,hash,proptest
2122

2223
%:
2324
$(MAKE) -C ../.. $@

0 commit comments

Comments
 (0)