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

Break election components apart #610

Merged
merged 8 commits into from
Nov 18, 2021
Merged

Conversation

brandonfancher
Copy link
Collaborator

@brandonfancher brandonfancher commented Nov 15, 2021

This componentizes and organizes the election UI. After this PR, we can refactor this to depend on subchain queries. And I'm sure we'll find more opportunities for refactoring as we do that.

@brandonfancher brandonfancher temporarily deployed to e2e_tests November 16, 2021 15:50 Inactive
@brandonfancher brandonfancher temporarily deployed to e2e_tests November 16, 2021 16:39 Inactive
@brandonfancher brandonfancher temporarily deployed to e2e_tests November 16, 2021 16:57 Inactive
@brandonfancher brandonfancher temporarily deployed to e2e_tests November 16, 2021 17:55 Inactive
@brandonfancher brandonfancher temporarily deployed to e2e_tests November 16, 2021 18:24 Inactive
@brandonfancher brandonfancher temporarily deployed to e2e_tests November 16, 2021 20:52 Inactive
r.checkpoint("small_election");
r.tester.induct_n(100);
r.checkpoint("inductions");
r.tester.eden_gm.act<actions::electsettime>(s2t("2021-11-16T18:45:00.000"));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like for this to always pull the current datetime so that the election is active after this runs...but haven't figured that out yet. That can be done in a subsequent PR.

Copy link
Collaborator

@sparkplug0025 sparkplug0025 Nov 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: nice touch!

r.tester.induct_n(100);
r.checkpoint("inductions");
r.tester.eden_gm.act<actions::electsettime>(s2t("2021-11-16T18:45:00.000"));
r.tester.start_election(true, 10000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: we can centralize the elections scenario in the current run-full-election.wasm file and use checkpoints to stop the runner where we want. For instance, as opposed of creating this file, just add this start_election to the bottom of the full-election one with a checkpoint:

   r.tester.genesis();
   r.tester.run_election(true, 10000, true);
   r.checkpoint("small_election");
   r.tester.induct_n(100);
   r.checkpoint("inductions");
   r.tester.eden_gm.act<actions::electsettime>(s2t("2021-11-16T18:45:00.000"));
   r.checkpoint("full_election1");
   r.tester.start_election(true, 10000);

If someone wants to avoid the start of the new election they can just do cltester run-full-elections.wasm -c full_election1

I also think since we are using checkpoints we should rename the file from run-full-elections to run-elections, then it's more generic about elections scenarios....

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, cool! That’s awesome!

Copy link
Collaborator

@sparkplug0025 sparkplug0025 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! With the checkpoint suggestion you can remove the new files and cmake changes :)

@brandonfancher brandonfancher temporarily deployed to e2e_tests November 18, 2021 17:28 Inactive
@brandonfancher brandonfancher merged commit 0bff7cd into main Nov 18, 2021
@brandonfancher brandonfancher deleted the bf/election-componentization branch November 18, 2021 18:02
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