Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

fix: Disable quote validation temporarily #259

Merged
merged 1 commit into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions src/services/swap_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,7 @@ export class SwapService {
}

public async calculateSwapQuoteAsync(params: CalculateSwapQuoteParams): Promise<GetSwapQuoteResponse> {
const {
buyAmount,
buyTokenAddress,
sellTokenAddress,
isETHSell,
from,
affiliateAddress,
// tslint:disable-next-line:boolean-naming
skipValidation,
} = params;
const { buyAmount, buyTokenAddress, sellTokenAddress, isETHSell, from, affiliateAddress } = params;
const swapQuote = await this._getMarketBuyOrSellQuoteAsync(params);

const attributedSwapQuote = serviceUtils.attributeSwapQuoteOrders(swapQuote);
Expand Down Expand Up @@ -124,7 +115,9 @@ export class SwapService {
);

let conservativeBestCaseGasEstimate = new BigNumber(worstCaseGas).plus(gasTokenGasCost);
if (!skipValidation && from) {
// Temporarily disable validation
// if (!skipValidation && from) {
if (false) {
// Force a revert error if the takerAddress does not have enough ETH.
const txDataValue = isETHSell
? BigNumber.min(value, await this._web3Wrapper.getBalanceInWeiAsync(from))
Expand Down
2 changes: 1 addition & 1 deletion test/rfqt_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ describe(SUITE_NAME, () => {
},
);
});
it('should fail validation when taker can not actually fill', async () => {
it.skip('should fail validation when taker can not actually fill', async () => {
const wethContract = new WETH9Contract(contractAddresses.etherToken, provider);
await wethContract
.approve(contractAddresses.erc20Proxy, new BigNumber(0))
Expand Down
2 changes: 1 addition & 1 deletion test/swap_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ describe(SUITE_NAME, () => {
},
);
});
it('should throw a validation error if takerAddress cannot complete the quote', async () => {
it.skip('should throw a validation error if takerAddress cannot complete the quote', async () => {
// The taker does not have an allowance
await quoteAndExpectAsync(
{
Expand Down