MCPcopy Create free account
hub / github.com/base/base / assert_structural_reason

Function assert_structural_reason

crates/execution/txpool/src/validator.rs:2665–2680  ·  view source on GitHub ↗
(
        result: Result<(), InvalidPoolTransactionError>,
        expected: &'static str,
    )

Source from the content-addressed store, hash-verified

2663 /// named [`BaseTxPoolError::Eip8130Validation`] reason.
2664 #[track_caller]
2665 fn assert_structural_reason(
2666 result: Result<(), InvalidPoolTransactionError>,
2667 expected: &'static str,
2668 ) {
2669 match result {
2670 Err(InvalidPoolTransactionError::Other(error)) => {
2671 match error.as_any().downcast_ref::<BaseTxPoolError>() {
2672 Some(BaseTxPoolError::Eip8130Validation { reason }) => {
2673 assert_eq!(*reason, expected);
2674 }
2675 other => panic!("expected Eip8130Validation, got {other:?}"),
2676 }
2677 }
2678 other => panic!("expected Eip8130Validation, got {other:?}"),
2679 }
2680 }
2681
2682 #[track_caller]
2683 fn assert_eip8130_validation_reason(

Calls 1

as_anyMethod · 0.45