diff --git a/aries/aries_vcx/src/protocols/issuance/holder/state_machine.rs b/aries/aries_vcx/src/protocols/issuance/holder/state_machine.rs index 3f07a9d727..5d0ee06aa9 100644 --- a/aries/aries_vcx/src/protocols/issuance/holder/state_machine.rs +++ b/aries/aries_vcx/src/protocols/issuance/holder/state_machine.rs @@ -1,5 +1,6 @@ use std::fmt; +use anoncreds_types::data_types::identifiers::schema_id::SchemaId; use aries_vcx_anoncreds::anoncreds::base_anoncreds::BaseAnonCreds; use aries_vcx_ledger::ledger::base_ledger::AnoncredsLedgerRead; use aries_vcx_wallet::wallet::base_wallet::BaseWallet; @@ -277,9 +278,7 @@ impl HolderSM { trace!("HolderSM::receive_credential >>"); let state = match self.state { HolderFullState::RequestSet(state_data) => { - let schema = ledger - .get_schema(&state_data.schema_id.clone().try_into()?, None) - .await?; + let schema = ledger.get_schema(&state_data.schema_id, None).await?; let schema_json = serde_json::to_string(&schema)?; match _store_credential( wallet, @@ -601,7 +600,7 @@ pub async fn create_anoncreds_credential_request( cred_def_id: &str, prover_did: &Did, cred_offer: &str, -) -> VcxResult<(String, String, String, String, String)> { +) -> VcxResult<(String, String, String, String, SchemaId)> { let cred_def_json = ledger .get_cred_def(&cred_def_id.to_string().try_into()?, None) .await?; @@ -628,7 +627,7 @@ pub async fn create_anoncreds_credential_request( serde_json::to_string(&s2).unwrap(), cred_def_id.to_string(), serde_json::to_string(&cred_def_json).unwrap(), - cred_def_json.schema_id.to_string(), + cred_def_json.schema_id, ) }) } @@ -642,7 +641,7 @@ async fn build_credential_request_msg( thread_id: String, my_pw_did: Did, offer: &OfferCredentialV1, -) -> VcxResult<(RequestCredentialV1, String, String, String)> { +) -> VcxResult<(RequestCredentialV1, String, String, SchemaId)> { trace!( "Holder::_make_credential_request >>> my_pw_did: {:?}, offer: {:?}", my_pw_did, diff --git a/aries/aries_vcx/src/protocols/issuance/holder/states/request_set.rs b/aries/aries_vcx/src/protocols/issuance/holder/states/request_set.rs index 586a75b2c6..b92044d3f3 100644 --- a/aries/aries_vcx/src/protocols/issuance/holder/states/request_set.rs +++ b/aries/aries_vcx/src/protocols/issuance/holder/states/request_set.rs @@ -1,3 +1,4 @@ +use anoncreds_types::data_types::identifiers::schema_id::SchemaId; use messages::msg_fields::protocols::cred_issuance::v1::{ issue_credential::IssueCredentialV1, request_credential::RequestCredentialV1, }; @@ -11,7 +12,7 @@ use crate::{ pub struct RequestSetState { pub req_meta: String, pub cred_def_json: String, - pub schema_id: String, + pub schema_id: SchemaId, pub msg_credential_request: RequestCredentialV1, }