aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers/test/erc721_wrapper_test.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-06-29 21:41:58 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-06-29 22:52:55 +0800
commit5dea432ebf27cf35cb85823c8f7fdc81fe8ae4f6 (patch)
tree88c312292b8b5349efe3317bd1e7f1b32e0387f5 /packages/contract-wrappers/test/erc721_wrapper_test.ts
parent016d82d766d2a15d02b2e93cf2d02a2a59e1feb4 (diff)
downloaddexon-0x-contracts-5dea432ebf27cf35cb85823c8f7fdc81fe8ae4f6.tar
dexon-0x-contracts-5dea432ebf27cf35cb85823c8f7fdc81fe8ae4f6.tar.gz
dexon-0x-contracts-5dea432ebf27cf35cb85823c8f7fdc81fe8ae4f6.tar.bz2
dexon-0x-contracts-5dea432ebf27cf35cb85823c8f7fdc81fe8ae4f6.tar.lz
dexon-0x-contracts-5dea432ebf27cf35cb85823c8f7fdc81fe8ae4f6.tar.xz
dexon-0x-contracts-5dea432ebf27cf35cb85823c8f7fdc81fe8ae4f6.tar.zst
dexon-0x-contracts-5dea432ebf27cf35cb85823c8f7fdc81fe8ae4f6.zip
Set the interval to 0 in awaitTranscationSuccessAsync
Diffstat (limited to 'packages/contract-wrappers/test/erc721_wrapper_test.ts')
-rw-r--r--packages/contract-wrappers/test/erc721_wrapper_test.ts29
1 files changed, 17 insertions, 12 deletions
diff --git a/packages/contract-wrappers/test/erc721_wrapper_test.ts b/packages/contract-wrappers/test/erc721_wrapper_test.ts
index 7d976c210..78bad2915 100644
--- a/packages/contract-wrappers/test/erc721_wrapper_test.ts
+++ b/packages/contract-wrappers/test/erc721_wrapper_test.ts
@@ -64,7 +64,7 @@ describe('ERC721Wrapper', () => {
it('should successfully transfer tokens when sender is an approved address', async () => {
const tokenId = await tokenUtils.mintDummyERC721Async(tokenAddress, ownerAddress);
let txHash = await contractWrappers.erc721Token.setApprovalAsync(tokenAddress, approvedAddress, tokenId);
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const owner = await contractWrappers.erc721Token.getOwnerOfAsync(tokenAddress, tokenId);
expect(owner).to.be.equal(ownerAddress);
txHash = await contractWrappers.erc721Token.transferFromAsync(
@@ -73,7 +73,7 @@ describe('ERC721Wrapper', () => {
approvedAddress,
tokenId,
);
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const newOwner = await contractWrappers.erc721Token.getOwnerOfAsync(tokenAddress, tokenId);
expect(newOwner).to.be.equal(receiverAddress);
});
@@ -86,7 +86,7 @@ describe('ERC721Wrapper', () => {
operatorAddress,
isApprovedForAll,
);
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const owner = await contractWrappers.erc721Token.getOwnerOfAsync(tokenAddress, tokenId);
expect(owner).to.be.equal(ownerAddress);
txHash = await contractWrappers.erc721Token.transferFromAsync(
@@ -95,7 +95,7 @@ describe('ERC721Wrapper', () => {
operatorAddress,
tokenId,
);
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const newOwner = await contractWrappers.erc721Token.getOwnerOfAsync(tokenAddress, tokenId);
expect(newOwner).to.be.equal(receiverAddress);
});
@@ -172,7 +172,7 @@ describe('ERC721Wrapper', () => {
operatorAddress,
true,
);
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
isApprovedForAll = await contractWrappers.erc721Token.isApprovedForAllAsync(
tokenAddress,
ownerAddress,
@@ -186,7 +186,7 @@ describe('ERC721Wrapper', () => {
operatorAddress,
false,
);
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
isApprovedForAll = await contractWrappers.erc721Token.isApprovedForAllAsync(
tokenAddress,
ownerAddress,
@@ -202,7 +202,7 @@ describe('ERC721Wrapper', () => {
ownerAddress,
true,
);
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const isApprovedForAll = await contractWrappers.erc721Token.isProxyApprovedForAllAsync(
tokenAddress,
ownerAddress,
@@ -268,6 +268,7 @@ describe('ERC721Wrapper', () => {
operatorAddress,
isApprovedForAll,
),
+ constants.AWAIT_TRANSACTION_MINED_MS,
);
contractWrappers.erc721Token.subscribe(
tokenAddress,
@@ -282,6 +283,7 @@ describe('ERC721Wrapper', () => {
operatorAddress,
tokenId,
),
+ constants.AWAIT_TRANSACTION_MINED_MS,
);
})().catch(done);
});
@@ -306,6 +308,7 @@ describe('ERC721Wrapper', () => {
const tokenId = await tokenUtils.mintDummyERC721Async(tokenAddress, ownerAddress);
await web3Wrapper.awaitTransactionSuccessAsync(
await contractWrappers.erc721Token.setApprovalAsync(tokenAddress, approvedAddress, tokenId),
+ constants.AWAIT_TRANSACTION_MINED_MS,
);
})().catch(done);
});
@@ -333,6 +336,7 @@ describe('ERC721Wrapper', () => {
const tokenId = await tokenUtils.mintDummyERC721Async(tokenAddress, ownerAddress);
await web3Wrapper.awaitTransactionSuccessAsync(
await contractWrappers.erc721Token.setApprovalAsync(tokenAddress, approvedAddress, tokenId),
+ constants.AWAIT_TRANSACTION_MINED_MS,
);
done();
})().catch(done);
@@ -361,6 +365,7 @@ describe('ERC721Wrapper', () => {
operatorAddress,
isApproved,
),
+ constants.AWAIT_TRANSACTION_MINED_MS,
);
done();
})().catch(done);
@@ -383,7 +388,7 @@ describe('ERC721Wrapper', () => {
operatorAddress,
true,
);
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const eventName = ERC721TokenEvents.ApprovalForAll;
const indexFilterValues = {};
const logs = await contractWrappers.erc721Token.getLogsAsync<ERC721TokenApprovalForAllEventArgs>(
@@ -406,7 +411,7 @@ describe('ERC721Wrapper', () => {
operatorAddress,
true,
);
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const differentEventName = ERC721TokenEvents.Transfer;
const indexFilterValues = {};
const logs = await contractWrappers.erc721Token.getLogsAsync(
@@ -417,21 +422,21 @@ describe('ERC721Wrapper', () => {
);
expect(logs).to.have.length(0);
});
- it('should only get the logs with the correct indexed fields', async () => {
+ it.only('should only get the logs with the correct indexed fields', async () => {
txHash = await contractWrappers.erc721Token.setApprovalForAllAsync(
tokenAddress,
ownerAddress,
operatorAddress,
true,
);
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
txHash = await contractWrappers.erc721Token.setApprovalForAllAsync(
tokenAddress,
anotherOwnerAddress,
operatorAddress,
true,
);
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const eventName = ERC721TokenEvents.ApprovalForAll;
const indexFilterValues = {
_owner: anotherOwnerAddress,