This repository has been archived by the owner on Jul 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 465
Conversation
This file contains 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
LogvinovLeon
suggested changes
Jun 26, 2017
|
||
const wethContractAddress = await this.getContractAddressAsync(); | ||
const WETHBalanceInBaseUnits = await this._tokenWrapper.getBalanceAsync(wethContractAddress, withdrawer); | ||
assert.assert(WETHBalanceInBaseUnits.gte(amountInWei), ZeroExError.INSUFFICIENT_WETH_BALANCE_FOR_WITHDRAWL); |
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.
WITHDRAWAL
test/ether_token_wrapper_test.ts
Outdated
const expect = chai.expect; | ||
const blockchainLifecycle = new BlockchainLifecycle(); | ||
|
||
describe.only('EtherTokenWrapper', () => { |
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.
remove only
src/web3_wrapper.ts
Outdated
public toWei(ethAmount: BigNumber.BigNumber): BigNumber.BigNumber { | ||
const balanceWei = this.web3.toWei(ethAmount, 'ether'); | ||
return balanceWei; | ||
} | ||
public async getBalanceInEthAsync(owner: string): Promise<BigNumber.BigNumber> { |
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.
Why do we have this function? Wouldn't it be better if we only operate on wei?
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.
Yeah, that makes sense to me. This was a legacy method ported from OTC. I'll refactor it to return wei.
…test assertions to check if the discrepancy between the existing ETH balance and expected balance is small enough to simply be the gas cost used by the transaction.
…o addWrappedETHSupport # Conflicts: # test/ether_token_wrapper_test.ts
LogvinovLeon
approved these changes
Jun 26, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR:
deposit
andwithdraw
on an Ether Wrapper ERC20 token contract.getBalanceAsync
.