Skip to content

Commit

Permalink
Merge branch 'tomas/split-up-apps' (#3259)
Browse files Browse the repository at this point in the history
* tomas/split-up-apps:
  changelog: add #3259
  test/apps_lib: fix the top-level dir check
  fix paths for split up namada_apps_lib
  git: ignore the new generated version.rs path
  symlink proto from `apps_lib`
  `mv crates/apps/build.rs crates/apps_lib/`
  `mv crates/apps_lib/src/lib/mod.rs crates/apps_lib/src/lib.rs`
  `mv crates/apps/src/lib crates/apps_lib/src`
  apps_lib: add a new crate for apps lib crate
  fixup! Merge branch 'grarco/masp-fees' (#3217)
  fixup! Merge branch 'grarco/tx-batch' (#3103)
  fixup! Merge branch 'grarco/tx-batch' (#3103)
  fixup! Merge branch 'bat/fix/issue-1796' (#3226)
  fixup! Merge branch 'tiago/max-proposal-bytes-validation' (#3220)
  fixup! Merge branch 'tomas/more-checked-arith' (#3214)
  empty commit
  changelog: add #3216
  deliberatly empty
  Changelog #2817
  added clone to transaction structs
  • Loading branch information
tzemanovic committed May 21, 2024
2 parents 6e99b38 + b132a3a commit d91b142
Show file tree
Hide file tree
Showing 102 changed files with 294 additions and 213 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/3259-split-up-apps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Separated the apps library code from binaries code into a new crate
`namada_apps_lib`. ([\#3259](https://github.com/anoma/namada/pull/3259))
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ target/
wasm/*.wasm

# app version string file
/crates/apps_lib/version.rs
# app version string file (previously at this path, left for transition)
/crates/apps/version.rs

# Hidden to stop from re-appearing. Moved to `tx/src/proto/generated/types.rs`.
Expand Down
31 changes: 28 additions & 3 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 @@ -4,6 +4,7 @@ resolver = "2"
members = [
"crates/account",
"crates/apps",
"crates/apps_lib",
"crates/benches",
"crates/controller",
"crates/core",
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ audit-ignores += RUSTSEC-2021-0076
crates := namada
crates += namada_account
crates += namada_apps
crates += namada_apps_lib
crates += namada_benchmarks
crates += namada_core
crates += namada_encoding_spec
Expand Down
115 changes: 12 additions & 103 deletions crates/apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ readme.workspace = true
repository.workspace = true
version.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
name = "namada_apps"
path = "src/lib/mod.rs"

# Namada CLI that aggregates some common commands for the node and the client
[[bin]]
doc = false
Expand Down Expand Up @@ -50,123 +44,38 @@ name = "namadar"
path = "src/bin/namada-relayer/main.rs"

[features]
default = ["migrations"]
mainnet = [
"namada/mainnet",
]
# for integration tests and test utilities
testing = ["namada_test_utils"]
benches = ["namada_test_utils"]
integration = []
jemalloc = ["rocksdb/jemalloc"]
migrations = [
"namada_migrations",
"namada_sdk/migrations",
"namada/migrations",
"linkme",
]
namada-eth-bridge = [
"namada/namada-eth-bridge",
"namada_sdk/namada-eth-bridge",
]
default = ["namada/mainnet", "migrations"]
mainnet = ["namada_apps_lib/mainnet"]
jemalloc = ["namada_apps_lib/jemalloc"]
migrations = ["namada/migrations", "namada_apps_lib/migrations"]
namada-eth-bridge = ["namada_apps_lib/namada-eth-bridge"]

[dependencies]
namada = {path = "../namada", features = ["multicore", "http-client", "tendermint-rpc", "std"]}
namada_macros = {path = "../macros"}
namada_migrations = {path = "../migrations", optional = true}
namada_sdk = {path = "../sdk", default-features = false, features = ["download-params", "std", "rand"]}
namada_test_utils = {path = "../test_utils", optional = true}
namada = {path = "../namada"}
namada_apps_lib = {path = "../apps_lib"}


ark-serialize.workspace = true
ark-std.workspace = true
arse-merkle-tree = { workspace = true, features = ["blake2b"] }
async-trait.workspace = true
base64.workspace = true
bech32.workspace = true
bimap.workspace = true
blake2b-rs.workspace = true
borsh.workspace = true
borsh-ext.workspace = true
byte-unit.workspace = true
byteorder.workspace = true
clap.workspace = true
color-eyre.workspace = true
config.workspace = true
data-encoding.workspace = true
derivative.workspace = true
directories.workspace = true
drain_filter_polyfill.workspace = true
ed25519-consensus = { workspace = true, features = ["std"] }
ethabi.workspace = true
ethbridge-bridge-events.workspace = true
ethbridge-events.workspace = true
eyre.workspace = true
fd-lock.workspace = true
flate2.workspace = true
futures.workspace = true
itertools.workspace = true
lazy_static.workspace= true
ledger-namada-rs.workspace = true
ledger-transport-hid.workspace = true
libc.workspace = true
libloading.workspace = true
linkme = { workspace = true, optional = true }
masp_primitives = { workspace = true, features = ["transparent-inputs"] }
masp_proofs = { workspace = true, features = ["bundled-prover", "download-params"] }
num_cpus.workspace = true
num256.workspace = true
num-rational.workspace = true
num-traits.workspace = true
once_cell.workspace = true
orion.workspace = true
prost-types.workspace = true
prost.workspace = true
rand_core = { workspace = true, features = ["std"] }
rand = { workspace = true, features = ["std"] }
rayon.workspace = true
regex.workspace = true
reqwest.workspace = true
ripemd.workspace = true
rlimit.workspace = true
rocksdb.workspace = true
rpassword.workspace = true
serde_bytes.workspace = true
serde_json = {workspace = true, features = ["raw_value"]}
serde.workspace = true
sha2.workspace = true
smooth-operator.workspace = true
sysinfo.workspace = true
tar.workspace = true
tempfile.workspace = true
tendermint-config.workspace = true
tendermint-rpc.workspace = true
textwrap-macros = "0.3.0"
thiserror.workspace = true
tokio = {workspace = true, features = ["full"]}
toml.workspace = true
tower-abci.workspace = true
tower.workspace = true
tracing-appender.workspace = true
tracing-log.workspace = true
tracing-subscriber = { workspace = true, features = ["std", "json", "ansi", "tracing-log"]}
tracing.workspace = true
zeroize.workspace = true
warp = "0.3.2"
bytes = "1.1.0"

[target.'cfg(windows)'.dependencies]
winapi.workspace = true

[dev-dependencies]
namada = {path = "../namada", default-features = false, features = ["testing", "wasm-runtime"]}
namada_test_utils = {path = "../test_utils"}
assert_matches.workspace = true

assert_matches = "1.5.0"
bit-set.workspace = true
pretty_assertions.workspace = true
proptest.workspace = true
test-log.workspace = true
tokio-test.workspace = true

[build-dependencies]
git2.workspace = true

[target.'cfg(windows)'.dependencies]
winapi.workspace = true
1 change: 0 additions & 1 deletion crates/apps/proto

This file was deleted.

6 changes: 3 additions & 3 deletions crates/apps/src/bin/namada-client/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use color_eyre::eyre::Result;
use namada_apps::cli::api::{CliApi, CliIo};
use namada_apps::facade::tendermint_rpc::HttpClient;
use namada_apps::{cli, logging};
use namada_apps_lib::cli::api::{CliApi, CliIo};
use namada_apps_lib::facade::tendermint_rpc::HttpClient;
use namada_apps_lib::{cli, logging};
use tracing_subscriber::filter::LevelFilter;

#[tokio::main]
Expand Down
6 changes: 3 additions & 3 deletions crates/apps/src/bin/namada-node/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

Expand Down
2 changes: 1 addition & 1 deletion crates/apps/src/bin/namada-node/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod cli;

use color_eyre::eyre::Result;
use namada_apps::logging;
use namada_apps_lib::logging;
use tracing_subscriber::filter::LevelFilter;

fn main() -> Result<()> {
Expand Down
4 changes: 2 additions & 2 deletions crates/apps/src/bin/namada-relayer/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use color_eyre::eyre::Result;
use namada::tendermint_rpc::HttpClient;
use namada_apps::cli::api::{CliApi, CliIo};
use namada_apps::{cli, logging};
use namada_apps_lib::cli::api::{CliApi, CliIo};
use namada_apps_lib::{cli, logging};
use tracing_subscriber::filter::LevelFilter;

#[tokio::main]
Expand Down
4 changes: 2 additions & 2 deletions crates/apps/src/bin/namada-wallet/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use color_eyre::eyre::Result;
use namada_apps::cli;
use namada_apps::cli::api::{CliApi, CliIo};
use namada_apps_lib::cli;
use namada_apps_lib::cli::api::{CliApi, CliIo};

#[tokio::main]
pub async fn main() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion crates/apps/src/bin/namada/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::env;
use std::process::Command;

use eyre::Result;
use namada_apps::cli;
use namada_apps_lib::cli;

pub fn main() -> Result<()> {
let (cmd, raw_sub_cmd) = cli::namada_cli();
Expand Down
2 changes: 1 addition & 1 deletion crates/apps/src/bin/namada/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod cli;

use color_eyre::eyre::Result;
use namada_apps::logging;
use namada_apps_lib::logging;
use tracing_subscriber::filter::LevelFilter;

fn main() -> Result<()> {
Expand Down
Loading

0 comments on commit d91b142

Please sign in to comment.