-
Notifications
You must be signed in to change notification settings - Fork 31
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
Unit tests: consistent use of Token units versus TokenWei units #82
Conversation
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.
Looks good!
only minor comment is to change the CHANGELOG to under v0.9.2
CHANGELOG.md
Outdated
@@ -33,6 +33,7 @@ experience to build mainstream applications on Ethereum. | |||
|
|||
Detailed changelog: | |||
|
|||
- Unit tests: Consistent use of Token units versus TokenWei units ([openst-protocol#1](https://github.com/OpenSTFoundation/openst-protocol/pull/82)) |
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.
can already be under new header v0.9.2
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.
Changes Done
test/BrandedToken.js
Outdated
@@ -97,7 +97,8 @@ contract('BrandedToken', function(accounts) { | |||
}) | |||
|
|||
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")); |
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.
indentation
test/OpenSTUtility.js
Outdated
// 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 }); |
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.
on redeemSTP.toNumber()
why convert it to a Number? (similarly on L 377, L385)
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.
Although it works but you are right it's not required.
toNumber() is required while comparing values while asserting.
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)