update blob transaction (#4218)

* update blob transaction

* update blob transaction

* rename in JSON deserializing
This commit is contained in:
realbigsean
2023-04-20 18:23:59 -04:00
committed by GitHub
parent a6335eb27e
commit e6b033aefd
3 changed files with 17 additions and 17 deletions

View File

@@ -2080,8 +2080,8 @@ pub enum BlobTxConversionError {
AccessListMissing,
/// Missing the `max_fee_per_data_gas` field.
MaxFeePerDataGasMissing,
/// Missing the `blob_versioned_hashes` field.
BlobVersionedHashesMissing,
/// Missing the `versioned_hashes` field.
VersionedHashesMissing,
/// `y_parity` field was greater than one.
InvalidYParity,
/// There was an error converting the transaction to SSZ.
@@ -2207,18 +2207,18 @@ fn ethers_tx_to_bytes<T: EthSpec>(
)
.map_err(BlobTxConversionError::FromStrRadix)?;
// blobVersionedHashes
let blob_versioned_hashes = other
.get("blobVersionedHashes")
.ok_or(BlobTxConversionError::BlobVersionedHashesMissing)?
// versionedHashes
let versioned_hashes = other
.get("versionedHashes")
.ok_or(BlobTxConversionError::VersionedHashesMissing)?
.as_array()
.ok_or(BlobTxConversionError::BlobVersionedHashesMissing)?
.ok_or(BlobTxConversionError::VersionedHashesMissing)?
.iter()
.map(|versioned_hash| {
let hash_bytes = eth2_serde_utils::hex::decode(
versioned_hash
.as_str()
.ok_or(BlobTxConversionError::BlobVersionedHashesMissing)?,
.ok_or(BlobTxConversionError::VersionedHashesMissing)?,
)
.map_err(BlobTxConversionError::FromHex)?;
if hash_bytes.len() != Hash256::ssz_fixed_len() {
@@ -2239,7 +2239,7 @@ fn ethers_tx_to_bytes<T: EthSpec>(
data,
access_list,
max_fee_per_data_gas,
blob_versioned_hashes: VariableList::new(blob_versioned_hashes)?,
versioned_hashes: VariableList::new(versioned_hashes)?,
};
// ******************** EcdsaSignature fields ********************