Skip to content

Commit

Permalink
nostr: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed May 20, 2023
1 parent 119288f commit 740abe1
Show file tree
Hide file tree
Showing 37 changed files with 337 additions and 759 deletions.
8 changes: 4 additions & 4 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ cargo fmt --all -- --config format_code_in_doc_comments=true

buildargs=(
"-p nostr"
"-p nostr --no-default-features"
"-p nostr --no-default-features --features all-nips"
"-p nostr --no-default-features --features vanity"
"-p nostr --features blocking"
"-p nostr --no-default-features" std
"-p nostr --no-default-features --features 'std all-nips'"
"-p nostr --no-default-features --features 'std vanity'"
"-p nostr --features 'std blocking'"
"-p nostr-sdk"
"-p nostr-sdk --no-default-features"
"-p nostr-sdk --features blocking"
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
- version: nightly
build-args:
[
--no-default-features,
-p no_std_example,
]
steps:
- name: Checkout
Expand All @@ -124,8 +124,6 @@ jobs:
run: rustup set profile minimal && rustup component add clippy
- name: Build
run: cargo build ${{ matrix.build-args }}
working-directory: ./crates/nostr/examples/ensure_no_std
- name: Clippy
run: cargo clippy ${{ matrix.build-args }} -- -D warnings
working-directory: ./crates/nostr/examples/ensure_no_std

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"bindings/nostr-sdk-ffi",
"bindings/nostr-sdk-js",
"crates/nostr",
"crates/nostr/examples/no_std",
"crates/nostr-sdk",
"crates/nostr-sdk-net",
]
Expand Down
37 changes: 13 additions & 24 deletions crates/nostr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@ default = ["all-nips", "std"]
std = [
"bech32?/std",
"bitcoin_hashes/std",
"once_cell/std",
"secp256k1/rand-std",
"serde/std",
"serde_json/std",
"url",
"secp256k1/global-context",
"secp256k1/rand-std",
]
alloc = [
"bech32?/alloc",
"bitcoin_hashes/alloc",
"once_cell/alloc",
"rand/alloc",
"rand/getrandom",
"secp256k1/alloc",
"secp256k1/rand",
"serde/alloc",
"serde_json/alloc",
"url_no_std",
"secp256k1/alloc",
"secp256k1/rand",
"rand",
]
blocking = ["reqwest?/blocking"]
vanity = ["nip19"]
Expand All @@ -51,30 +53,17 @@ base64 = { version = "0.21", optional = true }
bech32 = { git = "https://github.com/rust-bitcoin/rust-bech32", rev = "360af7e0647fa94bce892fa69f31c0ef02452b63", optional = true, default-features = false }
bip39 = { version = "2.0", optional = true }
bitcoin = { version = "0.30", optional = true }
bitcoin_hashes = { version = "0.12", default-features = false, features = [
"serde",
] }
bitcoin_hashes = { version = "0.12", default-features = false, features = [ "serde"] }
cbc = { version = "0.1", features = ["alloc"], optional = true }
log = "0.4" # no_std compatible by-default
nostr-ots = { version = "0.2", optional = true }
reqwest = { version = "0.11", default-features = false, features = [
"json",
"rustls-tls-webpki-roots",
"socks",
], optional = true }
once_cell = { version = "1.17", default-features = false }
rand = { version = "0.8", default-features = false }
reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls-webpki-roots", "socks"], optional = true }
secp256k1 = { version = "0.27", default-features = false, features = ["serde"] }

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

url = { version = "2", features = ["serde"], optional = true }
url_no_std = { package = "url", features = [
"alloc",
], git = "https://github.com/OverOrion/rust-url", branch = "no_std_net", optional = true, default-features = false }

rand = { version = "0.8", features = ["alloc", "getrandom"], default-features = false, optional = true }
url_no_std = { package = "url", features = ["alloc"], git = "https://github.com/OverOrion/rust-url", branch = "no_std_net", optional = true, default-features = false }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
Expand Down
15 changes: 0 additions & 15 deletions crates/nostr/examples/ensure_no_std/Cargo.toml

This file was deleted.

8 changes: 8 additions & 0 deletions crates/nostr/examples/no_std/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "no_std_example"
version = "0.1.0"
edition = "2021"

[dependencies]
libc = { version = "0.2", default-features = false }
nostr = { path = "../../../nostr", default-features = false, features = ["alloc"] }
File renamed without changes.
Loading

0 comments on commit 740abe1

Please sign in to comment.