refactor: rm CallRequest (#6364)

This commit is contained in:
Bjerg
2024-02-09 15:26:01 +01:00
committed by GitHub
parent bbc73d862d
commit 41361d8b41
21 changed files with 377 additions and 453 deletions

View File

@ -100,7 +100,7 @@ pub fn calculate_receipt_root(
return ordered_trie_root_with_encoder(receipts.as_slice(), |r, buf| {
r.encode_inner(buf, false)
})
});
}
ordered_trie_root_with_encoder(receipts, |r, buf| r.encode_inner(buf, false))
@ -144,7 +144,7 @@ pub fn calculate_receipt_root_ref(
return ordered_trie_root_with_encoder(&receipts, |r, buf| {
ReceiptWithBloomRef::from(r).encode_inner(buf, false)
})
});
}
ordered_trie_root_with_encoder(receipts, |r, buf| {
@ -156,7 +156,7 @@ pub fn calculate_receipt_root_ref(
pub fn calculate_ommers_root(ommers: &[Header]) -> B256 {
// Check if `ommers` list is empty
if ommers.is_empty() {
return EMPTY_OMMER_ROOT_HASH
return EMPTY_OMMER_ROOT_HASH;
}
// RLP Encode
let mut ommers_rlp = Vec::new();
@ -627,6 +627,7 @@ mod tests {
let mut genesis_alloc = HashMap::new();
genesis_alloc
.insert(test_addr, GenesisAccount { balance: U256::MAX, ..Default::default() });
let root = state_root_unhashed(genesis_alloc);
assert_eq!(root, expected_root);