Remove PLP VIP path from EP swap quote consumer (#36)
This commit is contained in:
parent
d2018f07a2
commit
8c87a77faa
@ -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",
|
"version": "5.1.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@ -34,7 +34,7 @@ import { getSwapMinBuyAmount } from './utils';
|
|||||||
|
|
||||||
// tslint:disable-next-line:custom-no-magic-numbers
|
// tslint:disable-next-line:custom-no-magic-numbers
|
||||||
const MAX_UINT256 = new BigNumber(2).pow(256).minus(1);
|
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 {
|
export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase {
|
||||||
public readonly provider: ZeroExProvider;
|
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.
|
// Build up the transforms.
|
||||||
const transforms = [];
|
const transforms = [];
|
||||||
if (isFromETH) {
|
if (isFromETH) {
|
||||||
|
@ -377,7 +377,7 @@ describe('ExchangeProxySwapQuoteConsumer', () => {
|
|||||||
INTERMEDIATE_TOKEN,
|
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 = {
|
const quote = {
|
||||||
...getRandomSellQuote(),
|
...getRandomSellQuote(),
|
||||||
orders: [
|
orders: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user