Skip to content

Commit

Permalink
sc-config - overflow-checks flag
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Dec 5, 2023
1 parent c985410 commit cd00e67
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions framework/meta/src/cargo_toml_contents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ impl CargoTomlContents {
"panic".to_string(),
Value::String(contract_profile.panic.to_owned()),
);
profile_props.insert("overflow-checks".to_string(), Value::Boolean(contract_profile.overflow_checks));

let mut toml_table = toml::map::Map::new();
toml_table.insert("release".to_string(), toml::Value::Table(profile_props));
Expand Down
1 change: 1 addition & 0 deletions framework/meta/src/cmd/contract/meta_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ opt-level = \"z\"
lto = true
debug = false
panic = \"abort\"
overflow-checks = true
[dependencies.test-crate-name]
path = \"..\"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pub struct ContractVariantProfile {
pub lto: bool,
pub debug: bool,
pub panic: String,
pub overflow_checks: bool,
}

impl Default for ContractVariantProfile {
Expand All @@ -78,6 +79,7 @@ impl Default for ContractVariantProfile {
lto: true,
debug: false,
panic: "abort".to_owned(),
overflow_checks: true,
}
}
}

0 comments on commit cd00e67

Please sign in to comment.