Skip to content

Commit

Permalink
fix everything that was depending on rm'd namada crate
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Jun 25, 2024
1 parent faffa43 commit 949f6b1
Show file tree
Hide file tree
Showing 167 changed files with 2,510 additions and 2,484 deletions.
19 changes: 17 additions & 2 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ wasmer = "4.3.1"
wasmer-cache = "4.3.1"
wasmer-compiler-singlepass = "4.3.1"
wasmer-vm = "4.3.1"
wasmtimer = "0.2.0"
winapi = "0.3.9"
yansi = "0.5.1"
zeroize = { version = "1.5.5", features = ["zeroize_derive"] }
Expand Down
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ check:
check-mainnet:
$(cargo) check --workspace --features "mainnet"

# Check that every crate can be built with default features and that namada crate
# can be built for wasm
# Check that every crate can be built with default features and that SDK crate
# can be built for wasm and with all features enabled
check-crates:
rustup target add --toolchain $(nightly) wasm32-unknown-unknown
$(foreach p,$(crates), echo "Checking $(p)" && cargo +$(nightly) check -Z unstable-options --tests -p $(p) && ) \
make -C $(wasms) check && \
make -C $(wasms_for_tests) check && \
cargo check --package namada --target wasm32-unknown-unknown --no-default-features --features "namada-sdk" && \
cargo check --package namada_sdk --target wasm32-unknown-unknown --no-default-features && \
cargo check --package namada_sdk --all-features

clippy-wasm = $(cargo) +$(nightly) clippy --manifest-path $(wasm)/Cargo.toml --all-targets -- -D warnings
Expand Down Expand Up @@ -155,7 +155,6 @@ test-coverage:
# Run integration tests separately because they require `integration`
# feature (and without coverage)
$(cargo) +$(nightly) llvm-cov --output-path lcov.info \
--features namada/testing \
--lcov \
-- --skip e2e --skip pos_state_machine_test --skip integration \
-Z unstable-options --report-time && \
Expand Down Expand Up @@ -204,7 +203,6 @@ test-unit-with-eth-bridge:

test-unit-with-coverage:
$(cargo) +$(nightly) llvm-cov --output-path lcov.info \
--features namada/testing \
--lcov \
-- --skip e2e --skip pos_state_machine_test --skip integration \
-Z unstable-options --report-time
Expand Down
8 changes: 4 additions & 4 deletions crates/apps/src/bin/namada-node/cli.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//! Namada node CLI.

use eyre::{Context, Result};
use namada::core::time::{DateTimeUtc, Utc};
use namada::sdk::migrations::ScheduledMigration;
use namada_apps_lib::cli::cmds::TestGenesis;
use namada_apps_lib::cli::{self, cmds};
use namada_apps_lib::config::{Action, ActionAtHeight, ValidatorLocalConfig};
use namada_node as node;
#[cfg(not(feature = "migrations"))]
use namada_sdk::display_line;
use namada_apps_lib::display_line;
use namada_apps_lib::migrations::ScheduledMigration;
use namada_apps_lib::time::{DateTimeUtc, Utc};
use namada_node as node;

