chainInfo fix
This commit is contained in:
10
chain.js
10
chain.js
@@ -15,7 +15,11 @@ const _chains = [
|
||||
]
|
||||
|
||||
for (const chain of _chains) {
|
||||
const path = `../contract/broadcast/Deploy.sol/${chain.id}/run-latest.json`;
|
||||
fs.readdir('../contract/broadcast', (err, files) => {
|
||||
if (err) throw err;
|
||||
for (const deploymentClassDir of files) {
|
||||
if (deploymentClassDir.startsWith('Deploy') && deploymentClassDir.endsWith('.sol')) {
|
||||
const path = `${deploymentClassDir}/${chain.id}/run-latest.json`;
|
||||
let deployment
|
||||
try {
|
||||
deployment = JSON.parse(fs.readFileSync(path, 'utf8')) //null synchronous is ok we only do this once on init
|
||||
@@ -50,4 +54,8 @@ for (const chain of _chains) {
|
||||
console.log('VaultFactory', chain.factory)
|
||||
console.log('QueryHelper', chain.helper)
|
||||
chainInfo[chain.id] = chain
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user