From 6aa37ad3e489f717ddba84118d1e6805816840d6 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 29 Jun 2017 13:41:35 -0700 Subject: Add tests for getProxyAuthorizedContractAddressesAsync --- test/exchange_wrapper_test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index cf828bd8d..dc68e44bd 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -23,6 +23,7 @@ import {DoneCallback} from '../src/types'; import {FillScenarios} from './utils/fill_scenarios'; import {TokenUtils} from './utils/token_utils'; import {assert} from '../src/utils/assert'; +import {ProxyWrapper} from '../src/contract_wrappers/proxy_wrapper'; chaiSetup.configure(); const expect = chai.expect; @@ -819,4 +820,15 @@ describe('ExchangeWrapper', () => { }); }); }); + describe('#getProxyAuthorizedContractAddressesAsync', () => { + it('returns the Proxy authorized exchange contract addresses', async () => { + const exchangeAddresses = await zeroEx.exchange.getProxyAuthorizedContractAddressesAsync(); + for (const exchangeAddress of exchangeAddresses) { + assert.isETHAddressHex('exchangeAddress', exchangeAddress); + const proxyWrapper = (zeroEx as any)._proxyWrapper as ProxyWrapper; + const isAuthorized = await proxyWrapper.isAuthorizedAsync(exchangeAddress); + expect(isAuthorized).to.be.true(); + } + }); + }); }); -- cgit v1.2.3