pr feedback
This commit is contained in:
parent
99da11e9f4
commit
a68e3eac2c
@ -14,6 +14,7 @@ pub use engine_api::{http, http::deposit_methods, http::HttpJsonRpc};
|
|||||||
use engines::{Engine, EngineError};
|
use engines::{Engine, EngineError};
|
||||||
pub use engines::{EngineState, ForkchoiceState};
|
pub use engines::{EngineState, ForkchoiceState};
|
||||||
use eth2::types::{builder_bid::SignedBuilderBid, ForkVersionedResponse};
|
use eth2::types::{builder_bid::SignedBuilderBid, ForkVersionedResponse};
|
||||||
|
use ethers_core::abi::ethereum_types::FromStrRadixErr;
|
||||||
use ethers_core::types::transaction::eip2930::AccessListItem;
|
use ethers_core::types::transaction::eip2930::AccessListItem;
|
||||||
use ethers_core::types::{Transaction as EthersTransaction, U64};
|
use ethers_core::types::{Transaction as EthersTransaction, U64};
|
||||||
use fork_choice::ForkchoiceUpdateParameters;
|
use fork_choice::ForkchoiceUpdateParameters;
|
||||||
@ -2042,9 +2043,9 @@ pub enum BlobTxConversionError {
|
|||||||
/// There was an error converting the transaction from JSON.
|
/// There was an error converting the transaction from JSON.
|
||||||
SerdeJson(serde_json::Error),
|
SerdeJson(serde_json::Error),
|
||||||
/// There was an error converting the transaction from hex.
|
/// There was an error converting the transaction from hex.
|
||||||
FromHexError(String),
|
FromHex(String),
|
||||||
/// The `max_fee_per_data_gas` field did not contains 32 bytes.
|
/// There was an error converting the transaction from hex.
|
||||||
InvalidDataGasBytesLen,
|
FromStrRadix(FromStrRadixErr),
|
||||||
/// A `versioned_hash` did not contain 32 bytes.
|
/// A `versioned_hash` did not contain 32 bytes.
|
||||||
InvalidVersionedHashBytesLen,
|
InvalidVersionedHashBytesLen,
|
||||||
}
|
}
|
||||||
@ -2150,19 +2151,15 @@ fn ethers_tx_to_bytes<T: EthSpec>(
|
|||||||
// `ethers-rs` does not yet support SSZ and therefore the blobs transaction type.
|
// `ethers-rs` does not yet support SSZ and therefore the blobs transaction type.
|
||||||
|
|
||||||
// maxFeePerDataGas
|
// maxFeePerDataGas
|
||||||
let data_gas_bytes = eth2_serde_utils::hex::decode(
|
let max_fee_per_data_gas = Uint256::from_str_radix(
|
||||||
other
|
other
|
||||||
.get("maxFeePerDataGas")
|
.get("maxFeePerDataGas")
|
||||||
.ok_or(BlobTxConversionError::MaxFeePerDataGasMissing)?
|
.ok_or(BlobTxConversionError::MaxFeePerDataGasMissing)?
|
||||||
.as_str()
|
.as_str()
|
||||||
.ok_or(BlobTxConversionError::MaxFeePerDataGasMissing)?,
|
.ok_or(BlobTxConversionError::MaxFeePerDataGasMissing)?,
|
||||||
|
16,
|
||||||
)
|
)
|
||||||
.map_err(BlobTxConversionError::FromHexError)?;
|
.map_err(BlobTxConversionError::FromStrRadix)?;
|
||||||
let max_fee_per_data_gas = if data_gas_bytes.len() != Uint256::ssz_fixed_len() {
|
|
||||||
Err(BlobTxConversionError::InvalidDataGasBytesLen)
|
|
||||||
} else {
|
|
||||||
Ok(Uint256::from_big_endian(&data_gas_bytes))
|
|
||||||
}?;
|
|
||||||
|
|
||||||
// blobVersionedHashes
|
// blobVersionedHashes
|
||||||
let blob_versioned_hashes = other
|
let blob_versioned_hashes = other
|
||||||
@ -2177,7 +2174,7 @@ fn ethers_tx_to_bytes<T: EthSpec>(
|
|||||||
.as_str()
|
.as_str()
|
||||||
.ok_or(BlobTxConversionError::BlobVersionedHashesMissing)?,
|
.ok_or(BlobTxConversionError::BlobVersionedHashesMissing)?,
|
||||||
)
|
)
|
||||||
.map_err(BlobTxConversionError::FromHexError)?;
|
.map_err(BlobTxConversionError::FromHex)?;
|
||||||
if hash_bytes.len() != Hash256::ssz_fixed_len() {
|
if hash_bytes.len() != Hash256::ssz_fixed_len() {
|
||||||
Err(BlobTxConversionError::InvalidVersionedHashBytesLen)
|
Err(BlobTxConversionError::InvalidVersionedHashBytesLen)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user