Remove PLP VIP path from EP swap quote consumer (#36)

This commit is contained in:
mzhu25 2020-11-13 17:49:30 -08:00 committed by GitHub
parent d2018f07a2
commit 8c87a77faa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 22 deletions

View File

@ -1,4 +1,13 @@
[
{
"version": "5.1.1",
"changes": [
{
"note": "Disable PLP VIP feature in EP swap quote consumer",
"pr": 36
}
]
},
{
"version": "5.1.0",
"changes": [

View File

@ -34,7 +34,7 @@ import { getSwapMinBuyAmount } from './utils';
// tslint:disable-next-line:custom-no-magic-numbers
const MAX_UINT256 = new BigNumber(2).pow(256).minus(1);
const { NULL_ADDRESS, NULL_BYTES, ZERO_AMOUNT } = constants;
const { NULL_ADDRESS, ZERO_AMOUNT } = constants;
export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase {
public readonly provider: ZeroExProvider;
@ -131,26 +131,6 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase {
};
}
if (isDirectSwapCompatible(quote, optsWithDefaults, [ERC20BridgeSource.LiquidityProvider])) {
const target = quote.orders[0].makerAddress;
return {
calldataHexString: this._exchangeProxy
.sellToLiquidityProvider(
isFromETH ? ETH_TOKEN_ADDRESS : sellToken,
isToETH ? ETH_TOKEN_ADDRESS : buyToken,
target,
NULL_ADDRESS,
sellAmount,
minBuyAmount,
NULL_BYTES,
)
.getABIEncodedTransactionData(),
ethAmount: isFromETH ? sellAmount : ZERO_AMOUNT,
toAddress: this._exchangeProxy.address,
allowanceTarget: this.contractAddresses.exchangeProxyAllowanceTarget,
};
}
// Build up the transforms.
const transforms = [];
if (isFromETH) {

View File

@ -377,7 +377,7 @@ describe('ExchangeProxySwapQuoteConsumer', () => {
INTERMEDIATE_TOKEN,
]);
});
it('Uses the `LiquidityProviderFeature` if given a single LiquidityProvider order', async () => {
it.skip('Uses the `LiquidityProviderFeature` if given a single LiquidityProvider order', async () => {
const quote = {
...getRandomSellQuote(),
orders: [