Merge remote-tracking branch 'origin/master' into orderspec
This commit is contained in:
11
abi.js
11
abi.js
@@ -41,7 +41,16 @@ export async function getAbi(className) {
|
|||||||
let found = abi[className]
|
let found = abi[className]
|
||||||
if (found === undefined) {
|
if (found === undefined) {
|
||||||
console.log('warning: loading ABI from filesystem for '+className)
|
console.log('warning: loading ABI from filesystem for '+className)
|
||||||
const 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']
|
found = JSON.parse(data.toString())['abi']
|
||||||
abi[className] = found
|
abi[className] = found
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user