Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Commit 0662936

Browse files
fix: invalid version format
commit-id:776e06e7
1 parent 517c0b9 commit 0662936

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

crates/blockifier/src/transaction/error_format_test.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

crates/blockifier/src/transaction/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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)]

0 commit comments

Comments
 (0)