QueryHelper printout

This commit is contained in:
Tim Olson
2023-11-10 19:55:23 -04:00
parent 00bbe84a63
commit 5e184600e1

View File

@@ -29,17 +29,31 @@ for (const chain of _chains) {
console.log(`warning: could not read deployment files for ${chain.id}`) console.log(`warning: could not read deployment files for ${chain.id}`)
continue continue
} }
let maybeFactory = null
for (const tx of deployment.transactions) { for (const tx of deployment.transactions) {
if (tx.contractName === 'Factory') if (tx.contractName === 'Factory')
chain.factory = tx.contractAddress chain.factory = tx.contractAddress
else if (tx.contractName === 'QueryHelper') else if (tx.contractName === 'QueryHelper')
chain.helper = tx.contractAddress chain.helper = tx.contractAddress
else if (tx.contractName === null) {
if( maybeFactory !== null ) {
console.warn('Multiple broadcast deployments found with a null contractAddress')
maybeFactory = -1 // prevent ever using the null labeled contracts
}
else if (maybeFactory !== -1)
maybeFactory = tx.contractAddress
}
}
if (chain.factory === undefined) {
if ( maybeFactory !== null && maybeFactory !== -1)
chain.factory = maybeFactory
else
throw Error(`No Factory deployment found for chainId ${chain.id} ${path}`)
} }
if (chain.factory === undefined)
throw Error(`No Factory deployment found for chainId ${chain.id} ${path}`)
if (chain.helper === undefined) if (chain.helper === undefined)
throw Error(`No QueryHelper deployment found for chainId ${chain.id} ${path}`) throw Error(`No QueryHelper deployment found for chainId ${chain.id} ${path}`)
console.log('Factory', chain.factory) console.log('Factory', chain.factory)
console.log('QueryHelper', chain.helper)
if(chain.id === 31337 ) { if(chain.id === 31337 ) {
const mockpath = `../contract/broadcast/DeployMock.sol/${chain.id}/run-${process.env['DEXORDER_DEPLOYMENT_' + chain.id]}.json` const mockpath = `../contract/broadcast/DeployMock.sol/${chain.id}/run-${process.env['DEXORDER_DEPLOYMENT_' + chain.id]}.json`
@@ -69,7 +83,7 @@ for (const chain of _chains) {
address: usdAddr, address: usdAddr,
}, },
] ]
console.log('Detected MockEnv at', tx.contractAddress) console.log('Detected MockEnv at', chain.id, tx.contractAddress)
} }
} }
} catch { } catch {