Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
d0cd committed May 30, 2024
1 parent 8964a19 commit 745d726
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 270 deletions.
File renamed without changes.
206 changes: 1 addition & 205 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ version = "0.1"
version = "0.3.18"
features = [ "fmt" ]

[dependencies.zip]
version = "^1.3"

[dependencies.crossterm]
version = "0.27.0"

Expand Down
12 changes: 2 additions & 10 deletions compiler/compiler/tests/utilities/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use leo_errors::{
LeoWarning,
};
use leo_package::root::env::Env;
use leo_retriever::NetworkName;
use leo_span::source_map::FileName;
use leo_test_framework::{test::TestConfig, Test};

Expand Down Expand Up @@ -137,16 +136,9 @@ pub fn setup_build_directory(
// Create the manifest file.
let _manifest_file = Manifest::create(&directory, &program_id).unwrap();

// Get the network name.
let network = match CurrentNetwork::ID {
MainnetV0::ID => NetworkName::MainnetV0,
TestnetV0::ID => NetworkName::TestnetV0,
_ => panic!("Invalid network"),
};

// Create the environment file.
Env::new(network).unwrap().write_to(&directory).unwrap();
if Env::exists_at(&directory) {
Env::<CurrentNetwork>::new().unwrap().write_to(&directory).unwrap();
if Env::<CurrentNetwork>::exists_at(&directory) {
println!(".env file created at {:?}", &directory);
}

Expand Down
3 changes: 1 addition & 2 deletions leo/cli/commands/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,8 @@ pub(crate) fn verify_message<N: Network>(

// Write the network and private key to the .env file in project directory.
fn write_to_env_file<N: Network>(private_key: PrivateKey<N>, ctx: &Context) -> Result<()> {
let data = format!("PRIVATE_KEY={private_key}\n");
let program_dir = ctx.dir()?;
Env::from(data).write_to(&program_dir)?;
Env::<N>::from(private_key).write_to(&program_dir)?;
tracing::info!("✅ Private Key written to {}", program_dir.join(".env").display());
Ok(())
}
Expand Down
4 changes: 1 addition & 3 deletions leo/cli/commands/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ impl Command for Add {
manifest.license(),
Some(dependencies),
);
let new_manifest_data = serde_json::to_string_pretty(&new_manifest)
.map_err(|err| PackageError::failed_to_serialize_manifest_file(path.to_str().unwrap(), err))?;
std::fs::write(path.join("program.json"), new_manifest_data).map_err(PackageError::failed_to_write_manifest)?;
new_manifest.write_to_dir(path)?;

Ok(())
}
Expand Down
Loading

0 comments on commit 745d726

Please sign in to comment.