Skip to content

Commit

Permalink
Merge branch 'main' into feat/auto-sync-mithril
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenj authored Jul 15, 2024
2 parents f038a98 + 9fa4890 commit 5a1d26f
Show file tree
Hide file tree
Showing 82 changed files with 3,395 additions and 715 deletions.
1 change: 1 addition & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ genhtml
GETFL
getres
gmtime
gossipsub
happ
hardano
hardlink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ app_metadata: {
label: |json
{
"name": "Athena - Project Catalyst Voting",
"icon": "/srv/www/icons/athena.svg",
"version" : "V2.7.3",
"description" : "Project Catalyst Innovation Platform",
"about": "About Project Catalyst, long form.\nMulti line.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ root group: {
|
}

root icon object: {
shape: page
label: icon.svg
style: {
font: mono
}
tooltip: |md
Application icon.svg image file.
|
}

root author signature object: {
shape: document
label: author.cose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Data is divided between them to make merging those views easy and consistent.
| `/lib/<module-name>/author.cose` | :octicons-file-badge-16: | Modules Author Signature | <span style="color: orange;">:octicons-circle-16:</span> | <span style="color: green;">:octicons-check-circle-fill-12:</span> |
| `/var/` | :octicons-file-directory-fill-16: | Contains variable data files. (Persistent) | <span style="color: green;">:octicons-check-circle-fill-12:</span> | <span style="color: orange;">:octicons-circle-16:</span> |
| `/metadata.json` | :octicons-file-16: | Applications Metadata | <span style="color: orange;">:octicons-circle-16:</span> | <span style="color: green;">:octicons-check-circle-fill-12:</span> |
| `/icon.svg` | :octicons-file-16: | Application Icon | <span style="color: orange;">:octicons-circle-16:</span> | <span style="color: green;">:octicons-check-circle-fill-12:</span> |
| `/author.cose` | :octicons-file-badge-16: | Application Author Signature | <span style="color: orange;">:octicons-circle-16:</span> | <span style="color: green;">:octicons-check-circle-fill-12:</span> |
| `/publisher.cose` | :octicons-file-badge-16: | Application Publisher Signature | <span style="color: orange;">:octicons-circle-16:</span> | <span style="color: orange;">:octicons-circle-16:</span> |

Expand Down
3 changes: 3 additions & 0 deletions hermes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ pallas-hardano = { git = "https://github.com/input-output-hk/catalyst-pallas.git
pallas-crypto = { git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "cd70422a7e6c011464e2268d1036cdf2249fb8d7", version = "0.28.0" }
cardano-chain-follower = { path = "crates/cardano-chain-follower", version = "0.1.0" }

hermes-ipfs = { path = "crates/hermes-ipfs", version = "0.0.1" }

wasmtime = "20.0.2"
rusty_ulid = "2.0.0"
anyhow = "1.0.71"
Expand Down Expand Up @@ -153,6 +155,7 @@ ed25519-dalek = "2.1.1"
x509-cert = "0.2.5"
coset = "0.3.7"
libipld = "0.16.0"
libp2p = "0.53.2"
rust-ipfs = "0.11.19"
rustyline-async = "0.4.2"
ouroboros = "0.18.4"
1 change: 1 addition & 0 deletions hermes/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ test-wasm-integration:
COPY ../wasm/integration-test/crypto+build/crypto.wasm ../wasm/test-components/
COPY ../wasm/integration-test/cardano+build/cardano.wasm ../wasm/test-components/
COPY ../wasm/integration-test/hashing+build/hashing.wasm ../wasm/test-components/
COPY ../wasm/integration-test/ipfs+build/ipfs.wasm ../wasm/test-components/
COPY ../wasm/integration-test/localtime+build/localtime.wasm ../wasm/test-components/
COPY ../wasm/integration-test/logger+build/logger.wasm ../wasm/test-components/
COPY ../wasm/integration-test/sqlite+build/sqlite.wasm ../wasm/test-components/
Expand Down
3 changes: 3 additions & 0 deletions hermes/bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ num_cpus = { workspace = true }
console = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
hyper = { version = "0.14.10", features = ["full"] }

jsonschema = { workspace = true }
hex = { workspace = true }
hmac = { workspace = true }
Expand All @@ -69,6 +71,7 @@ sha2 = { workspace = true }
ed25519-dalek = { workspace = true, features = ["pem"] }
x509-cert = { workspace = true, features = ["pem"] }
coset = { workspace = true }
hermes-ipfs = { workspace = true }

[build-dependencies]
build-info-build = { workspace = true }
Expand Down
9 changes: 2 additions & 7 deletions hermes/bin/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,14 @@ impl Cli {
.with_line_num(true)
.build();

logger::init(&log_config).unwrap_or_else(|err| errors.add_err(err));
logger::init(&log_config).unwrap_or_else(errors.get_add_err_fn());

match self.command {
None => run::Run::exec(),
Some(Commands::Module(cmd)) => cmd.exec(),
Some(Commands::App(cmd)) => cmd.exec(),
}
.unwrap_or_else(|err| {
match err.downcast::<Errors>() {
Ok(errs) => errors.merge(errs),
Err(err) => errors.add_err(err),
}
});
.unwrap_or_else(errors.get_add_err_fn());

if !errors.is_empty() {
println!("{}:\n{}", Emoji::new("🚨", "Errors"), style(errors).red());
Expand Down
20 changes: 13 additions & 7 deletions hermes/bin/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,19 @@ impl Errors {
}

/// Add an error to the `Errors`
pub(crate) fn add_err(&mut self, err: anyhow::Error) {
self.0.push(err);
pub(crate) fn add_err<E>(&mut self, err: E)
where E: Into<anyhow::Error> {
let err = err.into();
match err.downcast::<Errors>() {
Ok(errs) => self.0.extend(errs.0),
Err(err) => self.0.push(err),
}
}

/// Merge two `Errors`
pub(crate) fn merge(&mut self, other: Self) {
self.0.extend(other.0);
/// Return a closure that adds an error to the `Errors`
pub(crate) fn get_add_err_fn<E>(&mut self) -> impl FnOnce(E) + '_
where E: Into<anyhow::Error> {
|err| self.add_err(err)
}

/// Return errors if `Errors` is not empty or return `Ok(val)`
Expand Down Expand Up @@ -69,8 +75,8 @@ mod tests {
errors_2.add_err(anyhow::anyhow!("error 4"));

let mut combined_errors = Errors::new();
combined_errors.merge(errors_1);
combined_errors.merge(errors_2);
combined_errors.add_err(errors_1);
combined_errors.add_err(errors_2);

assert_eq!(
combined_errors.to_string(),
Expand Down
File renamed without changes.
Loading

0 comments on commit 5a1d26f

Please sign in to comment.