File tree Expand file tree Collapse file tree 8 files changed +40
-20
lines changed Expand file tree Collapse file tree 8 files changed +40
-20
lines changed Original file line number Diff line number Diff line change 39
39
- uses : Swatinem/rust-cache@v2
40
40
- name : check
41
41
run : |
42
- cargo check \
42
+ RUSTFLAGS='--cfg getrandom_backend="wasm_js"' cargo check \
43
43
--target wasm32-unknown-unknown \
44
44
--no-default-features \
45
45
--features browser
Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
- cargo build
6
- cargo test --lib
7
- cargo test --doc
5
+ # simple function to print on fail
6
+ fail () {
7
+ echo " "
8
+ echo " Build failed: $1 "
9
+ exit 1
10
+ }
11
+
12
+ cargo c -q || fail " Cargo build"
13
+ cargo test -q --workspace || fail " Cargo workspace tests"
14
+ cargo test -q --doc || fail " Cargo documentation tests"
8
15
9
16
# ## BIP32 ###
10
- cd crates/bip32
11
- cargo build
12
- cargo build --no-default-features
13
- cargo build --target wasm32-unknown-unknown
17
+ cargo c -q -p coins-bip32 || fail " BIP32 build failed"
18
+ cargo c -q -p coins-bip32 --no-default-features || fail " BIP32 build without default features"
19
+ RUSTFLAGS=' --cfg getrandom_backend="wasm_js"' cargo c -q -p coins-bip32 --target wasm32-unknown-unknown || fail " BIP32 wasm build "
14
20
15
21
# ## BIP39 ###
16
- cd ../bip39
17
- cargo build
18
- cargo build --no-default-features
19
- cargo build --target wasm32-unknown-unknown
22
+ cargo c -q -p coins-bip39 || fail " BIP39 build"
23
+ cargo c -q -p coins-bip39 --no-default-features || fail " BIP39 build without default features"
24
+ RUSTFLAGS=' --cfg getrandom_backend="wasm_js"' cargo c -q -p coins-bip39 --target wasm32-unknown-unknown || fail " BIP39 wasm build"
20
25
21
26
# ## Ledger ###
22
- cd ../ledger
23
27
# # broken on travis
24
- # cargo build
25
- cargo build -- target wasm32-unknown-unknown --no-default-features --features=" browser"
28
+ # cargo c -q
29
+ cargo c -q -p coins-ledger -- target wasm32-unknown-unknown --no-default-features --features=" browser" || fail " Ledger wasm build "
Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ serde.workspace = true
23
23
sha2.workspace = true
24
24
thiserror.workspace = true
25
25
26
+ [target .'cfg(target_arch = "wasm32")' .dependencies ]
27
+ gr03 = { package = " getrandom" , version = " 0.3" , features = [" wasm_js" ] }
28
+ gr02 = { package = " getrandom" , version = " 0.2" , features = [" js" ] }
29
+
26
30
[dev-dependencies ]
27
31
hex.workspace = true
28
32
Original file line number Diff line number Diff line change @@ -173,3 +173,9 @@ impl From<std::convert::Infallible> for Bip32Error {
173
173
unimplemented ! ( "unreachable, but required by type system" )
174
174
}
175
175
}
176
+
177
+ #[ cfg( target_arch = "wasm32" ) ]
178
+ mod _silence_warnings {
179
+ use gr02 as _;
180
+ use gr03 as _;
181
+ }
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ sha2.workspace = true
27
27
thiserror.workspace = true
28
28
29
29
[target .'cfg(target_arch = "wasm32")' .dependencies ]
30
- getrandom = { version = " 0.3" , features = [" wasm_js" ] }
30
+ gr03 = { package = " getrandom" , version = " 0.3" , features = [" wasm_js" ] }
31
+ gr02 = { package = " getrandom" , version = " 0.2" , features = [" js" ] }
31
32
32
33
[dev-dependencies ]
33
34
hex.workspace = true
Original file line number Diff line number Diff line change @@ -21,3 +21,9 @@ pub use self::mnemonic::*;
21
21
/// Wordlists
22
22
pub mod wordlist;
23
23
pub use self :: wordlist:: * ;
24
+
25
+ #[ cfg( target_arch = "wasm32" ) ]
26
+ mod _silence_warnings {
27
+ use gr02 as _;
28
+ use gr03 as _;
29
+ }
Original file line number Diff line number Diff line change @@ -43,9 +43,8 @@ wasm-bindgen = "0.2.88"
43
43
wasm-bindgen-futures = " 0.4.38"
44
44
js-sys = " 0.3.65"
45
45
log = " 0.4"
46
- # getrandom = { version = "0.3", features = ["wasm_js"] }
47
46
48
- [target . 'cfg(target_arch = "wasm32")' . dev-dependencies ]
47
+ [dev-dependencies ]
49
48
tokio = { version = " 1.34" , features = [" rt" , " macros" ] }
50
49
serial_test = " 2"
51
50
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ fn ledger_device_path() {
16
16
println ! ( "{manufacturer:?}" ) ;
17
17
}
18
18
19
- #[ tokio:: test]
20
- #[ serial]
21
19
#[ ignore]
20
+ #[ serial]
21
+ #[ tokio:: test]
22
22
async fn exchange ( ) {
23
23
let transport = transports:: Ledger :: init ( )
24
24
. await
You can’t perform that action at this time.
0 commit comments