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

Unit tests: consistent use of Token units versus TokenWei units #82

Merged
merged 7 commits into from
Jan 4, 2018

Conversation

abhayks1
Copy link
Contributor

@abhayks1 abhayks1 commented Jan 3, 2018

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)

@abhayks1 abhayks1 changed the title Gh81/token units Unit tests: consistent use of Token units versus TokenWei units Jan 3, 2018
@abhayks1
Copy link
Contributor Author

abhayks1 commented Jan 3, 2018

#81

Copy link
Contributor

@benjaminbollen benjaminbollen left a 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))
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes Done

@@ -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"));
Copy link
Contributor

Choose a reason for hiding this comment

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

indentation

// 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 });
Copy link
Contributor

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)

Copy link
Contributor Author

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.

@benjaminbollen benjaminbollen merged commit f583816 into develop Jan 4, 2018
@jasonklein jasonklein modified the milestones: v0.9.3, v0.9.2 Mar 27, 2018
@benjaminbollen benjaminbollen deleted the gh81/token_units branch June 4, 2018 14:33
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.

3 participants