Skip to content

Commit

Permalink
Merge pull request #30 from blu3beri/remove-seq-no
Browse files Browse the repository at this point in the history
Remove seq no
  • Loading branch information
berendsliedrecht authored Jan 3, 2023
2 parents 1dd9a60 + 9c3fe6e commit 0f331b9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
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

0 comments on commit 0f331b9

Please sign in to comment.