Skip to content

Commit

Permalink
Merge branch brent/grammatical-fixes (#2242)
Browse files Browse the repository at this point in the history
Miscellaneous grammatical fixes
  • Loading branch information
brentstone authored Jan 15, 2024
2 parents b951476 + 7026389 commit 46441f7
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .changelog/v0.30.0/improvements/2374-fix-bond-amount.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
- Fix the function to more accurately account for slashes.
([\#2374](https://github.com/anoma/namada/pull/2374))
- Fix the function `bond_amount` to more accurately account for slashes.
([\#2374](https://github.com/anoma/namada/pull/2374))
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Namada 0.30.0 is a minor release that primarily upgrades the MASP and WASM VM me
- Added validator's consensus key look-up to `client find-validator`
command, which now also accepts a native validator address.
([\#2368](https://github.com/anoma/namada/pull/2368))
- Fix the function to more accurately account for slashes.
- Fix the function `bond_amount` to more accurately account for slashes.
([\#2374](https://github.com/anoma/namada/pull/2374))
- The MASP VP now validates the tx expiration.
([\#2375](https://github.com/anoma/namada/pull/2375))
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ for i in $(ls -d .changelog/*/*/); do basename "$i"; done | sort | uniq

The Namada SDK is exposed to any developer building upon Namada. Thus, any change made to a public facing function is a breaking change, and therefore should be documented in the Changelog under the `SDK` section.

The message should outline the exact API change, along with a small section describing *how* and *why* the component was change. This should give motivation and context to any developer building upon Namada on how they can update their code to the next version.
The message should outline the exact API change, along with a small section describing *how* and *why* the component was changed. This should give motivation and context to any developer building upon Namada on how they can update their code to the next version.

## Development priorities

Expand Down
2 changes: 1 addition & 1 deletion apps/src/lib/node/ledger/broadcaster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Broadcaster {
}
}

/// Loop forever, braodcasting messages that have been received
/// Loop forever, broadcasting messages that have been received
/// by the receiver
async fn run_loop(&mut self) {
let result = time::Sleep {
Expand Down
2 changes: 1 addition & 1 deletion apps/src/lib/node/ledger/shell/init_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ where
#[cfg(any(test, feature = "testing"))]
_num_validators,
);
// propogate errors or panic
// propagate errors or panic
validation.error_out()?;

// Init masp commitment tree and anchor
Expand Down
6 changes: 3 additions & 3 deletions core/src/ledger/governance/cli/onchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl PgfAction {
}
}

/// Pgf fundings
/// Pgf funding
#[derive(
Debug, Clone, BorshSerialize, BorshDeserialize, Serialize, Deserialize,
)]
Expand All @@ -283,11 +283,11 @@ pub struct PgfFunding {
pub retro: Vec<PGFTarget>,
}

/// Pgf continous funding
/// Pgf continuous funding
#[derive(
Debug, Clone, BorshSerialize, BorshDeserialize, Serialize, Deserialize,
)]
pub struct PgfContinous {
pub struct PgfContinuous {
/// Pgf target
pub target: PGFTarget,
/// Pgf action
Expand Down
10 changes: 5 additions & 5 deletions core/src/ledger/governance/storage/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use thiserror::Error;

use crate::ibc::core::host::types::identifiers::{ChannelId, PortId};
use crate::ledger::governance::cli::onchain::{
PgfAction, PgfContinous, PgfRetro, PgfSteward, StewardsUpdate,
PgfAction, PgfContinuous, PgfRetro, PgfSteward, StewardsUpdate,
};
use crate::ledger::governance::utils::{ProposalStatus, TallyType};
use crate::ledger::storage_api::token::Amount;
Expand All @@ -22,7 +22,7 @@ pub enum ProposalTypeError {
InvalidProposalType,
}

/// Storage structure for pgf fundings
/// Storage structure for pgf funding
#[derive(
Debug,
Clone,
Expand Down Expand Up @@ -286,8 +286,8 @@ impl TryFrom<PgfSteward> for AddRemove<Address> {
}
}

impl From<PgfContinous> for PGFAction {
fn from(value: PgfContinous) -> Self {
impl From<PgfContinuous> for PGFAction {
fn from(value: PgfContinuous) -> Self {
match value.action {
PgfAction::Add => {
PGFAction::Continuous(AddRemove::Add(value.target))
Expand All @@ -306,7 +306,7 @@ impl From<PgfRetro> for PGFAction {
}

#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)]
/// Proposal rappresentation when fetched from the storage
/// Proposal representation when fetched from the storage
pub struct StorageProposal {
/// The proposal id
pub id: u64,
Expand Down
6 changes: 3 additions & 3 deletions core/src/ledger/governance/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ impl Display for ProposalResult {
}
}

/// /// General rappresentation of a vote
/// General representation of a vote
#[derive(Debug)]
pub enum TallyVote {
/// Rappresent a vote for a proposal onchain
/// Represent a vote for a proposal onchain
OnChain(ProposalVote),
/// Rappresent a vote for a proposal offline
/// Represent a vote for a proposal offline
Offline(OfflineVote),
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/ledger/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ where
) -> Result<i64> {
let value = value.as_ref();
if is_pending_transfer_key(key) {
// The tree of the bright pool stores the current height for the
// The tree of the bridge pool stores the current height for the
// pending transfer
let height = self.block.height.serialize_to_vec();
self.block.tree.update(key, height)?;
Expand Down
3 changes: 1 addition & 2 deletions documentation/dev/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Welcome to Namada's docs!
Namada is a sovereign, proof-of-stake blockchain protocol that enables private, asset-agnostic cash and private bartering among any number of parties. To learn more about the protocol, we recommend the following resources:

- [Introducing Namada: Interchain Asset-agnostic Privacy](https://blog.namada.net/introducing-namada-interchain-asset-agnostic-privacy/)
- [Namada's Whitepaper](https://namada.network/papers/whitepaper.pdf)
- [Namada's Vision paper](https://namada.network/papers/vision-paper.pdf)
- [Namada's mission](https://forum.namada.net/t/the-namada-mission/275)

> ⚠️ Here lay dragons: this codebase is still experimental, try at your own risk!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ At high level, all the data in the [accounts' dynamic
sub-spaces](../accounts.md#dynamic-storage-sub-space) is just keys associated with
arbitrary bytes and intents are just wrapper around arbitrary data. To help the
processes that read and write this data (transactions, validity predicates,
matchmaker) interpret it and implement interesting functionality on top it, the
matchmaker) interpret it and implement interesting functionality on top of it, the
ledger could provide a way to describe the schema of the data.

For storage data encoding, we're currently using the borsh library, which
Expand Down
4 changes: 2 additions & 2 deletions encoding_spec/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// tables.push(pos_bonds_table);

// Then add the rest of definitions sorted by their names
for (declaration, defition) in definitions
for (declaration, definition) in definitions
.into_iter()
.sorted_by_key(|(key, _val)| key.clone())
{
tables.push(definition_to_table(&declaration, defition))
tables.push(definition_to_table(&declaration, definition))
}

// Print the tables to markdown
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This directory contains examples and additional tooling to help in the
development of Namada. The currently provided examples are listed below:
## `generate-txs`
This utility serves to randomly generate Namada transaction test vectors
offline. These test vectors are useful for ensuring compatability with hardware
offline. These test vectors are useful for ensuring compatibility with hardware
wallets. This example is included in the Namada repository in order to ensure
that the test vector generation logic is maintained and remains up to date with
the latest changes in transaction formats.
Expand Down
2 changes: 1 addition & 1 deletion light_sdk/src/reading/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use namada_sdk::rpc::{TxEventQuery, TxResponse};
use super::*;

/// Call the corresponding `tx_event_query` RPC method, to fetch
/// the current status of a transation.
/// the current status of a transaction.
pub fn query_tx_events(
tendermint_addr: &str,
tx_hash: &str,
Expand Down
2 changes: 1 addition & 1 deletion proof_of_stake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ where
remaining = token::Amount::zero();

// NOTE: When there are multiple `src_validators` from which we're
// unbonding, `validator_to_modify` cannot get overriden, because
// unbonding, `validator_to_modify` cannot get overridden, because
// only one of them can be a partial unbond (`new_entry`
// is partial unbond)
if let Some((bond_epoch, new_bond_amount)) =
Expand Down
8 changes: 4 additions & 4 deletions proof_of_stake/src/slashing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ where
/// In the context of a redelegation, the function computes how much a validator
/// (the destination validator of the redelegation) should be slashed due to the
/// misbehaving of a second validator (the source validator of the
/// redelegation). The function computes how much the validator whould be
/// redelegation). The function computes how much the validator would be
/// slashed at all epochs between the current epoch (curEpoch) + 1 and the
/// current epoch + 1 + PIPELINE_OFFSET, accounting for any tokens of the
/// redelegation already unbonded.
Expand Down Expand Up @@ -815,8 +815,8 @@ where
}

/// Compute a token amount after slashing, given the initial amount and a set of
/// slashes. It is assumed that the input `slashes` are those commited while the
/// `amount` was contributing to voting power.
/// slashes. It is assumed that the input `slashes` are those committed while
/// the `amount` was contributing to voting power.
pub fn get_slashed_amount(
params: &PosParams,
amount: token::Amount,
Expand Down Expand Up @@ -986,7 +986,7 @@ where

/// Process a slash by (i) slashing the misbehaving validator; and (ii) any
/// validator to which it has redelegated some tokens and the slash misbehaving
/// epoch is wihtin the redelegation slashing window.
/// epoch is within the redelegation slashing window.
///
/// `validator` - the misbehaving validator.
/// `slash_rate` - the slash rate.
Expand Down
4 changes: 2 additions & 2 deletions proof_of_stake/src/tests/test_helper_fns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2000,13 +2000,13 @@ fn test_from_sm_case_1() {
let (new_entry_epoch, new_bond_amount) = bonds_to_unbond.new_entry.unwrap();
assert_eq!(outer_epoch_1, new_entry_epoch);
// The modified bond should be sum of all redelegations less the unbonded
// amouunt
// amount
assert_eq!(
epoch_1_redeleg_1 + epoch_1_redeleg_2 + epoch_2_redeleg_2
- unbond_amount,
new_bond_amount
);
// The current bond should be sum of redelegations fom the modified epoch
// The current bond should be sum of redelegations from the modified epoch
let cur_bond_amount = bonds_handle
.get_delta_val(&storage, new_entry_epoch)
.unwrap()
Expand Down

0 comments on commit 46441f7

Please sign in to comment.