Skip to content

Commit

Permalink
implementing dependencies for cargo toml
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaicalinluca committed Nov 13, 2023
1 parent d5e24ca commit 4a931f1
Show file tree
Hide file tree
Showing 9 changed files with 279 additions and 7 deletions.
21 changes: 21 additions & 0 deletions contracts/examples/multisig/wasm-multisig-full/test-Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "multisig-full-wasm"
version = "0.0.0"
edition = "2021"
publish = false

[lib]
crate-type = "cdylib"

[workspace]
members = [
".",
"meta",
]

["contracts.multisig-full.profile"]
codegen-units = 1
opt-level = "z"
lto = true
debug = false
panic = "abort"
21 changes: 21 additions & 0 deletions contracts/examples/multisig/wasm-multisig-view/test-Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "multisig-view-wasm"
version = "0.0.0"
edition = "2021"
publish = false

[lib]
crate-type = "cdylib"

[workspace]
members = [
".",
"meta",
]

["contracts.multisig-view.profile"]
codegen-units = 1
opt-level = "z"
lto = true
debug = false
panic = "abort"
21 changes: 21 additions & 0 deletions contracts/examples/multisig/wasm/test-Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "multisig-wasm"
version = "0.0.0"
edition = "2021"
publish = false

[lib]
crate-type = "cdylib"

[workspace]
members = [
".",
"meta",
]

["contracts.multisig.profile"]
codegen-units = 1
opt-level = "z"
lto = true
debug = false
panic = "abort"
21 changes: 21 additions & 0 deletions contracts/examples/multisig/wasm/want.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "{contract variant name}-wasm" # ok
version = "0.0.0"
edition = "{sc-crate.edition}" # from sc Cargo.toml
publish = false

[lib]
crate-type = ["cdylib"]

[profile.release]
... from sc-config.toml

[dependencies.{sc-crate.name}] # from sc Cargo.toml
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "{sc-crate.dependencies.multiversx-sc.version}"
path = "{sc-crate.dependencies.multiversx-sc.path - "base" + "wasm-adapter"}"

