chore: rewrite all error messages for consistency (#5176)

Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com>
This commit is contained in:
DaniPopes
2023-10-25 22:12:03 +02:00
committed by GitHub
parent 1c0373b322
commit e05dba69ce
73 changed files with 649 additions and 599 deletions

View File

@@ -40,10 +40,10 @@ pub enum ForkchoiceUpdateError {
/// [PayloadAttributes](crate::engine::PayloadAttributes).
///
/// This is returned as an error because the payload attributes are invalid and the payload is not valid, See <https://github.com/ethereum/execution-apis/blob/6709c2a795b707202e93c4f2867fa0bf2640a84f/src/engine/paris.md#engine_forkchoiceupdatedv1>
#[error("Invalid payload attributes")]
#[error("invalid payload attributes")]
UpdatedInvalidPayloadAttributes,
/// The given [ForkchoiceState] is invalid or inconsistent.
#[error("Invalid forkchoice state")]
#[error("invalid forkchoice state")]
InvalidState,
/// Thrown when a forkchoice final block does not exist in the database.
#[error("final block not available in database")]

View File

@@ -341,22 +341,22 @@ impl From<ExecutionPayloadV3> for ExecutionPayload {
#[derive(thiserror::Error, Debug)]
pub enum PayloadError {
/// Invalid payload extra data.
#[error("Invalid payload extra data: {0}")]
#[error("invalid payload extra data: {0}")]
ExtraData(Bytes),
/// Invalid payload base fee.
#[error("Invalid payload base fee: {0}")]
#[error("invalid payload base fee: {0}")]
BaseFee(U256),
/// Invalid payload blob gas used.
#[error("Invalid payload blob gas used: {0}")]
#[error("invalid payload blob gas used: {0}")]
BlobGasUsed(U256),
/// Invalid payload excess blob gas.
#[error("Invalid payload excess blob gas: {0}")]
#[error("invalid payload excess blob gas: {0}")]
ExcessBlobGas(U256),
/// Pre-cancun Payload has blob transactions.
#[error("Invalid payload, pre-Cancun payload has blob transactions")]
#[error("pre-Cancun payload has blob transactions")]
PreCancunBlockWithBlobTransactions,
/// Invalid payload block hash.
#[error("blockhash mismatch, want {consensus}, got {execution}")]
#[error("block hash mismatch: want {consensus}, got {execution}")]
BlockHash {
/// The block hash computed from the payload.
execution: B256,
@@ -364,7 +364,7 @@ pub enum PayloadError {
consensus: B256,
},
/// Expected blob versioned hashes do not match the given transactions.
#[error("Expected blob versioned hashes do not match the given transactions")]
#[error("expected blob versioned hashes do not match the given transactions")]
InvalidVersionedHashes,
/// Encountered decoding error.
#[error(transparent)]