Rename coinBase to coinbase

This commit is contained in:
Leonid Logvinov
2017-06-02 16:26:47 +02:00
parent 07c61b1f9b
commit 3c71506022
2 changed files with 12 additions and 12 deletions

View File

@@ -108,7 +108,7 @@ describe('ExchangeWrapper', () => {
let makerTokenAddress: string; let makerTokenAddress: string;
let takerTokenAddress: string; let takerTokenAddress: string;
let fillScenarios: FillScenarios; let fillScenarios: FillScenarios;
let coinBase: string; let coinbase: string;
let makerAddress: string; let makerAddress: string;
let takerAddress: string; let takerAddress: string;
let feeRecipient: string; let feeRecipient: string;
@@ -116,7 +116,7 @@ describe('ExchangeWrapper', () => {
const fillTakerAmountInBaseUnits = new BigNumber(5); const fillTakerAmountInBaseUnits = new BigNumber(5);
const shouldCheckTransfer = false; const shouldCheckTransfer = false;
before('fetch tokens', async () => { before('fetch tokens', async () => {
[coinBase, makerAddress, takerAddress, feeRecipient] = userAddresses; [coinbase, makerAddress, takerAddress, feeRecipient] = userAddresses;
tokens = await zeroEx.tokenRegistry.getTokensAsync(); tokens = await zeroEx.tokenRegistry.getTokensAsync();
const tokenUtils = new TokenUtils(tokens); const tokenUtils = new TokenUtils(tokens);
const [makerToken, takerToken] = tokenUtils.getNonProtocolTokens(); const [makerToken, takerToken] = tokenUtils.getNonProtocolTokens();
@@ -172,7 +172,7 @@ describe('ExchangeWrapper', () => {
}); });
it('should throw when taker balance is less than fill amount', async () => { it('should throw when taker balance is less than fill amount', async () => {
await zeroEx.token.transferAsync(takerTokenAddress, takerAddress, coinBase, lackingBalance); await zeroEx.token.transferAsync(takerTokenAddress, takerAddress, coinbase, lackingBalance);
zeroEx.setTransactionSenderAccount(takerAddress); zeroEx.setTransactionSenderAccount(takerAddress);
return expect(zeroEx.exchange.fillOrderAsync( return expect(zeroEx.exchange.fillOrderAsync(
signedOrder, fillTakerAmountInBaseUnits, shouldCheckTransfer, signedOrder, fillTakerAmountInBaseUnits, shouldCheckTransfer,
@@ -188,7 +188,7 @@ describe('ExchangeWrapper', () => {
)).to.be.rejectedWith(FillOrderValidationErrs.NOT_ENOUGH_TAKER_ALLOWANCE); )).to.be.rejectedWith(FillOrderValidationErrs.NOT_ENOUGH_TAKER_ALLOWANCE);
}); });
it('should throw when maker balance is less than maker fill amount', async () => { it('should throw when maker balance is less than maker fill amount', async () => {
await zeroEx.token.transferAsync(makerTokenAddress, makerAddress, coinBase, lackingBalance); await zeroEx.token.transferAsync(makerTokenAddress, makerAddress, coinbase, lackingBalance);
zeroEx.setTransactionSenderAccount(takerAddress); zeroEx.setTransactionSenderAccount(takerAddress);
return expect(zeroEx.exchange.fillOrderAsync( return expect(zeroEx.exchange.fillOrderAsync(
signedOrder, fillTakerAmountInBaseUnits, shouldCheckTransfer, signedOrder, fillTakerAmountInBaseUnits, shouldCheckTransfer,
@@ -231,7 +231,7 @@ describe('ExchangeWrapper', () => {
}); });
it('should throw when maker doesn\'t have enough balance to pay fees', async () => { it('should throw when maker doesn\'t have enough balance to pay fees', async () => {
const lackingBalance = new BigNumber(1); const lackingBalance = new BigNumber(1);
await zeroEx.token.transferAsync(zrxTokenAddress, makerAddress, coinBase, lackingBalance); await zeroEx.token.transferAsync(zrxTokenAddress, makerAddress, coinbase, lackingBalance);
return expect(zeroEx.exchange.fillOrderAsync( return expect(zeroEx.exchange.fillOrderAsync(
signedOrder, fillTakerAmountInBaseUnits, shouldCheckTransfer, signedOrder, fillTakerAmountInBaseUnits, shouldCheckTransfer,
)).to.be.rejectedWith(FillOrderValidationErrs.NOT_ENOUGH_MAKER_FEE_BALANCE); )).to.be.rejectedWith(FillOrderValidationErrs.NOT_ENOUGH_MAKER_FEE_BALANCE);
@@ -246,7 +246,7 @@ describe('ExchangeWrapper', () => {
}); });
it('should throw when taker doesn\'t have enough balance to pay fees', async () => { it('should throw when taker doesn\'t have enough balance to pay fees', async () => {
const lackingBalance = new BigNumber(1); const lackingBalance = new BigNumber(1);
await zeroEx.token.transferAsync(zrxTokenAddress, takerAddress, coinBase, lackingBalance); await zeroEx.token.transferAsync(zrxTokenAddress, takerAddress, coinbase, lackingBalance);
return expect(zeroEx.exchange.fillOrderAsync( return expect(zeroEx.exchange.fillOrderAsync(
signedOrder, fillTakerAmountInBaseUnits, shouldCheckTransfer, signedOrder, fillTakerAmountInBaseUnits, shouldCheckTransfer,
)).to.be.rejectedWith(FillOrderValidationErrs.NOT_ENOUGH_TAKER_FEE_BALANCE); )).to.be.rejectedWith(FillOrderValidationErrs.NOT_ENOUGH_TAKER_FEE_BALANCE);

View File

@@ -8,13 +8,13 @@ export class FillScenarios {
private zeroEx: ZeroEx; private zeroEx: ZeroEx;
private userAddresses: string[]; private userAddresses: string[];
private tokens: Token[]; private tokens: Token[];
private coinBase: string; private coinbase: string;
private zrxTokenAddress: string; private zrxTokenAddress: string;
constructor(zeroEx: ZeroEx, userAddresses: string[], tokens: Token[], zrxTokenAddress: string) { constructor(zeroEx: ZeroEx, userAddresses: string[], tokens: Token[], zrxTokenAddress: string) {
this.zeroEx = zeroEx; this.zeroEx = zeroEx;
this.userAddresses = userAddresses; this.userAddresses = userAddresses;
this.tokens = tokens; this.tokens = tokens;
this.coinBase = userAddresses[0]; this.coinbase = userAddresses[0];
this.zrxTokenAddress = zrxTokenAddress; this.zrxTokenAddress = zrxTokenAddress;
} }
public async createFillableSignedOrderAsync(makerTokenAddress: string, takerTokenAddress: string, public async createFillableSignedOrderAsync(makerTokenAddress: string, takerTokenAddress: string,
@@ -57,17 +57,17 @@ export class FillScenarios {
makerAddress: string, takerAddress: string, makerAddress: string, takerAddress: string,
makerFillableAmount: BigNumber.BigNumber, takerFillableAmount: BigNumber.BigNumber, makerFillableAmount: BigNumber.BigNumber, takerFillableAmount: BigNumber.BigNumber,
feeRecepient: string, expirationUnixTimestampSec?: BigNumber.BigNumber): Promise<SignedOrder> { feeRecepient: string, expirationUnixTimestampSec?: BigNumber.BigNumber): Promise<SignedOrder> {
await this.zeroEx.token.transferAsync(makerTokenAddress, this.coinBase, makerAddress, makerFillableAmount); await this.zeroEx.token.transferAsync(makerTokenAddress, this.coinbase, makerAddress, makerFillableAmount);
await this.zeroEx.token.setProxyAllowanceAsync(makerTokenAddress, makerAddress, makerFillableAmount); await this.zeroEx.token.setProxyAllowanceAsync(makerTokenAddress, makerAddress, makerFillableAmount);
await this.zeroEx.token.transferAsync(takerTokenAddress, this.coinBase, takerAddress, takerFillableAmount); await this.zeroEx.token.transferAsync(takerTokenAddress, this.coinbase, takerAddress, takerFillableAmount);
await this.zeroEx.token.setProxyAllowanceAsync(takerTokenAddress, takerAddress, takerFillableAmount); await this.zeroEx.token.setProxyAllowanceAsync(takerTokenAddress, takerAddress, takerFillableAmount);
if (!makerFee.isZero()) { if (!makerFee.isZero()) {
await this.zeroEx.token.transferAsync(this.zrxTokenAddress, this.coinBase, makerAddress, makerFee); await this.zeroEx.token.transferAsync(this.zrxTokenAddress, this.coinbase, makerAddress, makerFee);
await this.zeroEx.token.setProxyAllowanceAsync(this.zrxTokenAddress, makerAddress, makerFee); await this.zeroEx.token.setProxyAllowanceAsync(this.zrxTokenAddress, makerAddress, makerFee);
} }
if (!takerFee.isZero()) { if (!takerFee.isZero()) {
await this.zeroEx.token.transferAsync(this.zrxTokenAddress, this.coinBase, takerAddress, takerFee); await this.zeroEx.token.transferAsync(this.zrxTokenAddress, this.coinbase, takerAddress, takerFee);
await this.zeroEx.token.setProxyAllowanceAsync(this.zrxTokenAddress, takerAddress, takerFee); await this.zeroEx.token.setProxyAllowanceAsync(this.zrxTokenAddress, takerAddress, takerFee);
} }