pub fn main() -> Result<()> {
let (cmd, mut ctx) = cli::namada_node_cli()?;
Expand Down
2 changes: 1 addition & 1 deletion crates/apps/src/bin/namada-relayer/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use color_eyre::eyre::Result;
use namada::tendermint_rpc::HttpClient;
use namada_apps_lib::cli::api::{CliApi, CliIo};
use namada_apps_lib::tendermint_rpc::HttpClient;
use namada_apps_lib::{cli, logging};
use tracing_subscriber::filter::LevelFilter;

Expand Down
11 changes: 7 additions & 4 deletions crates/apps_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ mainnet = [
"namada_sdk/mainnet",
]
# for integration tests and test utilities
testing = ["namada_test_utils", "lazy_static"]
benches = ["namada_test_utils", "lazy_static"]
testing = ["namada_test_utils", "lazy_static", "namada_sdk/testing"]
benches = ["namada_test_utils", "lazy_static", "namada_sdk/benches"]
integration = []
migrations = [
"namada_migrations",
Expand All @@ -31,10 +31,12 @@ namada-eth-bridge = [
]

[dependencies]
namada_core = {path = "../core"}
namada_macros = {path = "../macros"}
namada_migrations = {path = "../migrations", optional = true}
namada_sdk = {path = "../sdk", default-features = false, features = ["download-params", "std", "rand"]}
namada_sdk = {path = "../sdk", features = ["download-params", "multicore"]}
namada_test_utils = {path = "../test_utils", optional = true}
namada_vm = {path = "../vm"}

async-trait.workspace = true
base64.workspace = true
Expand Down Expand Up @@ -67,7 +69,7 @@ sha2.workspace = true
tar.workspace = true
tempfile.workspace = true
tendermint-config.workspace = true
tendermint-rpc.workspace = true
tendermint-rpc = { workspace = true, features = ["http-client"] }
textwrap-macros = "0.3.0"
thiserror.workspace = true
tokio = {workspace = true, features = ["full"]}
Expand All @@ -79,6 +81,7 @@ tracing.workspace = true
zeroize.workspace = true

[dev-dependencies]
namada_sdk = {path = "../sdk", features = ["testing"]}
namada_test_utils = {path = "../test_utils"}

assert_matches.workspace = true
Expand Down
34 changes: 16 additions & 18 deletions crates/apps_lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub mod wallet;

use clap::{ArgGroup, ArgMatches, ColorChoice};
use color_eyre::eyre::Result;
use namada::io::StdIo;
use namada_sdk::io::StdIo;
use utils::*;
pub use utils::{safe_exit, Cmd};

Expand Down Expand Up @@ -3076,23 +3076,21 @@ pub mod args {
use std::str::FromStr;

use data_encoding::HEXUPPER;
use namada::core::address::{Address, EstablishedAddress};
use namada::core::chain::{ChainId, ChainIdPrefix};
use namada::core::collections::HashMap;
use namada::core::dec::Dec;
use namada::core::ethereum_events::EthAddress;
use namada::core::keccak::KeccakHash;
use namada::core::key::*;
use namada::core::masp::PaymentAddress;
use namada::core::storage::{self, BlockHeight, Epoch};
use namada::core::time::DateTimeUtc;
use namada::core::token;
use namada::core::token::NATIVE_MAX_DECIMAL_PLACES;
use namada::hash::Hash;
use namada::ibc::core::host::types::identifiers::{ChannelId, PortId};
use namada::masp::MaspEpoch;
use namada::tx::data::GasLimit;
use namada_sdk::address::{Address, EstablishedAddress};
pub use namada_sdk::args::*;
use namada_sdk::chain::{ChainId, ChainIdPrefix};
use namada_sdk::collections::HashMap;
use namada_sdk::dec::Dec;
use namada_sdk::ethereum_events::EthAddress;
use namada_sdk::hash::Hash;
use namada_sdk::ibc::core::host::types::identifiers::{ChannelId, PortId};
use namada_sdk::keccak::KeccakHash;
use namada_sdk::key::*;
use namada_sdk::masp::{MaspEpoch, PaymentAddress};
use namada_sdk::storage::{self, BlockHeight, Epoch};
use namada_sdk::time::DateTimeUtc;
use namada_sdk::token::NATIVE_MAX_DECIMAL_PLACES;
use namada_sdk::tx::data::GasLimit;
pub use namada_sdk::tx::{
TX_BECOME_VALIDATOR_WASM, TX_BOND_WASM, TX_BRIDGE_POOL_WASM,
TX_CHANGE_COMMISSION_WASM, TX_CHANGE_CONSENSUS_KEY_WASM,
Expand All @@ -3105,7 +3103,7 @@ pub mod args {
TX_UPDATE_ACCOUNT_WASM, TX_UPDATE_STEWARD_COMMISSION, TX_VOTE_PROPOSAL,
TX_WITHDRAW_WASM, VP_USER_WASM,
};
use namada_sdk::DEFAULT_GAS_LIMIT;
use namada_sdk::{token, DEFAULT_GAS_LIMIT};

use super::context::*;
use super::utils::*;
Expand Down
8 changes: 4 additions & 4 deletions crates/apps_lib/src/cli/api.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use namada::io::Io;
use namada::tendermint_rpc::HttpClient;
use namada_sdk::error::Error;
use namada_sdk::io::Io;
use namada_sdk::queries::Client;
use namada_sdk::rpc::wait_until_node_is_synched;
use tendermint_rpc::client::CompatMode;
use tendermint_rpc::Url as TendermintUrl;

use crate::facade::tendermint_rpc::client::CompatMode;
use crate::facade::tendermint_rpc::{HttpClient, Url as TendermintUrl};

/// Trait for clients that can be used with the CLI.
#[async_trait::async_trait(?Send)]
Expand Down
2 changes: 1 addition & 1 deletion crates/apps_lib/src/cli/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::io::Read;

use color_eyre::eyre::Result;
use masp_primitives::zip32::ExtendedFullViewingKey;
use namada::io::Io;
use namada_sdk::io::Io;
use namada_sdk::{display_line, Namada, NamadaImpl};

use crate::cli;
Expand Down
19 changes: 9 additions & 10 deletions crates/apps_lib/src/cli/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ use std::path::{Path, PathBuf};
use std::str::FromStr;

use color_eyre::eyre::Result;
use namada::core::address::{Address, InternalAddress};
use namada::core::chain::ChainId;
use namada::core::ethereum_events::EthAddress;
use namada::core::key::*;
use namada::core::masp::*;
use namada::ibc::{is_ibc_denom, is_nft_trace};
use namada::io::Io;
use namada::ledger::ibc::storage::ibc_token;
use namada_sdk::address::{Address, InternalAddress};
use namada_sdk::chain::ChainId;
use namada_sdk::ethereum_events::EthAddress;
use namada_sdk::ibc::storage::ibc_token;
use namada_sdk::ibc::{is_ibc_denom, is_nft_trace};
use namada_sdk::io::Io;
use namada_sdk::key::*;
use namada_sdk::masp::fs::FsShieldedUtils;
use namada_sdk::masp::ShieldedContext;
use namada_sdk::masp::{ShieldedContext, *};
use namada_sdk::wallet::Wallet;
use namada_sdk::{Namada, NamadaImpl};

Expand Down Expand Up @@ -226,7 +225,7 @@ impl Context {
/// Make an implementation of Namada from this object and parameters.
pub fn to_sdk<C, IO>(self, client: C, io: IO) -> impl Namada
where
C: namada::ledger::queries::Client + Sync,
C: namada_sdk::queries::Client + Sync,
IO: Io,
{
let chain_ctx = self.take_chain_or_exit();
Expand Down
2 changes: 1 addition & 1 deletion crates/apps_lib/src/cli/relayer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use color_eyre::eyre::Result;
use namada::io::Io;
use namada_sdk::io::Io;

use crate::cli;
use crate::cli::api::{CliApi, CliClient};
Expand Down
8 changes: 4 additions & 4 deletions crates/apps_lib/src/cli/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use std::sync::Arc;
use clap::{ArgAction, ArgMatches};
use color_eyre::eyre::Result;
use data_encoding::HEXLOWER_PERMISSIVE;
use namada::eth_bridge::ethers::core::k256::elliptic_curve::SecretKey as Secp256k1Sk;
use namada::eth_bridge::ethers::middleware::SignerMiddleware;
use namada::eth_bridge::ethers::providers::{Http, Middleware, Provider};
use namada::eth_bridge::ethers::signers::{Signer, Wallet};
use namada_sdk::eth_bridge::ethers::core::k256::elliptic_curve::SecretKey as Secp256k1Sk;
use namada_sdk::eth_bridge::ethers::middleware::SignerMiddleware;
use namada_sdk::eth_bridge::ethers::providers::{Http, Middleware, Provider};
use namada_sdk::eth_bridge::ethers::signers::{Signer, Wallet};

use super::args;
use super::context::Context;
Expand Down
11 changes: 6 additions & 5 deletions crates/apps_lib/src/cli/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ use ledger_namada_rs::{BIP44Path, NamadaApp};
use ledger_transport_hid::hidapi::HidApi;
use ledger_transport_hid::TransportNativeHID;
use masp_primitives::zip32::ExtendedFullViewingKey;
use namada::core::address::{Address, DecodeError};
use namada::core::key::*;
use namada::core::masp::{ExtendedSpendingKey, MaspValue, PaymentAddress};
use namada::io::Io;
use namada_sdk::masp::find_valid_diversifier;
use namada_sdk::address::{Address, DecodeError};
use namada_sdk::io::Io;
use namada_sdk::key::*;
use namada_sdk::masp::{
find_valid_diversifier, ExtendedSpendingKey, MaspValue, PaymentAddress,
};
use namada_sdk::wallet::{
DecryptionError, DerivationPath, DerivationPathError, FindKeyError, Wallet,
};
Expand Down
Loading

0 comments on commit 949f6b1

Please sign in to comment.