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

Create and use new network helper constants #1680

Merged
merged 1 commit into from Feb 1, 2019

Conversation

Projects
3 participants
@wezrule
Copy link
Collaborator

commented Feb 1, 2019

We do a lot of conditional checking like nano::nano_network == nano::nano_networks::nano_test_network I have created some helper constexpr variables which can be used instead e.g nano::is_test_network.

It especially helps in situations like this:
(nano::nano_network == nano::nano_networks::nano_test_network ? nano_test_account : nano::nano_network == nano::nano_networks::nano_beta_network ? nano_beta_account : nano_live_account)

Which becomes:
(nano::is_test_network ? nano_test_account : nano::is_beta_network ? nano_beta_account : nano_live_account)

@wezrule wezrule requested a review from cryptocode Feb 1, 2019

@wezrule wezrule self-assigned this Feb 1, 2019

@cryptocode
Copy link
Collaborator

left a comment

Nice cleanup

@wezrule

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 1, 2019

Thanks!

@wezrule wezrule merged commit d174168 into nanocurrency:master Feb 1, 2019

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

@wezrule wezrule deleted the wezrule:helper_network_constants branch Feb 1, 2019

@argakiig argakiig added this to the V18.0 milestone Feb 1, 2019

@zhyatt zhyatt added this to During RC in V18 Feb 6, 2019

@zhyatt zhyatt moved this from RC2 to CP 3/RC 1 (2018-02-01) in V18 Feb 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.