diff --git a/identity_iota_core/src/rebased/assets/asset.rs b/identity_iota_core/src/rebased/assets/asset.rs index 525cefb5f..866bf9be2 100644 --- a/identity_iota_core/src/rebased/assets/asset.rs +++ b/identity_iota_core/src/rebased/assets/asset.rs @@ -24,7 +24,6 @@ use iota_sdk::types::base_types::SequenceNumber; use iota_sdk::types::id::UID; use iota_sdk::types::object::Owner; use iota_sdk::types::TypeTag; -use iota_sdk::IotaClient; use move_core_types::ident_str; use move_core_types::language_storage::StructTag; use secret_storage::Signer; @@ -69,7 +68,7 @@ where T: DeserializeOwned, { /// Resolves an [`AuthenticatedAsset`] by its ID `id`. - pub async fn get_by_id(id: ObjectID, client: &IotaClient) -> Result { + pub async fn get_by_id(id: ObjectID, client: &IdentityClient) -> Result { let res = client .read_api() .get_object_with_options(id, IotaObjectDataOptions::new().with_content()) @@ -89,7 +88,7 @@ where } impl AuthenticatedAsset { - async fn object_ref(&self, client: &IotaClient) -> Result { + async fn object_ref(&self, client: &IdentityClient) -> Result { client .read_api() .get_object_with_options(self.id(), IotaObjectDataOptions::default()) @@ -259,7 +258,7 @@ impl MoveType for TransferProposal { impl TransferProposal { /// Resolves a [`TransferProposal`] by its ID `id`. - pub async fn get_by_id(id: ObjectID, client: &IotaClient) -> Result { + pub async fn get_by_id(id: ObjectID, client: &IdentityClient) -> Result { let res = client .read_api() .get_object_with_options(id, IotaObjectDataOptions::new().with_content()) @@ -294,7 +293,7 @@ impl TransferProposal { }) } - async fn asset_metadata(&self, client: &IotaClient) -> anyhow::Result<(ObjectRef, TypeTag)> { + async fn asset_metadata(&self, client: &IdentityClient) -> anyhow::Result<(ObjectRef, TypeTag)> { let res = client .read_api() .get_object_with_options(self.asset_id, IotaObjectDataOptions::default().with_type()) @@ -318,7 +317,7 @@ impl TransferProposal { Ok((asset_ref, param_type)) } - async fn initial_shared_version(&self, client: &IotaClient) -> anyhow::Result { + async fn initial_shared_version(&self, client: &IdentityClient) -> anyhow::Result { let owner = client .read_api() .get_object_with_options(*self.id.object_id(), IotaObjectDataOptions::default().with_owner()) diff --git a/identity_iota_core/src/rebased/client/full_client.rs b/identity_iota_core/src/rebased/client/full_client.rs index 0a43c288b..1aa7b70e4 100644 --- a/identity_iota_core/src/rebased/client/full_client.rs +++ b/identity_iota_core/src/rebased/client/full_client.rs @@ -102,7 +102,7 @@ impl Deref for IdentityClient { impl IdentityClient where - S: Signer, + S: Signer + Sync, { pub async fn new(client: IdentityClientReadOnly, signer: S) -> Result { let public_key = signer diff --git a/identity_iota_core/src/rebased/error.rs b/identity_iota_core/src/rebased/error.rs index e537e22a9..c2fd24b51 100644 --- a/identity_iota_core/src/rebased/error.rs +++ b/identity_iota_core/src/rebased/error.rs @@ -65,4 +65,7 @@ pub enum Error { /// An error caused by either a connection issue or an invalid RPC call. #[error("RPC error: {0}")] RpcError(String), + /// An error caused by a bcs serialization or deserialization. + #[error("BCS error: {0}")] + BcsError(#[from] bcs::Error), }