diff --git a/akd_core/src/proto/mod.rs b/akd_core/src/proto/mod.rs index d313acae..7751adbb 100644 --- a/akd_core/src/proto/mod.rs +++ b/akd_core/src/proto/mod.rs @@ -215,7 +215,7 @@ impl TryFrom<&specs::types::SiblingProof> for crate::SiblingProof { let label: crate::NodeLabel = input.label.as_ref().unwrap().try_into()?; // get the raw data & it's length, but at most crate::hash::DIGEST_BYTES bytes - let siblings = input.siblings.get(0); + let siblings = input.siblings.first(); if siblings.is_none() { return Err(ConversionError::Deserialization( "Required field siblings missing".to_string(), diff --git a/examples/README.md b/examples/README.md index 0d02e844..bbaf0910 100644 --- a/examples/README.md +++ b/examples/README.md @@ -26,7 +26,11 @@ cargo run -p examples --release -- whatsapp-kt-auditor -l This example requires setting up [Docker](https://docs.docker.com/get-docker/) (which will host the MySQL instance). Once Docker is up and running, you can simply run: +```bash +docker compose up [-d] ``` +in the root of repository to spin up the MySQL instance and then run: +```bash cargo run -p examples --release -- mysql-demo ``` to run the demo. You can also pass the `--help` argument to view various options for running benchmarks and auto-populating the instance. @@ -67,4 +71,4 @@ the tests should now pass. This example, unlike the others, is not executable and is mainly intended to demonstrate how an application can build the WASM bindings for the client operations. Since the client operations only depend on the `akd_core` crate, which has fewer dependencies than the full `akd` crate, the resulting WASM library will be much more condensed than simply building directly from `akd`. You can take a look in the -`wasm_client/` sub-directory for a simple example set of bindings for a client that wishes to verify proofs generated by the server. \ No newline at end of file +`wasm_client/` sub-directory for a simple example set of bindings for a client that wishes to verify proofs generated by the server. diff --git a/examples/src/mysql_demo/commands.rs b/examples/src/mysql_demo/commands.rs index 2bd6d403..adab89fb 100644 --- a/examples/src/mysql_demo/commands.rs +++ b/examples/src/mysql_demo/commands.rs @@ -83,10 +83,9 @@ impl Command { "end".blue() ); println!( - " {}|{} {}:\t\tretrieve the root hash at given epoch (default = latest epoch)", + " {}|{}\t\tretrieve the root hash at the latest epoch", "root".green(), "root_hash".green(), - "epoch".magenta() ); } diff --git a/examples/src/whatsapp_kt_auditor/auditor.rs b/examples/src/whatsapp_kt_auditor/auditor.rs index 688e57d9..ddf782f6 100644 --- a/examples/src/whatsapp_kt_auditor/auditor.rs +++ b/examples/src/whatsapp_kt_auditor/auditor.rs @@ -68,7 +68,7 @@ pub(crate) async fn audit_epoch(blob: akd::local_auditing::AuditBlob) -> Result< } } -pub(crate) fn display_audit_proofs_info(info: &mut Vec) -> Result { +pub(crate) fn display_audit_proofs_info(info: &mut [EpochSummary]) -> Result { info.sort_by(|a, b| a.name.epoch.cmp(&b.name.epoch)); if info.is_empty() { bail!("There are no epochs present in the storage repository");