File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ use crate::{
13
13
14
14
use crate :: Felt252 ;
15
15
use bincode:: enc:: write:: Writer ;
16
-
17
16
use thiserror_no_std:: Error ;
18
17
19
18
#[ cfg( feature = "arbitrary" ) ]
@@ -126,7 +125,8 @@ pub fn cairo_run_pie(
126
125
{
127
126
return Err ( RunnerError :: PieNStepsVsRunResourcesNStepsMismatch . into ( ) ) ;
128
127
}
129
- pie. run_validity_checks ( ) ?;
128
+ pie. run_validity_checks ( )
129
+ . map_err ( |cairo_pie_err| CairoRunError :: Runner ( cairo_pie_err. into ( ) ) ) ?;
130
130
let secure_run = cairo_run_config. secure_run . unwrap_or ( true ) ;
131
131
132
132
let allow_missing_builtins = cairo_run_config. allow_missing_builtins . unwrap_or_default ( ) ;
@@ -170,7 +170,8 @@ pub fn cairo_run_pie(
170
170
// Check that the Cairo PIE produced by this run is compatible with the Cairo PIE received
171
171
cairo_runner
172
172
. get_cairo_pie ( & vm) ?
173
- . check_pie_compatibility ( pie) ?;
173
+ . check_pie_compatibility ( pie)
174
+ . map_err ( |cairo_pie_err| CairoRunError :: Runner ( cairo_pie_err. into ( ) ) ) ?;
174
175
}
175
176
cairo_runner. relocate ( & mut vm, cairo_run_config. relocate_mem ) ?;
176
177
Original file line number Diff line number Diff line change 1
1
use thiserror_no_std:: Error ;
2
2
3
- use super :: cairo_pie_errors:: CairoPieValidationError ;
4
3
use super :: memory_errors:: MemoryError ;
5
4
use super :: vm_exception:: VmException ;
6
5
use crate :: types:: errors:: program_errors:: ProgramError ;
@@ -22,6 +21,4 @@ pub enum CairoRunError {
22
21
MemoryError ( #[ from] MemoryError ) ,
23
22
#[ error( transparent) ]
24
23
VmException ( #[ from] VmException ) ,
25
- #[ error( "Cairo Pie validation failed: {0}" ) ]
26
- CairoPieValidation ( #[ from] CairoPieValidationError ) ,
27
24
}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use crate::types::builtin_name::BuiltinName;
6
6
use crate :: types:: layout_name:: LayoutName ;
7
7
use thiserror_no_std:: Error ;
8
8
9
+ use super :: cairo_pie_errors:: CairoPieValidationError ;
9
10
use super :: { memory_errors:: MemoryError , trace_errors:: TraceError } ;
10
11
use crate :: types:: { errors:: math_errors:: MathError , relocatable:: Relocatable } ;
11
12
use crate :: Felt252 ;
@@ -132,6 +133,8 @@ pub enum RunnerError {
132
133
CairoPieProofMode ,
133
134
#[ error( "{0}: Invalid additional data" ) ]
134
135
InvalidAdditionalData ( BuiltinName ) ,
136
+ #[ error( "Cairo Pie validation failed: {0}" ) ]
137
+ CairoPieValidation ( #[ from] CairoPieValidationError ) ,
135
138
}
136
139
137
140
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments