Skip to content

Commit

Permalink
add 10 testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
temaniarpit27 committed Apr 19, 2024
1 parent 02b2e2f commit efa0efc
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 3 deletions.
68 changes: 65 additions & 3 deletions trace_decoder/src/compact/compact_processing_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,9 +1036,11 @@ mod tests {
MPT_TEST_PAYLOAD_1, MPT_TEST_PAYLOAD_2, MPT_TEST_PAYLOAD_3, MPT_TEST_PAYLOAD_4,
MPT_TEST_PAYLOAD_5, MPT_TEST_PAYLOAD_6, SMT_TEST_PAYLOAD_1, SMT_TEST_PAYLOAD_10,
SMT_TEST_PAYLOAD_11, SMT_TEST_PAYLOAD_12, SMT_TEST_PAYLOAD_13, SMT_TEST_PAYLOAD_14,
SMT_TEST_PAYLOAD_15, SMT_TEST_PAYLOAD_2, SMT_TEST_PAYLOAD_3, SMT_TEST_PAYLOAD_4,
SMT_TEST_PAYLOAD_5, SMT_TEST_PAYLOAD_6, SMT_TEST_PAYLOAD_7, SMT_TEST_PAYLOAD_8,
SMT_TEST_PAYLOAD_9,
SMT_TEST_PAYLOAD_15, SMT_TEST_PAYLOAD_16, SMT_TEST_PAYLOAD_17, SMT_TEST_PAYLOAD_18,
SMT_TEST_PAYLOAD_19, SMT_TEST_PAYLOAD_2, SMT_TEST_PAYLOAD_20, SMT_TEST_PAYLOAD_21,
SMT_TEST_PAYLOAD_22, SMT_TEST_PAYLOAD_23, SMT_TEST_PAYLOAD_24, SMT_TEST_PAYLOAD_25,
SMT_TEST_PAYLOAD_3, SMT_TEST_PAYLOAD_4, SMT_TEST_PAYLOAD_5, SMT_TEST_PAYLOAD_6,
SMT_TEST_PAYLOAD_7, SMT_TEST_PAYLOAD_8, SMT_TEST_PAYLOAD_9,
},
};

Expand Down Expand Up @@ -1210,4 +1212,64 @@ mod tests {
init();
SMT_TEST_PAYLOAD_15.parse_and_check_hash_matches_with_debug_smt();
}

#[test]
fn smt_complex_payload_16() {
init();
SMT_TEST_PAYLOAD_16.parse_and_check_hash_matches_with_debug_smt();
}

#[test]
fn smt_complex_payload_17() {
init();
SMT_TEST_PAYLOAD_17.parse_and_check_hash_matches_with_debug_smt();
}

#[test]
fn smt_complex_payload_18() {
init();
SMT_TEST_PAYLOAD_18.parse_and_check_hash_matches_with_debug_smt();
}

#[test]
fn smt_complex_payload_19() {
init();
SMT_TEST_PAYLOAD_19.parse_and_check_hash_matches_with_debug_smt();
}

#[test]
fn smt_complex_payload_20() {
init();
SMT_TEST_PAYLOAD_20.parse_and_check_hash_matches_with_debug_smt();
}

#[test]
fn smt_complex_payload_21() {
init();
SMT_TEST_PAYLOAD_21.parse_and_check_hash_matches_with_debug_smt();
}

#[test]
fn smt_complex_payload_22() {
init();
SMT_TEST_PAYLOAD_22.parse_and_check_hash_matches_with_debug_smt();
}

#[test]
fn smt_complex_payload_23() {
init();
SMT_TEST_PAYLOAD_23.parse_and_check_hash_matches_with_debug_smt();
}

#[test]
fn smt_complex_payload_24() {
init();
SMT_TEST_PAYLOAD_24.parse_and_check_hash_matches_with_debug_smt();
}

#[test]
fn smt_complex_payload_25() {
init();
SMT_TEST_PAYLOAD_25.parse_and_check_hash_matches_with_debug_smt();
}
}
60 changes: 60 additions & 0 deletions trace_decoder/src/compact/complex_test_payloads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,66 @@ pub(crate) const SMT_TEST_PAYLOAD_15: TestProtocolInputAndRoot = TestProtocolInp
root_str: "355baf018ce42aae0df4605ff6274da1c2cd650bee756412dd12e60667794049",
};

