Skip to content
Merged
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
22 changes: 22 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Typos

on:
push:
branches: [develop, sdk-bindings]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

concurrency:
group: typos-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

jobs:
typos:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install typos-cli
run: cargo install typos-cli
- name: Run typos-cli
run: typos
31 changes: 31 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[default]
extend-ignore-identifiers-re = [
# Short git hashes
"^[a-f0-9]{7}$",
"^[a-f0-9]{12}$",
# Base64
"^[a-zA-Z0-9_]{43}$",
"^[a-zA-Z0-9_]{44}$",
"^[a-zA-Z0-9_]{47}$",
"^[a-zA-Z0-9_]{49}$",
"^[a-zA-Z0-9_]{56,}$",
]

extend-ignore-re = [
# Truncated hex IDs (ex. "0x9...a9b")
"0x[a-f0-9]\\.{3}[a-f0-9]{3}",
# Documentation pattern
"\\d*OCTECT",
]

[default.extend-words]
# random identifiers, variables, functions, ...
groth = "groth"

[files]
extend-exclude = [
"bindings/go/iota_sdk_ffi/iota_sdk_ffi.go",
"bindings/go/iota_sdk_ffi/iota_sdk_ffi.h",
"bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt",
"bindings/python/lib/iota_sdk_ffi.py",
]
8 changes: 4 additions & 4 deletions bindings/go/iota_sdk_ffi/iota_sdk_ffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -5491,7 +5491,7 @@ func (ffiObject *FfiObject)freeRustArcPtr() {
//
// Deriving an address consists of the Blake2b256 hash of the sequence of bytes
// of its corresponding authenticator, prefixed with a domain-separator (except
// ed25519, for compatability reasons). For each other authenticator, this
// ed25519, for compatibility reasons). For each other authenticator, this
// domain-separator is the single byte-value of its
// [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature
// schema flag || authenticator bytes)`.
Expand Down Expand Up @@ -5548,7 +5548,7 @@ type AddressInterface interface {
//
// Deriving an address consists of the Blake2b256 hash of the sequence of bytes
// of its corresponding authenticator, prefixed with a domain-separator (except
// ed25519, for compatability reasons). For each other authenticator, this
// ed25519, for compatibility reasons). For each other authenticator, this
// domain-separator is the single byte-value of its
// [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature
// schema flag || authenticator bytes)`.
Expand Down Expand Up @@ -12664,7 +12664,7 @@ func (_ FfiDestroyerMultisigAggregatedSignature) Destroy(value *MultisigAggregat
// A multisig committee
//
// A `MultisigCommittee` is a set of members who collectively control a single
// `Address` on the IOTA blockchain. The number of required signautres to
// `Address` on the IOTA blockchain. The number of required signatures to
// authorize the execution of a transaction is determined by
// `(signature_0_weight + signature_1_weight ..) >= threshold`.
//
Expand Down Expand Up @@ -12706,7 +12706,7 @@ type MultisigCommitteeInterface interface {
// A multisig committee
//
// A `MultisigCommittee` is a set of members who collectively control a single
// `Address` on the IOTA blockchain. The number of required signautres to
// `Address` on the IOTA blockchain. The number of required signatures to
// authorize the execution of a transaction is determined by
// `(signature_0_weight + signature_1_weight ..) >= threshold`.
//
Expand Down
8 changes: 4 additions & 4 deletions bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6775,7 +6775,7 @@ public object FfiConverterDuration: FfiConverterRustBuffer<java.time.Duration> {
*
* Deriving an address consists of the Blake2b256 hash of the sequence of bytes
* of its corresponding authenticator, prefixed with a domain-separator (except
* ed25519, for compatability reasons). For each other authenticator, this
* ed25519, for compatibility reasons). For each other authenticator, this
* domain-separator is the single byte-value of its
* [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature
* schema flag || authenticator bytes)`.
Expand Down Expand Up @@ -6839,7 +6839,7 @@ public interface AddressInterface {
*
* Deriving an address consists of the Blake2b256 hash of the sequence of bytes
* of its corresponding authenticator, prefixed with a domain-separator (except
* ed25519, for compatability reasons). For each other authenticator, this
* ed25519, for compatibility reasons). For each other authenticator, this
* domain-separator is the single byte-value of its
* [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature
* schema flag || authenticator bytes)`.
Expand Down Expand Up @@ -21429,7 +21429,7 @@ public object FfiConverterTypeMultisigAggregatedSignature: FfiConverter<Multisig
* A multisig committee
*
* A `MultisigCommittee` is a set of members who collectively control a single
* `Address` on the IOTA blockchain. The number of required signautres to
* `Address` on the IOTA blockchain. The number of required signatures to
* authorize the execution of a transaction is determined by
* `(signature_0_weight + signature_1_weight ..) >= threshold`.
*
Expand Down Expand Up @@ -21488,7 +21488,7 @@ public interface MultisigCommitteeInterface {
* A multisig committee
*
* A `MultisigCommittee` is a set of members who collectively control a single
* `Address` on the IOTA blockchain. The number of required signautres to
* `Address` on the IOTA blockchain. The number of required signatures to
* authorize the execution of a transaction is determined by
* `(signature_0_weight + signature_1_weight ..) >= threshold`.
*
Expand Down
8 changes: 4 additions & 4 deletions bindings/python/lib/iota_sdk_ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18740,7 +18740,7 @@ class AddressProtocol(typing.Protocol):

Deriving an address consists of the Blake2b256 hash of the sequence of bytes
of its corresponding authenticator, prefixed with a domain-separator (except
ed25519, for compatability reasons). For each other authenticator, this
ed25519, for compatibility reasons). For each other authenticator, this
domain-separator is the single byte-value of its
[`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature
schema flag || authenticator bytes)`.
Expand Down Expand Up @@ -18802,7 +18802,7 @@ class Address():

Deriving an address consists of the Blake2b256 hash of the sequence of bytes
of its corresponding authenticator, prefixed with a domain-separator (except
ed25519, for compatability reasons). For each other authenticator, this
ed25519, for compatibility reasons). For each other authenticator, this
domain-separator is the single byte-value of its
[`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature
schema flag || authenticator bytes)`.
Expand Down Expand Up @@ -26241,7 +26241,7 @@ class MultisigCommitteeProtocol(typing.Protocol):
A multisig committee

A `MultisigCommittee` is a set of members who collectively control a single
`Address` on the IOTA blockchain. The number of required signautres to
`Address` on the IOTA blockchain. The number of required signatures to
authorize the execution of a transaction is determined by
`(signature_0_weight + signature_1_weight ..) >= threshold`.

Expand Down Expand Up @@ -26302,7 +26302,7 @@ class MultisigCommittee():
A multisig committee

A `MultisigCommittee` is a set of members who collectively control a single
`Address` on the IOTA blockchain. The number of required signautres to
`Address` on the IOTA blockchain. The number of required signatures to
authorize the execution of a transaction is determined by
`(signature_0_weight + signature_1_weight ..) >= threshold`.

Expand Down
2 changes: 1 addition & 1 deletion crates/iota-crypto/src/multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ fn multisig_pubkey_and_signature_from_user_signature(
}

UserSignature::Multisig(_) | UserSignature::Passkey(_) => {
Err(SignatureError::from_source("invalid siganture scheme"))
Err(SignatureError::from_source("invalid signature scheme"))
}
}
}
14 changes: 7 additions & 7 deletions crates/iota-crypto/src/zklogin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ impl Verifier<ZkLoginAuthenticator> for ZkloginVerifier {
message: &[u8],
signature: &ZkLoginAuthenticator,
) -> Result<(), SignatureError> {
// 1. check that we have a valid corrisponding Jwk
// 1. check that we have a valid corresponding Jwk
let jwt_details = JwtDetails::from_zklogin_inputs(&signature.inputs)?;
let jwk = self.jwks.get(&jwt_details.id).ok_or_else(|| {
SignatureError::from_source(format!(
"unable to find corrisponding jwk with id '{:?}' for provided authenticator",
"unable to find corresponding jwk with id '{:?}' for provided authenticator",
jwt_details.id
))
})?;
Expand Down Expand Up @@ -86,7 +86,7 @@ impl Verifier<UserSignature> for ZkloginVerifier {
}
}

/// A structed of parsed JWT details, consists of kid, header, iss.
/// A struct of parsed JWT details, consists of kid, header, iss.
#[derive(Debug, Clone, PartialEq, Eq)]
struct JwtDetails {
header: JwtHeader,
Expand All @@ -112,7 +112,7 @@ impl JwtDetails {
struct JwtHeader {
alg: String,
kid: String,
typ: Option<String>,
type_: Option<String>,
}

impl JwtHeader {
Expand All @@ -124,17 +124,17 @@ impl JwtHeader {
alg: String,
kid: String,
#[serde(skip_serializing_if = "Option::is_none")]
typ: Option<String>,
type_: Option<String>,
}

let header_bytes = Base64UrlUnpadded::decode_vec(s)
.map_err(|e| SignatureError::from_source(e.to_string()))?;
let Header { alg, kid, typ } =
let Header { alg, kid, type_ } =
serde_json::from_slice(&header_bytes).map_err(SignatureError::from_source)?;
if alg != "RS256" {
return Err(SignatureError::from_source("jwt alg must be RS256"));
}
Ok(Self { alg, kid, typ })
Ok(Self { alg, kid, type_ })
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/iota-crypto/src/zklogin/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ fn zklogin_proof_to_arkworks(
})
}

/// Given a SimpleSignature convert the corrisponding public key, prefixed with
/// Given a SimpleSignature convert the corresponding public key, prefixed with
/// the signature scheme flag, to two Bn254Frs
pub fn public_key_to_frs(signature: &SimpleSignature) -> (Fr, Fr) {
// buf length of the longest public key secp256r1/secp256k1 of 33 bytes plus 1
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-graphql-client/src/faucet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl FaucetClient {
error!("Faucet request was unsuccessful: {err}");
bail!("Faucet request was unsuccessful: {err}")
} else {
info!("Request succesful: {:?}", faucet_resp.task);
info!("Request successful: {:?}", faucet_resp.task);
Ok(faucet_resp.task)
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-graphql-client/src/pagination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub struct PaginationFilter {
pub direction: Direction,
/// An opaque cursor used for pagination.
pub cursor: Option<String>,
/// The maximum number of items to return. If this is ommitted, it will
/// The maximum number of items to return. If this is omitted, it will
/// lazily query the service configuration for the max page size.
pub limit: Option<i32>,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-ffi/src/types/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::error::Result;
///
/// Deriving an address consists of the Blake2b256 hash of the sequence of bytes
/// of its corresponding authenticator, prefixed with a domain-separator (except
/// ed25519, for compatability reasons). For each other authenticator, this
/// ed25519, for compatibility reasons). For each other authenticator, this
/// domain-separator is the single byte-value of its
/// [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature
/// schema flag || authenticator bytes)`.
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-ffi/src/types/crypto/multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl MultisigAggregatedSignature {
/// A multisig committee
///
/// A `MultisigCommittee` is a set of members who collectively control a single
/// `Address` on the IOTA blockchain. The number of required signautres to
/// `Address` on the IOTA blockchain. The number of required signatures to
/// authorize the execution of a transaction is determined by
/// `(signature_0_weight + signature_1_weight ..) >= threshold`.
///
Expand Down
16 changes: 8 additions & 8 deletions crates/iota-sdk-ffi/src/uniffi_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ use crate::types::{
};

macro_rules! define_paged_record {
($id:ident, $typ:ty) => {
($id:ident, $type_:ty) => {
/// A page of items returned by the GraphQL server.
#[derive(Debug, Clone, uniffi::Record)]
pub struct $id {
/// Information about the page, such as the cursor and whether there are
/// more pages.
pub page_info: PageInfo,
/// The data returned by the server.
pub data: Vec<$typ>,
pub data: Vec<$type_>,
}

impl From<iota_graphql_client::pagination::Page<$typ>> for $id {
fn from(value: iota_graphql_client::pagination::Page<$typ>) -> Self {
impl From<iota_graphql_client::pagination::Page<$type_>> for $id {
fn from(value: iota_graphql_client::pagination::Page<$type_>) -> Self {
Self {
page_info: value.page_info.into(),
data: value.data,
Expand All @@ -44,19 +44,19 @@ define_paged_record!(EventPage, Event);
define_paged_record!(ValidatorPage, Validator);

macro_rules! define_paged_object {
($id:ident, $typ:ty) => {
($id:ident, $type_:ty) => {
/// A page of items returned by the GraphQL server.
#[derive(Debug, Clone, uniffi::Record)]
pub struct $id {
/// Information about the page, such as the cursor and whether there are
/// more pages.
pub page_info: PageInfo,
/// The data returned by the server.
pub data: Vec<std::sync::Arc<$typ>>,
pub data: Vec<std::sync::Arc<$type_>>,
}

impl From<iota_graphql_client::pagination::Page<$typ>> for $id {
fn from(value: iota_graphql_client::pagination::Page<$typ>) -> Self {
impl From<iota_graphql_client::pagination::Page<$type_>> for $id {
fn from(value: iota_graphql_client::pagination::Page<$type_>) -> Self {
Self {
page_info: value.page_info.into(),
data: value
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-types/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
///
/// Deriving an address consists of the Blake2b256 hash of the sequence of bytes
/// of its corresponding authenticator, prefixed with a domain-separator (except
/// ed25519, for compatability reasons). For each other authenticator, this
/// ed25519, for compatibility reasons). For each other authenticator, this
/// domain-separator is the single byte-value of its
/// [`SignatureScheme`](crate::SignatureScheme) flag. E.g. `hash(signature
/// schema flag || authenticator bytes)`.
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-types/src/checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ pub struct CheckpointTransaction {
pub transaction: SignedTransaction,
/// The effects produced by executing this transaction
pub effects: TransactionEffects,
/// The events, if any, emitted by this transaciton during execution
/// The events, if any, emitted by this transaction during execution
pub events: Option<TransactionEvents>,
/// The state of all inputs to this transaction as they were prior to
/// execution.
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-types/src/crypto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl std::error::Error for SignatureFromBytesError {}
/// Utility for calculating base64 encoding lengths.
///
/// In the Base64 encoding each character is used to represent 6 bits (log2(64)
/// = 6). This means that 4 characters are used to represnet 4*6 = 24 bits = 3
/// = 6). This means that 4 characters are used to represent 4*6 = 24 bits = 3
/// bytes. So you need 4*(`n`/3) characters in order to represent `n` bytes, and
/// this needs to be rounded up to a multiple of 4. The number of unused padding
/// characters resulting from the rounding will be 0, 1, 2, or 3.
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-types/src/crypto/multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl MultisigMember {
/// A multisig committee
///
/// A `MultisigCommittee` is a set of members who collectively control a single
/// `Address` on the IOTA blockchain. The number of required signautres to
/// `Address` on the IOTA blockchain. The number of required signatures to
/// authorize the execution of a transaction is determined by
/// `(signature_0_weight + signature_1_weight ..) >= threshold`.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-types/src/transaction/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ mod transaction_expiration {
// `deny_unknown_fields`. If additional properties were allowed
// one could easily construct an object that validated against
// multiple variants since here it's the properties rather than
// the values of a property that distingish between variants.
// the values of a property that distinguish between variants.
additional_properties: Some(Box::new(false.into())),
..Default::default()
})),
Expand Down
Loading