Merge branch 'unstable' of https://github.com/sigp/lighthouse into eip4844

This commit is contained in:
realbigsean
2022-11-04 13:23:55 -04:00
26 changed files with 37 additions and 77 deletions

View File

@@ -10,7 +10,7 @@ where
S: Serializer,
{
let mut hex_string: String = "0x".to_string();
hex_string.push_str(&hex::encode(&bytes));
hex_string.push_str(&hex::encode(bytes));
serializer.serialize_str(&hex_string)
}

View File

@@ -39,7 +39,7 @@ impl<'de> Visitor<'de> for QuantityVisitor {
hex::decode(&format!("0{}", stripped))
.map_err(|e| de::Error::custom(format!("invalid hex ({:?})", e)))
} else {
hex::decode(&stripped).map_err(|e| de::Error::custom(format!("invalid hex ({:?})", e)))
hex::decode(stripped).map_err(|e| de::Error::custom(format!("invalid hex ({:?})", e)))
}
}
}

View File

@@ -368,7 +368,7 @@ mod test {
fn context_size() {
assert_eq!(
mem::size_of::<HalfNode>(),
232,
224,
"Halfnode size should be as expected"
);
}

View File

@@ -40,7 +40,7 @@ impl ConfigAndPreset {
let extra_fields = get_extra_fields(spec);
if spec.bellatrix_fork_epoch.is_some()
|| fork_name == None
|| fork_name.is_none()
|| fork_name == Some(ForkName::Merge)
{
let bellatrix_preset = BellatrixPreset::from_chain_spec::<T>(spec);
@@ -65,7 +65,7 @@ impl ConfigAndPreset {
/// Get a hashmap of constants to add to the `PresetAndConfig`
pub fn get_extra_fields(spec: &ChainSpec) -> HashMap<String, Value> {
let hex_string = |value: &[u8]| format!("0x{}", hex::encode(&value)).into();
let hex_string = |value: &[u8]| format!("0x{}", hex::encode(value)).into();
let u32_hex = |v: u32| hex_string(&v.to_le_bytes());
let u8_hex = |v: u8| hex_string(&v.to_le_bytes());
hashmap! {

View File

@@ -27,7 +27,7 @@ impl Graffiti {
impl fmt::Display for Graffiti {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", eth2_serde_utils::hex::encode(&self.0))
write!(f, "{}", eth2_serde_utils::hex::encode(self.0))
}
}