[workspace]
members = ["."]
98 changes: 97 additions & 1 deletion framework/meta/src/cargo_toml_contents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use std::{

use toml::{value::Table, Value};

use crate::cmd::contract::sc_config::ContractVariant;

pub const CARGO_TOML_DEPENDENCIES: &str = "dependencies";
pub const CARGO_TOML_DEV_DEPENDENCIES: &str = "dev-dependencies";

Expand All @@ -29,13 +31,26 @@ impl CargoTomlContents {
String::from_utf8(cargo_toml_content).expect("error decoding Cargo.toml utf-8");
let toml_value = cargo_toml_content_str
.parse::<toml::Value>()
.expect("failed to parse Cargo.toml toml format");
// .expect("failed to parse Cargo.toml toml format")
.unwrap_or_else(|e| {
panic!(
"failed to parse Cargo.toml toml format, path:{}, error: {e}",
path_ref.display()
)
});
CargoTomlContents {
path: path_ref.to_owned(),
toml_value,
}
}

pub fn new() -> Self {
CargoTomlContents {
path: PathBuf::new(),
toml_value: toml::Value::Table(Table::new()),
}
}

pub fn save_to_file<P: AsRef<Path>>(&self, path: P) {
let cargo_toml_content_str =
toml::to_string_pretty(&self.toml_value).expect("failed to format Cargo.toml contents");
Expand All @@ -55,6 +70,19 @@ impl CargoTomlContents {
.to_string()
}

pub fn package_edition(&self) -> String {
self.toml_value
.get("package")
.expect("missing package in Cargo.toml")
.get("edition")
.expect("missing package name in Cargo.toml")
.as_str()
.expect("package name not a string value")
.to_string()
}

pub fn add_deps(&mut self, crate_name: String, adapter_version: String, adapter_path: String) {}

Check warning on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

unused variable: `crate_name`

Check warning on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

unused variable: `adapter_version`

Check warning on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

unused variable: `adapter_path`

Check warning on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/meta/src/cargo_toml_contents.rs#L84

warning: unused variable: `crate_name` --> framework/meta/src/cargo_toml_contents.rs:84:32 | 84 | pub fn add_deps(&mut self, crate_name: String, adapter_version: String, adapter_path: String) {} | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_crate_name` | = note: `#[warn(unused_variables)]` on by default
Raw output
framework/meta/src/cargo_toml_contents.rs:84:32:w:warning: unused variable: `crate_name`
  --> framework/meta/src/cargo_toml_contents.rs:84:32
   |
84 |     pub fn add_deps(&mut self, crate_name: String, adapter_version: String, adapter_path: String) {}
   |                                ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_crate_name`
   |
   = note: `#[warn(unused_variables)]` on by default


__END__

Check warning on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/meta/src/cargo_toml_contents.rs#L84

warning: unused variable: `adapter_version` --> framework/meta/src/cargo_toml_contents.rs:84:52 | 84 | pub fn add_deps(&mut self, crate_name: String, adapter_version: String, adapter_path: String) {} | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_adapter_version`
Raw output
framework/meta/src/cargo_toml_contents.rs:84:52:w:warning: unused variable: `adapter_version`
  --> framework/meta/src/cargo_toml_contents.rs:84:52
   |
84 |     pub fn add_deps(&mut self, crate_name: String, adapter_version: String, adapter_path: String) {}
   |                                                    ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_adapter_version`


__END__

Check warning on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/meta/src/cargo_toml_contents.rs#L84

warning: unused variable: `adapter_path` --> framework/meta/src/cargo_toml_contents.rs:84:77 | 84 | pub fn add_deps(&mut self, crate_name: String, adapter_version: String, adapter_path: String) {} | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_adapter_path`
Raw output
framework/meta/src/cargo_toml_contents.rs:84:77:w:warning: unused variable: `adapter_path`
  --> framework/meta/src/cargo_toml_contents.rs:84:77
   |
84 |     pub fn add_deps(&mut self, crate_name: String, adapter_version: String, adapter_path: String) {}
   |                                                                             ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_adapter_path`


__END__

Check failure on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Template tool test - current (unreleased) templates

unused variable: `crate_name`

Check failure on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Template tool test - current (unreleased) templates

unused variable: `adapter_version`

Check failure on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Template tool test - current (unreleased) templates

unused variable: `adapter_path`

Check failure on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Template tool test - released templates

unused variable: `crate_name`

Check failure on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Template tool test - released templates

unused variable: `adapter_version`

Check failure on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Template tool test - released templates

unused variable: `adapter_path`

Check warning on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unused variable: `crate_name`

Check warning on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unused variable: `adapter_version`

Check warning on line 84 in framework/meta/src/cargo_toml_contents.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unused variable: `adapter_path`

/// Assumes that a package section already exists.
pub fn change_package_name(&mut self, new_package_name: String) {
let package = self
Expand Down Expand Up @@ -109,6 +137,74 @@ impl CargoTomlContents {
.expect("malformed crate Cargo.toml")
}

pub fn add_lib(&mut self) {
let mut value = toml::map::Map::new();
value.insert(
"crate-type".to_string(),
Value::String("cdylib".to_string()),
);

self.toml_value
.as_table_mut()
.expect("malformed package in Cargo.toml")
.insert("lib".to_string(), toml::Value::Table(value));
}

//maybe create another function change_package_info(params)
//just like change_package_name for keeping the same structure
pub fn add_package_info(
&mut self,
name: String,
version: String,
current_edition: String,
publish: bool,
) {
let mut value = toml::map::Map::new();
value.insert("name".to_string(), Value::String(name));
value.insert("version".to_string(), Value::String(version));
value.insert("edition".to_string(), Value::String(current_edition));
value.insert("publish".to_string(), Value::Boolean(publish));

self.toml_value
.as_table_mut()
.expect("malformed package in Cargo.toml / add_package")
.insert("package".to_string(), toml::Value::Table(value));
}

pub fn add_contract_variant_profile(&mut self, contract: &ContractVariant) {
// contract variant profile
// codegen_units: u8,
// opt_level: String,
// lto: bool,
// debug: bool,
// panic: String,

//turn struct into value/map/whatever
let contract_profile = contract.settings.contract_variant_profile.clone();

let mut profile_props = toml::map::Map::new();
profile_props.insert(
"codegen-units".to_string(),
Value::Integer(contract_profile.codegen_units.into()),
);
profile_props.insert(
"opt-level".to_string(),
Value::String(contract_profile.opt_level),
);
profile_props.insert("lto".to_string(), Value::Boolean(contract_profile.lto));
profile_props.insert("debug".to_string(), Value::Boolean(contract_profile.debug));
profile_props.insert("panic".to_string(), Value::String(contract_profile.panic));

//get key name from contract.name [contracts.<contract_name>.profile]
let key = format!("contracts.{}.profile", contract.contract_name);

//insert into toml
self.toml_value
.as_table_mut()
.expect("malformed package in Cargo.toml")
.insert(key, toml::Value::Table(profile_props));
}

pub fn insert_default_workspace(&mut self) {
let array = vec![
toml::Value::String(".".to_string()),
Expand Down
76 changes: 74 additions & 2 deletions framework/meta/src/cmd/contract/meta_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ pub struct MetaConfig {

impl MetaConfig {
pub fn create(original_contract_abi: ContractAbi, load_abi_git_version: bool) -> MetaConfig {
let sc_config =
ScConfig::load_from_crate_or_default("..", &original_contract_abi);
let sc_config = ScConfig::load_from_crate_or_default("..", &original_contract_abi);

MetaConfig {
load_abi_git_version,
Expand All @@ -38,6 +37,7 @@ impl MetaConfig {
pub fn generate_wasm_crates(&mut self) {
self.remove_unexpected_wasm_crates();
self.create_wasm_crate_dirs();
self.generate_cargo_toml_for_all_contracts();
self.generate_cargo_toml_for_secondary_contracts();
self.generate_wasm_src_lib();
copy_to_wasm_unmanaged_ei();
Expand All @@ -49,6 +49,47 @@ impl MetaConfig {
}
}

//create a struct for cargo toml with all the fields
pub fn generate_cargo_toml_for_all_contracts(&mut self) {
//get sc_config toml
let mut sc_config_cargo_toml_contents =

Check warning on line 55 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

unused variable: `sc_config_cargo_toml_contents`

Check warning on line 55 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

variable does not need to be mutable

Check warning on line 55 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/meta/src/cmd/contract/meta_config.rs#L55

warning: unused variable: `sc_config_cargo_toml_contents` --> framework/meta/src/cmd/contract/meta_config.rs:55:17 | 55 | let mut sc_config_cargo_toml_contents = | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_sc_config_cargo_toml_contents`
Raw output
framework/meta/src/cmd/contract/meta_config.rs:55:17:w:warning: unused variable: `sc_config_cargo_toml_contents`
  --> framework/meta/src/cmd/contract/meta_config.rs:55:17
   |
55 |         let mut sc_config_cargo_toml_contents =
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_sc_config_cargo_toml_contents`


__END__

Check warning on line 55 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/meta/src/cmd/contract/meta_config.rs#L55

warning: variable does not need to be mutable --> framework/meta/src/cmd/contract/meta_config.rs:55:13 | 55 | let mut sc_config_cargo_toml_contents = | ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default
Raw output
framework/meta/src/cmd/contract/meta_config.rs:55:13:w:warning: variable does not need to be mutable
  --> framework/meta/src/cmd/contract/meta_config.rs:55:13
   |
55 |         let mut sc_config_cargo_toml_contents =
   |             ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |             |
   |             help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default


__END__

Check failure on line 55 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Template tool test - current (unreleased) templates

unused variable: `sc_config_cargo_toml_contents`

Check failure on line 55 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Template tool test - current (unreleased) templates

variable does not need to be mutable

Check failure on line 55 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Template tool test - released templates

unused variable: `sc_config_cargo_toml_contents`

Check failure on line 55 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Template tool test - released templates

variable does not need to be mutable

Check warning on line 55 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unused variable: `sc_config_cargo_toml_contents`

Check warning on line 55 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

variable does not need to be mutable
CargoTomlContents::load_from_file("../sc-config.toml");
let mut main_cargo_toml_contents = CargoTomlContents::load_from_file("../Cargo.toml");

Check warning on line 57 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

variable does not need to be mutable

Check warning on line 57 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/meta/src/cmd/contract/meta_config.rs#L57

warning: variable does not need to be mutable --> framework/meta/src/cmd/contract/meta_config.rs:57:13 | 57 | let mut main_cargo_toml_contents = CargoTomlContents::load_from_file("../Cargo.toml"); | ----^^^^^^^^^^^^^^^^^^^^^^^^ | | | help: remove this `mut`
Raw output
framework/meta/src/cmd/contract/meta_config.rs:57:13:w:warning: variable does not need to be mutable
  --> framework/meta/src/cmd/contract/meta_config.rs:57:13
   |
57 |         let mut main_cargo_toml_contents = CargoTomlContents::load_from_file("../Cargo.toml");
   |             ----^^^^^^^^^^^^^^^^^^^^^^^^
   |             |
   |             help: remove this `mut`


__END__

Check failure on line 57 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Template tool test - current (unreleased) templates

variable does not need to be mutable

Check failure on line 57 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Template tool test - released templates

variable does not need to be mutable

Check warning on line 57 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

variable does not need to be mutable

let current_edition = main_cargo_toml_contents.package_edition();
let adapter_version = "".to_string();
let adapter_path = "".to_string();
// let mut deps = main_cargo_toml_contents.dependencies_mut();

let mut new_cargo = CargoTomlContents::new();

//add package category with name, version, edition and publish
new_cargo.add_package_info(
"config".to_string(),
"0.0.0".to_string(),
current_edition,
false,
);

//add lib part
new_cargo.add_lib();

//insert default workspace
new_cargo.insert_default_workspace();

//generate toml for every contract from sc_config
for contract in self.sc_config.contracts.iter() {
contract_cargo_toml(
contract,
&new_cargo,
main_cargo_toml_contents.package_name(),
adapter_version,

Check failure on line 86 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

use of moved value: `adapter_version`

Check failure on line 86 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/meta/src/cmd/contract/meta_config.rs#L86

error[E0382]: use of moved value: `adapter_version` --> framework/meta/src/cmd/contract/meta_config.rs:86:17 | 60 | let adapter_version = "".to_string(); | --------------- move occurs because `adapter_version` has type `std::string::String`, which does not implement the `Copy` trait ... 86 | adapter_version, | ^^^^^^^^^^^^^^^ value moved here, in previous iteration of loop
Raw output
framework/meta/src/cmd/contract/meta_config.rs:86:17:e:error[E0382]: use of moved value: `adapter_version`
  --> framework/meta/src/cmd/contract/meta_config.rs:86:17
   |
60 |         let adapter_version = "".to_string();
   |             --------------- move occurs because `adapter_version` has type `std::string::String`, which does not implement the `Copy` trait
...
86 |                 adapter_version,
   |                 ^^^^^^^^^^^^^^^ value moved here, in previous iteration of loop


__END__

Check failure on line 86 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Template tool test - current (unreleased) templates

use of moved value: `adapter_version`

Check failure on line 86 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Template tool test - released templates

use of moved value: `adapter_version`

Check failure on line 86 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

use of moved value: `adapter_version`
adapter_path,

Check failure on line 87 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

use of moved value: `adapter_path`

Check failure on line 87 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/meta/src/cmd/contract/meta_config.rs#L87

error[E0382]: use of moved value: `adapter_path` --> framework/meta/src/cmd/contract/meta_config.rs:87:17 | 61 | let adapter_path = "".to_string(); | ------------ move occurs because `adapter_path` has type `std::string::String`, which does not implement the `Copy` trait ... 87 | adapter_path, | ^^^^^^^^^^^^ value moved here, in previous iteration of loop
Raw output
framework/meta/src/cmd/contract/meta_config.rs:87:17:e:error[E0382]: use of moved value: `adapter_path`
  --> framework/meta/src/cmd/contract/meta_config.rs:87:17
   |
61 |         let adapter_path = "".to_string();
   |             ------------ move occurs because `adapter_path` has type `std::string::String`, which does not implement the `Copy` trait
...
87 |                 adapter_path,
   |                 ^^^^^^^^^^^^ value moved here, in previous iteration of loop


__END__

Check failure on line 87 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Template tool test - current (unreleased) templates

use of moved value: `adapter_path`

Check failure on line 87 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Template tool test - released templates

use of moved value: `adapter_path`

Check failure on line 87 in framework/meta/src/cmd/contract/meta_config.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

use of moved value: `adapter_path`
)
.save_to_file(contract.some_other_test_path())
}
}

/// Cargo.toml files for secondary contracts are generated from the main contract Cargo.toml,
/// by changing the package name.
pub fn generate_cargo_toml_for_secondary_contracts(&mut self) {
Expand All @@ -58,19 +99,50 @@ impl MetaConfig {
CargoTomlContents::load_from_file(main_contract.cargo_toml_path());
main_contract.wasm_crate_name = main_cargo_toml_contents.package_name();

//this should generate toml based on sc_config, not main contract
//should generate main contract toml also
for secondary_contract in self.sc_config.secondary_contracts() {
secondary_contract_cargo_toml(secondary_contract, &main_cargo_toml_contents)
.save_to_file(secondary_contract.cargo_toml_path());
}
}
}

fn contract_cargo_toml(
contract: &ContractVariant,
sc_config_cargo_toml_contents: &CargoTomlContents,
crate_name: String,
adapter_version: String,
adapter_path: String,
) -> CargoTomlContents {
let mut cargo_toml_contents = sc_config_cargo_toml_contents.clone();

//change package name
cargo_toml_contents.change_package_name(contract.wasm_crate_name.clone());

//writes profile in cargo
cargo_toml_contents.add_contract_variant_profile(contract);

//add deps
cargo_toml_contents.add_deps(crate_name, adapter_version, adapter_path);

if !contract.settings.features.is_empty() {
cargo_toml_contents
.change_features_for_parent_crate_dep(contract.settings.features.as_slice());
}
cargo_toml_contents
}

fn secondary_contract_cargo_toml(
secondary_contract: &ContractVariant,
main_cargo_toml_contents: &CargoTomlContents,
) -> CargoTomlContents {
//add lib side and get profile from sc_config
let mut cargo_toml_contents = main_cargo_toml_contents.clone();
cargo_toml_contents.change_package_name(secondary_contract.wasm_crate_name.clone());

//cargo_toml_contents.add_lib(); //adds top lib part
//cargo_toml_contents.add_contract_variant_profile(secondary_contract); //writes profile in cargo, adds name
if !secondary_contract.settings.features.is_empty() {
cargo_toml_contents
.change_features_for_parent_crate_dep(secondary_contract.settings.features.as_slice());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

// add this to cargo
// const LIB = r"[lib]
// crate-type = ["cdylib"]";

Expand Down Expand Up @@ -55,7 +56,6 @@ pub struct ContractVariantSerde {
#[serde(default)]
pub kill_legacy_callback: bool,

// #[serde()]
#[serde(default)]
pub contract_variant_profile: Option<ContractVariantProfile>
}
Expand Down
Loading

0 comments on commit 4a931f1

Please sign in to comment.