aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-09-05 01:08:14 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-09-05 01:08:14 +0800
commitc9e490bdaec53e3a93b5da8daaaf0b1d87d9de76 (patch)
tree49aa1f687e3b0727ff9a00815848c92cb64311f3 /test
parent6325a038188293658ad3d209cb95a2741911f5b9 (diff)
downloaddexon-sol-tools-c9e490bdaec53e3a93b5da8daaaf0b1d87d9de76.tar
dexon-sol-tools-c9e490bdaec53e3a93b5da8daaaf0b1d87d9de76.tar.gz
dexon-sol-tools-c9e490bdaec53e3a93b5da8daaaf0b1d87d9de76.tar.bz2
dexon-sol-tools-c9e490bdaec53e3a93b5da8daaaf0b1d87d9de76.tar.lz
dexon-sol-tools-c9e490bdaec53e3a93b5da8daaaf0b1d87d9de76.tar.xz
dexon-sol-tools-c9e490bdaec53e3a93b5da8daaaf0b1d87d9de76.tar.zst
dexon-sol-tools-c9e490bdaec53e3a93b5da8daaaf0b1d87d9de76.zip
Implement zeroEx.awaitTransactionMined
Diffstat (limited to 'test')
-rw-r--r--test/exchange_wrapper_test.ts8
-rw-r--r--test/utils/blockchain_lifecycle.ts3
2 files changed, 4 insertions, 7 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts
index 15e957ee1..99e61a751 100644
--- a/test/exchange_wrapper_test.ts
+++ b/test/exchange_wrapper_test.ts
@@ -205,7 +205,7 @@ describe('ExchangeWrapper', () => {
);
const txHash = await zeroEx.exchange.fillOrderAsync(
signedOrder, fillTakerAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress);
- await blockchainLifecycle.waitUntilMinedAsync(txHash);
+ await zeroEx.awaitTransactionMined(txHash);
expect(await zeroEx.token.getBalanceAsync(zrxTokenAddress, feeRecipient))
.to.be.bignumber.equal(makerFee.plus(takerFee));
});
@@ -246,7 +246,7 @@ describe('ExchangeWrapper', () => {
it('should successfully fill multiple orders', async () => {
const txHash = await zeroEx.exchange.batchFillOrdersAsync(
orderFillBatch, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress);
- await blockchainLifecycle.waitUntilMinedAsync(txHash);
+ await zeroEx.awaitTransactionMined(txHash);
const filledAmount = await zeroEx.exchange.getFilledTakerAmountAsync(signedOrderHashHex);
const anotherFilledAmount = await zeroEx.exchange.getFilledTakerAmountAsync(anotherOrderHashHex);
expect(filledAmount).to.be.bignumber.equal(fillTakerAmount);
@@ -282,7 +282,7 @@ describe('ExchangeWrapper', () => {
const txHash = await zeroEx.exchange.fillOrdersUpToAsync(
signedOrders, fillUpToAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress,
);
- await blockchainLifecycle.waitUntilMinedAsync(txHash);
+ await zeroEx.awaitTransactionMined(txHash);
const filledAmount = await zeroEx.exchange.getFilledTakerAmountAsync(signedOrderHashHex);
const anotherFilledAmount = await zeroEx.exchange.getFilledTakerAmountAsync(anotherOrderHashHex);
expect(filledAmount).to.be.bignumber.equal(fillableAmount);
@@ -316,7 +316,7 @@ describe('ExchangeWrapper', () => {
describe('successful cancels', () => {
it('should cancel an order', async () => {
const txHash = await zeroEx.exchange.cancelOrderAsync(signedOrder, cancelAmount);
- await blockchainLifecycle.waitUntilMinedAsync(txHash);
+ await zeroEx.awaitTransactionMined(txHash);
const cancelledAmount = await zeroEx.exchange.getCanceledTakerAmountAsync(orderHashHex);
expect(cancelledAmount).to.be.bignumber.equal(cancelAmount);
});
diff --git a/test/utils/blockchain_lifecycle.ts b/test/utils/blockchain_lifecycle.ts
index b4f742e63..50eb57b95 100644
--- a/test/utils/blockchain_lifecycle.ts
+++ b/test/utils/blockchain_lifecycle.ts
@@ -17,7 +17,4 @@ export class BlockchainLifecycle {
throw new Error(`Snapshot with id #${this.snapshotId} failed to revert`);
}
}
- public async waitUntilMinedAsync(txHash: string): Promise<void> {
- return undefined;
- }
}