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

Refactor node builders [ECR-4298] #1800

Merged
merged 10 commits into from
Mar 4, 2020
Merged

Conversation

slowli
Copy link
Contributor

@slowli slowli commented Mar 1, 2020

Overview

This PR refactors node builders in the testkit and the CLI crate, extracting reusable parts into a separate extendable interface.


See: https://jira.bf.local/browse/ECR-4298

@slowli slowli added discussion 💬 The design isn't finalized yet, feel free to participate in the discussion. breaking change ⚠️ API or ABI is changed. testkit cli Changes affecting exonum-cli crate labels Mar 1, 2020
@codecov
Copy link

codecov bot commented Mar 1, 2020

Codecov Report

Merging #1800 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1800      +/-   ##
=========================================
- Coverage    94.8%   94.8%   -0.01%     
=========================================
  Files         269     269              
  Lines       42044   42044              
=========================================
- Hits        39861   39859       -2     
- Misses       2183    2185       +2
Impacted Files Coverage Δ
exonum/src/runtime/mod.rs 100% <ø> (ø) ⬆️
exonum/src/runtime/execution_context.rs 96.48% <ø> (ø) ⬆️
exonum-node/src/events/network.rs 88.14% <0%> (-0.61%) ⬇️
exonum-node/src/sandbox/tests/round_details.rs 98.2% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2430d7...6cbb08e. Read the comment docs.


/// Marker type for artifact deployment without migration support.
#[derive(Debug)]
pub struct Simple(());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just Service?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think Simple / Migrating dichotomy provides a better description than Service / Migrating. (For one, "simple" and "migrating" are both adjectives 🙃)

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, that is my mistake, I meant that we can just write struct Simple instead of struct Simple(()).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted Simple / Migrating to be marker types (i.e., not instantiable).

#[derive(Debug)]
pub struct Migrating(());

/// Deploy specification for a Rust artifact. The spec can include 0 or more instantiated services.
Copy link
Contributor

Choose a reason for hiding this comment

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

Imo zero instead of 0 is more readable.

@slowli slowli merged commit 3438731 into exonum:master Mar 4, 2020
@slowli slowli deleted the refactor-builders branch March 4, 2020 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change ⚠️ API or ABI is changed. cli Changes affecting exonum-cli crate discussion 💬 The design isn't finalized yet, feel free to participate in the discussion. testkit
Development

Successfully merging this pull request may close these issues.

3 participants