From 90e25dc6cf6886a3494cd60c76942f10b76f2252 Mon Sep 17 00:00:00 2001 From: sean Date: Sun, 5 Feb 2023 16:55:55 -0500 Subject: [PATCH] from to new --- beacon_node/execution_layer/src/engine_api.rs | 9 +++++++-- beacon_node/execution_layer/src/lib.rs | 12 ++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/beacon_node/execution_layer/src/engine_api.rs b/beacon_node/execution_layer/src/engine_api.rs index 8419de588..3c931a0cd 100644 --- a/beacon_node/execution_layer/src/engine_api.rs +++ b/beacon_node/execution_layer/src/engine_api.rs @@ -40,8 +40,7 @@ pub enum Error { PayloadIdUnavailable, TransitionConfigurationMismatch, PayloadConversionLogicFlaw, - DeserializeTransaction(ssz_types::Error), - DeserializeTransactions(ssz_types::Error), + SszError(ssz_types::Error), DeserializeWithdrawals(ssz_types::Error), BuilderApi(builder_client::Error), IncorrectStateVariant, @@ -89,6 +88,12 @@ impl From for Error { } } +impl From for Error { + fn from(e: ssz_types::Error) -> Self { + Error::SszError(e) + } +} + #[derive(Clone, Copy, Debug, PartialEq, IntoStaticStr)] #[strum(serialize_all = "snake_case")] pub enum PayloadStatusV1Status { diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index 85ed0e25a..06e527508 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -2084,7 +2084,6 @@ fn noop(_: &ExecutionLayer, _: &ExecutionPayload) -> Option( transaction: &Transaction, ) -> Result, ApiError> { - let tx_type = transaction .transaction_type .ok_or(ApiError::BlobTxConversionError)? @@ -2103,22 +2102,23 @@ fn ethers_tx_to_bytes( let gas = std::cmp::min(transaction.gas, Uint256::from(u64::MAX)).as_u64(); let to = transaction.to; let value = transaction.value; - let data = VariableList::from(transaction.input.to_vec()); + let data = VariableList::new(transaction.input.to_vec())?; - let access_list = VariableList::from( + let access_list = VariableList::new( transaction - .access_list.as_ref() + .access_list + .as_ref() .ok_or(ApiError::BlobTxConversionError)? .0 .iter() .map(|access_tuple| { Ok(AccessTuple { address: access_tuple.address, - storage_keys: VariableList::from(access_tuple.storage_keys.clone()), + storage_keys: VariableList::new(access_tuple.storage_keys.clone())?, }) }) .collect::, ApiError>>()?, - ); + )?; let max_fee_per_data_gas = transaction .other .get("max_fee_per_data_gas")