This repository was archived by the owner on Aug 21, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
crates/blockifier/src/transaction Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,3 +27,15 @@ fn test_declare_transaction_error_format() {
2727 already declared."
2828 ) ;
2929}
30+
31+ #[ test]
32+ fn test_invalid_version_format ( ) {
33+ let error = TransactionExecutionError :: InvalidVersion {
34+ version : TransactionVersion :: THREE ,
35+ allowed_versions : vec ! [ TransactionVersion :: ONE , TransactionVersion :: TWO ] ,
36+ } ;
37+ assert_eq ! (
38+ error. to_string( ) ,
39+ "Transaction version 0x3 is not supported. Supported versions: [0x1, 0x2]."
40+ ) ;
41+ }
Original file line number Diff line number Diff line change @@ -78,8 +78,8 @@ pub enum TransactionExecutionError {
7878 #[ error( "The `validate` entry point should return `VALID`. Got {actual:?}." ) ]
7979 InvalidValidateReturnData { actual : Retdata } ,
8080 #[ error(
81- "Transaction version {version :?} is not supported. Supported versions: \
82- {allowed_versions :?}."
81+ "Transaction version {:?} is not supported. Supported versions: \
82+ {:?}.", * * version , allowed_versions . iter ( ) . map ( |v| * * v ) . collect :: < Vec <_>> ( )
8383 ) ]
8484 InvalidVersion { version : TransactionVersion , allowed_versions : Vec < TransactionVersion > } ,
8585 #[ error( transparent) ]
You can’t perform that action at this time.
0 commit comments