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

Remove unused constants - Closes #1732 #1768

Merged
merged 6 commits into from Mar 26, 2018

Conversation

ManuGowda
Copy link
Contributor

What was the problem?

Unused constants in Lisk-core

How did I fix it?

Identified the usage of constants in Lisk-core and removed unused constants.

How to test it?

Review checklist

@4miners
Copy link
Contributor

4miners commented Mar 21, 2018

Why comment them instead of remove?

@MaciejBaj MaciejBaj changed the title Remove unused constants Remove unused constants - Closes #1732 Mar 21, 2018
@MaciejBaj MaciejBaj self-assigned this Mar 21, 2018
@ManuGowda
Copy link
Contributor Author

@4miners I am gonna remove it as well, the PR is still in pending, I just wanted to build on jenkins to see if any errors i could find before rising a PR, but I will remove the unused constants and give a PR.

@MaciejBaj
Copy link
Contributor

@ManuGowda you could do it as well also on a branch or what's even better locally. Open PRs when they are ready.

@@ -118,8 +98,6 @@ var constants = {
// Testnet
'da3ed6a45429278bac2666961289ca17ad86595d33b31037615d4b8e8f158bba',
],
numberLength: 100000000,
Copy link

@diego-G diego-G Mar 23, 2018

Choose a reason for hiding this comment

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

numberLength should be renamed, kept and used along our test suites. We already have the same concept named normalizer instead of getting it from constants. I suggest to rename and get it in the test suite from here https://github.com/LiskHQ/lisk/blob/02d35b04afb2384db1e1b4257b0b8d202ea3fda5/test/common/utils/normalizer.js#L17

@@ -83,17 +70,10 @@ var constants = {
dappDeposit: 10000000,
data: 10000000,
},
feeStart: 1,
feeStartVolume: 10000 * 100000000,
fixedPoint: Math.pow(10, 8),
Copy link

@diego-G diego-G Mar 23, 2018

Choose a reason for hiding this comment

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

fixedPoint was used and should be used in here: https://github.com/LiskHQ/lisk/blob/02d35b04afb2384db1e1b4257b0b8d202ea3fda5/schema/swagger.yml#L1102 Also lisk-js uses it in their test suites as a hardcoded value. We need to ping @Tosch110 @shuse2 & @willclarktech once it is settled, suggesting to integrate it as a constant.

@ManuGowda ManuGowda force-pushed the 1732-Remove_unused_helpers_constants_variables branch from 440a2a5 to f8f9608 Compare March 23, 2018 17:12
@MaciejBaj MaciejBaj dismissed diego-G’s stale review March 23, 2018 17:18

Requested changes are made.

@@ -118,8 +99,7 @@ var constants = {
// Testnet
'da3ed6a45429278bac2666961289ca17ad86595d33b31037615d4b8e8f158bba',
],
numberLength: 100000000,
requestLength: 104,
normalizer: 100000000,
Copy link
Contributor

Choose a reason for hiding this comment

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

normalizer means nothing, please use better name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@diego-G @4miners any suggestions for the name?

Copy link
Contributor

Choose a reason for hiding this comment

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

@ManuGowda be creative 😃

Copy link

Choose a reason for hiding this comment

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

normalizer is ok to me. It was like that before

@MaciejBaj MaciejBaj dismissed 4miners’s stale review March 26, 2018 11:09

normalizer was the name that was used before. Let's leave it for now as it is.

@MaciejBaj MaciejBaj merged commit 50626be into 1.0.0 Mar 26, 2018
@MaciejBaj MaciejBaj deleted the 1732-Remove_unused_helpers_constants_variables branch March 26, 2018 11:09
@4miners
Copy link
Contributor

4miners commented Mar 26, 2018

@MaciejBaj In tests, now we added it to constants which is something used globally in our application. It's not that hard to pick proper name.

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.

None yet

5 participants