Refactor manifest handling around forc-pkg to accommodate workspace manifest files (#2894)

This commit is contained in:
Kaya Gökalp 2022-10-07 11:51:53 +03:00 committed by GitHub
parent 4e9a5ae61a
commit c27135ffee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 164 additions and 60 deletions

View file

@ -1,5 +1,5 @@
use anyhow::{bail, Result};
use forc_pkg::{BuildOptions, Compiled, ManifestFile};
use forc_pkg::{BuildOptions, Compiled, PackageManifestFile};
use fuel_crypto::Signature;
use fuel_gql_client::client::FuelClient;
use fuel_tx::{Output, Salt, StorageSlot, Transaction};
@ -20,7 +20,7 @@ pub async fn deploy(command: DeployCommand) -> Result<fuel_tx::ContractId> {
} else {
std::env::current_dir()?
};
let manifest = ManifestFile::from_dir(&curr_dir)?;
let manifest = PackageManifestFile::from_dir(&curr_dir)?;
manifest.check_program_type(vec![TreeType::Contract])?;
let DeployCommand {

View file

@ -1,5 +1,5 @@
use anyhow::{anyhow, bail, Result};
use forc_pkg::{fuel_core_not_running, BuildOptions, ManifestFile};
use forc_pkg::{fuel_core_not_running, BuildOptions, PackageManifestFile};
use fuel_crypto::Signature;
use fuel_gql_client::client::FuelClient;
use fuel_tx::{AssetId, Output, Transaction, Witness};
@ -21,7 +21,7 @@ pub async fn run(command: RunCommand) -> Result<Vec<fuel_tx::Receipt>> {
} else {
std::env::current_dir().map_err(|e| anyhow!("{:?}", e))?
};
let manifest = ManifestFile::from_dir(&path_dir)?;
let manifest = PackageManifestFile::from_dir(&path_dir)?;
manifest.check_program_type(vec![TreeType::Script])?;
let input_data = &command.data.unwrap_or_else(|| "".into());