Skip to content

Commit

Permalink
fmt and Cargo.lock files
Browse files Browse the repository at this point in the history
  • Loading branch information
brentstone committed Oct 24, 2022
1 parent cf45864 commit eee0635
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 20 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,8 @@ pub mod args {

const LEDGER_ADDRESS: Arg<TendermintAddress> = arg("ledger-address");
const LOCALHOST: ArgFlag = flag("localhost");
const MAX_COMMISSION_RATE_CHANGE: Arg<Decimal> = arg("max-commission-rate-change");
const MAX_COMMISSION_RATE_CHANGE: Arg<Decimal> =
arg("max-commission-rate-change");
const MODE: ArgOpt<String> = arg_opt("mode");
const NET_ADDRESS: Arg<SocketAddr> = arg("net-address");
const NFT_ADDRESS: Arg<Address> = arg("nft-address");
Expand Down
3 changes: 1 addition & 2 deletions apps/src/lib/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1953,8 +1953,7 @@ async fn get_validator_stake(
.expect("Total deltas should be defined");
let validator_stake = validator_deltas.get(epoch);

VotePower::try_from(validator_stake.unwrap_or_default())
.unwrap_or_default()
VotePower::try_from(validator_stake.unwrap_or_default()).unwrap_or_default()
}

pub async fn get_delegators_delegation(
Expand Down
20 changes: 11 additions & 9 deletions apps/src/lib/node/ledger/shims/abcipp_shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,17 @@ impl AbcippShim {
_ => Err(Error::ConvertResp(res)),
})
}
_ => match Request::try_from(req.clone()) {
Ok(request) => self
.service
.call(request)
.map(Resp::try_from)
.map_err(Error::Shell)
.and_then(|inner| inner),
Err(err) => Err(err),
},
_ => {
match Request::try_from(req.clone()) {
Ok(request) => self
.service
.call(request)
.map(Resp::try_from)
.map_err(Error::Shell)
.and_then(|inner| inner),
Err(err) => Err(err),
}
}
};
let resp = resp.map_err(|e| e.into());
if resp_sender.send(resp).is_err() {
Expand Down
5 changes: 3 additions & 2 deletions proof_of_stake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,8 +1043,9 @@ pub trait PosBase {
);
signer_set.insert(native_address.clone());

// vote.validator_vp is updating at a constant delay relative to the validator deltas
// use validator deltas in namada protocol to get voting power instead
// vote.validator_vp is updating at a constant delay relative to the
// validator deltas.
// Use validator deltas in namada protocol to get voting power instead
let deltas = self.read_validator_deltas(&native_address).unwrap();
let stake: Self::TokenChange = deltas.get(epoch).unwrap();
let stake: u64 = Into::<i128>::into(stake).try_into().unwrap();
Expand Down
1 change: 1 addition & 0 deletions tests/src/e2e/ledger_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use namada::types::token;
use namada_apps::config::genesis::genesis_config::{
GenesisConfig, ParametersConfig, PosParamsConfig,
};
use rust_decimal_macros::dec;
use serde_json::json;
use setup::constants::*;

Expand Down
29 changes: 24 additions & 5 deletions wasm/Cargo.lock

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

3 changes: 2 additions & 1 deletion wasm/wasm_source/src/tx_bond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ mod tests {
}
} else {
// This is a self-bond
// Check that a bond already exists from genesis with initial stake for the validator
// Check that a bond already exists from genesis with initial stake
// for the validator
let genesis_epoch =
namada_tx_prelude::proof_of_stake::types::Epoch::from(0);
for epoch in 0..pos_params.pipeline_len {
Expand Down

0 comments on commit eee0635

Please sign in to comment.