Skip to content

Commit

Permalink
Merge 7e3e95e into f342f52
Browse files Browse the repository at this point in the history
  • Loading branch information
kayagokalp committed May 29, 2024
2 parents f342f52 + 7e3e95e commit 52d495e
Show file tree
Hide file tree
Showing 12 changed files with 695 additions and 156 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ fuel-vm = "0.49.0"
# Dependencies from the `fuels-rs` repository:
fuels-core = "0.62.0"
fuels-accounts = "0.62.0"
fuels = "0.62.0"

# Dependencies from the `forc-wallet` repository:
forc-wallet = "0.7.1"
Expand Down
17 changes: 17 additions & 0 deletions forc-pkg/src/manifest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ pub struct PackageManifest {
pub build_target: Option<BTreeMap<String, BuildTarget>>,
build_profile: Option<BTreeMap<String, BuildProfile>>,
pub contract_dependencies: Option<BTreeMap<String, ContractDependency>>,
pub proxy: Option<Proxy>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -242,6 +243,17 @@ pub struct DependencyDetails {
pub(crate) ipfs: Option<String>,
}

/// Describes the details around proxy contract.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub struct Proxy {
pub enabled: bool,
/// Points to the proxy contract to be updated with the new contract id.
/// If there is a value for this field, forc will try to update the proxy contract's storage
/// field such that it points to current contract's deployed instance.
pub address: Option<String>,
}

impl DependencyDetails {
/// Checks if dependency details reserved for a specific dependency type used without the main
/// detail for that type.
Expand Down Expand Up @@ -619,6 +631,11 @@ impl PackageManifest {
.and_then(|patches| patches.get(patch_name))
}

/// Retrieve the proxy table for the package.
pub fn proxy(&self) -> Option<&Proxy> {
self.proxy.as_ref()
}

/// Check for the `core` and `std` packages under `[dependencies]`. If both are missing, add
/// `std` implicitly.
///
Expand Down
6 changes: 5 additions & 1 deletion forc-pkg/src/pkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ pub struct MinifyOpts {
type ContractIdConst = String;

/// The set of options provided to the `build` functions.
#[derive(Default)]
#[derive(Default, Clone)]
pub struct BuildOpts {
pub pkg: PkgOpts,
pub print: PrintOpts,
Expand Down Expand Up @@ -315,6 +315,7 @@ pub struct BuildOpts {
}

/// The set of options to filter type of projects to build in a workspace.
#[derive(Clone)]
pub struct MemberFilter {
pub build_contracts: bool,
pub build_scripts: bool,
Expand Down Expand Up @@ -2126,6 +2127,9 @@ pub fn build_with_options(build_options: &BuildOpts) -> Result<Built> {
.as_ref()
.map_or_else(|| current_dir, PathBuf::from);

let building = ansi_term::Colour::Green.bold().paint("Building");
info!(" {} {}", building, path.display());

let build_plan = BuildPlan::from_build_opts(build_options)?;
let graph = build_plan.graph();
let manifest_map = build_plan.manifest_map();
Expand Down
3 changes: 3 additions & 0 deletions forc-plugins/forc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ anyhow = "1"
async-trait = "0.1.58"
chrono = { version = "0.4", default-features = false, features = ["std"] }
clap = { version = "4.5.4", features = ["derive", "env"] }
colored = "2.0.0"
devault = "0.1"
forc = { version = "0.60.0", path = "../../forc" }
forc-pkg = { version = "0.60.0", path = "../../forc-pkg" }
Expand All @@ -26,6 +27,7 @@ fuel-core-types = { workspace = true }
fuel-crypto = { workspace = true }
fuel-tx = { workspace = true, features = ["test-helpers"] }
fuel-vm = { workspace = true }
fuels = { workspace = true }
fuels-accounts = { workspace = true }
fuels-core = { workspace = true }
futures = "0.3"
Expand All @@ -38,6 +40,7 @@ sway-core = { version = "0.60.0", path = "../../sway-core" }
sway-types = { version = "0.60.0", path = "../../sway-types" }
sway-utils = { version = "0.60.0", path = "../../sway-utils" }
tokio = { version = "1.8", features = ["macros", "rt-multi-thread", "process"] }
toml_edit = "0.21.1"
tracing = "0.1"

[[bin]]
Expand Down
3 changes: 0 additions & 3 deletions forc-plugins/forc-client/src/cmd/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ pub struct Command {
pub unsigned: bool,
/// Set the key to be used for signing.
pub signing_key: Option<SecretKey>,
/// Sign the deployment transaction manually.
#[clap(long)]
pub manual_signing: bool,
/// Override storage slot initialization.
///
/// By default, storage slots are initialized with the values defined in the storage block in
Expand Down
3 changes: 0 additions & 3 deletions forc-plugins/forc-client/src/cmd/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ pub struct Command {
pub unsigned: bool,
/// Set the key to be used for signing.
pub signing_key: Option<SecretKey>,
/// Sign the deployment transaction manually.
#[clap(long)]
pub manual_signing: bool,
/// Arguments to pass into main function with forc run.
#[clap(long)]
pub args: Option<Vec<String>>,
Expand Down
Loading

0 comments on commit 52d495e

Please sign in to comment.