// 2407440
pub(crate) const SMT_TEST_PAYLOAD_16: TestProtocolInputAndRoot = TestProtocolInputAndRoot {
byte_str: include_str!("large_test_payloads/smt_test_payload_16.txt"),
root_str: "76aea30744667aa3cd19c4334dc2712faad7b2f172bac7b7c28dfcbebc478ebd",
};

// 2407441
pub(crate) const SMT_TEST_PAYLOAD_17: TestProtocolInputAndRoot = TestProtocolInputAndRoot {
byte_str: include_str!("large_test_payloads/smt_test_payload_17.txt"),
root_str: "92f67ab1267a150e4cffa902b1c320cf981faeb912f6555238ef9b74eb239740",
};

// 2407442
pub(crate) const SMT_TEST_PAYLOAD_18: TestProtocolInputAndRoot = TestProtocolInputAndRoot {
byte_str: include_str!("large_test_payloads/smt_test_payload_18.txt"),
root_str: "0db217a91709087ad310506b8cc3aa50792b64aac30fd6b25b8c16e6737ae903",
};

// 2407443
pub(crate) const SMT_TEST_PAYLOAD_19: TestProtocolInputAndRoot = TestProtocolInputAndRoot {
byte_str: include_str!("large_test_payloads/smt_test_payload_19.txt"),
root_str: "6bd5c187eedbc3243daa823c5388eb1cf07bd0ed4145a0b093f246f8999b257d",
};

// 2407444
pub(crate) const SMT_TEST_PAYLOAD_20: TestProtocolInputAndRoot = TestProtocolInputAndRoot {
byte_str: include_str!("large_test_payloads/smt_test_payload_20.txt"),
root_str: "c881e24833744cc8c627e59b3541da7d3b6b63c869b50a0978e21d0eea0e436f",
};

// 2407445
pub(crate) const SMT_TEST_PAYLOAD_21: TestProtocolInputAndRoot = TestProtocolInputAndRoot {
byte_str: include_str!("large_test_payloads/smt_test_payload_21.txt"),
root_str: "b39c00ddb244617afcc4b11696ad8dbccad125cceb820278d7e75a5074f4e32f",
};

// 2407446
pub(crate) const SMT_TEST_PAYLOAD_22: TestProtocolInputAndRoot = TestProtocolInputAndRoot {
byte_str: include_str!("large_test_payloads/smt_test_payload_22.txt"),
root_str: "659335a0a85a3337f48591ae6e0494d09352d84a7f76f788ad81f20881bbb598",
};

// 2407447
pub(crate) const SMT_TEST_PAYLOAD_23: TestProtocolInputAndRoot = TestProtocolInputAndRoot {
byte_str: include_str!("large_test_payloads/smt_test_payload_23.txt"),
root_str: "787fb7e084b8d93a77147c837c6ef6e8688a550d7a05db28a3cddeb078049f0a",
};

// 2407448
pub(crate) const SMT_TEST_PAYLOAD_24: TestProtocolInputAndRoot = TestProtocolInputAndRoot {
byte_str: include_str!("large_test_payloads/smt_test_payload_24.txt"),
root_str: "fe8ac2c08a3cec9909fc975534a68479807ce6e617fff2103051ad60b4b52f15",
};

// 2407449
pub(crate) const SMT_TEST_PAYLOAD_25: TestProtocolInputAndRoot = TestProtocolInputAndRoot {
byte_str: include_str!("large_test_payloads/smt_test_payload_25.txt"),
root_str: "24047e78097271a4a9d0e3cf69dd9f5273dc050ae866f2bc5c9450b6f99fe049",
};

type ProcessMptCompactPrestateFn = ProcessedCompactPrestateFn<StateTrieExtractionOutput>;

type ProcessSmtCompactPrestateFn = ProcessedCompactPrestateFn<SmtStateTrieExtractionOutput>;
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit efa0efc

Please sign in to comment.