pub trait EngineApiValidator<Types: PayloadTypes>:
Send
+ Sync
+ Unpin
+ 'static {
// Required methods
fn validate_version_specific_fields(
&self,
version: EngineApiMessageVersion,
payload_or_attrs: PayloadOrAttributes<'_, Types::ExecutionData, Types::PayloadAttributes>,
) -> Result<(), EngineObjectValidationError>;
fn ensure_well_formed_attributes(
&self,
version: EngineApiMessageVersion,
attributes: &Types::PayloadAttributes,
) -> Result<(), EngineObjectValidationError>;
}
Expand description
Type that validates the payloads processed by the engine API.
Required Methods§
Sourcefn validate_version_specific_fields(
&self,
version: EngineApiMessageVersion,
payload_or_attrs: PayloadOrAttributes<'_, Types::ExecutionData, Types::PayloadAttributes>,
) -> Result<(), EngineObjectValidationError>
fn validate_version_specific_fields( &self, version: EngineApiMessageVersion, payload_or_attrs: PayloadOrAttributes<'_, Types::ExecutionData, Types::PayloadAttributes>, ) -> Result<(), EngineObjectValidationError>
Validates the presence or exclusion of fork-specific fields based on the payload attributes and the message version.
Sourcefn ensure_well_formed_attributes(
&self,
version: EngineApiMessageVersion,
attributes: &Types::PayloadAttributes,
) -> Result<(), EngineObjectValidationError>
fn ensure_well_formed_attributes( &self, version: EngineApiMessageVersion, attributes: &Types::PayloadAttributes, ) -> Result<(), EngineObjectValidationError>
Ensures that the payload attributes are valid for the given [EngineApiMessageVersion
].