forked from 0xPolygonHermez/zkevm-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
export all jsons in compiled-contracts
- Loading branch information
1 parent
13c092f
commit 474dad6
Showing
10 changed files
with
116 additions
and
54 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
module.exports.PolygonZkEVMBridge = require('./compiled-contracts/PolygonZkEVMBridge.json'); | ||
module.exports.PolygonZkEVMGlobalExitRoot = require('./compiled-contracts/PolygonZkEVMGlobalExitRoot.json'); | ||
module.exports.PolygonZkEVMGlobalExitRootL2 = require('./compiled-contracts/PolygonZkEVMGlobalExitRootL2.json'); | ||
module.exports.PolygonZkEVM = require('./compiled-contracts/PolygonZkEVM.json'); | ||
module.exports.TokenWrapped = require('./compiled-contracts/TokenWrapped.json'); | ||
module.exports.FflonkVerifier = require('./compiled-contracts/FflonkVerifier.json'); | ||
module.exports.PolygonZkEVMBridgeMock = require('./compiled-contracts/PolygonZkEVMBridgeMock.json'); | ||
module.exports.ERC20PermitMock = require('./compiled-contracts/ERC20PermitMock.json'); | ||
module.exports.PolygonZkEVMGlobalExitRootL2Mock = require('./compiled-contracts/PolygonZkEVMGlobalExitRootL2Mock.json'); | ||
module.exports.PolygonZkEVMGlobalExitRootMock = require('./compiled-contracts/PolygonZkEVMGlobalExitRootMock.json'); | ||
module.exports.PolygonZkEVMMock = require('./compiled-contracts/PolygonZkEVMMock.json'); | ||
module.exports.VerifierRollupHelperMock = require('./compiled-contracts/VerifierRollupHelperMock.json'); | ||
module.exports.PermitHelper = require('./src/permit-helper'); | ||
module.exports.ProxyAdmin = require('./compiled-contracts/ProxyAdmin.json'); | ||
module.exports.TransparentUpgradeableProxy = require('./compiled-contracts/TransparentUpgradeableProxy.json'); | ||
module.exports.PolygonZkEVMDeployer = require('./compiled-contracts/PolygonZkEVMDeployer.json'); | ||
module.exports.PolygonZkEVMTimelock = require('./compiled-contracts/PolygonZkEVMTimelock.json'); | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const compileContracts = {} | ||
const pathToCompiledContracts = path.join(__dirname, './compiled-contracts') | ||
|
||
function exportCompileContracts(pathDir) { | ||
fs.readdirSync(pathDir).forEach(file => { | ||
const fullName = path.join(pathDir, file) | ||
const pathInfo = path.parse(fullName); | ||
|
||
if (pathInfo.ext === '.json') { | ||
compileContracts[pathInfo.name] = require(fullName); | ||
} | ||
}) | ||
} | ||
|
||
exportCompileContracts(pathToCompiledContracts); | ||
|
||
module.exports = compileContracts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-disable no-restricted-syntax */ | ||
const { expect } = require('chai'); | ||
const index = require('../index'); | ||
|
||
describe('should export index', () => { | ||
it('should validate all abi exports', async () => { | ||
for (const file of Object.keys(index)) { | ||
expect(index[file]).to.be.an('object'); | ||
expect(index[file]).to.have.property('abi'); | ||
} | ||
}); | ||
}); |