From 53b8117e9578f2bd7a64a0f35af5342b07cd959a Mon Sep 17 00:00:00 2001 From: wulfraem Date: Tue, 26 Nov 2024 10:46:40 +0100 Subject: [PATCH] cleanup names and commits (#1443) --- identity_iota_core/src/rebased/assets/asset.rs | 6 +++--- identity_iota_core/src/rebased/client/full_client.rs | 2 +- identity_iota_core/src/rebased/migration/alias.rs | 2 +- identity_iota_core/src/rebased/migration/identity.rs | 6 +++--- .../proposals/{deactive_did.rs => deactivate_did.rs} | 10 +++++----- identity_iota_core/src/rebased/proposals/mod.rs | 4 ++-- identity_storage/src/storage/error.rs | 3 +-- 7 files changed, 16 insertions(+), 17 deletions(-) rename identity_iota_core/src/rebased/proposals/{deactive_did.rs => deactivate_did.rs} (94%) diff --git a/identity_iota_core/src/rebased/assets/asset.rs b/identity_iota_core/src/rebased/assets/asset.rs index 866bf9be21..e1e60b3e41 100644 --- a/identity_iota_core/src/rebased/assets/asset.rs +++ b/identity_iota_core/src/rebased/assets/asset.rs @@ -126,7 +126,7 @@ impl AuthenticatedAsset { /// Destroys this [`AuthenticatedAsset`]. /// # Notes /// This function doesn't delete the asset right away, but instead creates a [`Transaction`] that - /// can be executed in order to destory the asset. + /// can be executed in order to destroy the asset. /// # Failures /// * Returns an [`Error::InvalidConfig`] if this asset cannot be deleted. pub fn delete(self) -> Result, Error> { @@ -202,7 +202,7 @@ impl AuthenticatedAssetBuilder { /// Sets whether the new asset allows the transfer of its ownership. /// - /// By default an [`AuthenticatedAsset`] **cannot** be transfered. + /// By default an [`AuthenticatedAsset`] **cannot** be transferred. pub fn transferable(mut self, transferable: bool) -> Self { self.transferable = transferable; self @@ -232,7 +232,7 @@ impl AuthenticatedAssetBuilder { /// owner and a `RecipientCap` to the specified `recipient` address. /// `recipient` can accept the transfer by presenting its `RecipientCap` (this prevents other users from claiming the /// asset for themselves). -/// The current owner can cancel the proposal at any time - given the transfer hasn't been conclued yet - by presenting +/// The current owner can cancel the proposal at any time - given the transfer hasn't been concluded yet - by presenting /// its `SenderCap`. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferProposal { diff --git a/identity_iota_core/src/rebased/client/full_client.rs b/identity_iota_core/src/rebased/client/full_client.rs index 1aa7b70e44..066bac68cc 100644 --- a/identity_iota_core/src/rebased/client/full_client.rs +++ b/identity_iota_core/src/rebased/client/full_client.rs @@ -281,7 +281,7 @@ impl IdentityClient { } /// Query the objects owned by the address wrapped by this client to find the object of type `tag` - /// and that satifies `predicate`. + /// and that satisfies `predicate`. pub async fn find_owned_ref

(&self, tag: StructTag, predicate: P) -> Result, Error> where P: Fn(&IotaObjectData) -> bool, diff --git a/identity_iota_core/src/rebased/migration/alias.rs b/identity_iota_core/src/rebased/migration/alias.rs index 73a628e97c..ba56ca3790 100644 --- a/identity_iota_core/src/rebased/migration/alias.rs +++ b/identity_iota_core/src/rebased/migration/alias.rs @@ -149,7 +149,7 @@ impl Transaction for MigrateLegacyAliasTx { S: Signer + Sync, { let response = self.0.execute_with_opt_gas(gas_budget, client).await?.response; - // Make sure the tx was successfull. + // Make sure the tx was successful. let effects = response .effects .as_ref() diff --git a/identity_iota_core/src/rebased/migration/identity.rs b/identity_iota_core/src/rebased/migration/identity.rs index 6ed6aa11b0..109121a9f6 100644 --- a/identity_iota_core/src/rebased/migration/identity.rs +++ b/identity_iota_core/src/rebased/migration/identity.rs @@ -40,7 +40,7 @@ use crate::rebased::client::IdentityClientReadOnly; use crate::rebased::client::IotaKeySignature; use crate::rebased::proposals::BorrowAction; use crate::rebased::proposals::ConfigChange; -use crate::rebased::proposals::DeactiveDid; +use crate::rebased::proposals::DeactivateDid; use crate::rebased::proposals::ProposalBuilder; use crate::rebased::proposals::SendAction; use crate::rebased::proposals::UpdateDidDocument; @@ -165,8 +165,8 @@ impl OnChainIdentity { } /// Deactivates the DID Document represented by this [`OnChainIdentity`]. - pub fn deactivate_did(&mut self) -> ProposalBuilder<'_, DeactiveDid> { - ProposalBuilder::new(self, DeactiveDid::new()) + pub fn deactivate_did(&mut self) -> ProposalBuilder<'_, DeactivateDid> { + ProposalBuilder::new(self, DeactivateDid::new()) } /// Sends assets owned by this [`OnChainIdentity`] to other addresses. diff --git a/identity_iota_core/src/rebased/proposals/deactive_did.rs b/identity_iota_core/src/rebased/proposals/deactivate_did.rs similarity index 94% rename from identity_iota_core/src/rebased/proposals/deactive_did.rs rename to identity_iota_core/src/rebased/proposals/deactivate_did.rs index 31eede5ee0..cfca0b9018 100644 --- a/identity_iota_core/src/rebased/proposals/deactive_did.rs +++ b/identity_iota_core/src/rebased/proposals/deactivate_did.rs @@ -25,15 +25,15 @@ use super::ProposalT; /// Action for deactivating a DID Document inside an Identity. #[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)] -pub struct DeactiveDid; +pub struct DeactivateDid; -impl DeactiveDid { +impl DeactivateDid { pub const fn new() -> Self { Self } } -impl MoveType for DeactiveDid { +impl MoveType for DeactivateDid { fn move_type(package: ObjectID) -> TypeTag { use std::str::FromStr; @@ -42,8 +42,8 @@ impl MoveType for DeactiveDid { } #[async_trait] -impl ProposalT for Proposal { - type Action = DeactiveDid; +impl ProposalT for Proposal { + type Action = DeactivateDid; type Output = (); async fn create<'i, S>( diff --git a/identity_iota_core/src/rebased/proposals/mod.rs b/identity_iota_core/src/rebased/proposals/mod.rs index 1869b76c1a..766d575b88 100644 --- a/identity_iota_core/src/rebased/proposals/mod.rs +++ b/identity_iota_core/src/rebased/proposals/mod.rs @@ -3,7 +3,7 @@ mod borrow; mod config_change; -mod deactive_did; +mod deactivate_did; mod send; mod update_did_doc; @@ -19,7 +19,7 @@ use crate::rebased::transaction::ProtoTransaction; use async_trait::async_trait; pub use borrow::*; pub use config_change::*; -pub use deactive_did::*; +pub use deactivate_did::*; use iota_sdk::rpc_types::IotaExecutionStatus; use iota_sdk::rpc_types::IotaObjectData; use iota_sdk::rpc_types::IotaObjectDataOptions; diff --git a/identity_storage/src/storage/error.rs b/identity_storage/src/storage/error.rs index 51af20ead0..307ecf24fb 100644 --- a/identity_storage/src/storage/error.rs +++ b/identity_storage/src/storage/error.rs @@ -30,13 +30,12 @@ pub enum JwkStorageDocumentError { /// Caused by an invalid JWP algorithm. #[error("invalid JWP algorithm")] InvalidJwpAlgorithm, - /// Cannot cunstruct a valid Jwp (issued or presented form) + /// Cannot construct a valid Jwp (issued or presented form) #[error("Not able to construct a valid Jwp")] JwpBuildingError, /// Credential's proof update internal error #[error("Credential's proof internal error")] ProofUpdateError(String), - /// Caused by a failure to construct a verification method. #[error("method generation failed: unable to create a valid verification method")] VerificationMethodConstructionError(#[source] identity_verification::Error),