Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the typos #11

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ This section is dedicated to the finer details of the API change, but we include
- Epoch is returned as a U64 (the string wrapper), not a u64. The v0 API received this change too, as the previous behavior was inconsistent and potentially incorrect.
- `/transactions/simulate` returns a `UserTransaction` now, not just a `Transaction`. The user can only ever submit a user transaction to this endpoint, so it can only ever return a user transaction.
- All docs in the spec that incorrectly used a 16 byte address have been updated.
- MoveTypes are now returned as structured structs instead of strings. To deal with some types that we don't have proper parsing for, e.g. generic type params, a new “unparseable” variant has been added. This ensures the response from the API can actually be deserialized.
- MoveValue has received the same treatment, minus the unparseable stuff.
- MoveTypes are now returned as structured structs instead of strings. To deal with some types that we don't have proper parsing for, e.g. generic type params, a new “unparsable” variant has been added. This ensures the response from the API can actually be deserialized.
- MoveValue has received the same treatment, minus the unparsable stuff.
- Some snake casing is different, e.g. ed25519 became ed_25519 (proper snake casing).
- U64 and U128 have been used throughout every endpoint. There were a couple of places in v0 where we should've been using it but weren't, e.g. paging params.
- The `v1` API runs on a separate port (where the OS selects a free port) behind a reverse proxy running within the node. This works fine with our source and docker based deployments. This is only temporary while we host both APIs.
Expand Down
8 changes: 4 additions & 4 deletions api/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl Context {
let log_per_call_stats = node_config.api.periodic_function_stats_sec.is_some();
(
Arc::new(FunctionStats::new(
FunctionType::ViewFuntion,
FunctionType::ViewFunction,
log_per_call_stats,
)),
Arc::new(FunctionStats::new(
Expand Down Expand Up @@ -1381,21 +1381,21 @@ pub enum LogEvent {
}

pub enum FunctionType {
ViewFuntion,
ViewFunction,
TxnSimulation,
}

impl FunctionType {
fn log_event(&self) -> LogEvent {
match self {
FunctionType::ViewFuntion => LogEvent::ViewFunction,
FunctionType::ViewFunction => LogEvent::ViewFunction,
FunctionType::TxnSimulation => LogEvent::TxnSimulation,
}
}

fn operation_id(&self) -> &'static str {
match self {
FunctionType::ViewFuntion => "view_function",
FunctionType::ViewFunction => "view_function",
FunctionType::TxnSimulation => "txn_simulation",
}
}
Expand Down
4 changes: 2 additions & 2 deletions api/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub async fn middleware_log<E: Endpoint>(next: E, request: Request) -> Result<Re
method: request.method().clone(),
path: request.uri().path().to_string(),
status: 0,
referer: request
referrer: request
.headers()
.get(header::REFERER)
.and_then(|v| v.to_str().ok().map(|v| v.to_string())),
Expand Down Expand Up @@ -140,7 +140,7 @@ pub struct HttpRequestLog {
method: Method,
path: String,
pub status: u16,
referer: Option<String>,
referrer: Option<String>,
user_agent: Option<String>,
aptos_client: Option<String>,
#[schema(debug)]
Expand Down
2 changes: 1 addition & 1 deletion api/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub trait AptosErrorResponse {
fn inner_mut(&mut self) -> &mut AptosError;
}

/// This macro defines traits for all of the given status codes. In eahc trait
/// This macro defines traits for all of the given status codes. In each trait
/// there is a function that defines a helper for building an instance of the
/// error type using that code. These traits are helpful for defining what
/// error types an internal function can return. For example, the failpoint
Expand Down
2 changes: 1 addition & 1 deletion api/src/tests/transaction_vector_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Purpose of transaction vector test
*
* a. Validates that the BCS and transaction signing code always genereate consistent bytes
* a. Validates that the BCS and transaction signing code always generate consistent bytes
* b. The golden files contain the expected outputs for various transaction payloads. These files could be used by
* other languages to verify their implementations of the transaction signing code.
* c. The transaction payload generation heavily relies on proptest. We need to make sure the proptest uses a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ module veiled_coin::veiled_coin_tests {
// TODO: This throws an invariant violation (INTERNAL_TYPE_ERROR (code 2009))
//print(&recipient);

// Encrypt the transfered amount `v` under the `recipient`'s PK
// Encrypt the transferred amount `v` under the `recipient`'s PK
let deposit_ct = elgamal::new_ciphertext_with_basepoint(
&amount_val, &amount_rand, &recipient_pk);

Expand Down
4 changes: 2 additions & 2 deletions aptos-node/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ fn register_client_and_service_with_network<
}
}

/// Tranforms the given network handles into interfaces that can
/// Transforms the given network handles into interfaces that can
/// be used by the applications themselves.
fn transform_network_handles_into_interfaces(
node_config: &NodeConfig,
Expand Down Expand Up @@ -493,7 +493,7 @@ fn transform_network_handles_into_interfaces(
)
}

/// Creates an application network inteface using the given
/// Creates an application network interface using the given
/// handles and config.
fn create_network_interfaces<
T: Serialize + for<'de> Deserialize<'de> + Send + Sync + Clone + 'static,
Expand Down
2 changes: 1 addition & 1 deletion crates/aptos-faucet/configs/testing_checkers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ checker_configs:
- type: "IpBlocklist"
file: "/tmp/ip_blocklist.txt"
- type: "RefererBlocklist"
file: "/tmp/referer_blocklist.txt"
file: "/tmp/referrer_blocklist.txt"
- type: "MagicHeader"
magic_header_key: "what_wallet_my_guy"
magic_header_value: "the_wallet_that_rocks"
Expand Down
4 changes: 2 additions & 2 deletions crates/aptos-faucet/core/src/checkers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod ip_blocklist;
mod magic_header;
mod memory_ratelimit;
mod redis_ratelimit;
mod referer_blocklist;
mod referrer_blocklist;
mod tap_captcha;

pub use self::tap_captcha::CaptchaManager;
Expand All @@ -18,7 +18,7 @@ use self::{
magic_header::{MagicHeaderChecker, MagicHeaderCheckerConfig},
memory_ratelimit::{MemoryRatelimitChecker, MemoryRatelimitCheckerConfig},
redis_ratelimit::{RedisRatelimitChecker, RedisRatelimitCheckerConfig},
referer_blocklist::RefererBlocklistChecker,
referrer_blocklist::RefererBlocklistChecker,
tap_captcha::{TapCaptchaChecker, TapCaptchaCheckerConfig},
};
use crate::{
Expand Down
10 changes: 5 additions & 5 deletions crates/aptos-faucet/core/src/checkers/referer_blocklist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ impl CheckerTrait for RefererBlocklistChecker {
data: CheckerData,
_dry_run: bool,
) -> Result<Vec<RejectionReason>, AptosTapError> {
let referer = match data.headers.get(REFERER).and_then(|v| v.to_str().ok()) {
Some(referer) => referer,
let referrer = match data.headers.get(REFERER).and_then(|v| v.to_str().ok()) {
Some(referrer) => referrer,
None => return Ok(vec![]),
};
if self.manager.contains(referer) {
if self.manager.contains(referrer) {
Ok(vec![RejectionReason::new(
format!(
"The provided referer is not allowed by the server: {}",
referer
"The provided referrer is not allowed by the server: {}",
referrer
),
RejectionReasonCode::RefererBlocklisted,
)])
Expand Down
4 changes: 2 additions & 2 deletions crates/aptos-faucet/core/src/middleware/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub async fn middleware_log<E: Endpoint>(next: E, request: Request) -> Result<Re
source_ip,
method: request.method().to_string(),
path: request.uri().path().to_string(),
referer: request
referrer: request
.headers()
.get(header::REFERER)
.and_then(|v| v.to_str().ok().map(|v| v.to_string())),
Expand Down Expand Up @@ -74,7 +74,7 @@ pub struct HttpRequestLog {
source_ip: Option<IpAddr>,
method: String,
path: String,
referer: Option<String>,
referrer: Option<String>,
user_agent: Option<String>,
forwarded: Option<String>,
}
Expand Down
8 changes: 4 additions & 4 deletions crates/aptos-faucet/core/src/server/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ mod test {
make_list_file("/tmp/ip_blocklist.txt", ip_ranges)
}

fn make_referer_blocklist_file(referers: &[&str]) -> Result<()> {
make_list_file("/tmp/referer_blocklist.txt", referers)
fn make_referrer_blocklist_file(referrers: &[&str]) -> Result<()> {
make_list_file("/tmp/referrer_blocklist.txt", referrers)
}

fn get_fund_request(amount: Option<u64>) -> FundRequest {
Expand Down Expand Up @@ -537,7 +537,7 @@ mod test {
init();
make_ip_blocklist(&[])?;
make_auth_tokens_file(&["test_token"])?;
make_referer_blocklist_file(&["https://mysite.com"])?;
make_referrer_blocklist_file(&["https://mysite.com"])?;
let config_content = include_str!("../../../configs/testing_checkers.yaml");
let (port, _handle) = start_server(config_content).await?;

Expand Down Expand Up @@ -584,7 +584,7 @@ mod test {
assert!(rejection_reason_codes.contains(&RejectionReasonCode::MagicHeaderIncorrect));
assert!(rejection_reason_codes.contains(&RejectionReasonCode::AuthTokenInvalid));

// Assert that the referer blocklist checker works.
// Assert that the referrer blocklist checker works.
let response = reqwest::Client::new()
.post(get_fund_endpoint(port))
.body(get_fund_request(Some(10)).to_json_string())
Expand Down
4 changes: 2 additions & 2 deletions crates/aptos-warp-webserver/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn logger() -> Log<impl Fn(Info) + Copy> {
method: info.method().to_string(),
path: info.path().to_string(),
status,
referer: info.referer(),
referrer: info.referrer(),
user_agent: info.user_agent(),
elapsed: info.elapsed(),
forwarded: info
Expand All @@ -45,7 +45,7 @@ pub struct HttpRequestLog<'a> {
method: String,
path: String,
status: u16,
referer: Option<&'a str>,
referrer: Option<&'a str>,
user_agent: Option<&'a str>,
#[schema(debug)]
elapsed: std::time::Duration,
Expand Down
2 changes: 1 addition & 1 deletion dashboards/mempool.json
Original file line number Diff line number Diff line change
Expand Up @@ -2661,7 +2661,7 @@
},
{
"datasource": { "type": "prometheus", "uid": "${Datasource}" },
"description": "rate of broadcasts that are retrying expired braodcasts (that did not get back an ACK in window of time)",
"description": "rate of broadcasts that are retrying expired broadcasts (that did not get back an ACK in window of time)",
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub static SHORT_CONNECTION_COUNT: Lazy<IntCounterVec> = Lazy::new(|| {
.unwrap()
});

/// Count of bytes transfered to the client. This only represents the bytes prepared and ready
/// Count of bytes transferred to the client. This only represents the bytes prepared and ready
/// to send to the client. It does not represent the bytes actually sent to the client.
pub static BYTES_READY_TO_TRANSFER_FROM_SERVER: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
Expand Down
14 changes: 7 additions & 7 deletions ecosystem/typescript/sdk/src/plugins/token_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ export class TokenClient {
/**
* Transfers specified amount of tokens from account to receiver
*
* @param account AptosAccount where token from which tokens will be transfered
* @param receiver Hex-encoded 32 byte Aptos account address to which tokens will be transfered
* @param account AptosAccount where token from which tokens will be transferred
* @param receiver Hex-encoded 32 byte Aptos account address to which tokens will be transferred
* @param creator Hex-encoded 32 byte Aptos account address to which created tokens
* @param collectionName Name of collection where token is stored
* @param name Token name
* @param amount Amount of tokens which will be transfered
* @param amount Amount of tokens which will be transferred
* @param property_version the version of token PropertyMap with a default value 0.
* @returns The hash of the transaction submitted to the API
*/
Expand Down Expand Up @@ -261,7 +261,7 @@ export class TokenClient {
* @param account AptosAccount which will remove token from pending list
* @param receiver Hex-encoded 32 byte Aptos account address which had to claim token
* @param creator Hex-encoded 32 byte Aptos account address which created a token
* @param collectionName Name of collection where token is strored
* @param collectionName Name of collection where token is stored
* @param name Token name
* @param property_version the version of token PropertyMap with a default value 0.
* @returns The hash of the transaction submitted to the API
Expand Down Expand Up @@ -454,7 +454,7 @@ export class TokenClient {
* @param collectionName Name of collection where token is stored
* @param name Token name
* @param property_version the version of token PropertyMap
* @param amount Amount of tokens which will be transfered
* @param amount Amount of tokens which will be transferred
* @returns The hash of the transaction submitted to the API
*/
async transferWithOptIn(
Expand Down Expand Up @@ -485,7 +485,7 @@ export class TokenClient {
* @param ownerAddress address of the token owner
* @param collectionName Name of collection where token is stored
* @param name Token name
* @param amount Amount of tokens which will be transfered
* @param amount Amount of tokens which will be transferred
* @param property_version the version of token PropertyMap
* @returns The hash of the transaction submitted to the API
*/
Expand Down Expand Up @@ -517,7 +517,7 @@ export class TokenClient {
* @param creatorAddress address of the token creator
* @param collectionName Name of collection where token is stored
* @param name Token name
* @param amount Amount of tokens which will be transfered
* @param amount Amount of tokens which will be transferred
* @param property_version the version of token PropertyMap
* @returns The hash of the transaction submitted to the API
*/
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/typescript/sdk/src/providers/aptos_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export class AptosClient {
* for which events are queried. This refers to the account that events were emitted
* to, not the account hosting the move module that emits that event type.
* @param creationNumber Creation number corresponding to the event type.
* @returns Array of events assotiated with the given account and creation number.
* @returns Array of events associated with the given account and creation number.
*/
@parseApiError
async getEventsByCreationNumber(
Expand Down
8 changes: 4 additions & 4 deletions ecosystem/typescript/sdk/src/tests/e2e/aptos_client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,9 @@ test(
await client.waitForTransaction(txn.hash, { checkSuccess: true });

// Check that Alice and Bob did not pay the fee
// Alice final balance is -100000 coins transfered to Bob
// Alice final balance is -100000 coins transferred to Bob
expect(await getBalance(alice)).toBe(aliceBefore - BigInt(100000));
// Bob final balance is 100000 coins transfered from Alice
// Bob final balance is 100000 coins transferred from Alice
expect(await getBalance(bob)).toBe(BigInt(100000));
// Check that feePayer paid the fee
expect(await getBalance(feePayer)).toBeLessThan(feePayerBefore);
Expand Down Expand Up @@ -696,9 +696,9 @@ test(
await client.waitForTransaction(txn.hash, { checkSuccess: true });

// Check that Alice and Bob did not pay the fee
// Alice final balance is -100000 coins transfered to Bob
// Alice final balance is -100000 coins transferred to Bob
expect(await getBalance(alice)).toBe(aliceBefore);
// Bob final balance is 100000 coins transfered from Alice
// Bob final balance is 100000 coins transferred from Alice
expect(await getBalance(bob)).toBe(bobBefore);
// Check that feePayer paid the fee
expect(await getBalance(feePayer)).toBeLessThan(feePayerBefore);
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/src/chunk_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ impl<V: VMExecutor> ChunkExecutorInner<V> {
)?
};

// Calcualte state snapshot
// Calculate state snapshot
let (result_state, next_epoch_state, state_checkpoint_output) =
ApplyChunkOutput::calculate_state_checkpoint(
chunk_output,
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/src/db_bootstrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl GenesisCommitter {
.clone(),
Some(&self.output.ledger_update_output.sharded_state_cache),
)?;
info!("Genesis commited.");
info!("Genesis committed.");
// DB bootstrapped, avoid anything that could fail after this.

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub static APTOS_EXECUTOR_COMMIT_BLOCKS_SECONDS: Lazy<Histogram> = Lazy::new(||
// metric name
"aptos_executor_commit_blocks_seconds",
// metric description
"The total time spent in seconds of commiting blocks in Aptos executor ",
"The total time spent in seconds of committing blocks in Aptos executor ",
exponential_buckets(/*start=*/ 1e-3, /*factor=*/ 2.0, /*count=*/ 20).unwrap(),
)
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion mempool/src/core_mempool/transaction_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct TransactionStore {
// Index for looking up transaction by hash.
// Transactions are stored by AccountAddress + sequence number.
// This index stores map of transaction committed hash to (AccountAddress, sequence number) pair.
// Using transaction commited hash because from end user's point view, a transaction should only have
// Using transaction committed hash because from end user's point view, a transaction should only have
// one valid hash.
hash_index: HashMap<HashValue, (AccountAddress, u64)>,
// estimated size in bytes
Expand Down
2 changes: 1 addition & 1 deletion mempool/src/shared_mempool/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ where
statuses
}

/// Perfoms VM validation on the transactions and inserts those that passes
/// Performs VM validation on the transactions and inserts those that passes
/// validation into the mempool.
#[cfg(not(feature = "consensus-only-perf-test"))]
fn validate_and_add_transactions<NetworkClient, TransactionValidator>(
Expand Down
4 changes: 2 additions & 2 deletions mempool/src/tests/shared_mempool_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ async fn test_mempool_notify_committed_txns() {
// Sleep for a while
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
};
if let Err(elasped) = timeout(std::time::Duration::from_secs(5), wait_for_commit).await {
if let Err(elapsed) = timeout(std::time::Duration::from_secs(5), wait_for_commit).await {
panic!(
"Mempool did not receive the commit notification! {:?}",
elasped
elapsed
);
}
}
2 changes: 1 addition & 1 deletion scripts/git-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ for rev in $(git rev-list $oldrev..$newrev); do
done

# Disallow checking in insane filenames that are not broadly
# compatible across source control systems and plaforms.
# compatible across source control systems and platforms.
#
# For example, no carriage returns or line feeds should be allowed in filenames.
export LC_ALL=C
Expand Down
2 changes: 1 addition & 1 deletion secure/storage/src/vault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ pub mod policy {
}

/// Create a new policy in Vault, see the explanation for Policy for how the data is
/// structured. Vault does not distingush a create and update. An update must first read the
/// structured. Vault does not distinguish a create and update. An update must first read the
/// existing policy, amend the contents, and then be applied via this API.
pub fn set_policy(
&self,
Expand Down
Loading