Skip to content

chain-impl-mockchain: use more idiomatic builder-style APIs #533

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eugene-babichenko
Copy link
Contributor

No description provided.

@eugene-babichenko eugene-babichenko requested a review from a team February 24, 2021 20:58
@eugene-babichenko eugene-babichenko self-assigned this Feb 24, 2021
@eugene-babichenko eugene-babichenko changed the title make ScenarioBuilder consume self for more convenient chaining chain-impl-mockchain: use more idiomatic builder-style APIs Feb 24, 2021
@@ -90,7 +90,7 @@ pub fn no_tax() {

fn verify_distribute_rewards(
total_reward: u64,
stake_pool_builder: &mut StakePoolDefBuilder,
Copy link
Contributor

Choose a reason for hiding this comment

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

OK, this was clearly wrong...

self.with_date(parent.block_date());
self.with_chain_length(parent.chain_length());
self
pub fn with_parent(self, parent: &Header) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you describe the benefits of changing this? Both styles have their own advantages.

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.

2 participants