Skip to content

Commit d57c697

Browse files
Ludo GalabruLudo Galabru
authored andcommitted
chore: remove depends_on attribute
1 parent 5df8330 commit d57c697

File tree

3 files changed

+19
-34
lines changed

3 files changed

+19
-34
lines changed

src/generate/contract.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ Clarinet.test({{
120120
let manifest_path = self.manifest_path.clone();
121121

122122
let contract_config = ContractConfig {
123-
depends_on: deps,
124123
path: format!("contracts/{}", contract_file_name),
125124
deployer: None,
126125
};

src/generate/project.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,21 +176,22 @@ history.txt
176176
name = "{}"
177177
authors = []
178178
telemetry = {}
179+
cache_dir = "./.requirements"
180+
181+
# [contracts.counter]
182+
# path = "contracts/counter.clar"
183+
179184
[repl.analysis]
180185
passes = ["check_checker"]
181-
[repl.analysis.check_checker]
182-
# If true, inputs are trusted after tx_sender has been checked.
183-
trusted_sender = false
184-
# If true, inputs are trusted after contract-caller has been checked.
185-
trusted_caller = false
186-
# If true, untrusted data may be passed into a private function without a
186+
check_checker = {{ trusted_sender = false, trusted_caller = false, callee_filter = false }}
187+
188+
# Check-checker settings:
189+
# trusted_sender: if true, inputs are trusted after tx_sender has been checked.
190+
# trusted_caller: if true, inputs are trusted after contract-caller has been checked.
191+
# callee_filter: if true, untrusted data may be passed into a private function without a
187192
# warning, if it gets checked inside. This check will also propagate up to the
188193
# caller.
189-
callee_filter = false
190-
191-
# [contracts.counter]
192-
# path = "contracts/counter.clar"
193-
# depends_on = []
194+
# More informations: https://www.hiro.so/blog/new-safety-checks-in-clarinet
194195
"#,
195196
self.project_name, self.telemetry_enabled
196197
);

src/types/project_manifest.rs

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ pub struct RequirementConfig {
6262
#[derive(Serialize, Deserialize, Debug, Clone)]
6363
pub struct ContractConfig {
6464
pub path: String,
65-
pub depends_on: Vec<String>,
6665
pub deployer: Option<String>,
6766
}
6867

@@ -77,8 +76,7 @@ impl ProjectManifest {
7776
let file = match File::open(path) {
7877
Ok(path) => path,
7978
Err(_e) => {
80-
println!("Error: unable to locate Clarinet.toml in current directory");
81-
std::process::exit(1);
79+
return Err("unable to locate Clarinet.toml in current directory".to_string());
8280
}
8381
};
8482
let mut project_manifest_file_reader = BufReader::new(file);
@@ -91,12 +89,7 @@ impl ProjectManifest {
9189
match toml::from_slice(&project_manifest_file_buffer[..]) {
9290
Ok(s) => s,
9391
Err(e) => {
94-
println!(
95-
"{}: Clarinet.toml file malformatted.\n{:?}",
96-
red!("error"),
97-
e
98-
);
99-
std::process::exit(1);
92+
return Err(format!("Clarinet.toml file malformatted {:?}", e));
10093
}
10194
};
10295

@@ -127,11 +120,7 @@ impl ProjectManifest {
127120
let path = match PathBuf::from_str(path) {
128121
Ok(path) => path,
129122
Err(_e) => {
130-
println!(
131-
"{}: Clarinet.toml file malformatted, the entry cache_dir is not a valid path",
132-
red!("error")
133-
);
134-
std::process::exit(1);
123+
return Err("setting cache_dir is not a valid path".to_string());
135124
}
136125
};
137126
if path.is_relative() {
@@ -206,13 +195,10 @@ impl ProjectManifest {
206195
Some(Value::String(path)) => path.to_string(),
207196
_ => continue,
208197
};
209-
let depends_on = match contract_settings.get("depends_on") {
210-
Some(Value::Array(depends_on)) => depends_on
211-
.iter()
212-
.map(|v| v.as_str().unwrap().to_string())
213-
.collect::<Vec<String>>(),
214-
_ => continue,
215-
};
198+
if contract_settings.get("depends_on").is_some() {
199+
// We could print a deprecation notice here if that code path
200+
// was not used by the LSP.
201+
}
216202
let deployer = match contract_settings.get("deployer") {
217203
Some(Value::String(path)) => Some(path.to_string()),
218204
_ => None,
@@ -221,7 +207,6 @@ impl ProjectManifest {
221207
contract_name.to_string(),
222208
ContractConfig {
223209
path,
224-
depends_on,
225210
deployer,
226211
},
227212
);

0 commit comments

Comments
 (0)