-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clap based improvements for the CLI #214
Comments
We have no access to the /// SGX-specific configuration. Required if `MOCK_SGX` is not set.
#[derive(Debug, Parser, Clone, Serialize, Deserialize)]
pub struct SgxConfiguration {
/// FMSPC (Family-Model-Stepping-Platform-Custom SKU)
#[arg(long)]
#[serde(skip_serializing_if = "Option::is_none")]
pub fmspc: Option<Fmspc>,
/// Address of the TcbInfo contract
#[arg(long)]
#[serde(skip_serializing_if = "Option::is_none")]
pub tcbinfo_contract: Option<AccountId>,
/// Address of the DCAP verifier contract
#[arg(long)]
#[serde(skip_serializing_if = "Option::is_none")]
pub dcap_verifier_contract: Option<AccountId>,
}
impl SgxConfiguration {
fn validate(&self) -> Result<(), String> {
if std::env::var("MOCK_SGX").is_err() {
self.check_required_field(&self.fmspc, "FMSPC")?;
self.check_required_field(&self.tcbinfo_contract, "tcbinfo_contract")?;
self.check_required_field(&self.dcap_verifier_contract, "dcap_verifier_contract")?;
}
Ok(())
}
fn check_required_field<T>(&self, field: &Option<T>, field_name: &str) -> Result<(), String> {
if field.is_none() {
return Err(format!("{} is required if MOCK_SGX isn't set", field_name));
}
Ok(())
}
} |
@piotr-roslaniec Thanks for you comment. I am not 100% clear on what you meant. |
Hi @dusterbloom, thanks for getting back to me. For details, please see this draft: #279 |
Summary
(Copying @dangush's comments from #150)
The text was updated successfully, but these errors were encountered: