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

Commit

Permalink
Move "core" back to be the root of the crate
Browse files Browse the repository at this point in the history
  • Loading branch information
olanod committed Apr 9, 2023
1 parent 98c5463 commit 8a1ec24
Show file tree
Hide file tree
Showing 32 changed files with 58 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
rustup target add wasm32-unknown-unknown
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build
working-directory: libwallet-js
working-directory: js
run: |
wasm-pack build --dev --target nodejs --all-features
- name: Run tests
working-directory: libwallet-js/test
working-directory: js/test
run: |
npm ci
npm test
2 changes: 0 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build
working-directory: libwallet-core
run: cargo build --verbose
- name: Run tests
working-directory: libwallet-core
run: cargo test --verbose --all-features
52 changes: 50 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
[package]
authors = ["Daniel Olano <[email protected]>"]
autoexamples = true
edition = "2018"
name = "libwallet"
version = "0.3.0"

[dependencies]
# base dependencies
arrayvec = {version = "0.7.2", default-features = false}

serde = {version = "1.0", default-features = false, features = ["derive"], optional = true}

# feature util_pin
hmac = {version = "0.12.1", default-features = false, optional = true}
pbkdf2 = {version = "0.11.0", default-features = false, optional = true}
sha2 = {version = "0.10.2", default-features = false, optional = true}

mnemonic = {package = "bip0039", version = "0.10.1", default-features = false, optional = true}

rand_core = {version = "0.6.3", optional = true}
# substrate related
schnorrkel = {version = "0.10.2", default-features = false, optional = true}# soft derivation in no_std
rand_chacha = {version = "0.3.1", default-features = false, optional = true}

# vault os
keyring = {version = "1.1.2", optional = true}
# vault pass
prs-lib = {version = "0.2.1", optional = true}

[dev-dependencies]
async-std = {version = "1.10.0", features = ["attributes"]}
serde_json = {version = "1.0", default-features = false, features = ["alloc"]}
# pass vault example
dirs = "4.0"

[features]
default = ["std", "substrate", "vault_simple", "mnemonic", "rand"]
rand = ["rand_core"]
sr25519 = ["schnorrkel/u64_backend", "schnorrkel/getrandom"]
std = [
"rand_core/getrandom",
]
substrate = ["sr25519"]
util_pin = ["pbkdf2", "hmac", "sha2"]
vault_os = ["keyring"]
vault_pass = ["prs-lib"]
vault_simple = []

[workspace]
members = [
"libwallet-core",
"libwallet-js"
"js",
]
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions libwallet-js/Cargo.toml → js/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ version = "0.1.0"
crate-type = ["cdylib"]

[dependencies]
hex = {version = "0.4.3", optional = true}
libwallet = { path = "..", default-features = false }
hex = { version = "0.4.3", optional = true }
js-sys = "0.3.61"
libwallet = {path = "../libwallet-core", default-features = false}
rand_core = {version = "0.6.3", features = ["getrandom"]}
serde = {version = "1.0.152", features = ["derive"]}
rand_core = { version = "0.6.3", features = ["getrandom"] }
serde = { version = "1.0.152", features = ["derive"] }
serde-wasm-bindgen = "0.4.5"
wasm-bindgen = "0.2.84"
wasm-bindgen-futures = "0.4.34"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 0 additions & 37 deletions libwallet-core/Cargo.toml

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions libwallet-core/src/lib.rs → src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ mod util {
let protected_seed = $pin.protect::<64>($seed);
#[cfg(feature = "util_pin")]
let $seed = &protected_seed;
#[cfg(not(feature = "util_pin"))]
let _ = &$pin; // use the variable to avoid warning
};
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8a1ec24

Please sign in to comment.