From a7baf0176123160d26b9f440d103f943b4eb5595 Mon Sep 17 00:00:00 2001 From: Rohit Ranjan Date: Tue, 9 Jul 2024 11:42:48 +0530 Subject: [PATCH] add voyager interface --- crates/sncast/src/main.rs | 98 +- crates/sncast/src/starknet_commands/verify.rs | 5 + .../data/contracts/virtual_workspace/a.log | 1109 +++++++++++++++++ .../virtual_workspace/snfoundry.toml | 5 + 4 files changed, 1178 insertions(+), 39 deletions(-) create mode 100644 crates/sncast/tests/data/contracts/virtual_workspace/a.log create mode 100644 crates/sncast/tests/data/contracts/virtual_workspace/snfoundry.toml diff --git a/crates/sncast/src/main.rs b/crates/sncast/src/main.rs index 6d5be21b38..e375c50b1b 100644 --- a/crates/sncast/src/main.rs +++ b/crates/sncast/src/main.rs @@ -155,19 +155,31 @@ fn main() -> Result<()> { let runtime = Runtime::new().expect("Failed to instantiate Runtime"); - if let Commands::Script(script) = &cli.command { - run_script_command(&cli, runtime, script, numbers_format, &output_format) - } else { - let mut config = load_global_config::(&None, &cli.profile)?; - update_cast_config(&mut config, &cli); - let provider = get_provider(&config.url)?; - runtime.block_on(run_async_command( - cli, - config, - provider, - numbers_format, - output_format, - )) + match &cli.command { + Commands::Script(script) => { + run_script_command(&cli, runtime, script, numbers_format, &output_format) + } + Commands::Verify(verify) => { + // run_verify_command(&cli, runtime, verify, numbers_format, &output_format) + runtime.block_on(run_verify_command( + &cli, + verify, + numbers_format, + &output_format, + )) + } + _ => { + let mut config = load_global_config::(&None, &cli.profile)?; + update_cast_config(&mut config, &cli); + let provider = get_provider(&config.url)?; + runtime.block_on(run_async_command( + cli, + config, + provider, + numbers_format, + output_format, + )) + } } } @@ -430,32 +442,7 @@ async fn run_async_command( print_command_result("tx-status", &mut result, numbers_format, &output_format)?; Ok(()) } - Commands::Verify(verify) => { - let manifest_path = assert_manifest_path_exists()?; - let package_metadata = get_package_metadata(&manifest_path, &verify.package)?; - let artifacts = build_and_load_artifacts( - &package_metadata, - &BuildConfig { - scarb_toml_path: manifest_path.clone(), - json: cli.json, - profile: cli.profile.unwrap_or("dev".to_string()), - }, - ) - .expect("Failed to build contract"); - let mut result = starknet_commands::verify::verify( - verify.contract_address, - verify.contract_name, - verify.verifier, - verify.network, - verify.confirm_verification, - &package_metadata.manifest_path, - &artifacts, - ) - .await; - - print_command_result("verify", &mut result, numbers_format, &output_format)?; - Ok(()) - } + Commands::Verify(_) => unreachable!(), Commands::Script(_) => unreachable!(), } } @@ -536,6 +523,39 @@ fn run_script_command( Ok(()) } +async fn run_verify_command( + cli: &Cli, + verify: &Verify, + numbers_format: NumbersFormat, + output_format: &OutputFormat, +) -> Result<()> { + let manifest_path = assert_manifest_path_exists()?; + let package_metadata = get_package_metadata(&manifest_path, &verify.package)?; + + let artifacts = build_and_load_artifacts( + &package_metadata, + &BuildConfig { + scarb_toml_path: manifest_path.clone(), + json: cli.json, + profile: cli.profile.clone().unwrap_or("dev".to_string()), + }, + ) + .expect("Failed to build contract"); + let mut result = starknet_commands::verify::verify( + verify.contract_address, + verify.contract_name.clone(), + verify.verifier.clone(), + verify.network.clone(), + verify.confirm_verification, + &package_metadata.manifest_path, + &artifacts, + ) + .await; + + print_command_result("verify", &mut result, numbers_format, &output_format)?; + Ok(()) +} + fn update_cast_config(config: &mut CastConfig, cli: &Cli) { macro_rules! clone_or_else { ($field:expr, $config_field:expr) => { diff --git a/crates/sncast/src/starknet_commands/verify.rs b/crates/sncast/src/starknet_commands/verify.rs index c56107737b..aee21906cc 100644 --- a/crates/sncast/src/starknet_commands/verify.rs +++ b/crates/sncast/src/starknet_commands/verify.rs @@ -135,11 +135,16 @@ impl VerificationInterface for WalnutVerificationInterface { contract_address: FieldElement, contract_name: String, ) -> Result { + + println!("Verifying contract {contract_name} at address {contract_address}"); + // Read all files name along with their contents in a JSON format // in the workspace dir recursively // key is the file name and value is the file content let mut file_data = serde_json::Map::new(); + println!("directory: {0}", self.workspace_dir); + // Recursively read files and their contents in workspace directory for entry in WalkDir::new(self.workspace_dir.clone()).follow_links(true) { let entry = entry?; diff --git a/crates/sncast/tests/data/contracts/virtual_workspace/a.log b/crates/sncast/tests/data/contracts/virtual_workspace/a.log new file mode 100644 index 0000000000..5bf52a1909 --- /dev/null +++ b/crates/sncast/tests/data/contracts/virtual_workspace/a.log @@ -0,0 +1,1109 @@ +PackageMetadata { + id: PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + name: "cast_addition", + version: Version { + major: 0, + minor: 1, + patch: 0, + }, + edition: Some( + "2023_01", + ), + source: SourceId { + repr: "path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml", + }, + manifest_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml", + root: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition", + dependencies: [ + DependencyMetadata { + name: "core", + version_req: VersionReq { + comparators: [ + Comparator { + op: Exact, + major: 2, + minor: Some( + 6, + ), + patch: Some( + 4, + ), + pre: Prerelease(""), + }, + ], + }, + source: SourceId { + repr: "registry+https://there-is-no-default-registry-yet.com/", + }, + kind: None, + extra: {}, + }, + DependencyMetadata { + name: "starknet", + version_req: VersionReq { + comparators: [ + Comparator { + op: Caret, + major: 2, + minor: Some( + 4, + ), + patch: Some( + 0, + ), + pre: Prerelease(""), + }, + ], + }, + source: SourceId { + repr: "registry+https://there-is-no-default-registry-yet.com/", + }, + kind: None, + extra: {}, + }, + DependencyMetadata { + name: "test_plugin", + version_req: VersionReq { + comparators: [ + Comparator { + op: Exact, + major: 2, + minor: Some( + 6, + ), + patch: Some( + 4, + ), + pre: Prerelease(""), + }, + ], + }, + source: SourceId { + repr: "registry+https://there-is-no-default-registry-yet.com/", + }, + kind: Some( + Dev, + ), + extra: {}, + }, + ], + targets: [ + TargetMetadata { + kind: "lib", + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + params: Object {}, + extra: {}, + }, + TargetMetadata { + kind: "starknet-contract", + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + params: Object {}, + extra: {}, + }, + TargetMetadata { + kind: "test", + name: "cast_addition_unittest", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + params: Object { + "test-type": String("unit"), + }, + extra: {}, + }, + ], + manifest_metadata: ManifestMetadata { + authors: None, + description: None, + documentation: None, + homepage: None, + keywords: None, + license: None, + license_file: None, + readme: None, + repository: None, + urls: None, + tool: None, + }, + experimental_features: [], + extra: {}, +} +Metadata { + version: VersionPin, + app_exe: Some( + "/Users/rohit/.asdf/installs/scarb/2.6.5/bin/scarb", + ), + app_version_info: VersionInfo { + version: Version { + major: 2, + minor: 6, + patch: 5, + }, + commit_info: Some( + CommitInfo { + short_commit_hash: "d49f54394", + commit_hash: "d49f543948a7ae8a7d3108c8ff8f6b17dc15ef78", + commit_date: Some( + "2024-06-11", + ), + }, + ), + cairo: CairoVersionInfo { + version: Version { + major: 2, + minor: 6, + patch: 4, + }, + commit_info: None, + extra: {}, + }, + extra: {}, + }, + target_dir: Some( + "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/target", + ), + runtime_manifest: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml", + workspace: WorkspaceMetadata { + manifest_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/Scarb.toml", + root: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace", + members: [ + PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + PackageId { + repr: "cast_fibonacci 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml)", + }, + ], + extra: {}, + }, + packages: [ + PackageMetadata { + id: PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + name: "cast_addition", + version: Version { + major: 0, + minor: 1, + patch: 0, + }, + edition: Some( + "2023_01", + ), + source: SourceId { + repr: "path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml", + }, + manifest_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml", + root: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition", + dependencies: [ + DependencyMetadata { + name: "core", + version_req: VersionReq { + comparators: [ + Comparator { + op: Exact, + major: 2, + minor: Some( + 6, + ), + patch: Some( + 4, + ), + pre: Prerelease(""), + }, + ], + }, + source: SourceId { + repr: "registry+https://there-is-no-default-registry-yet.com/", + }, + kind: None, + extra: {}, + }, + DependencyMetadata { + name: "starknet", + version_req: VersionReq { + comparators: [ + Comparator { + op: Caret, + major: 2, + minor: Some( + 4, + ), + patch: Some( + 0, + ), + pre: Prerelease(""), + }, + ], + }, + source: SourceId { + repr: "registry+https://there-is-no-default-registry-yet.com/", + }, + kind: None, + extra: {}, + }, + DependencyMetadata { + name: "test_plugin", + version_req: VersionReq { + comparators: [ + Comparator { + op: Exact, + major: 2, + minor: Some( + 6, + ), + patch: Some( + 4, + ), + pre: Prerelease(""), + }, + ], + }, + source: SourceId { + repr: "registry+https://there-is-no-default-registry-yet.com/", + }, + kind: Some( + Dev, + ), + extra: {}, + }, + ], + targets: [ + TargetMetadata { + kind: "lib", + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + params: Object {}, + extra: {}, + }, + TargetMetadata { + kind: "starknet-contract", + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + params: Object {}, + extra: {}, + }, + TargetMetadata { + kind: "test", + name: "cast_addition_unittest", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + params: Object { + "test-type": String("unit"), + }, + extra: {}, + }, + ], + manifest_metadata: ManifestMetadata { + authors: None, + description: None, + documentation: None, + homepage: None, + keywords: None, + license: None, + license_file: None, + readme: None, + repository: None, + urls: None, + tool: None, + }, + experimental_features: [], + extra: {}, + }, + PackageMetadata { + id: PackageId { + repr: "cast_fibonacci 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml)", + }, + name: "cast_fibonacci", + version: Version { + major: 0, + minor: 1, + patch: 0, + }, + edition: Some( + "2023_01", + ), + source: SourceId { + repr: "path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml", + }, + manifest_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml", + root: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci", + dependencies: [ + DependencyMetadata { + name: "cast_addition", + version_req: VersionReq { + comparators: [], + }, + source: SourceId { + repr: "path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml", + }, + kind: None, + extra: {}, + }, + DependencyMetadata { + name: "core", + version_req: VersionReq { + comparators: [ + Comparator { + op: Exact, + major: 2, + minor: Some( + 6, + ), + patch: Some( + 4, + ), + pre: Prerelease(""), + }, + ], + }, + source: SourceId { + repr: "registry+https://there-is-no-default-registry-yet.com/", + }, + kind: None, + extra: {}, + }, + DependencyMetadata { + name: "starknet", + version_req: VersionReq { + comparators: [ + Comparator { + op: Caret, + major: 2, + minor: Some( + 4, + ), + patch: Some( + 0, + ), + pre: Prerelease(""), + }, + ], + }, + source: SourceId { + repr: "registry+https://there-is-no-default-registry-yet.com/", + }, + kind: None, + extra: {}, + }, + DependencyMetadata { + name: "test_plugin", + version_req: VersionReq { + comparators: [ + Comparator { + op: Exact, + major: 2, + minor: Some( + 6, + ), + patch: Some( + 4, + ), + pre: Prerelease(""), + }, + ], + }, + source: SourceId { + repr: "registry+https://there-is-no-default-registry-yet.com/", + }, + kind: Some( + Dev, + ), + extra: {}, + }, + ], + targets: [ + TargetMetadata { + kind: "lib", + name: "cast_fibonacci", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/src/lib.cairo", + params: Object {}, + extra: {}, + }, + TargetMetadata { + kind: "starknet-contract", + name: "cast_fibonacci", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/src/lib.cairo", + params: Object { + "build-external-contracts": Array [ + String("cast_addition::AdditionContract"), + ], + }, + extra: {}, + }, + TargetMetadata { + kind: "test", + name: "cast_fibonacci_unittest", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/src/lib.cairo", + params: Object { + "test-type": String("unit"), + }, + extra: {}, + }, + ], + manifest_metadata: ManifestMetadata { + authors: None, + description: None, + documentation: None, + homepage: None, + keywords: None, + license: None, + license_file: None, + readme: None, + repository: None, + urls: None, + tool: None, + }, + experimental_features: [], + extra: {}, + }, + PackageMetadata { + id: PackageId { + repr: "core 2.6.4 (std)", + }, + name: "core", + version: Version { + major: 2, + minor: 6, + patch: 4, + }, + edition: Some( + "2023_11", + ), + source: SourceId { + repr: "std", + }, + manifest_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/core/Scarb.toml", + root: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/core", + dependencies: [ + DependencyMetadata { + name: "test_plugin", + version_req: VersionReq { + comparators: [ + Comparator { + op: Exact, + major: 2, + minor: Some( + 6, + ), + patch: Some( + 4, + ), + pre: Prerelease(""), + }, + ], + }, + source: SourceId { + repr: "registry+https://there-is-no-default-registry-yet.com/", + }, + kind: Some( + Dev, + ), + extra: {}, + }, + ], + targets: [ + TargetMetadata { + kind: "lib", + name: "core", + source_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/core/src/lib.cairo", + params: Object {}, + extra: {}, + }, + TargetMetadata { + kind: "test", + name: "core_unittest", + source_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/core/src/lib.cairo", + params: Object { + "test-type": String("unit"), + }, + extra: {}, + }, + ], + manifest_metadata: ManifestMetadata { + authors: None, + description: None, + documentation: None, + homepage: None, + keywords: None, + license: None, + license_file: None, + readme: None, + repository: None, + urls: None, + tool: None, + }, + experimental_features: [ + "coupons", + "negative_impls", + ], + extra: {}, + }, + PackageMetadata { + id: PackageId { + repr: "starknet 2.6.4 (std)", + }, + name: "starknet", + version: Version { + major: 2, + minor: 6, + patch: 4, + }, + edition: Some( + "2023_01", + ), + source: SourceId { + repr: "std", + }, + manifest_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/starknet/Scarb.toml", + root: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/starknet", + dependencies: [ + DependencyMetadata { + name: "core", + version_req: VersionReq { + comparators: [ + Comparator { + op: Exact, + major: 2, + minor: Some( + 6, + ), + patch: Some( + 4, + ), + pre: Prerelease(""), + }, + ], + }, + source: SourceId { + repr: "registry+https://there-is-no-default-registry-yet.com/", + }, + kind: None, + extra: {}, + }, + ], + targets: [ + TargetMetadata { + kind: "cairo-plugin", + name: "starknet", + source_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/starknet/src/lib.cairo", + params: Object { + "builtin": Bool(true), + }, + extra: {}, + }, + ], + manifest_metadata: ManifestMetadata { + authors: None, + description: None, + documentation: None, + homepage: None, + keywords: None, + license: None, + license_file: None, + readme: None, + repository: None, + urls: None, + tool: None, + }, + experimental_features: [], + extra: {}, + }, + PackageMetadata { + id: PackageId { + repr: "test_plugin 2.6.4 (std)", + }, + name: "test_plugin", + version: Version { + major: 2, + minor: 6, + patch: 4, + }, + edition: Some( + "2023_01", + ), + source: SourceId { + repr: "std", + }, + manifest_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/test_plugin/Scarb.toml", + root: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/test_plugin", + dependencies: [], + targets: [ + TargetMetadata { + kind: "cairo-plugin", + name: "test_plugin", + source_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/test_plugin/src/lib.cairo", + params: Object { + "builtin": Bool(true), + }, + extra: {}, + }, + ], + manifest_metadata: ManifestMetadata { + authors: None, + description: None, + documentation: None, + homepage: None, + keywords: None, + license: None, + license_file: None, + readme: None, + repository: None, + urls: None, + tool: None, + }, + experimental_features: [], + extra: {}, + }, + ], + compilation_units: [ + CompilationUnitMetadata { + id: CompilationUnitId { + repr: "cast_addition-eek73dk05g7n0", + }, + package: PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + target: TargetMetadata { + kind: "lib", + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + params: Object {}, + extra: {}, + }, + compiler_config: Object { + "allow_warnings": Bool(true), + "enable_gas": Bool(true), + "sierra_replace_ids": Bool(true), + }, + components: [ + CompilationUnitComponentMetadata { + package: PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + cfg: None, + extra: {}, + }, + CompilationUnitComponentMetadata { + package: PackageId { + repr: "core 2.6.4 (std)", + }, + name: "core", + source_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/core/src/lib.cairo", + cfg: None, + extra: {}, + }, + ], + cairo_plugins: [ + CompilationUnitCairoPluginMetadata { + package: PackageId { + repr: "starknet 2.6.4 (std)", + }, + extra: {}, + }, + ], + cfg: [ + KV( + "target", + "lib", + ), + ], + extra: { + "components": Array [ + String("cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)"), + String("core 2.6.4 (std)"), + ], + }, + }, + CompilationUnitMetadata { + id: CompilationUnitId { + repr: "cast_addition-lku86m7pefpsg", + }, + package: PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + target: TargetMetadata { + kind: "starknet-contract", + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + params: Object {}, + extra: {}, + }, + compiler_config: Object { + "allow_warnings": Bool(true), + "enable_gas": Bool(true), + "sierra_replace_ids": Bool(true), + }, + components: [ + CompilationUnitComponentMetadata { + package: PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + cfg: None, + extra: {}, + }, + CompilationUnitComponentMetadata { + package: PackageId { + repr: "core 2.6.4 (std)", + }, + name: "core", + source_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/core/src/lib.cairo", + cfg: None, + extra: {}, + }, + ], + cairo_plugins: [ + CompilationUnitCairoPluginMetadata { + package: PackageId { + repr: "starknet 2.6.4 (std)", + }, + extra: {}, + }, + ], + cfg: [ + KV( + "target", + "starknet-contract", + ), + ], + extra: { + "components": Array [ + String("cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)"), + String("core 2.6.4 (std)"), + ], + }, + }, + CompilationUnitMetadata { + id: CompilationUnitId { + repr: "cast_addition-n236gfrbi6utc", + }, + package: PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + target: TargetMetadata { + kind: "test", + name: "cast_addition_unittest", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + params: Object { + "test-type": String("unit"), + }, + extra: {}, + }, + compiler_config: Object { + "allow_warnings": Bool(true), + "enable_gas": Bool(true), + "sierra_replace_ids": Bool(true), + }, + components: [ + CompilationUnitComponentMetadata { + package: PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + cfg: None, + extra: {}, + }, + CompilationUnitComponentMetadata { + package: PackageId { + repr: "core 2.6.4 (std)", + }, + name: "core", + source_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/core/src/lib.cairo", + cfg: Some( + [ + KV( + "target", + "test", + ), + ], + ), + extra: {}, + }, + ], + cairo_plugins: [ + CompilationUnitCairoPluginMetadata { + package: PackageId { + repr: "starknet 2.6.4 (std)", + }, + extra: {}, + }, + CompilationUnitCairoPluginMetadata { + package: PackageId { + repr: "test_plugin 2.6.4 (std)", + }, + extra: {}, + }, + ], + cfg: [ + KV( + "target", + "test", + ), + Name( + "test", + ), + ], + extra: { + "components": Array [ + String("cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)"), + String("core 2.6.4 (std)"), + ], + }, + }, + CompilationUnitMetadata { + id: CompilationUnitId { + repr: "cast_fibonacci-pj89dd0fe5h6a", + }, + package: PackageId { + repr: "cast_fibonacci 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml)", + }, + target: TargetMetadata { + kind: "lib", + name: "cast_fibonacci", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/src/lib.cairo", + params: Object {}, + extra: {}, + }, + compiler_config: Object { + "allow_warnings": Bool(true), + "enable_gas": Bool(true), + "sierra_replace_ids": Bool(true), + }, + components: [ + CompilationUnitComponentMetadata { + package: PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + cfg: None, + extra: {}, + }, + CompilationUnitComponentMetadata { + package: PackageId { + repr: "cast_fibonacci 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml)", + }, + name: "cast_fibonacci", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/src/lib.cairo", + cfg: None, + extra: {}, + }, + CompilationUnitComponentMetadata { + package: PackageId { + repr: "core 2.6.4 (std)", + }, + name: "core", + source_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/core/src/lib.cairo", + cfg: None, + extra: {}, + }, + ], + cairo_plugins: [ + CompilationUnitCairoPluginMetadata { + package: PackageId { + repr: "starknet 2.6.4 (std)", + }, + extra: {}, + }, + ], + cfg: [ + KV( + "target", + "lib", + ), + ], + extra: { + "components": Array [ + String("cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)"), + String("cast_fibonacci 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml)"), + String("core 2.6.4 (std)"), + ], + }, + }, + CompilationUnitMetadata { + id: CompilationUnitId { + repr: "cast_fibonacci-lk8hp8d874f2k", + }, + package: PackageId { + repr: "cast_fibonacci 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml)", + }, + target: TargetMetadata { + kind: "starknet-contract", + name: "cast_fibonacci", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/src/lib.cairo", + params: Object { + "build-external-contracts": Array [ + String("cast_addition::AdditionContract"), + ], + }, + extra: {}, + }, + compiler_config: Object { + "allow_warnings": Bool(true), + "enable_gas": Bool(true), + "sierra_replace_ids": Bool(true), + }, + components: [ + CompilationUnitComponentMetadata { + package: PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + cfg: None, + extra: {}, + }, + CompilationUnitComponentMetadata { + package: PackageId { + repr: "cast_fibonacci 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml)", + }, + name: "cast_fibonacci", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/src/lib.cairo", + cfg: None, + extra: {}, + }, + CompilationUnitComponentMetadata { + package: PackageId { + repr: "core 2.6.4 (std)", + }, + name: "core", + source_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/core/src/lib.cairo", + cfg: None, + extra: {}, + }, + ], + cairo_plugins: [ + CompilationUnitCairoPluginMetadata { + package: PackageId { + repr: "starknet 2.6.4 (std)", + }, + extra: {}, + }, + ], + cfg: [ + KV( + "target", + "starknet-contract", + ), + ], + extra: { + "components": Array [ + String("cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)"), + String("cast_fibonacci 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml)"), + String("core 2.6.4 (std)"), + ], + }, + }, + CompilationUnitMetadata { + id: CompilationUnitId { + repr: "cast_fibonacci-9ijl61fc9b00e", + }, + package: PackageId { + repr: "cast_fibonacci 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml)", + }, + target: TargetMetadata { + kind: "test", + name: "cast_fibonacci_unittest", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/src/lib.cairo", + params: Object { + "test-type": String("unit"), + }, + extra: {}, + }, + compiler_config: Object { + "allow_warnings": Bool(true), + "enable_gas": Bool(true), + "sierra_replace_ids": Bool(true), + }, + components: [ + CompilationUnitComponentMetadata { + package: PackageId { + repr: "cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)", + }, + name: "cast_addition", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo", + cfg: Some( + [ + KV( + "target", + "test", + ), + ], + ), + extra: {}, + }, + CompilationUnitComponentMetadata { + package: PackageId { + repr: "cast_fibonacci 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml)", + }, + name: "cast_fibonacci", + source_path: "/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/src/lib.cairo", + cfg: None, + extra: {}, + }, + CompilationUnitComponentMetadata { + package: PackageId { + repr: "core 2.6.4 (std)", + }, + name: "core", + source_path: "/Users/rohit/Library/Caches/com.swmansion.scarb/registry/std/v2.6.4/core/src/lib.cairo", + cfg: Some( + [ + KV( + "target", + "test", + ), + ], + ), + extra: {}, + }, + ], + cairo_plugins: [ + CompilationUnitCairoPluginMetadata { + package: PackageId { + repr: "starknet 2.6.4 (std)", + }, + extra: {}, + }, + CompilationUnitCairoPluginMetadata { + package: PackageId { + repr: "test_plugin 2.6.4 (std)", + }, + extra: {}, + }, + ], + cfg: [ + KV( + "target", + "test", + ), + Name( + "test", + ), + ], + extra: { + "components": Array [ + String("cast_addition 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml)"), + String("cast_fibonacci 0.1.0 (path+file:///Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml)"), + String("core 2.6.4 (std)"), + ], + }, + }, + ], + current_profile: "dev", + profiles: [ + "dev", + "release", + ], + extra: {}, +} + Compiling lib(cast_addition) cast_addition v0.1.0 (/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml) + Compiling starknet-contract(cast_addition) cast_addition v0.1.0 (/Users/rohit/nmd/starknet-foundry/crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml) + Finished release target(s) in 2 seconds +[?2004h You are about to submit the entire workspace's code to the third-party chosen verifier at walnut, and the code will be publicly available through walnut's APIs. Are you sure? (Y/n): [?2004l diff --git a/crates/sncast/tests/data/contracts/virtual_workspace/snfoundry.toml b/crates/sncast/tests/data/contracts/virtual_workspace/snfoundry.toml new file mode 100644 index 0000000000..d6a1abd653 --- /dev/null +++ b/crates/sncast/tests/data/contracts/virtual_workspace/snfoundry.toml @@ -0,0 +1,5 @@ + +[sncast.account1] +account = "account2" +accounts-file = "/Users/rohit/.starknet_accounts/starknet_open_zeppelin_accounts.json" +url = "https://free-rpc.nethermind.io/sepolia-juno"