Skip to content

Commit 9d2df51

Browse files
authored
feat!: remove old history content value types and migration (#1708)
1 parent 4d863f2 commit 9d2df51

File tree

18 files changed

+19
-1167
lines changed

18 files changed

+19
-1167
lines changed

crates/ethportal-api/src/types/content_value/history.rs

Lines changed: 0 additions & 83 deletions
This file was deleted.

crates/ethportal-api/src/types/content_value/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::{
66
pub mod beacon;
77
pub mod constants;
88
pub mod error;
9-
pub mod history;
109
pub mod history_new;
1110
pub mod state;
1211

crates/ethportal-api/src/types/execution/header_with_proof.rs

Lines changed: 0 additions & 219 deletions
This file was deleted.

crates/ethportal-api/src/types/execution/header_with_proof_new.rs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,19 +252,22 @@ pub fn build_block_proof_historical_summaries(
252252
#[cfg(test)]
253253
#[allow(clippy::unwrap_used)]
254254
mod tests {
255-
use std::fs;
256-
257255
use serde_json::Value;
258256
use serde_yaml::Value as YamlValue;
259257
use ssz::Decode;
260258

261259
use super::*;
262-
use crate::utils::bytes::{hex_decode, hex_encode};
260+
use crate::{
261+
test_utils::read_file_from_tests_submodule,
262+
utils::bytes::{hex_decode, hex_encode},
263+
};
263264

264265
#[test_log::test]
265266
fn decode_encode_headers_with_proof() {
266-
let file =
267-
fs::read_to_string("../validation/src/assets/fluffy/1000001-1000010.json").unwrap();
267+
let file = read_file_from_tests_submodule(
268+
"tests/mainnet/history/headers_with_proof/1000001-1000010.json",
269+
)
270+
.unwrap();
268271
let json: Value = serde_json::from_str(&file).unwrap();
269272
let hwps = json.as_object().unwrap();
270273
for (block_number, obj) in hwps {
@@ -282,9 +285,17 @@ mod tests {
282285
#[case("14764013")]
283286
#[case("15537392")]
284287
#[case("15537393")]
288+
#[case("15539558")]
289+
#[case("15547621")]
290+
#[case("15555729")]
291+
#[case("17034870")]
292+
#[case("17042287")]
293+
#[case("17062257")]
285294
fn decode_encode_more_headers_with_proofs(#[case] filename: &str) {
286-
let file = fs::read_to_string(format!("../validation/src/assets/fluffy/{filename}.yaml",))
287-
.unwrap();
295+
let file = read_file_from_tests_submodule(format!(
296+
"tests/mainnet/history/headers_with_proof/{filename}.yaml"
297+
))
298+
.unwrap();
288299
let yaml: serde_yaml::Value = serde_yaml::from_str(&file).unwrap();
289300
let actual_hwp = yaml.get("content_value").unwrap().as_str().unwrap();
290301
let hwp = HeaderWithProof::from_ssz_bytes(&hex_decode(actual_hwp).unwrap()).unwrap();

crates/ethportal-api/src/types/execution/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pub mod accumulator;
22
pub mod block_body;
33
pub mod header;
4-
pub mod header_with_proof;
54
pub mod header_with_proof_new;
65
pub mod receipts;
76
pub mod transaction;

0 commit comments

Comments
 (0)