From d10edd75bc3617191aa9e6bcf7d37d4b3490a94a Mon Sep 17 00:00:00 2001 From: hu55a1n1 Date: Fri, 23 Feb 2024 12:48:56 -0800 Subject: [PATCH] Add MRENCLAVE to CLI args --- enclaves/quartz/Cargo.toml | 3 +++ enclaves/quartz/src/cli.rs | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/enclaves/quartz/Cargo.toml b/enclaves/quartz/Cargo.toml index 815fecd..2b6ccf3 100644 --- a/enclaves/quartz/Cargo.toml +++ b/enclaves/quartz/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] clap = { version = "4.1.8", features = ["derive"] } color-eyre = "0.6.2" +cosmwasm-std = "1.4.0" prost = "0.12" tendermint = "0.34.0" tendermint-light-client = "0.34.0" @@ -15,3 +16,5 @@ tonic = "0.11" tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } quartz-proto = { path = "../../utils/quartz-proto" } +quartz-cw = { path = "../../../bisenzone-cw-mvp/packages/quartz-cw" } +quartz-tee-ra = { git = "ssh://git@github.com/informalsystems/bisenzone-cw-mvp.git", branch = "hu55a1n1/11-use-quartz" } diff --git a/enclaves/quartz/src/cli.rs b/enclaves/quartz/src/cli.rs index bb618ac..6868973 100644 --- a/enclaves/quartz/src/cli.rs +++ b/enclaves/quartz/src/cli.rs @@ -2,6 +2,8 @@ use std::net::SocketAddr; use clap::Parser; use color_eyre::eyre::{eyre, Result}; +use cosmwasm_std::HexBinary; +use quartz_cw::state::MrEnclave; use tendermint::Hash; use tendermint_light_client::types::{Height, TrustThreshold}; @@ -15,6 +17,11 @@ fn parse_trust_threshold(s: &str) -> Result { } } +fn parse_mr_enclave(s: &str) -> Result { + Ok(HexBinary::from_hex(s)?.to_array()?) +} + + #[derive(Debug, Parser)] #[command(author, version, about, long_about = None)] pub struct Cli { @@ -22,6 +29,10 @@ pub struct Cli { #[clap(long, default_value = "127.0.0.1:11090")] pub rpc_addr: SocketAddr, + /// MRENCLAVE of this enclave + #[clap(long, value_parser = parse_mr_enclave)] + pub mr_enclave: MrEnclave, + /// Identifier of the chain #[clap(long)] pub chain_id: String,