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

Abstract tendermint_node #2127

Merged
merged 6 commits into from
Dec 29, 2023
Merged

Abstract tendermint_node #2127

merged 6 commits into from
Dec 29, 2023

Conversation

mariari
Copy link
Member

@mariari mariari commented Nov 8, 2023

Describe your changes

Cleaning up logic pertaining to writing and reading configuration files.

This code has no outward affects, purely for code quality

Indicate on which release or other PRs this topic is based on

0.28.1

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

@mariari mariari force-pushed the mariari/basic-abstraction branch from d0a3e1a to 360a09b Compare November 8, 2023 06:33
@mariari mariari mentioned this pull request Dec 11, 2023
tzemanovic
tzemanovic previously approved these changes Dec 12, 2023
Before the code would bind a variable just for creating a path, we
abstract this out with some functions

Further I started to remove the rather verbose file creation
This was an unused function that simply repeated the logic of the non
async version
Instead of expecting right away and placing a literal string, we can
instead abstract the commonalities of the strings into the error type

This shows off a lot of similarities between write_* functions, that
can now be cleanly abstracted
After the previous commits the write_validator_state and
write_validator_key were basically the same modulo some error
parameters and minor state details
Before the function had 3 phases, that was jumbled into 1 whole.

There was:
1. setup
2. running
3. response handling

Since this structure is rather well defined, and not much data is
shared between these phases, we just turn the function into
dispatching into functions that reprsent each stage
@tzemanovic tzemanovic force-pushed the mariari/basic-abstraction branch from d420ea3 to 4f3bb08 Compare December 22, 2023 12:49
brentstone added a commit that referenced this pull request Dec 26, 2023
* mariari/basic-abstraction:
  changelog: add #2127
  Abstract `tendermint_node::run` into 3 distinct phases
  Abstract out the commanality in write tendermint
  Abstract out file error messages with the error type
  Remove write_validator
  repace manua path with functions. Start abstraction on file creation
brentstone added a commit that referenced this pull request Dec 29, 2023
* origin/mariari/basic-abstraction:
  changelog: add #2127
  Abstract `tendermint_node::run` into 3 distinct phases
  Abstract out the commanality in write tendermint
  Abstract out file error messages with the error type
  Remove write_validator
  repace manua path with functions. Start abstraction on file creation
@brentstone brentstone merged commit 97ea5aa into main Dec 29, 2023
14 of 15 checks passed
@brentstone brentstone deleted the mariari/basic-abstraction branch December 29, 2023 19:37
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.

3 participants