mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 05:44:44 +00:00
Fix Uint256 deserialization (#2786)
* Change base_fee_per_gas to Uint256 * Add custom (de)serialization to ExecutionPayload * Fix errors * Add a quoted_u256 module * Remove unused function * lint * Add test * Remove extra line Co-authored-by: Paul Hauner <paul@paulhauner.com>
This commit is contained in:
committed by
Paul Hauner
parent
de49c7ddaa
commit
24966c059d
@@ -29,7 +29,8 @@ pub struct ExecutionPayload<T: EthSpec> {
|
||||
pub timestamp: u64,
|
||||
#[serde(with = "ssz_types::serde_utils::hex_var_list")]
|
||||
pub extra_data: VariableList<u8, T::MaxExtraDataBytes>,
|
||||
pub base_fee_per_gas: Hash256,
|
||||
#[serde(with = "eth2_serde_utils::quoted_u256")]
|
||||
pub base_fee_per_gas: Uint256,
|
||||
pub block_hash: Hash256,
|
||||
#[serde(with = "ssz_types::serde_utils::list_of_hex_var_list")]
|
||||
pub transactions:
|
||||
@@ -51,7 +52,7 @@ impl<T: EthSpec> ExecutionPayload<T> {
|
||||
gas_used: 0,
|
||||
timestamp: 0,
|
||||
extra_data: VariableList::empty(),
|
||||
base_fee_per_gas: Hash256::zero(),
|
||||
base_fee_per_gas: Uint256::zero(),
|
||||
block_hash: Hash256::zero(),
|
||||
transactions: VariableList::empty(),
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@ pub struct ExecutionPayloadHeader<T: EthSpec> {
|
||||
pub timestamp: u64,
|
||||
#[serde(with = "ssz_types::serde_utils::hex_var_list")]
|
||||
pub extra_data: VariableList<u8, T::MaxExtraDataBytes>,
|
||||
pub base_fee_per_gas: Hash256,
|
||||
#[serde(with = "eth2_serde_utils::quoted_u256")]
|
||||
pub base_fee_per_gas: Uint256,
|
||||
pub block_hash: Hash256,
|
||||
pub transactions_root: Hash256,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user