Skip to content

Commit

Permalink
Use e.into() instead of Self::from
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Apr 26, 2024
1 parent 1000fcd commit 67f23be
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions crates/katana/executor/src/implementation/blockifier/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ impl From<TransactionExecutionError> for ExecutionError {
Self::ClassAlreadyDeclared(class_hash.0.into())
}
TransactionExecutionError::ValidateTransactionError(e) => {
Self::TransactionValidationFailed(Box::new(Self::from(e)))
Self::TransactionValidationFailed(Box::new(e.into()))
}
TransactionExecutionError::StateError(e) => Self::from(e),
TransactionExecutionError::TransactionPreValidationError(e) => Self::from(e),
TransactionExecutionError::TransactionFeeError(e) => Self::from(e),
TransactionExecutionError::ExecutionError(e) => Self::from(e),
TransactionExecutionError::StateError(e) => e.into(),
TransactionExecutionError::TransactionPreValidationError(e) => e.into(),
TransactionExecutionError::TransactionFeeError(e) => e.into(),
TransactionExecutionError::ExecutionError(e) => e.into(),

Check warning on line 23 in crates/katana/executor/src/implementation/blockifier/error.rs

View check run for this annotation

Codecov / codecov/patch

crates/katana/executor/src/implementation/blockifier/error.rs#L20-L23

Added lines #L20 - L23 were not covered by tests
TransactionExecutionError::ContractConstructorExecutionFailed(e) => {
Self::ConstructorExecutionFailed(Box::new(Self::from(e)))
Self::ConstructorExecutionFailed(Box::new(e.into()))

Check warning on line 25 in crates/katana/executor/src/implementation/blockifier/error.rs

View check run for this annotation

Codecov / codecov/patch

crates/katana/executor/src/implementation/blockifier/error.rs#L25

Added line #L25 was not covered by tests
}
e => Self::Other(e.to_string()),
}
Expand All @@ -39,8 +39,8 @@ impl From<EntryPointExecutionError> for ExecutionError {
Self::InvalidInput { input_descriptor, info }
}
EntryPointExecutionError::RecursionDepthExceeded => Self::RecursionDepthExceeded,
EntryPointExecutionError::StateError(e) => Self::from(e),
EntryPointExecutionError::PreExecutionError(e) => Self::from(e),
EntryPointExecutionError::StateError(e) => e.into(),

Check warning on line 42 in crates/katana/executor/src/implementation/blockifier/error.rs

View check run for this annotation

Codecov / codecov/patch

crates/katana/executor/src/implementation/blockifier/error.rs#L42

Added line #L42 was not covered by tests
EntryPointExecutionError::PreExecutionError(e) => e.into(),
e => Self::Other(e.to_string()),
}
}
Expand All @@ -55,7 +55,7 @@ impl From<PreExecutionError> for ExecutionError {
PreExecutionError::UninitializedStorageAddress(address) => {
Self::ContractNotDeployed(to_address(address))
}
PreExecutionError::StateError(e) => Self::from(e),
PreExecutionError::StateError(e) => e.into(),

Check warning on line 58 in crates/katana/executor/src/implementation/blockifier/error.rs

View check run for this annotation

Codecov / codecov/patch

crates/katana/executor/src/implementation/blockifier/error.rs#L58

Added line #L58 was not covered by tests
e => Self::Other(e.to_string()),
}
}
Expand All @@ -72,8 +72,8 @@ impl From<TransactionPreValidationError> for ExecutionError {
actual: account_nonce.0.into(),
expected: incoming_tx_nonce.0.into(),
},
TransactionPreValidationError::TransactionFeeError(e) => Self::from(e),
TransactionPreValidationError::StateError(e) => Self::from(e),
TransactionPreValidationError::TransactionFeeError(e) => e.into(),
TransactionPreValidationError::StateError(e) => e.into(),

Check warning on line 76 in crates/katana/executor/src/implementation/blockifier/error.rs

View check run for this annotation

Codecov / codecov/patch

crates/katana/executor/src/implementation/blockifier/error.rs#L75-L76

Added lines #L75 - L76 were not covered by tests
}
}
}
Expand All @@ -87,7 +87,7 @@ impl From<TransactionFeeError> for ExecutionError {
TransactionFeeError::MaxFeeTooLow { min_fee, max_fee } => {
Self::MaxFeeTooLow { min: min_fee.0, max_fee: max_fee.0 }
}
TransactionFeeError::StateError(e) => Self::from(e),
TransactionFeeError::StateError(e) => e.into(),

Check warning on line 90 in crates/katana/executor/src/implementation/blockifier/error.rs

View check run for this annotation

Codecov / codecov/patch

crates/katana/executor/src/implementation/blockifier/error.rs#L90

Added line #L90 was not covered by tests
e => Self::Other(e.to_string()),
}
}
Expand Down

0 comments on commit 67f23be

Please sign in to comment.