Skip to content

Commit

Permalink
Misc changes (#276)
Browse files Browse the repository at this point in the history
* Changes and simplifications.

* Address review comments.

* Fix removal of revocation keys.

* Remove issuer keys.

* Add functions for updating credential metadata, and emitting relevant events.

* Remove unused Update event, fix serialization.

* Fix signature checking.

* Remove the use of credential IDs (uuids).

* Update examples/credential-registry/src/lib.rs

* Add comments; fix holder revocation test

---------

Co-authored-by: Danil Annenkov <[email protected]>
  • Loading branch information
abizjak and annenkov authored May 23, 2023
1 parent 0f60e45 commit b2557de
Show file tree
Hide file tree
Showing 3 changed files with 346 additions and 384 deletions.
12 changes: 12 additions & 0 deletions concordium-std/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,18 @@ impl FromStr for PublicKeyEd25519 {
}
}

#[cfg(feature = "concordium-quickcheck")]
impl quickcheck::Arbitrary for PublicKeyEd25519 {
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
let lower: u128 = quickcheck::Arbitrary::arbitrary(g);
let upper: u128 = quickcheck::Arbitrary::arbitrary(g);
let mut out = [0u8; 32];
out[..16].copy_from_slice(&lower.to_le_bytes());
out[16..].copy_from_slice(&upper.to_le_bytes());
PublicKeyEd25519(out)
}
}

/// Public key for ECDSA over Secp256k1. Must be 33 bytes long.
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord)]
#[repr(transparent)]
Expand Down
3 changes: 0 additions & 3 deletions examples/credential-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ concordium-std = {path = "../../concordium-std", version="6.1", features = ["con
concordium-cis2 = {path = "../../concordium-cis2", version="3.0", default-features = false}
quickcheck = {version = "1.0.3"}

[dev-dependencies]
concordium-std = {path = "../../concordium-std", version="6.1"}

[lib]
crate-type=["cdylib", "rlib"]

Expand Down
Loading

0 comments on commit b2557de

Please sign in to comment.