Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: fix consensus version inconsistency in newTestLedger #5342

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

cce
Copy link
Contributor

@cce cce commented Apr 28, 2023

Summary

While updating a test that uses newTestLedger (formerly known as OpenLedger; a previous version returned a real *Ledger until #2983 changed it to return a mock type *evalTestLedger), I noticed some inconsistency in the consensus version used by newTestLedger where MakeGenesisBlock() is called to use vFuture but later sets evalTestLedger.genesisProto = vCurrent. So this means the evaluator and the blocks it generates after genesis will all use vFuture, but calls to Ledger.GenesisProto() will return vCurrent.

Test Plan

Existing tests should pass; I didn't see any tests fail when I changed this, which is good because it means no tests were relying on this inconsistent mock ledger behavior.

Future work

Future work might include support for passing a custom consensus version to newTestLedger, or replacing its usage everywhere with a real *Ledger-based replacement.

@cce cce requested a review from jannotti April 28, 2023 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants