Unit tests: consistent use of Token units versus TokenWei units - #82
Merged
Conversation
Contributor
Author
benjaminbollen
approved these changes
Jan 3, 2018
benjaminbollen
left a comment
Contributor
There was a problem hiding this comment.
Looks good!
only minor comment is to change the CHANGELOG to under v0.9.2
|
|
||
| Detailed changelog: | ||
|
|
||
| - Unit tests: Consistent use of Token units versus TokenWei units ([openst-protocol#1](https://github.com/OpenSTFoundation/openst-protocol/pull/82)) |
Contributor
There was a problem hiding this comment.
can already be under new header v0.9.2
|
|
||
| it('fails to burn by openSTProtocol if msg.value != 0', async () => { | ||
| await Utils.expectThrow(token.burn(beneficiary, ST1, { from: openSTProtocol, value: 1 })); | ||
| const amountBT = new BigNumber(web3.toWei(1, "ether")); |
| // call block number is one less than send block number | ||
| unlockHeight = redeemReturns[1].plus(1) | ||
| var checkRedemptionIntentHash = await openSTUtility.hashRedemptionIntent.call(uuidSTPrime, redeemer, 2, redeemSTP, unlockHeight); | ||
| result = await openSTUtility.redeemSTPrime(redeemSTP.toNumber(), { from: redeemer, value: redeemSTP }); |
Contributor
There was a problem hiding this comment.
on redeemSTP.toNumber() why convert it to a Number? (similarly on L 377, L385)
Contributor
Author
There was a problem hiding this comment.
Although it works but you are right it's not required.
toNumber() is required while comparing values while asserting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR for consistent use of Token units versus TokenWei units: review and correct unit tests for correct naming and use of Token vs TokenWei (ST vs STWei, BT vs BTWei, UT vs UTWei)