Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove seq no #30

Merged
merged 1 commit into from
Jan 3, 2023
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
1 change: 0 additions & 1 deletion anoncreds/src/data_types/anoncreds/rev_reg_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ impl IssuanceType {
*self == IssuanceType::ISSUANCE_BY_DEFAULT
}
}

#[allow(non_camel_case_types)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub enum RegistryType {
Expand Down
1 change: 0 additions & 1 deletion anoncreds/src/data_types/anoncreds/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pub struct SchemaV1 {
pub version: String,
#[serde(rename = "attrNames")]
pub attr_names: AttributeNames,
pub seq_no: Option<u32>,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
Expand Down
6 changes: 0 additions & 6 deletions anoncreds/src/ffi/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub extern "C" fn anoncreds_create_schema(
schema_name: FfiStr,
schema_version: FfiStr,
attr_names: FfiStrList,
seq_no: i64,
result_p: *mut ObjectHandle,
) -> ErrorCode {
catch_error(|| {
Expand All @@ -25,11 +24,6 @@ pub extern "C" fn anoncreds_create_schema(
schema_name,
schema_version,
attr_names.to_string_vec()?.into(),
if seq_no > 0 {
Some(seq_no as u32)
} else {
None
},
)?;
let handle = ObjectHandle::create(schema)?;
unsafe { *result_p = handle };
Expand Down
2 changes: 0 additions & 2 deletions anoncreds/src/services/issuer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ pub fn create_schema(
schema_name: &str,
schema_version: &str,
attr_names: AttributeNames,
seq_no: Option<u32>,
) -> Result<Schema> {
trace!(
"create_schema >>> schema_name: {:?}, schema_version: {:?}, attr_names: {:?}",
Expand All @@ -43,7 +42,6 @@ pub fn create_schema(
name: schema_name.to_string(),
version: schema_version.to_string(),
attr_names,
seq_no,
};
Ok(Schema::SchemaV1(schema))
}
Expand Down
14 changes: 5 additions & 9 deletions anoncreds/tests/anoncreds_demos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ use self::utils::anoncreds::{IssuerWallet, ProverWallet};

mod utils;

pub static GVT_SCHEMA_NAME: &'static str = "gvt";
pub static GVT_SCHEMA_ATTRIBUTES: &[&'static str; 4] = &["name", "age", "sex", "height"];
pub static SCHEMA_ID: &str = "mock:uri";
pub static CRED_DEF_ID: &str = "mock:uri";
pub const GVT_SCHEMA_NAME: &str = "gvt";
pub const GVT_SCHEMA_ATTRIBUTES: &[&str; 4] = &["name", "age", "sex", "height"];

#[test]
fn anoncreds_works_for_single_issuer_single_prover() {
Expand All @@ -27,13 +27,9 @@ fn anoncreds_works_for_single_issuer_single_prover() {
let mut prover_wallet = ProverWallet::default();

// Issuer creates Schema - would be published to the ledger
let gvt_schema = issuer::create_schema(
GVT_SCHEMA_NAME,
"1.0",
GVT_SCHEMA_ATTRIBUTES[..].into(),
None,
)
.expect("Error creating gvt schema for issuer");
let gvt_schema =
issuer::create_schema(GVT_SCHEMA_NAME, "1.0", GVT_SCHEMA_ATTRIBUTES[..].into())
.expect("Error creating gvt schema for issuer");

// Issuer creates Credential Definition
let cred_def_parts = issuer::create_credential_definition(
Expand Down