-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor core into simplified WASM module (#79)
- Loading branch information
Showing
20 changed files
with
2,027 additions
and
2,919 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ target/ | |
Cargo.lock | ||
**/*.rs.bk | ||
|
||
*.wasm | ||
mod.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,39 @@ | ||
[package] | ||
name = "dusk-wallet-core" | ||
version = "0.20.0-piecrust.0.6" | ||
version = "0.21.0" | ||
edition = "2021" | ||
description = "The core functionality of the Dusk wallet" | ||
license = "MPL-2.0" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[dependencies] | ||
rand_core = "^0.6" | ||
rand_chacha = { version = "^0.3", default-features = false } | ||
sha2 = { version = "^0.10", default-features = false } | ||
phoenix-core = { version = "0.20.0-rc.0", default-features = false, features = ["alloc", "rkyv-impl"] } | ||
dusk-pki = { version = "0.12", default-features = false } | ||
bytecheck = { version = "0.6", default-features = false } | ||
bs58 = { version = "0.5", default-features = false, features = ["alloc", "cb58"] } | ||
dusk-bls12_381-sign = { version = "0.4", default-features = false } | ||
dusk-bytes = "^0.1" | ||
dusk-schnorr = { version = "0.13", default-features = false } | ||
dusk-jubjub = { version = "0.12", default-features = false } | ||
dusk-poseidon = { version = "0.30", default-features = false } | ||
dusk-pki = { version = "0.12", default-features = false, features = ["rkyv-impl"] } | ||
dusk-schnorr = { version = "0.13", default-features = false } | ||
phoenix-core = { version = "0.20.0-rc.0", default-features = false, features = ["alloc", "rkyv-impl"] } | ||
poseidon-merkle = { version = "0.2.1-rc.0", features = ["rkyv-impl"] } | ||
dusk-plonk = { version = "0.14", default-features = false } | ||
rand_chacha = { version = "^0.3", default-features = false } | ||
rand_core = "^0.6" | ||
rkyv = { version = "^0.7", default-features = false, features = ["size_32"] } | ||
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } | ||
serde_json = { version = "1.0", default-features = false, features = ["alloc"] } | ||
sha2 = { version = "^0.10", default-features = false } | ||
|
||
[target.'cfg(target_family = "wasm")'.dependencies] | ||
rusk-abi = "0.10.0-piecrust.0.6" | ||
|
||
[target.'cfg(not(target_family = "wasm"))'.dependencies] | ||
rusk-abi = { version = "0.10.0-piecrust.0.6", default-features = false } | ||
dusk-bls12_381-sign = { version = "0.4", default-features = false } | ||
rkyv = { version = "0.7", default-features = false } | ||
|
||
[dev-dependencies] | ||
rand = "^0.8" | ||
wasmer = "=3.1" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
[build-dependencies] | ||
schemafy_lib = "0.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
PROJECT := $(shell sed -n '0,/name\s*=\s*"\(.*\)"/s/name\s*=\s*"\(.*\)"/\1/p' Cargo.toml) | ||
VERSION := $(shell sed -n '0,/version\s*=\s*"\(.*\)"/s/version\s*=\s*"\(.*\)"/\1/p' Cargo.toml) | ||
FLAGS := RUSTFLAGS="$(RUSTFLAGS) --remap-path-prefix $(HOME)= -C link-args=-zstack-size=65536" | ||
WASM := "target/wasm32-unknown-unknown/release/$(shell sed -n '0,/name\s*=\s*"\(.*\)"/s/name\s*=\s*"\(.*\)"/\1/p' Cargo.toml | sed 's/-/_/g').wasm" | ||
NPM_WASM := "mod.wasm" | ||
PACKAGE := "assets/$(PROJECT)-$(VERSION).wasm" | ||
|
||
help: ## Display this help screen | ||
@grep -h \ | ||
-E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ | ||
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
test: wasm ## Run the wasmer tests | ||
@cargo test | ||
|
||
wasm: ## Build the WASM files | ||
@$(FLAGS) cargo build --release \ | ||
--target wasm32-unknown-unknown \ | ||
--color=always \ | ||
-Z build-std=core,alloc,panic_abort \ | ||
-Z build-std-features=panic_immediate_abort | ||
@cp target/wasm32-unknown-unknown/release/dusk_wallet_core.wasm \ | ||
assets/ | ||
|
||
package: wasm ## Prepare the WASM package | ||
@wasm-opt -O3 $(WASM) -o $(NPM_WASM) | ||
@cp $(NPM_WASM) $(PACKAGE) | ||
@echo "Package created: $(PACKAGE)" | ||
|
||
.PHONY: test wasm package help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Oops, something went wrong.