diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-06-27 16:48:01 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-06-29 22:52:53 +0800 |
commit | 2adc299c78f17712dfea55cf8257c1cb237479cb (patch) | |
tree | d0439649a9fa50e947976a351ff552c41edd931a /packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts | |
parent | 3aef323c1334e577905855cac50a6f41245563c6 (diff) | |
download | dexon-0x-contracts-2adc299c78f17712dfea55cf8257c1cb237479cb.tar dexon-0x-contracts-2adc299c78f17712dfea55cf8257c1cb237479cb.tar.gz dexon-0x-contracts-2adc299c78f17712dfea55cf8257c1cb237479cb.tar.bz2 dexon-0x-contracts-2adc299c78f17712dfea55cf8257c1cb237479cb.tar.lz dexon-0x-contracts-2adc299c78f17712dfea55cf8257c1cb237479cb.tar.xz dexon-0x-contracts-2adc299c78f17712dfea55cf8257c1cb237479cb.tar.zst dexon-0x-contracts-2adc299c78f17712dfea55cf8257c1cb237479cb.zip |
Implement ERC721 token wrapper and token transfer proxy with tests
Diffstat (limited to 'packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts')
-rw-r--r-- | packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts | 36 |
1 files changed, 36 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..7d1a5b8bb --- /dev/null +++ b/packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts @@ -0,0 +1,36 @@ +import * as chai from 'chai'; +import 'make-promises-safe'; + +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(); + } + }); + }); +}); |