Move Forwarder test to integrations; update to use new framework

This commit is contained in:
Michael Zhu
2019-10-22 11:47:16 -07:00
parent db9be73fec
commit 3d56c06ff3
16 changed files with 953 additions and 1238 deletions

View File

@@ -41,6 +41,18 @@ export class LocalBalanceStore extends BalanceStore {
this._balances.eth[senderAddress] = this._balances.eth[senderAddress].minus(amount);
}
/**
* Converts some amount of the ETH balance of an address to WETH balance to simulate wrapping ETH.
* @param senderAddress Address whose ETH to wrap.
* @param amount Amount to wrap.
*/
public wrapEth(senderAddress: string, wethAddress: string, amount: Numberish): void {
this._balances.eth[senderAddress] = this._balances.eth[senderAddress].minus(amount);
_.update(this._balances.erc20, [senderAddress, wethAddress], balance =>
(balance || constants.ZERO_AMOUNT).plus(amount),
);
}
/**
* Sends ETH from `fromAddress` to `toAddress`.
* @param fromAddress Sender of ETH.