Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
feat: support wasm32 target (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Br1ght0ne authored Aug 26, 2022
1 parent 1ba88dc commit d94039b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ jobs:
target: thumbv6m-none-eabi
override: true

- name: Install toolchain WASM
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true

- name: Install Cargo.toml linter
uses: baptiste0928/cargo-install@v1
with:
Expand Down Expand Up @@ -73,6 +80,24 @@ jobs:
command: build
args: --verbose --target thumbv6m-none-eabi --no-default-features --features random

- name: Build WASM
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --target wasm32-unknown-unknown --no-default-features

- name: Build WASM alloc
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --target wasm32-unknown-unknown --no-default-features --features alloc

- name: Build WASM random
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --target wasm32-unknown-unknown --no-default-features --features random

- name: Run tests all features
uses: actions-rs/cargo@v1
with:
Expand Down
12 changes: 7 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ coins-bip32 = { version = "0.7", default-features = false, optional = true }
coins-bip39 = { version = "0.7", default-features = false, optional = true }
fuel-types = { version = "0.5", default-features = false }
lazy_static = { version = "1.4", optional = true }
rand = { version = "0.8", default-features = false, features = ["std_rng"], optional = true }
# `rand-std` is used to further protect the blinders from side-channel attacks and won't compromise
# the deterministic arguments of the signature (key, nonce, message), as defined in the RFC-6979
secp256k1 = { version = "0.24", features = [ "rand-std", "recovery" ], optional = true }
rand = { version = "0.8", default-features = false, optional = true }
secp256k1 = { version = "0.24", default-features = false, features = ["recovery"], optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
sha2 = { version = "0.10", default-features = false }

Expand All @@ -33,9 +31,13 @@ sha2 = "0.10"

[features]
default = ["fuel-types/default", "std"]
alloc = ["rand/alloc", "secp256k1/alloc"]
random = ["fuel-types/random", "rand"]
serde = ["dep:serde", "fuel-types/serde"]
std = ["fuel-types/std", "lazy_static", "secp256k1", "serde?/default", "coins-bip32", "coins-bip39"]
# `rand-std` is used to further protect the blinders from side-channel attacks and won't compromise
# the deterministic arguments of the signature (key, nonce, message), as defined in the RFC-6979
std = ["alloc", "coins-bip32", "coins-bip39", "fuel-types/std", "lazy_static", "rand/std_rng", "secp256k1/rand-std", "serde?/default"]
wasm = ["secp256k1/rand"]

[[test]]
name = "test-mnemonic"
Expand Down

0 comments on commit d94039b

Please sign in to comment.