Skip to content

Commit

Permalink
various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Jan 8, 2024
1 parent fd84114 commit fa49cda
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 13 deletions.
2 changes: 1 addition & 1 deletion benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ path = "host_env.rs"
[dependencies]

[dev-dependencies]
namada = { path = "../shared", features = ["testing"] }
namada = { path = "../shared", features = ["std", "testing"] }
namada_apps = { path = "../apps", features = ["benches"] }
masp_primitives.workspace = true
borsh.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion core/src/types/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ pub mod tests {
}

/// Generate a new established address.
#[cfg(feature = "rand")]
#[cfg(any(test, feature = "rand"))]
pub fn gen_established_address(seed: impl AsRef<str>) -> Address {
use rand::prelude::ThreadRng;
use rand::{thread_rng, RngCore};
Expand Down
4 changes: 2 additions & 2 deletions core/src/types/key/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::str::FromStr;
use borsh::{BorshDeserialize, BorshSchema, BorshSerialize};
use borsh_ext::BorshSerializeExt;
use data_encoding::HEXLOWER;
#[cfg(feature = "rand")]
#[cfg(any(test, feature = "rand"))]
use rand::{CryptoRng, RngCore};
use serde::{Deserialize, Serialize};
use thiserror::Error;
Expand Down Expand Up @@ -394,7 +394,7 @@ impl super::SigScheme for SigScheme {

const TYPE: SchemeType = SchemeType::Common;

#[cfg(feature = "rand")]
#[cfg(any(test, feature = "rand"))]
fn generate<R>(_csprng: &mut R) -> SecretKey
where
R: CryptoRng + RngCore,
Expand Down
4 changes: 2 additions & 2 deletions core/src/types/key/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::str::FromStr;
use borsh::{BorshDeserialize, BorshSchema, BorshSerialize};
use borsh_ext::BorshSerializeExt;
use data_encoding::HEXLOWER;
#[cfg(feature = "rand")]
#[cfg(any(test, feature = "rand"))]
use rand::{CryptoRng, RngCore};
use serde::{Deserialize, Serialize};
use zeroize::{Zeroize, ZeroizeOnDrop};
Expand Down Expand Up @@ -350,7 +350,7 @@ impl super::SigScheme for SigScheme {

const TYPE: SchemeType = SchemeType::Ed25519;

#[cfg(feature = "rand")]
#[cfg(any(test, feature = "rand"))]
fn generate<R>(csprng: &mut R) -> SecretKey
where
R: CryptoRng + RngCore,
Expand Down
4 changes: 2 additions & 2 deletions core/src/types/key/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::str::FromStr;
use borsh::{BorshDeserialize, BorshSchema, BorshSerialize};
use borsh_ext::BorshSerializeExt;
use data_encoding::HEXUPPER;
#[cfg(feature = "rand")]
#[cfg(any(test, feature = "rand"))]
use rand::{CryptoRng, RngCore};
use serde::{Deserialize, Serialize};
use sha2::{Digest, Sha256};
Expand Down Expand Up @@ -225,7 +225,7 @@ pub trait SigScheme: Eq + Ord + Debug + Serialize + Default {
const TYPE: SchemeType;

/// Generate a keypair.
#[cfg(feature = "rand")]
#[cfg(any(test, feature = "rand"))]
fn generate<R>(csprng: &mut R) -> Self::SecretKey
where
R: CryptoRng + RngCore;
Expand Down
4 changes: 2 additions & 2 deletions core/src/types/key/secp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use data_encoding::HEXLOWER;
use ethabi::Token;
use k256::ecdsa::RecoveryId;
use k256::elliptic_curve::sec1::ToEncodedPoint;
#[cfg(feature = "rand")]
#[cfg(any(test, feature = "rand"))]
use rand::{CryptoRng, RngCore};
use serde::de::{Error, SeqAccess, Visitor};
use serde::ser::SerializeTuple;
Expand Down Expand Up @@ -548,7 +548,7 @@ impl super::SigScheme for SigScheme {

const TYPE: SchemeType = SchemeType::Secp256k1;

#[cfg(feature = "rand")]
#[cfg(any(test, feature = "rand"))]
fn generate<R>(csprng: &mut R) -> SecretKey
where
R: CryptoRng + RngCore,
Expand Down
2 changes: 1 addition & 1 deletion encoding_spec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ version.workspace = true
default = []

[dependencies]
namada = {path = "../shared"}
namada = { path = "../shared", features = ["std", "tendermint-rpc", "download-params"] }
borsh.workspace = true
itertools.workspace = true
lazy_static.workspace = true
Expand Down
1 change: 0 additions & 1 deletion proof_of_stake/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::num::TryFromIntError;
use namada_core::types::address::Address;
use namada_core::types::dec::Dec;
use namada_core::types::storage::Epoch;
use namada_storage;
use thiserror::Error;

use crate::rewards;
Expand Down
2 changes: 1 addition & 1 deletion 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", "download-params"]
default = ["tendermint-rpc", "download-params", "std"]

multicore = ["masp_proofs/multicore"]

Expand Down
2 changes: 2 additions & 0 deletions shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ multicore = [
"namada_sdk/multicore",
"namada_token/multicore",
]
# Download MASP params if they're not present
download-params = ["namada_sdk/download-params"]

[dependencies]
namada_account = { path = "../account" }
Expand Down
14 changes: 14 additions & 0 deletions wasm_for_tests/wasm_source/Cargo.lock

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

0 comments on commit fa49cda

Please sign in to comment.