Skip to content

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

Merged
benjaminbollen merged 7 commits into
developfrom
gh81/token_units
Jan 4, 2018
Merged

Unit tests: consistent use of Token units versus TokenWei units#82
benjaminbollen merged 7 commits into
developfrom
gh81/token_units

Conversation

@abhayks1

@abhayks1 abhayks1 commented Jan 3, 2018

Copy link
Copy Markdown
Contributor

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

abhayks1 commented Jan 3, 2018

Copy link
Copy Markdown
Contributor Author

#81

@benjaminbollen benjaminbollen left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread CHANGELOG.md Outdated

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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changes Done

Comment thread test/BrandedToken.js Outdated

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

indentation

Comment thread 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 });

Copy link
Copy Markdown
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
Copy Markdown
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