Repository: unionlabs/union
File: hubble/src/beacon.rs (Rust)

Code before:
    #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
    #[serde(rename_all = "camelCase")]
    pub struct ExecutionPayload {
        #[serde(rename = "parent_hash")]
        pub parent_hash: String,
        #[serde(rename = "fee_recipient")]
        pub fee_recipient: String,
        #[serde(rename = "state_root")]
        pub state_root: String,
        #[serde(rename = "receipts_root")]
        pub receipts_root: String,
        #[serde(rename = "logs_bloom")]
        pub logs_bloom: String,
        #[serde(rename = "prev_randao")]
        pub prev_randao: String,
        #[serde(
            deserialize_with = "deserialize_number_from_string",
            rename = "block_number"
        )]
        pub block_number: i64,
        #[serde(rename = "gas_limit")]
        pub gas_limit: String,
        #[serde(rename = "gas_used")]
        pub gas_used: String,
        pub timestamp: String,
        #[serde(rename = "extra_data")]
        pub extra_data: String,
        #[serde(rename = "base_fee_per_gas")]
        pub base_fee_per_gas: String,
        #[serde(rename = "block_hash")]
        pub block_hash: String,
        pub transactions: Vec<String>,
        pub withdrawals: Vec<Withdrawal>,
        #[serde(rename = "blob_gas_used")]
        pub blob_gas_used: String,
        #[serde(rename = "excess_blob_gas")]
        pub excess_blob_gas: String,
    }

    #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
    #[serde(rename_all = "camelCase")]
    pub struct Withdrawal {
        pub index: String,
        #[serde(rename = "validator_index")]
        pub validator_index: String,
        pub address: String,
        pub amount: String,
    }
}


Review comment (refactor):
two nits, this is a `u64` and we already have this helper in serde_utils if you're willing to bring on that dependency

Code after:
        #[serde(rename = "sync_committee_bits")]
        pub sync_committee_bits: String,
        #[serde(rename = "sync_committee_signature")]
        pub sync_committee_signature: String,
    }

    #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
    #[serde(rename_all = "camelCase")]
    pub struct ExecutionPayload {
        #[serde(rename = "parent_hash")]
        pub parent_hash: String,
        #[serde(rename = "fee_recipient")]
        pub fee_recipient: String,
        #[serde(rename = "state_root")]
        pub state_root: String,
        #[serde(rename = "receipts_root")]
        pub receipts_root: String,
        #[serde(rename = "logs_bloom")]
        pub logs_bloom: String,
        #[serde(rename = "prev_randao")]
        pub prev_randao: String,
        #[serde(
            deserialize_with = "deserialize_number_from_string",
            rename = "block_number"
        )]
        pub block_number: i64,
        #[serde(rename = "gas_limit")]
        pub gas_limit: String,
        #[serde(rename = "gas_used")]
        pub gas_used: String,
        pub timestamp: String,
        #[serde(rename = "extra_data")]
        pub extra_data: String,
        #[serde(rename = "base_fee_per_gas")]
        pub base_fee_per_gas: String,
        #[serde(rename = "block_hash")]
        pub block_hash: String,
        pub transactions: Vec<String>,
        pub withdrawals: Vec<Withdrawal>,
        #[serde(rename = "blob_gas_used")]
        pub blob_gas_used: String,
        #[serde(rename = "excess_blob_gas")]
        pub excess_blob_gas: String,
    }

    #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
    #[serde(rename_all = "camelCase")]
    pub struct Withdrawal {
        pub index: String,
        #[serde(rename = "validator_index")]
        pub validator_index: String,