Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Rust tiny-secp256k1 lib and remove wasm-pack #10

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.DS_Store
package-lock.json
/node_modules
/pkg
/rust/target
/rust/pkg
/tmp
/target

.DS_Store
package-lock.json
231 changes: 231 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[workspace]
members = [
"secp256k1",
"secp256k1-wasm"
]

[profile.release]
# https://rust-embedded.github.io/book/unsorted/speed-vs-size.html#optimize-for-size
# Before activate "s", need to verify with benchmark that performance change is acceptable.
# opt-level = "s"
lto = true
codegen-units = 1
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
build:
cargo build --release -p secp256k1-wasm --target wasm32-unknown-unknown
wasm-bindgen --out-dir pkg --target nodejs target/wasm32-unknown-unknown/release/secp256k1_wasm.wasm
wasm-opt -O4 pkg/secp256k1_wasm_bg.wasm --output pkg/secp256k1_wasm_bg.wasm

build-debug:
cargo build -p secp256k1-wasm --target wasm32-unknown-unknown
wasm-bindgen --out-dir pkg --target nodejs --debug --no-demangle --keep-debug target/wasm32-unknown-unknown/debug/secp256k1_wasm.wasm

clean:
rm -rf node_modules pkg target

# TODO: add js format (prettier?)
format:
cargo-fmt

# TODO: add js linter (same as fmt, prettier?)
lint:
cargo fmt -- --check
cargo clippy
48 changes: 0 additions & 48 deletions bin/build.sh

This file was deleted.

Loading