Skip to content

Commit

Permalink
chore: fix some typos (#1276)
Browse files Browse the repository at this point in the history
* chore: fix typos

* chore: codegen
  • Loading branch information
matteojug authored Jan 27, 2025
1 parent e9129f8 commit 39b961f
Show file tree
Hide file tree
Showing 22 changed files with 51 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use crate::models;
use serde::{Deserialize, Serialize};

/// DepositUpdate : A singlular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
/// DepositUpdate : A singular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DepositUpdate {
/// Output index on the bitcoin transaction associated with this specific deposit.
Expand Down Expand Up @@ -41,7 +41,7 @@ pub struct DepositUpdate {
}

impl DepositUpdate {
/// A singlular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
/// A singular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
pub fn new(
bitcoin_tx_output_index: u32,
bitcoin_txid: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use crate::models;
use serde::{Deserialize, Serialize};

/// WithdrawalUpdate : A singlular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
/// WithdrawalUpdate : A singular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WithdrawalUpdate {
#[serde(
Expand All @@ -38,7 +38,7 @@ pub struct WithdrawalUpdate {
}

impl WithdrawalUpdate {
/// A singlular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
/// A singular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
pub fn new(
last_update_block_hash: String,
last_update_height: u64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use crate::models;
use serde::{Deserialize, Serialize};

/// DepositUpdate : A singlular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
/// DepositUpdate : A singular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DepositUpdate {
/// Output index on the bitcoin transaction associated with this specific deposit.
Expand Down Expand Up @@ -41,7 +41,7 @@ pub struct DepositUpdate {
}

impl DepositUpdate {
/// A singlular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
/// A singular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
pub fn new(
bitcoin_tx_output_index: u32,
bitcoin_txid: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use crate::models;
use serde::{Deserialize, Serialize};

/// WithdrawalUpdate : A singlular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
/// WithdrawalUpdate : A singular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WithdrawalUpdate {
#[serde(
Expand All @@ -38,7 +38,7 @@ pub struct WithdrawalUpdate {
}

impl WithdrawalUpdate {
/// A singlular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
/// A singular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
pub fn new(
last_update_block_hash: String,
last_update_height: u64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use crate::models;
use serde::{Deserialize, Serialize};

/// DepositUpdate : A singlular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
/// DepositUpdate : A singular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DepositUpdate {
/// Output index on the bitcoin transaction associated with this specific deposit.
Expand Down Expand Up @@ -41,7 +41,7 @@ pub struct DepositUpdate {
}

impl DepositUpdate {
/// A singlular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
/// A singular Deposit update that contains only the fields pertinent to updating the status of a deposit. This includes the key related data in addition to status history related data.
pub fn new(
bitcoin_tx_output_index: u32,
bitcoin_txid: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use crate::models;
use serde::{Deserialize, Serialize};

/// WithdrawalUpdate : A singlular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
/// WithdrawalUpdate : A singular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WithdrawalUpdate {
#[serde(
Expand All @@ -38,7 +38,7 @@ pub struct WithdrawalUpdate {
}

impl WithdrawalUpdate {
/// A singlular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
/// A singular Withdrawal update that contains only the fields pertinent to updating the status of a withdrawal. This includes the key related data in addition to status history related data.
pub fn new(
last_update_block_hash: String,
last_update_height: u64,
Expand Down
10 changes: 5 additions & 5 deletions emily/cdk/lib/emily-stack-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ export class EmilyStackUtils {
//
// It would be nice if there were a solution that didn't involve doing this ourselves.
// At the moment, there isn't.
let apiJsonDefiniton = JSON.parse(fs.readFileSync(restApiPathOrFileDescriptor, 'utf-8'));
let paths = apiJsonDefiniton["paths"];
let apiJsonDefinition = JSON.parse(fs.readFileSync(restApiPathOrFileDescriptor, 'utf-8'));
let paths = apiJsonDefinition["paths"];
Object.keys(paths).forEach(path => {
let verbs = paths[path];
Object.keys(verbs).forEach(verb => {
Expand All @@ -266,8 +266,8 @@ export class EmilyStackUtils {
// replace the identifier with the lambda arn.
//
// This will incorrectly handle the already invalid case where two function ARNS are in the uri.
// Handling multiple replacements is left as an exercize for the reader.
apiJsonDefiniton["paths"][path][verb]["x-amazon-apigateway-integration"]["uri"]["Fn::Sub"] =
// Handling multiple replacements is left as an exercise for the reader.
apiJsonDefinition["paths"][path][verb]["x-amazon-apigateway-integration"]["uri"]["Fn::Sub"] =
[ originalSubString, { [lambdaIdentifier] : lambdaFunction.functionArn } ]
}
})
Expand All @@ -276,6 +276,6 @@ export class EmilyStackUtils {
})

// Return the modified template as an ApiDefinition.
return ApiDefinition.fromInline(apiJsonDefiniton)
return ApiDefinition.fromInline(apiJsonDefinition)
}
}
2 changes: 1 addition & 1 deletion emily/cdk/lib/emily-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ export class EmilyStack extends cdk.Stack {
}

// Create the custom domain name of the format:
// if stage != prod: [stage].[purpose].[customRootDomainNameRoot]
// if stage != prod: [purpose].[stage].[customRootDomainNameRoot]
// if stage == prod: [purpose].[customRootDomainNameRoot]
const stagePrefix = EmilyStackUtils.getStageName() === Constants.PROD_STAGE_NAME
? ""
Expand Down
4 changes: 2 additions & 2 deletions emily/handler/src/api/handlers/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async fn set_api_state_status(
Err(Error::VersionConflict) => {
debug!("Failed to update API state - retrying: {api_state:?}")
}
// If some other error occured then return from here; this shouldn't
// If some other error occurred then return from here; this shouldn't
// happen and something has actually gone wrong.
e @ Err(_) => e?,
}
Expand All @@ -90,7 +90,7 @@ async fn set_api_state_status(

/// Handler that executes a reorg.
///
/// This function isn't intendeded to be exposed into any specific endpoint
/// This function isn't intended to be exposed into any specific endpoint
/// outside of what could maybe be a testing endpoint one day. It handles
/// the internal requests to execute a reorg.
pub async fn execute_reorg_handler(
Expand Down
4 changes: 2 additions & 2 deletions emily/handler/src/api/models/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ pub enum Status {
Reprocessing,
/// Transaction has been seen and accepted by the sBTC Signers, but is not
/// yet included in any on chain artifact. The transaction can still fail
/// at this point if the Signers fail to include the transaciton in an on
/// at this point if the Signers fail to include the transaction in an on
/// chain artifact.
///
/// For example, a deposit or withdrawal that has specified too low of a
/// BTC fee may fail after being accepted.
Accepted,
/// The articacts that fulill the operation have been observed in a valid fork of
/// The artifacts that fulfill the operation have been observed in a valid fork of
/// both the Stacks blockchain and the Bitcoin blockchain by at least one signer.
///
/// Note that if the signers detect a conflicting chainstate in which the operation
Expand Down
2 changes: 1 addition & 1 deletion emily/handler/src/api/models/deposit/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct CreateDepositRequestBody {
pub deposit_script: String,
}

/// A singlular Deposit update that contains only the fields pertinent
/// A singular Deposit update that contains only the fields pertinent
/// to updating the status of a deposit. This includes the key related
/// data in addition to status history related data.
#[derive(Clone, Default, Debug, PartialEq, Hash, Serialize, Deserialize, ToSchema)]
Expand Down
2 changes: 1 addition & 1 deletion emily/handler/src/api/models/withdrawal/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub struct CreateWithdrawalRequestBody {
pub parameters: WithdrawalParameters,
}

/// A singlular Withdrawal update that contains only the fields pertinent
/// A singular Withdrawal update that contains only the fields pertinent
/// to updating the status of a withdrawal. This includes the key related
/// data in addition to status history related data.
#[derive(Clone, Default, Debug, PartialEq, Hash, Serialize, Deserialize, ToSchema)]
Expand Down
2 changes: 1 addition & 1 deletion emily/handler/src/api/routes/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Route definitiions for the Emily API.
//! Route definitions for the Emily API.
use crate::context::EmilyContext;

Expand Down
6 changes: 3 additions & 3 deletions emily/handler/src/common/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub enum Error {

/// API is reorganizing.
#[error("Api is reorganizing around new chain tip {0:?}")]
Reorganzing(Chainstate),
Reorganizing(Chainstate),

/// An entry update version conflict in a resource update resulted
/// in an update not being performed.
Expand Down Expand Up @@ -132,7 +132,7 @@ impl Error {
Error::RequestTimeout => StatusCode::REQUEST_TIMEOUT,
Error::TooManyInternalRetries => StatusCode::INTERNAL_SERVER_ERROR,
Error::InconsistentState(_) => StatusCode::INTERNAL_SERVER_ERROR,
Error::Reorganzing(_) => StatusCode::INTERNAL_SERVER_ERROR,
Error::Reorganizing(_) => StatusCode::INTERNAL_SERVER_ERROR,
Error::BadRequest(_) => StatusCode::BAD_REQUEST,
Error::VersionConflict => StatusCode::INTERNAL_SERVER_ERROR,
}
Expand Down Expand Up @@ -160,7 +160,7 @@ impl Error {
| Error::Network(_)
| Error::ServiceUnavailable
| Error::VersionConflict
| Error::Reorganzing(_)
| Error::Reorganizing(_)
| Error::InternalServer => Error::InternalServer,
err => err,
}
Expand Down
12 changes: 6 additions & 6 deletions emily/handler/src/database/accessors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub async fn get_deposit_entries_by_recipient(
.await
}

/// Hacky exhasutive list of all statuses that we will iterate over in order to
/// Hacky exhaustive list of all statuses that we will iterate over in order to
/// get every deposit present.
const ALL_STATUSES: &[Status] = &[
Status::Accepted,
Expand Down Expand Up @@ -634,7 +634,7 @@ pub async fn set_api_state(context: &EmilyContext, api_state: &ApiStateEntry) ->
/// Note, this function provides the direct output structure for the api call
/// to get the limits for the full sbtc system, and therefore is breaching the
/// typical contract for these accessor functions. We do this here because the
/// data for this sigular entry is spread across the entire table in a way that
/// data for this singular entry is spread across the entire table in a way that
/// needs to be first gathered, then filtered. It does not neatly fit into a
/// return type that is within the table as an entry.
pub async fn get_limits(context: &EmilyContext) -> Result<Limits, Error> {
Expand Down Expand Up @@ -804,14 +804,14 @@ async fn delete_entry<T: TableIndexTrait>(

async fn query_with_partition_key<T: TableIndexTrait>(
context: &EmilyContext,
parition_key: &<<<T as TableIndexTrait>::Entry as EntryTrait>::Key as KeyTrait>::PartitionKey,
partition_key: &<<<T as TableIndexTrait>::Entry as EntryTrait>::Key as KeyTrait>::PartitionKey,
maybe_next_token: Option<String>,
maybe_page_size: Option<u16>,
) -> Result<(Vec<<T as TableIndexTrait>::Entry>, Option<String>), Error> {
<T as TableIndexTrait>::query_with_partition_key(
&context.dynamodb_client,
&context.settings,
parition_key,
partition_key,
maybe_next_token,
maybe_page_size,
)
Expand All @@ -820,7 +820,7 @@ async fn query_with_partition_key<T: TableIndexTrait>(

async fn query_all_with_partition_and_sort_key<T: TableIndexTrait>(
context: &EmilyContext,
parition_key: &<<<T as TableIndexTrait>::Entry as EntryTrait>::Key as KeyTrait>::PartitionKey,
partition_key: &<<<T as TableIndexTrait>::Entry as EntryTrait>::Key as KeyTrait>::PartitionKey,
sort_key: &<<<T as TableIndexTrait>::Entry as EntryTrait>::Key as KeyTrait>::SortKey,
sort_key_operator: &str,
maybe_page_size: Option<u16>,
Expand All @@ -835,7 +835,7 @@ async fn query_all_with_partition_and_sort_key<T: TableIndexTrait>(
(new_items, next_token) = <T as TableIndexTrait>::query_with_partition_and_sort_key(
&context.dynamodb_client,
&context.settings,
parition_key,
partition_key,
sort_key,
sort_key_operator,
next_token,
Expand Down
2 changes: 1 addition & 1 deletion emily/handler/src/database/entries/chainstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl ApiStateEntry {
/// Create the appropriate error if the API is reorganizing.
pub fn error_if_reorganizing(&self) -> Result<(), Error> {
if let ApiStatus::Reorg(chaintip) = &self.api_status {
Err(Error::Reorganzing(chaintip.clone().into()))
Err(Error::Reorganizing(chaintip.clone().into()))
} else {
Ok(())
}
Expand Down
6 changes: 3 additions & 3 deletions emily/handler/src/database/entries/deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ impl From<DepositInfoByRecipientEntry> for DepositInfo {
/// Validated version of the update deposit request.
#[derive(Clone, Default, Debug, Eq, PartialEq, Hash)]
pub struct ValidatedUpdateDepositsRequest {
/// Validated deposit update requests where each update request is in chronoloical order
/// Validated deposit update requests where each update request is in chronological order
/// of when the update should have occurred, but where the first value of the tuple is the
/// index of the update in the original request.
///
Expand All @@ -541,7 +541,7 @@ pub struct ValidatedUpdateDepositsRequest {
impl TryFrom<UpdateDepositsRequestBody> for ValidatedUpdateDepositsRequest {
type Error = Error;
fn try_from(update_request: UpdateDepositsRequestBody) -> Result<Self, Self::Error> {
// Validate all the depoit updates.
// Validate all the deposit updates.
let mut deposits: Vec<(usize, ValidatedDepositUpdate)> = update_request
.deposits
.into_iter()
Expand Down Expand Up @@ -579,7 +579,7 @@ impl ValidatedUpdateDepositsRequest {
.into_iter()
.collect::<Vec<_>>();

// Sort the chainsates in the order that they should come in.
// Sort the chainstates in the order that they should come in.
inferred_chainstates.sort_by_key(|chainstate| chainstate.stacks_block_height);

// Return.
Expand Down
10 changes: 5 additions & 5 deletions emily/handler/src/database/entries/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ pub enum StatusEntry {
Reprocessing,
/// Transaction has been seen and accepted by the sBTC Signers, but is not
/// yet included in any on chain artifact. The transaction can still fail
/// at this point if the Signers fail to include the transaciton in an on
/// at this point if the Signers fail to include the transaction in an on
/// chain artifact.
///
/// For example, a deposit or withdrawal that has specified too low of a
/// BTC fee may fail after being accepted.
Accepted,
/// The articacts that fulill the operation have been observed in a valid fork of
/// The artifacts that fulfill the operation have been observed in a valid fork of
/// both the Stacks blockchain and the Bitcoin blockchain by at least one signer.
///
/// Note that if the signers detect a conflicting chainstate in which the operation
Expand Down Expand Up @@ -138,7 +138,7 @@ pub trait KeyTrait: serde::Serialize + for<'de> serde::Deserialize<'de> {
type PartitionKey: serde::Serialize + for<'de> serde::Deserialize<'de>;
/// Sort key type.
type SortKey: serde::Serialize + for<'de> serde::Deserialize<'de>;
/// Parition key name.
/// Partition key name.
const PARTITION_KEY_NAME: &'static str;
/// Sort key name.
const SORT_KEY_NAME: &'static str;
Expand Down Expand Up @@ -560,8 +560,8 @@ fn tokenize<T>(key: T) -> Result<String, Error>
where
T: Serialize,
{
let serialied = serde_json::to_string(&key)?;
let encoded: String = URL_SAFE_NO_PAD.encode(serialied);
let serialized = serde_json::to_string(&key)?;
let encoded: String = URL_SAFE_NO_PAD.encode(serialized);
Ok(encoded)
}

Expand Down
Loading

0 comments on commit 39b961f

Please sign in to comment.