limit getAbi() to only look for IVault.sol.
This commit is contained in:
16
abi.js
16
abi.js
@@ -41,13 +41,15 @@ export async function getAbi(className) {
|
||||
let found = abi[className]
|
||||
if (found === undefined) {
|
||||
console.log('warning: loading ABI from filesystem for '+className)
|
||||
// const data = await readFile(ABI_BASE_PATH + `/${className}.sol/${className}.json`)
|
||||
let data
|
||||
try {
|
||||
data = await readFile(ABI_BASE_PATH + `/I${className}.sol/I${className}.json`)
|
||||
}
|
||||
catch (e) {
|
||||
data = await readFile(ABI_BASE_PATH + `/${className}.sol/${className}.json`)
|
||||
let data = await readFile(ABI_BASE_PATH + `/${className}.sol/${className}.json`)
|
||||
// Tricky code to handle proxy Vault where interface file is needed instead of class file
|
||||
if (className == 'Vault') {
|
||||
try {
|
||||
data = await readFile(ABI_BASE_PATH + `/I${className}.sol/I${className}.json`)
|
||||
}
|
||||
catch (e) {
|
||||
if (e.code !== 'ENOENT') throw e;
|
||||
}
|
||||
}
|
||||
found = JSON.parse(data.toString())['abi']
|
||||
abi[className] = found
|
||||
|
||||
Reference in New Issue
Block a user