Add tests for getProxyAuthorizedContractAddressesAsync

This commit is contained in:
Leonid Logvinov
2017-06-29 13:41:35 -07:00
parent 1321ea5beb
commit 6aa37ad3e4

View File

@@ -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();
}
});
});
});