@0x/contracts-exchange: Make marketBuy/SellNoThrow the default.

`@0x/contracts-exchange`: Add more `wrapper_unit_tests` tests.
This commit is contained in:
Lawrence Forman
2019-08-06 15:26:05 -04:00
parent 566e74310a
commit ca28b8f93e
5 changed files with 85 additions and 494 deletions

View File

@@ -133,25 +133,11 @@ export class ExchangeWrapper {
return tx;
}
public async marketSellOrdersAsync(
orders: SignedOrder[],
from: string,
opts: { takerAssetFillAmount: BigNumber },
): Promise<TransactionReceiptWithDecodedLogs> {
const txHash = await this._exchange.marketSellOrders.sendTransactionAsync(
orders,
opts.takerAssetFillAmount,
orders.map(signedOrder => signedOrder.signature),
{ from },
);
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
return tx;
}
public async marketSellOrdersNoThrowAsync(
orders: SignedOrder[],
from: string,
opts: { takerAssetFillAmount: BigNumber; gas?: number },
): Promise<TransactionReceiptWithDecodedLogs> {
const txHash = await this._exchange.marketSellOrdersNoThrow.sendTransactionAsync(
const txHash = await this._exchange.marketSellOrders.sendTransactionAsync(
orders,
opts.takerAssetFillAmount,
orders.map(signedOrder => signedOrder.signature),
@@ -161,25 +147,11 @@ export class ExchangeWrapper {
return tx;
}
public async marketBuyOrdersAsync(
orders: SignedOrder[],
from: string,
opts: { makerAssetFillAmount: BigNumber },
): Promise<TransactionReceiptWithDecodedLogs> {
const txHash = await this._exchange.marketBuyOrders.sendTransactionAsync(
orders,
opts.makerAssetFillAmount,
orders.map(signedOrder => signedOrder.signature),
{ from },
);
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
return tx;
}
public async marketBuyOrdersNoThrowAsync(
orders: SignedOrder[],
from: string,
opts: { makerAssetFillAmount: BigNumber; gas?: number },
): Promise<TransactionReceiptWithDecodedLogs> {
const txHash = await this._exchange.marketBuyOrdersNoThrow.sendTransactionAsync(
const txHash = await this._exchange.marketBuyOrders.sendTransactionAsync(
orders,
opts.makerAssetFillAmount,
orders.map(signedOrder => signedOrder.signature),