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

Opinionated refactoring of #16415 #16467

Merged

Conversation

mrmr1993
Copy link
Member

This PR builds upon #16415. The commits in this PR apply a series of transformations to make the code more readable and maintainable. Most notably:

  • the pervasive use of the overloaded word 'spec' is removed
  • Account_spec is renamed to Simple_account
  • the Account_spec.t array pattern is encapsulated as a new Simple_ledger module
  • Command_spec is renamed to Simple_command
  • single-letter and non-descriptive variables names have been updated
  • functions and generators that cause side-effects on ledgers are named to record that
  • the edge-case generators are split into their own helper functions
  • transactions now carry a sender_info struct instead of a full account
  • yojson is used in place of s-expression strings masquerading as JSON
  • comment formatting is fixed
  • some inline functions are lifted outside as appropriate.

The goal of this PR is to modify the original so that abstractions and naming guide the reader towards an understanding of mutability, the differences between the various arrays and 'spec' concepts, and more generally the mapping between the test code and the concepts in the rest of the code. The diff with compatible can be found here for reference.

@mrmr1993 mrmr1993 requested a review from a team as a code owner January 15, 2025 02:37
@mrmr1993
Copy link
Member Author

!ci-build-me

@dkijania
Copy link
Member

changes in 2372a97 and caa9b60 also look ok

@dkijania dkijania merged commit 914fe20 into dkijania/transaction_pool_tests Jan 16, 2025
1 check passed
@dkijania dkijania deleted the mrmr1993/transaction_pool_tests branch January 16, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants