Refactor ERC20 token transfer proxy and it's tests

This commit is contained in:
Leonid Logvinov
2018-06-27 11:47:14 +03:00
parent a655cd046c
commit 3aef323c13
2 changed files with 27 additions and 29 deletions

View File

@@ -9,7 +9,7 @@ import { provider } from './utils/web3_wrapper';
chaiSetup.configure();
const expect = chai.expect;
describe('TokenTransferProxyWrapper', () => {
describe('ERC20ProxyWrapper', () => {
let contractWrappers: ContractWrappers;
const config = {
networkId: constants.TESTRPC_NETWORK_ID,
@@ -19,15 +19,15 @@ describe('TokenTransferProxyWrapper', () => {
});
describe('#isAuthorizedAsync', () => {
it('should return false if the address is not authorized', async () => {
const isAuthorized = await contractWrappers.proxy.isAuthorizedAsync(constants.NULL_ADDRESS);
const isAuthorized = await contractWrappers.erc20Proxy.isAuthorizedAsync(constants.NULL_ADDRESS);
expect(isAuthorized).to.be.false();
});
});
describe('#getAuthorizedAddressesAsync', () => {
it('should return the list of authorized addresses', async () => {
const authorizedAddresses = await contractWrappers.proxy.getAuthorizedAddressesAsync();
const authorizedAddresses = await contractWrappers.erc20Proxy.getAuthorizedAddressesAsync();
for (const authorizedAddress of authorizedAddresses) {
const isAuthorized = await contractWrappers.proxy.isAuthorizedAsync(authorizedAddress);
const isAuthorized = await contractWrappers.erc20Proxy.isAuthorizedAsync(authorizedAddress);
expect(isAuthorized).to.be.true();
}
});