aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/exchange_wrapper.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-06 18:40:58 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-06 18:40:58 +0800
commitf7236e7f499f59d883603798cda11d3636b26f4a (patch)
treea4ab3fd3758bc179cb16fea8dfa78700f5d309aa /src/contract_wrappers/exchange_wrapper.ts
parented3d1a8142e6f65480f95df7c3991ae00c757e38 (diff)
downloaddexon-sol-tools-f7236e7f499f59d883603798cda11d3636b26f4a.tar
dexon-sol-tools-f7236e7f499f59d883603798cda11d3636b26f4a.tar.gz
dexon-sol-tools-f7236e7f499f59d883603798cda11d3636b26f4a.tar.bz2
dexon-sol-tools-f7236e7f499f59d883603798cda11d3636b26f4a.tar.lz
dexon-sol-tools-f7236e7f499f59d883603798cda11d3636b26f4a.tar.xz
dexon-sol-tools-f7236e7f499f59d883603798cda11d3636b26f4a.tar.zst
dexon-sol-tools-f7236e7f499f59d883603798cda11d3636b26f4a.zip
Rename senderAccount to senderAddress
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 5c5a46a03..dd06830aa 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -203,11 +203,11 @@ export class ExchangeWrapper extends ContractWrapper {
}
private async validateFillOrderAndThrowIfInvalidAsync(signedOrder: SignedOrder,
fillTakerAmount: BigNumber.BigNumber,
- senderAccount: string): Promise<void> {
+ senderAddress: string): Promise<void> {
if (fillTakerAmount.eq(0)) {
throw new Error(ExchangeContractErrs.ORDER_REMAINING_FILL_AMOUNT_ZERO);
}
- if (signedOrder.taker !== constants.NULL_ADDRESS && signedOrder.taker !== senderAccount) {
+ if (signedOrder.taker !== constants.NULL_ADDRESS && signedOrder.taker !== senderAddress) {
throw new Error(ExchangeContractErrs.TRANSACTION_SENDER_IS_NOT_FILL_ORDER_TAKER);
}
const currentUnixTimestampSec = Date.now() / 1000;
@@ -216,7 +216,7 @@ export class ExchangeWrapper extends ContractWrapper {
}
const zrxTokenAddress = await this.getZRXTokenAddressAsync();
await this.validateFillOrderBalancesAndAllowancesAndThrowIfInvalidAsync(signedOrder, fillTakerAmount,
- senderAccount, zrxTokenAddress);
+ senderAddress, zrxTokenAddress);
const wouldRoundingErrorOccur = await this.isRoundingErrorAsync(
signedOrder.takerTokenAmount, fillTakerAmount, signedOrder.makerTokenAmount,
@@ -237,16 +237,16 @@ export class ExchangeWrapper extends ContractWrapper {
*/
private async validateFillOrderBalancesAndAllowancesAndThrowIfInvalidAsync(signedOrder: SignedOrder,
fillTakerAmount: BigNumber.BigNumber,
- senderAccount: string,
+ senderAddress: string,
zrxTokenAddress: string): Promise<void> {
const makerBalance = await this.tokenWrapper.getBalanceAsync(signedOrder.makerTokenAddress,
signedOrder.maker);
- const takerBalance = await this.tokenWrapper.getBalanceAsync(signedOrder.takerTokenAddress, senderAccount);
+ const takerBalance = await this.tokenWrapper.getBalanceAsync(signedOrder.takerTokenAddress, senderAddress);
const makerAllowance = await this.tokenWrapper.getProxyAllowanceAsync(signedOrder.makerTokenAddress,
signedOrder.maker);
const takerAllowance = await this.tokenWrapper.getProxyAllowanceAsync(signedOrder.takerTokenAddress,
- senderAccount);
+ senderAddress);
// exchangeRate is the price of one maker token denominated in taker tokens
const exchangeRate = signedOrder.takerTokenAmount.div(signedOrder.makerTokenAmount);
@@ -267,11 +267,11 @@ export class ExchangeWrapper extends ContractWrapper {
const makerFeeBalance = await this.tokenWrapper.getBalanceAsync(zrxTokenAddress,
signedOrder.maker);
- const takerFeeBalance = await this.tokenWrapper.getBalanceAsync(zrxTokenAddress, senderAccount);
+ const takerFeeBalance = await this.tokenWrapper.getBalanceAsync(zrxTokenAddress, senderAddress);
const makerFeeAllowance = await this.tokenWrapper.getProxyAllowanceAsync(zrxTokenAddress,
signedOrder.maker);
const takerFeeAllowance = await this.tokenWrapper.getProxyAllowanceAsync(zrxTokenAddress,
- senderAccount);
+ senderAddress);
if (signedOrder.takerFee.greaterThan(takerFeeBalance)) {
throw new Error(ExchangeContractErrs.INSUFFICIENT_TAKER_FEE_BALANCE);