Skip to content

Commit 6d4bdd7

Browse files
native_blockifier: box StatefulValidatorError in NativeBlockifierError
1 parent 00c9691 commit 6d4bdd7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

crates/native_blockifier/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ native_blockifier_errors!(
6868
(SerdeError, serde_json::Error, PySerdeError),
6969
(StarknetApiError, StarknetApiError, PyStarknetApiError),
7070
(StateError, StateError, PyStateError),
71-
(StatefulValidatorError, StatefulValidatorError, PyStatefulValidatorError),
71+
(StatefulValidatorError, Box<StatefulValidatorError>, PyStatefulValidatorError),
7272
(StorageError, apollo_storage::StorageError, PyStorageError),
7373
(TransactionExecutionError, TransactionExecutionError, PyTransactionExecutionError),
7474
(TransactionExecutorError, TransactionExecutorError, PyTransactionExecutorError),

crates/native_blockifier/src/py_validator.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ impl PyValidator {
7373

7474
// We check if the transaction should be skipped due to the deploy account not being
7575
// processed.
76-
let validate = self.should_run_stateful_validations(&account_tx, deploy_account_tx_hash)?;
76+
let validate = self
77+
.should_run_stateful_validations(&account_tx, deploy_account_tx_hash)
78+
.map_err(Box::new)?;
7779

7880
account_tx.execution_flags.validate = validate;
7981
account_tx.execution_flags.strict_nonce_check = false;
80-
self.stateful_validator.perform_validations(account_tx)?;
82+
self.stateful_validator.perform_validations(account_tx).map_err(Box::new)?;
8183

8284
Ok(())
8385
}

0 commit comments

Comments
 (0)