Revert "Merge pull request #493 from hysz/features/deployer/multipleCodebaseSupport"

This reverts commit 70d403e6f8, reversing
changes made to 073bf738dd.
This commit is contained in:
Leonid Logvinov
2018-04-10 13:44:15 +02:00
parent ed0c64fdcf
commit f2f9bd2e7a
40 changed files with 5657 additions and 521 deletions

View File

@@ -47,34 +47,28 @@ describe('Compiler utils', () => {
});
describe('#parseDependencies', () => {
it('correctly parses Exchange dependencies', async () => {
const exchangeSource = await fsWrapper.readFileAsync(`${__dirname}/fixtures/contracts/main/Exchange.sol`, {
const exchangeSource = await fsWrapper.readFileAsync(`${__dirname}/fixtures/contracts/Exchange.sol`, {
encoding: 'utf8',
});
const sourceFileId = '/main/Exchange.sol';
expect(parseDependencies(exchangeSource, sourceFileId)).to.be.deep.equal([
'/main/TokenTransferProxy.sol',
'/base/Token.sol',
'/base/SafeMath.sol',
expect(parseDependencies(exchangeSource)).to.be.deep.equal([
'TokenTransferProxy.sol',
'Token.sol',
'SafeMath.sol',
]);
});
it('correctly parses TokenTransferProxy dependencies', async () => {
const exchangeSource = await fsWrapper.readFileAsync(
`${__dirname}/fixtures/contracts/main/TokenTransferProxy.sol`,
`${__dirname}/fixtures/contracts/TokenTransferProxy.sol`,
{
encoding: 'utf8',
},
);
const sourceFileId = '/main/TokenTransferProxy.sol';
expect(parseDependencies(exchangeSource, sourceFileId)).to.be.deep.equal([
'/base/Token.sol',
'/base/Ownable.sol',
]);
expect(parseDependencies(exchangeSource)).to.be.deep.equal(['Token.sol', 'Ownable.sol']);
});
// TODO: For now that doesn't work. This will work after we switch to a grammar-based parser
it.skip('correctly parses commented out dependencies', async () => {
const contractWithCommentedOutDependencies = `// import "./TokenTransferProxy.sol";`;
const sourceFileId = '/main/TokenTransferProxy.sol';
expect(parseDependencies(contractWithCommentedOutDependencies, sourceFileId)).to.be.deep.equal([]);
expect(parseDependencies(contractWithCommentedOutDependencies)).to.be.deep.equal([]);
});
});
});