Feat/multiplex/v2 (#263)
* Refactor Multiplex into multiple files * Pull UniswapV3 into separate file * Add support for multihop nested within batch sell * Add useSelfBalance and recipient to _fillRfqOrder * Expose onlySelf variant in UniswapV3Feature for Multiplex * Add useSelfBalance and recipient to _transformERC20 * Add support for proportional fill amounts in batchSell * Comments and renaming * Unit tests * Use caps for immutables * Rename taker -> recipient in TransformContext and SettleOrderInfo * lint * Address nits * Swallow reverts for LiquidityProvider and UniswapV2 batch sells * Address spot-check findings (#279) * Check didSucceed in _callWithOptionalBooleanResult * Add takerToken=ETH support to OtcOrdersFeature (#287) * Add takerToken=ETH support to OtcOrdersFeature * Add batchFillTakerSignedOtcOrders * Add support for OTC to Multiplex * Address PR feedback * Update TransformERC20Feature (#303) * remove multiplex_utils * Update changelog * unbreak tests
This commit is contained in:
@@ -156,14 +156,23 @@ export class NativeOrdersTestEnvironment {
|
||||
unwrapWeth: boolean = false,
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
await this.prepareBalancesForOrdersAsync([order], taker);
|
||||
return this.zeroEx
|
||||
.fillOtcOrder(
|
||||
order,
|
||||
await order.getSignatureWithProviderAsync(this._env.provider),
|
||||
new BigNumber(fillAmount),
|
||||
unwrapWeth,
|
||||
)
|
||||
.awaitTransactionSuccessAsync({ from: taker });
|
||||
if (unwrapWeth) {
|
||||
return this.zeroEx
|
||||
.fillOtcOrderForEth(
|
||||
order,
|
||||
await order.getSignatureWithProviderAsync(this._env.provider),
|
||||
new BigNumber(fillAmount),
|
||||
)
|
||||
.awaitTransactionSuccessAsync({ from: taker });
|
||||
} else {
|
||||
return this.zeroEx
|
||||
.fillOtcOrder(
|
||||
order,
|
||||
await order.getSignatureWithProviderAsync(this._env.provider),
|
||||
new BigNumber(fillAmount),
|
||||
)
|
||||
.awaitTransactionSuccessAsync({ from: taker });
|
||||
}
|
||||
}
|
||||
|
||||
public async fillTakerSignedOtcOrderAsync(
|
||||
@@ -173,14 +182,23 @@ export class NativeOrdersTestEnvironment {
|
||||
unwrapWeth: boolean = false,
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
await this.prepareBalancesForOrdersAsync([order], taker);
|
||||
return this.zeroEx
|
||||
.fillTakerSignedOtcOrder(
|
||||
order,
|
||||
await order.getSignatureWithProviderAsync(this._env.provider),
|
||||
await order.getSignatureWithProviderAsync(this._env.provider, SignatureType.EthSign, taker),
|
||||
unwrapWeth,
|
||||
)
|
||||
.awaitTransactionSuccessAsync({ from: origin });
|
||||
if (unwrapWeth) {
|
||||
return this.zeroEx
|
||||
.fillTakerSignedOtcOrderForEth(
|
||||
order,
|
||||
await order.getSignatureWithProviderAsync(this._env.provider),
|
||||
await order.getSignatureWithProviderAsync(this._env.provider, SignatureType.EthSign, taker),
|
||||
)
|
||||
.awaitTransactionSuccessAsync({ from: origin });
|
||||
} else {
|
||||
return this.zeroEx
|
||||
.fillTakerSignedOtcOrder(
|
||||
order,
|
||||
await order.getSignatureWithProviderAsync(this._env.provider),
|
||||
await order.getSignatureWithProviderAsync(this._env.provider, SignatureType.EthSign, taker),
|
||||
)
|
||||
.awaitTransactionSuccessAsync({ from: origin });
|
||||
}
|
||||
}
|
||||
|
||||
public async fillOtcOrderWithEthAsync(
|
||||
|
||||
Reference in New Issue
Block a user