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 21, 2024
1 parent 2b56fbe commit 8e91b53
Show file tree
Hide file tree
Showing 153 changed files with 2,429 additions and 2,395 deletions.
17 changes: 16 additions & 1 deletion Cargo.lock

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

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
13 changes: 9 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 = ["testing"]
integration = []
migrations = [
"namada_migrations",
Expand All @@ -31,10 +31,14 @@ 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 = ["validation", "std", "rand"]}
namada_sdk = {path = "../sdk", default-features = false, features = [
"async-client", "std", "tendermint-rpc", "rand", "validation", "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 +71,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 +83,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 8e91b53

Please sign in to comment.