aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-06-29 21:46:41 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-06-29 22:52:55 +0800
commit62910c8e895c50c3cff98d58096a506a31503824 (patch)
treeba63a07473a0b528af75341a027cc4c13ec30589
parentf20e1acad980abad8f6dcd92856f3aafe5a2ec3d (diff)
downloaddexon-sol-tools-62910c8e895c50c3cff98d58096a506a31503824.tar
dexon-sol-tools-62910c8e895c50c3cff98d58096a506a31503824.tar.gz
dexon-sol-tools-62910c8e895c50c3cff98d58096a506a31503824.tar.bz2
dexon-sol-tools-62910c8e895c50c3cff98d58096a506a31503824.tar.lz
dexon-sol-tools-62910c8e895c50c3cff98d58096a506a31503824.tar.xz
dexon-sol-tools-62910c8e895c50c3cff98d58096a506a31503824.tar.zst
dexon-sol-tools-62910c8e895c50c3cff98d58096a506a31503824.zip
Assign true values to names vars
-rw-r--r--packages/contract-wrappers/test/erc721_wrapper_test.ts21
1 files changed, 13 insertions, 8 deletions
diff --git a/packages/contract-wrappers/test/erc721_wrapper_test.ts b/packages/contract-wrappers/test/erc721_wrapper_test.ts
index dbedb4e58..138ff866b 100644
--- a/packages/contract-wrappers/test/erc721_wrapper_test.ts
+++ b/packages/contract-wrappers/test/erc721_wrapper_test.ts
@@ -166,11 +166,12 @@ describe('ERC721Wrapper', () => {
);
expect(isApprovedForAll).to.be.false();
// set
+ const isApprovedForAll = true;
let txHash = await contractWrappers.erc721Token.setApprovalForAllAsync(
tokenAddress,
ownerAddress,
operatorAddress,
- true,
+ isApprovedForAll,
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
isApprovedForAll = await contractWrappers.erc721Token.isApprovedForAllAsync(
@@ -197,13 +198,14 @@ describe('ERC721Wrapper', () => {
});
describe('#setProxyApprovalForAllAsync/isProxyApprovedForAllAsync', () => {
it('should check if proxy address is approved', async () => {
+ let isApprovedForAll = true;
const txHash = await contractWrappers.erc721Token.setProxyApprovalForAllAsync(
tokenAddress,
ownerAddress,
- true,
+ isApprovedForAll,
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
- const isApprovedForAll = await contractWrappers.erc721Token.isProxyApprovedForAllAsync(
+ isApprovedForAll = await contractWrappers.erc721Token.isProxyApprovedForAllAsync(
tokenAddress,
ownerAddress,
);
@@ -382,11 +384,12 @@ describe('ERC721Wrapper', () => {
tokenTransferProxyAddress = contractWrappers.erc721Proxy.getContractAddress();
});
it('should get logs with decoded args emitted by ApprovalForAll', async () => {
+ const isApprovedForAll = true;
txHash = await contractWrappers.erc721Token.setApprovalForAllAsync(
tokenAddress,
ownerAddress,
operatorAddress,
- true,
+ isApprovedForAll,
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const eventName = ERC721TokenEvents.ApprovalForAll;
@@ -402,14 +405,15 @@ describe('ERC721Wrapper', () => {
expect(logs[0].event).to.be.equal(eventName);
expect(args._owner).to.be.equal(ownerAddress);
expect(args._operator).to.be.equal(operatorAddress);
- expect(args._approved).to.be.equal(true);
+ expect(args._approved).to.be.equal(isApprovedForAll);
});
it('should only get the logs with the correct event name', async () => {
+ const isApprovedForAll = true;
txHash = await contractWrappers.erc721Token.setApprovalForAllAsync(
tokenAddress,
ownerAddress,
operatorAddress,
- true,
+ isApprovedForAll,
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const differentEventName = ERC721TokenEvents.Transfer;
@@ -423,18 +427,19 @@ describe('ERC721Wrapper', () => {
expect(logs).to.have.length(0);
});
it.only('should only get the logs with the correct indexed fields', async () => {
+ const isApprovedForAll = true;
txHash = await contractWrappers.erc721Token.setApprovalForAllAsync(
tokenAddress,
ownerAddress,
operatorAddress,
- true,
+ isApprovedForAll,
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
txHash = await contractWrappers.erc721Token.setApprovalForAllAsync(
tokenAddress,
anotherOwnerAddress,
operatorAddress,
- true,
+ isApprovedForAll,
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const eventName = ERC721TokenEvents.ApprovalForAll;