Skip to content

Improve Block Production Unit Tests #17508

@mh0lt

Description

@mh0lt

Rationale

In testing #17363 it seems like we missed this becuase we don't have a unit test which covers internal block state. More generally I think we don't have enough unit tests for the mining flow and for its use via the engine_api in particular.

I think this a just a legacy of the fact that most of the base blockchain unit tests where writtent before the engine api existed and therefor drive the flow by using a Mock Sentry.

Now we have a EngineAPITester I think we can refactor some or all of the tests to use this api and for some of them use the EngineAPI FCU+Block Builder process to poulate the chain. This will mean that this code gets excercized in our unit tests rather than just during runtime.

I think we also need to add tests for specific scenarios one of which is:

  • Create block whith transaction which access syscontract state.

Implementation

  • Adjust/Duplicate chain tests to populate chains via the engine api
  • Add test to excercize block creation with internal state access
  • Add additional tests as required

Sub-issues

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions