Skip to content

Commit

Permalink
feat!: remove old history content value types and migration
Browse files Browse the repository at this point in the history
  • Loading branch information
morph-dev committed Feb 26, 2025
1 parent e07ffa5 commit 50b81c0
Show file tree
Hide file tree
Showing 18 changed files with 19 additions and 1,167 deletions.
83 changes: 0 additions & 83 deletions crates/ethportal-api/src/types/content_value/history.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/ethportal-api/src/types/content_value/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use crate::{
pub mod beacon;
pub mod constants;
pub mod error;
pub mod history;
pub mod history_new;
pub mod state;

Expand Down
219 changes: 0 additions & 219 deletions crates/ethportal-api/src/types/execution/header_with_proof.rs

This file was deleted.

25 changes: 18 additions & 7 deletions crates/ethportal-api/src/types/execution/header_with_proof_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,21 @@ pub mod ssz_header {
#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod tests {
use std::fs;

use serde_json::Value;
use ssz::Decode;

use super::*;
use crate::utils::bytes::{hex_decode, hex_encode};
use crate::{
test_utils::read_file_from_tests_submodule,
utils::bytes::{hex_decode, hex_encode},
};

#[test_log::test]
fn decode_encode_headers_with_proof() {
let file =
fs::read_to_string("../validation/src/assets/fluffy/1000001-1000010.json").unwrap();
let file = read_file_from_tests_submodule(
"tests/mainnet/history/headers_with_proof/1000001-1000010.json",
)
.unwrap();
let json: Value = serde_json::from_str(&file).unwrap();
let hwps = json.as_object().unwrap();
for (block_number, obj) in hwps {
Expand All @@ -226,9 +229,17 @@ mod tests {
#[case("14764013")]
#[case("15537392")]
#[case("15537393")]
#[case("15539558")]
#[case("15547621")]
#[case("15555729")]
#[case("17034870")]
#[case("17042287")]
#[case("17062257")]
fn decode_encode_more_headers_with_proofs(#[case] filename: &str) {
let file = fs::read_to_string(format!("../validation/src/assets/fluffy/{filename}.yaml",))
.unwrap();
let file = read_file_from_tests_submodule(format!(
"tests/mainnet/history/headers_with_proof/{filename}.yaml"
))
.unwrap();
let yaml: serde_yaml::Value = serde_yaml::from_str(&file).unwrap();
let actual_hwp = yaml.get("content_value").unwrap().as_str().unwrap();
let hwp = HeaderWithProof::from_ssz_bytes(&hex_decode(actual_hwp).unwrap()).unwrap();
Expand Down
1 change: 0 additions & 1 deletion crates/ethportal-api/src/types/execution/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub mod accumulator;
pub mod block_body;
pub mod header;
pub mod header_with_proof;
pub mod header_with_proof_new;
pub mod receipts;
pub mod transaction;
Expand Down
Loading

0 comments on commit 50b81c0

Please sign in to comment.