Skip to content

Commit

Permalink
fix: should detect account class automatically (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwkang1998 authored Aug 25, 2024
1 parent 67a5148 commit a175e69
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
2 changes: 0 additions & 2 deletions crates/cli/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ pub fn dispatch_class_verification_job(
network: Network,
address: &str,
license: &str,
is_account: bool,
name: &str,
project_metadata: ProjectMetadataInfo,
files: Vec<FileInfo>,
Expand All @@ -204,7 +203,6 @@ pub fn dispatch_class_verification_job(
)
.text("scarb_version", project_metadata.scarb_version.to_string())
.text("license", license.to_string())
.text("account_contract", is_account.to_string())
.text("name", name.to_string())
.text("contract_file", project_metadata.contract_file)
.text("project_dir_path", project_metadata.project_dir_path);
Expand Down
14 changes: 1 addition & 13 deletions crates/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::resolver::TargetType;
use crate::utils::detect_local_tools;
use camino::Utf8PathBuf;
use console::{style, Emoji};
use dialoguer::{theme::ColorfulTheme, Confirm, Input, Select};
use dialoguer::{theme::ColorfulTheme, Input, Select};
use dirs::home_dir;
use indicatif::{HumanDuration, ProgressBar, ProgressStyle};
use std::{
Expand Down Expand Up @@ -199,17 +199,6 @@ fn main() -> anyhow::Result<()> {
.trim()
.to_string();

// Check if account contract
// TODO: Is there a way to detect this automatically?
// println!(
// "{} {} Checking if account contract...",
// style("[x/x]").bold().dim(),
// Emoji("📃 ", "")
// );
let is_account_contract: bool = Confirm::with_theme(&ColorfulTheme::default())
.with_prompt("Is this an Account Class?")
.interact()?;

// Set license for your contract code
let licenses: Vec<LicenseType> = LicenseType::iter().collect();
let license_index = Select::with_theme(&ColorfulTheme::default())
Expand Down Expand Up @@ -239,7 +228,6 @@ fn main() -> anyhow::Result<()> {
hash: class_hash,
license: licenses[license_index],
name: class_name,
is_account_contract: Some(is_account_contract),
max_retries: Some(10),
api_key: "".to_string(),
path: utf8_path,
Expand Down
4 changes: 0 additions & 4 deletions crates/cli/src/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ pub struct VerifyProjectArgs {
#[arg(help = "Source directory", required = true)]
pub path: Utf8PathBuf,

#[arg(long, help = "Is it an account contract?")]
pub is_account_contract: Option<bool>,

#[arg(long, help = "Max retries")]
pub max_retries: Option<u32>,

Expand All @@ -63,7 +60,6 @@ pub fn verify_project(
network_enum.clone(),
&args.hash,
args.license.to_long_string().as_str(),
args.is_account_contract.unwrap_or(false),
&args.name,
metadata,
files,
Expand Down

0 comments on commit a175e69

Please sign in to comment.