diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-07-06 17:10:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-06 17:10:55 +0800 |
commit | b21f6e4d8652eb402fc1c8bbf8a13a024d945c74 (patch) | |
tree | 106a622d3b121c61fa011cd7e4134c12dd788b3a /packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts | |
parent | bc52303402e6ee1b3ab9d948d909d1d10ebf26e4 (diff) | |
parent | 0c8264801ac15952861724ecd6a2620dc3055e5e (diff) | |
download | dexon-0x-contracts-b21f6e4d8652eb402fc1c8bbf8a13a024d945c74.tar.gz dexon-0x-contracts-b21f6e4d8652eb402fc1c8bbf8a13a024d945c74.tar.zst dexon-0x-contracts-b21f6e4d8652eb402fc1c8bbf8a13a024d945c74.zip |
Merge pull request #822 from 0xProject/v2-contract-wrappers-WIP
V2 contract wrappers
Diffstat (limited to 'packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts')
-rw-r--r-- | packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts b/packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts new file mode 100644 index 000000000..9473d930b --- /dev/null +++ b/packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts @@ -0,0 +1,35 @@ +import * as chai from 'chai'; + +import { ContractWrappers } from '../src'; + +import { chaiSetup } from './utils/chai_setup'; +import { constants } from './utils/constants'; +import { provider } from './utils/web3_wrapper'; + +chaiSetup.configure(); +const expect = chai.expect; + +describe('ERC721ProxyWrapper', () => { + let contractWrappers: ContractWrappers; + const config = { + networkId: constants.TESTRPC_NETWORK_ID, + }; + before(async () => { + contractWrappers = new ContractWrappers(provider, config); + }); + describe('#isAuthorizedAsync', () => { + it('should return false if the address is not authorized', async () => { + const isAuthorized = await contractWrappers.erc721Proxy.isAuthorizedAsync(constants.NULL_ADDRESS); + expect(isAuthorized).to.be.false(); + }); + }); + describe('#getAuthorizedAddressesAsync', () => { + it('should return the list of authorized addresses', async () => { + const authorizedAddresses = await contractWrappers.erc721Proxy.getAuthorizedAddressesAsync(); + for (const authorizedAddress of authorizedAddresses) { + const isAuthorized = await contractWrappers.erc721Proxy.isAuthorizedAsync(authorizedAddress); + expect(isAuthorized).to.be.true(); + } + }); + }); +}); |