Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use e.into() instead of Self::from #1892

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
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 @@
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 @@
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 @@
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
Loading