This repository was archived by the owner on Jul 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,9 @@ impl ExecutionEntryPoint {
269
269
entry_point
270
270
. or ( default_entry_point)
271
271
. cloned ( )
272
- . ok_or ( TransactionError :: EntryPointNotFound )
272
+ . ok_or ( TransactionError :: EntryPointNotFound (
273
+ self . entry_point_selector ,
274
+ ) )
273
275
}
274
276
275
277
// Returns the entry point with selector corresponding with self.entry_point_selector, or the
@@ -302,7 +304,9 @@ impl ExecutionEntryPoint {
302
304
entry_point
303
305
. or ( default_entry_point)
304
306
. cloned ( )
305
- . ok_or ( TransactionError :: EntryPointNotFound )
307
+ . ok_or ( TransactionError :: EntryPointNotFound (
308
+ self . entry_point_selector ,
309
+ ) )
306
310
}
307
311
308
312
/// Constructs a CallInfo object for deprecated contract classes.
Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ pub enum TransactionError {
80
80
NotDeployedContract ( ClassHash ) ,
81
81
#[ error( "Non-unique entry points are not possible in a ContractClass object" ) ]
82
82
NonUniqueEntryPoint ,
83
- #[ error( "Requested entry point was not found" ) ]
84
- EntryPointNotFound ,
83
+ #[ error( "Requested entry point with selector {0:#x} was not found" ) ]
84
+ EntryPointNotFound ( Felt252 ) ,
85
85
#[ error( "Ptr result diverges after calculating final stacks" ) ]
86
86
OsContextPtrNotEqual ,
87
87
#[ error( "Empty OS context" ) ]
Original file line number Diff line number Diff line change @@ -950,7 +950,7 @@ mod tests {
950
950
assert ! ( expected_error. is_err( ) ) ;
951
951
assert_matches ! (
952
952
expected_error. unwrap_err( ) ,
953
- TransactionError :: EntryPointNotFound
953
+ TransactionError :: EntryPointNotFound ( _ )
954
954
) ;
955
955
}
956
956
@@ -1402,9 +1402,11 @@ mod tests {
1402
1402
1403
1403
#[ test]
1404
1404
fn test_reverted_transaction_wrong_entry_point ( ) {
1405
+ let entry_point_selector = Felt252 :: from_bytes_be ( & calculate_sn_keccak ( b"factorial_" ) ) ;
1406
+
1405
1407
let internal_invoke_function = InvokeFunction {
1406
1408
contract_address : Address ( 0 . into ( ) ) ,
1407
- entry_point_selector : Felt252 :: from_bytes_be ( & calculate_sn_keccak ( b"factorial_" ) ) ,
1409
+ entry_point_selector,
1408
1410
entry_point_type : EntryPointType :: External ,
1409
1411
calldata : vec ! [ ] ,
1410
1412
tx_type : TransactionType :: InvokeFunction ,
@@ -1466,7 +1468,9 @@ mod tests {
1466
1468
assert ! ( result. call_info. is_none( ) ) ;
1467
1469
assert_eq ! (
1468
1470
result. revert_error,
1469
- Some ( "Requested entry point was not found" . to_string( ) )
1471
+ Some ( format!(
1472
+ "Requested entry point with selector {entry_point_selector:#x} was not found"
1473
+ ) )
1470
1474
) ;
1471
1475
assert_eq_sorted ! (
1472
1476
state. cache. class_hash_writes,
Original file line number Diff line number Diff line change @@ -2208,7 +2208,7 @@ fn test_invoke_tx_wrong_entrypoint() {
2208
2208
) ;
2209
2209
2210
2210
// Assert error
2211
- assert_matches ! ( result, Err ( TransactionError :: EntryPointNotFound ) ) ;
2211
+ assert_matches ! ( result, Err ( TransactionError :: EntryPointNotFound ( _ ) ) ) ;
2212
2212
}
2213
2213
2214
2214
#[ test]
You can’t perform that action at this time.
0 commit comments