Fix tests
This commit is contained in:
@@ -28,6 +28,7 @@ blockchainTests('Migration tests', env => {
|
||||
env.txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
await stakingContract.addAuthorizedAddress.awaitTransactionSuccessAsync(authorizedAddress);
|
||||
});
|
||||
|
||||
describe('StakingProxy', () => {
|
||||
@@ -37,13 +38,15 @@ blockchainTests('Migration tests', env => {
|
||||
let revertAddress: string;
|
||||
|
||||
async function deployStakingProxyAsync(stakingContractAddress?: string): Promise<TestStakingProxyContract> {
|
||||
return TestStakingProxyContract.deployFrom0xArtifactAsync(
|
||||
const proxyContract = await TestStakingProxyContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestStakingProxy,
|
||||
env.provider,
|
||||
env.txDefaults,
|
||||
artifacts,
|
||||
stakingContractAddress || constants.NULL_ADDRESS,
|
||||
);
|
||||
await proxyContract.addAuthorizedAddress.awaitTransactionSuccessAsync(authorizedAddress);
|
||||
return proxyContract;
|
||||
}
|
||||
|
||||
before(async () => {
|
||||
|
@@ -95,20 +95,6 @@ blockchainTests.resets('Exchange Unit Tests', env => {
|
||||
return expect(tx).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('should successfully add an exchange if called by the (authorized) owner', async () => {
|
||||
// Register a new exchange.
|
||||
const receipt = await exchangeManager.addExchangeAddress.awaitTransactionSuccessAsync(nonExchange, {
|
||||
from: owner,
|
||||
});
|
||||
|
||||
// Ensure that the logged event was correct.
|
||||
verifyExchangeManagerEvent(ExchangeManagerEventType.ExchangeAdded, nonExchange, receipt);
|
||||
|
||||
// Ensure that the exchange was successfully registered.
|
||||
const isValidExchange = await exchangeManager.validExchanges.callAsync(nonExchange);
|
||||
expect(isValidExchange).to.be.true();
|
||||
});
|
||||
|
||||
it('should successfully add an exchange if called by an authorized address', async () => {
|
||||
// Register a new exchange.
|
||||
const receipt = await exchangeManager.addExchangeAddress.awaitTransactionSuccessAsync(nonExchange, {
|
||||
@@ -142,20 +128,6 @@ blockchainTests.resets('Exchange Unit Tests', env => {
|
||||
return expect(tx).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('should successfully remove an exchange if called by the (authorized) owner', async () => {
|
||||
// Remove the registered exchange.
|
||||
const receipt = await exchangeManager.removeExchangeAddress.awaitTransactionSuccessAsync(exchange, {
|
||||
from: owner,
|
||||
});
|
||||
|
||||
// Ensure that the logged event was correct.
|
||||
verifyExchangeManagerEvent(ExchangeManagerEventType.ExchangeRemoved, exchange, receipt);
|
||||
|
||||
// Ensure that the exchange was removed.
|
||||
const isValidExchange = await exchangeManager.validExchanges.callAsync(exchange);
|
||||
expect(isValidExchange).to.be.false();
|
||||
});
|
||||
|
||||
it('should successfully remove a registered exchange if called by an authorized address', async () => {
|
||||
// Remove the registered exchange.
|
||||
const receipt = await exchangeManager.removeExchangeAddress.awaitTransactionSuccessAsync(exchange, {
|
||||
|
@@ -21,6 +21,7 @@ blockchainTests('Configurable Parameters unit tests', env => {
|
||||
env.txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
await testContract.addAuthorizedAddress.awaitTransactionSuccessAsync(authorizedAddress);
|
||||
});
|
||||
|
||||
blockchainTests.resets('setParams()', () => {
|
||||
|
@@ -57,6 +57,8 @@ blockchainTests.resets('ZrxVault unit tests', env => {
|
||||
zrxTokenContract.address,
|
||||
);
|
||||
|
||||
await zrxVault.addAuthorizedAddress.awaitTransactionSuccessAsync(owner);
|
||||
|
||||
// configure erc20 proxy to accept calls from zrx vault
|
||||
await erc20ProxyContract.addAuthorizedAddress.awaitTransactionSuccessAsync(zrxVault.address);
|
||||
});
|
||||
|
@@ -236,6 +236,8 @@ export async function deployAndConfigureContractsAsync(
|
||||
zrxTokenContract.address,
|
||||
);
|
||||
|
||||
await zrxVaultContract.addAuthorizedAddress.awaitTransactionSuccessAsync(ownerAddress);
|
||||
|
||||
// deploy staking contract
|
||||
const stakingContract = await TestStakingContract.deployFrom0xArtifactAsync(
|
||||
customStakingArtifact !== undefined ? customStakingArtifact : artifacts.TestStaking,
|
||||
@@ -263,6 +265,9 @@ export async function deployAndConfigureContractsAsync(
|
||||
stakingContract.address,
|
||||
readOnlyProxyContract.address,
|
||||
);
|
||||
|
||||
await stakingProxyContract.addAuthorizedAddress.awaitTransactionSuccessAsync(ownerAddress);
|
||||
|
||||
// deploy cobb douglas contract
|
||||
const cobbDouglasContract = await TestCobbDouglasContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestCobbDouglas,
|
||||
|
Reference in New Issue
Block a user