-
Notifications
You must be signed in to change notification settings - Fork 215
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
(Fix) Add address to whitelist in manage screen #672
Conversation
Pull Request Test Coverage Report for Build 1644
💛 - Coveralls |
@@ -152,15 +152,12 @@ export class WhitelistInputBlock extends React.Component { | |||
/> | |||
</div> | |||
</div> | |||
{whitelistElements && whitelistElements.map(e => | |||
{whitelist.length > 0 && whitelist.map((item, index) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure whitelist.length > 0
is not necessary, React will just ignore the resulting empty array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/stores/TierStore.js
Outdated
const currentAddress = curr.addr.toLowerCase() | ||
const previousAddress = prev.addr.toLowerCase() | ||
|
||
return currentAddress > previousAddress ? -1 : currentAddress === previousAddress ? curr.stored ? 1 : -1 : 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
let whitelist = this.tiers[crowdsaleNum].whitelist.slice() | ||
whitelist[whitelistNum].deleted = true | ||
this.setTierProperty(whitelist, 'whitelist', crowdsaleNum) | ||
const removedItem = this.tiers[crowdsaleNum].whitelist.splice(whitelistNum, 1)[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs tests too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, and added test for the other modified/created methods
@vbaranov conflict resolution done |
@vbaranov Can we merge this? |
@fvictorio formally yes, but if you could give me some hours, I'll appreciate it. I plan to test it too soon. |
Sure, no problem. I just want to merge as many PRs as possible so that I can start working on #536 with less risk. |
Closes #596
In this PR
whitelistElements
collection was removed and only useswhitelist
.Style was applied for the whitelist elements in the manage screen, so the user can recognize what addresses are being modified, added or untouched.
Things to fix that I found:
min
andmax
values are not being checked, so a user can enter amin
value greater thanmax
. The tx will fail, but it won't be clear why.