Skip to content

Commit

Permalink
update paths for core split and apply many small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Nov 21, 2022
1 parent b36c8a6 commit 7dd2d31
Show file tree
Hide file tree
Showing 90 changed files with 1,827 additions and 1,856 deletions.
47 changes: 25 additions & 22 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ clippy-abcipp:
$(cargo) +$(nightly) clippy \
--all-targets \
--manifest-path ./vm_env/Cargo.toml \
--no-default-features \
--features "abcipp" && \
--no-default-features && \
make -C $(wasms) clippy && \
$(foreach wasm,$(wasm_templates),$(clippy-wasm) && ) true

Expand Down
10 changes: 6 additions & 4 deletions apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,27 @@ std = ["ed25519-consensus/std", "rand/std", "rand_core/std"]
testing = ["dev"]

abcipp = [
"namada/abcipp",
"namada/tendermint-rpc-abcipp",
"tendermint-abcipp",
"tendermint-config-abcipp",
"tendermint-proto-abcipp",
"tendermint-rpc-abcipp",
"tower-abci-abcipp",
"namada/abcipp"
]

abciplus = [
"namada/abciplus",
"namada/tendermint-rpc",
"tendermint",
"tendermint-config",
"tendermint-rpc",
"tendermint-proto",
"tower-abci",
"namada/abciplus"
]

[dependencies]
namada = {path = "../shared", features = ["wasm-runtime", "ferveo-tpke", "rand", "tendermint-rpc", "secp256k1-sign-verify"]}
namada = {path = "../shared", default-features = false, features = ["wasm-runtime", "ferveo-tpke"]}
ark-serialize = "0.3.0"
ark-std = "0.3.0"
# branch = "bat/arse-merkle-tree"
Expand Down Expand Up @@ -148,7 +150,7 @@ rust_decimal = "1.26.1"
rust_decimal_macros = "1.26.1"

[dev-dependencies]
namada = {path = "../shared", features = ["testing", "wasm-runtime"]}
namada = {path = "../shared", default-features = false, features = ["testing", "wasm-runtime"]}
bit-set = "0.5.2"
# A fork with state machime testing
proptest = {git = "https://github.com/heliaxdev/proptest", branch = "tomas/sm"}
Expand Down
13 changes: 5 additions & 8 deletions apps/src/lib/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use masp_primitives::zip32::ExtendedFullViewingKey;
use namada::ledger::events::Event;
use namada::ledger::governance::parameters::GovParams;
use namada::ledger::governance::storage as gov_storage;
use namada::ledger::governance::utils::Votes;
use namada::ledger::native_vp::governance::utils::Votes;
use namada::ledger::parameters::{storage as param_storage, EpochDuration};
use namada::ledger::pos::types::{
decimal_mult_u64, Epoch as PosEpoch, WeightedValidator,
Expand Down Expand Up @@ -131,7 +131,7 @@ pub async fn query_epoch(args: args::Query) -> Epoch {
/// Query the last committed block
pub async fn query_block(
args: args::Query,
) -> tendermint_rpc::endpoint::block::Response {
) -> crate::facade::tendermint_rpc::endpoint::block::Response {
let client = HttpClient::new(args.ledger_address).unwrap();
let response = client.latest_block().await.unwrap();
println!(
Expand Down Expand Up @@ -2065,8 +2065,7 @@ fn process_bonds_query(
.unwrap();
delta = apply_slashes(slashes, delta, *epoch_start, None, Some(w));
current_total += delta;
let epoch_start: Epoch = (*epoch_start).into();
if epoch >= &epoch_start {
if epoch >= epoch_start {
total_active += delta;
}
}
Expand Down Expand Up @@ -2121,8 +2120,7 @@ fn process_unbonds_query(
Some(w),
);
current_total += delta;
let epoch_end: Epoch = (*epoch_end).into();
if epoch > &epoch_end {
if epoch > epoch_end {
withdrawable += delta;
}
}
Expand Down Expand Up @@ -2800,8 +2798,7 @@ pub async fn get_bond_amount_at(
None,
None,
);
let epoch_start: Epoch = (*epoch_start).into();
if epoch >= epoch_start {
if epoch >= *epoch_start {
delegated_amount += delta;
}
}
Expand Down
4 changes: 2 additions & 2 deletions apps/src/lib/client/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2179,7 +2179,7 @@ async fn is_safe_voting_window(

match proposal_end_epoch {
Some(proposal_end_epoch) => {
!namada::ledger::governance::utils::is_valid_validator_voting_period(
!namada::ledger::native_vp::governance::utils::is_valid_validator_voting_period(
current_epoch,
proposal_start_epoch,
proposal_end_epoch,
Expand Down Expand Up @@ -2486,7 +2486,7 @@ pub async fn submit_validator_commission_change(
match (commission_rates, max_change) {
(Some(rates), Some(max_change)) => {
// Assuming that pipeline length = 2
let rate_next_epoch = rates.get(epoch + 1).unwrap();
let rate_next_epoch = rates.get(epoch.next()).unwrap();
if (args.rate - rate_next_epoch).abs() > max_change {
eprintln!(
"New rate is too large of a change with respect to \
Expand Down
2 changes: 1 addition & 1 deletion apps/src/lib/client/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use namada::types::masp::{TransferSource, TransferTarget};
use namada::types::storage::Epoch;
use namada::types::transaction::GasLimit;
use namada::types::{key, token};
use tendermint_config::net::Address as TendermintAddress;

use super::rpc;
use crate::cli::{args, Context};
use crate::client::tx::Conversions;
use crate::facade::tendermint_config::net::Address as TendermintAddress;

#[derive(Clone, Debug)]
pub struct ParsedTxArgs {
Expand Down
Loading

0 comments on commit 7dd2d31

Please sign in to comment.