order placement doesnt crash
This commit is contained in:
6
misc.js
6
misc.js
@@ -4,8 +4,9 @@ import {keccak256} from "ethers";
|
||||
|
||||
export const readFile = (fileName) => util.promisify(fs.readFile)(fileName, 'utf8');
|
||||
|
||||
const vaultCode = JSON.parse(fs.readFileSync('./contract/out/Vault.sol/Vault.json').toString())
|
||||
const vaultCode = JSON.parse(fs.readFileSync('../contract/out/Vault.sol/Vault.json').toString())
|
||||
export const VAULT_INIT_CODE_HASH = keccak256(vaultCode.bytecode.object)
|
||||
console.log('VAULT_INIT_CODE_HASH', VAULT_INIT_CODE_HASH)
|
||||
|
||||
export const chainInfo = {}
|
||||
|
||||
@@ -20,7 +21,7 @@ function _setChainInfo(c, k, v) {
|
||||
}
|
||||
|
||||
for (const chain of _chains) {
|
||||
const path = `contract/broadcast/Deploy.sol/${chain.id}/run-${process.env['DEXORDER_DEPLOYMENT_' + chain.id]}.json`;
|
||||
const path = `../contract/broadcast/Deploy.sol/${chain.id}/run-${process.env['DEXORDER_DEPLOYMENT_' + chain.id]}.json`;
|
||||
let deployment
|
||||
try {
|
||||
deployment = JSON.parse(fs.readFileSync(path, 'utf8')) //null synchronous is ok we only do this once on init
|
||||
@@ -42,5 +43,6 @@ for (const chain of _chains) {
|
||||
throw Error(`No Factory deployment found for chainId ${chain.id} ${path}`)
|
||||
if (chain.helper === undefined)
|
||||
throw Error(`No QueryHelper deployment found for chainId ${chain.id} ${path}`)
|
||||
console.log('Factory', chain.factory)
|
||||
chainInfo[chain.id] = chain
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user