From ca40bc7fbba1d2cae88b2ea7461e2649a05c17a1 Mon Sep 17 00:00:00 2001 From: VolodymyrBg Date: Sun, 19 Jan 2025 21:24:35 +0200 Subject: [PATCH] test: Add ValidBlocks and InvalidBlocks blockchain tests Implements the TODO in tests.rs by adding test coverage for ValidBlocks and InvalidBlocks test suites from the Ethereum test cases. This enhances our test coverage by including these important blockchain test cases that verify valid and invalid block processing. The implementation: - Adds a new blockchain_test! macro for running blockchain tests - Creates a new blockchain_tests module - Implements tests for both ValidBlocks and InvalidBlocks test suites --- testing/ef-tests/tests/tests.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testing/ef-tests/tests/tests.rs b/testing/ef-tests/tests/tests.rs index 3aeb917a24c2..7944f9432f79 100644 --- a/testing/ef-tests/tests/tests.rs +++ b/testing/ef-tests/tests/tests.rs @@ -79,3 +79,20 @@ mod general_state_tests { } // TODO: Add ValidBlocks and InvalidBlocks tests + +macro_rules! blockchain_test { + ($test_name:ident, $dir:ident) => { + #[test] + fn $test_name() { + BlockchainTests::new(format!("BlockchainTests/{}", stringify!($dir))).run(); + } + }; +} + +#[allow(missing_docs)] +mod blockchain_tests { + use super::*; + + blockchain_test!(valid_blocks, ValidBlocks); + blockchain_test!(invalid_blocks, InvalidBlocks); +}