Skip to content

Commit ce83714

Browse files
committed
relocate warning
1 parent 97e321e commit ce83714

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

extensions/scarb-prove/src/main.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ fn main_inner(args: Args, ui: Ui) -> Result<()> {
8383

8484
let scarb_target_dir = Utf8PathBuf::from(env::var("SCARB_TARGET_DIR")?);
8585

86-
ui.warn("soundness of proof is not yet guaranteed by Stwo, use at your own risk");
87-
8886
let metadata = MetadataCommand::new().inherit_stderr().exec()?;
8987
let package = args.packages_filter.match_one(&metadata)?;
9088

@@ -96,6 +94,7 @@ fn main_inner(args: Args, ui: Ui) -> Result<()> {
9694
}
9795
};
9896
ui.print(Status::new("Proving", &package.name));
97+
ui.warn("soundness of proof is not yet guaranteed by Stwo, use at your own risk");
9998

10099
let (pub_input_path, priv_input_path, proof_path) =
101100
resolve_paths_from_package(&scarb_target_dir, &package.name, execution_id)?;

extensions/scarb-prove/tests/build.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ fn prove_from_execution_output() {
4646
.assert()
4747
.success()
4848
.stdout_matches(indoc! {r#"
49-
[..]soundness of proof is not yet guaranteed by Stwo, use at your own risk
5049
[..]Proving hello
50+
warn: soundness of proof is not yet guaranteed by Stwo, use at your own risk
5151
Saving proof to: target/execute/hello/execution1/proof/proof.json
5252
"#});
5353

@@ -127,8 +127,8 @@ fn prove_fails_when_execution_output_not_found() {
127127
.assert()
128128
.failure(),
129129
indoc! {r#"
130-
[..]soundness of proof is not yet guaranteed by Stwo, use at your own risk
131130
[..]Proving hello
131+
warn: soundness of proof is not yet guaranteed by Stwo, use at your own risk
132132
error: execution directory not found: [..]/target/execute/hello/execution1
133133
help: make sure to run `scarb execute` first
134134
and then run `scarb prove` with correct execution ID
@@ -142,6 +142,7 @@ fn prove_fails_when_execution_output_not_found() {
142142
fn prove_fails_when_cairo_pie_output() {
143143
let t = build_executable_project();
144144

145+
// First create a cairo pie output
145146
Scarb::quick_snapbox()
146147
.arg("execute")
147148
.arg("--target=bootloader")
@@ -153,6 +154,7 @@ fn prove_fails_when_cairo_pie_output() {
153154
t.child("target/execute/hello/execution1/cairo_pie.zip")
154155
.assert(predicates::path::exists());
155156

157+
// Then try to prove it
156158
output_assert(
157159
Scarb::quick_snapbox()
158160
.arg("prove")
@@ -161,14 +163,14 @@ fn prove_fails_when_cairo_pie_output() {
161163
.assert()
162164
.failure(),
163165
indoc! {r#"
164-
[..]soundness of proof is not yet guaranteed by Stwo, use at your own risk
165166
[..]Proving hello
167+
warn: soundness of proof is not yet guaranteed by Stwo, use at your own risk
166168
error: proving cairo pie output is not supported: [..]/target/execute/hello/execution1/cairo_pie.zip
167169
help: run `scarb execute --output=standard` first
168170
and then run `scarb prove` with correct execution ID
169171
170172
"#},
171-
)
173+
);
172174
}
173175

174176
#[test]
@@ -184,12 +186,12 @@ fn prove_with_execute() {
184186
.assert()
185187
.success()
186188
.stdout_matches(indoc! {r#"
187-
[..]soundness of proof is not yet guaranteed by Stwo, use at your own risk
188189
[..]Compiling hello v0.1.0 ([..])
189190
[..]Finished `dev` profile target(s) in [..]
190191
[..]Executing hello
191192
Saving output to: target/execute/hello/execution1
192193
[..]Proving hello
194+
warn: soundness of proof is not yet guaranteed by Stwo, use at your own risk
193195
Saving proof to: target/execute/hello/execution1/proof/proof.json
194196
"#});
195197

0 commit comments

Comments
 (0)