Skip to content

Commit

Permalink
feature guard masp "download-params" in the sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Dec 6, 2023
1 parent 8a14131 commit c57e818
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
2 changes: 1 addition & 1 deletion apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ integration = []

[dependencies]
namada = {path = "../shared", features = ["multicore", "http-client", "tendermint-rpc"]}
namada_sdk = {path = "../sdk", default-features = false, features = ["wasm-runtime"]}
namada_sdk = {path = "../sdk", default-features = false, features = ["wasm-runtime", "download-params"]}
namada_test_utils = {path = "../test_utils", optional = true}
ark-serialize.workspace = true
ark-std.workspace = true
Expand Down
7 changes: 5 additions & 2 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ version.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = ["tendermint-rpc"]
default = ["tendermint-rpc", "download-params"]

multicore = ["masp_proofs/multicore"]

Expand Down Expand Up @@ -53,6 +53,9 @@ testing = [
"async-client",
]

# Download MASP params if they're not present
download-params = ["masp_proofs/download-params"]

[dependencies]
async-trait = {version = "0.1.51", optional = true}
bimap.workspace = true
Expand All @@ -67,7 +70,7 @@ fd-lock = { workspace = true, optional = true }
futures.workspace = true
itertools.workspace = true
masp_primitives.workspace = true
masp_proofs = { workspace = true, features = ["download-params"] }
masp_proofs.workspace = true
namada_core = {path = "../core", default-features = false, features = ["rand"]}
namada_ethereum_bridge = {path = "../ethereum_bridge", default-features = false}
namada_proof_of_stake = {path = "../proof_of_stake", default-features = false}
Expand Down
1 change: 1 addition & 0 deletions sdk/src/masp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ fn load_pvks() -> (
let [spend_path, convert_path, output_path] =
[SPEND_NAME, CONVERT_NAME, OUTPUT_NAME].map(|p| params_dir.join(p));

#[cfg(feature = "download-params")]
if !spend_path.exists() || !convert_path.exists() || !output_path.exists() {
let paths = masp_proofs::download_masp_parameters(None).expect(
"MASP parameters were not present, expected the download to \
Expand Down
2 changes: 1 addition & 1 deletion shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ futures.workspace = true
itertools.workspace = true
loupe = {version = "0.1.3", optional = true}
masp_primitives.workspace = true
masp_proofs = { workspace = true, features = ["download-params"] }
masp_proofs.workspace = true
num256.workspace = true
orion.workspace = true
owo-colors = "3.5.0"
Expand Down
20 changes: 0 additions & 20 deletions wasm/Cargo.lock

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

0 comments on commit c57e818

Please sign in to comment.