Skip to content

Commit

Permalink
chore: testnode for bold upgrade (#268)
Browse files Browse the repository at this point in the history
* chore: testnode for bold upgrade

* test: stakeToken should be contract
  • Loading branch information
gzeoneth authored Dec 9, 2024
1 parent 0972e25 commit 78c2272
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions scripts/boldUpgradeCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,17 @@ export const getConfig = async (
if (!config) {
throw new Error('config not found')
}
if (process.env.ROLLUP_ADDRESS) {
console.log('Using ROLLUP_ADDRESS from env:', process.env.ROLLUP_ADDRESS)
config.contracts.rollup = process.env.ROLLUP_ADDRESS
// in testnode mode we allow some config to be overridden from env for easier testing
if (process.env.TESTNODE_MODE) {
console.log('In testnode mode')
if (process.env.ROLLUP_ADDRESS) {
console.log('Using ROLLUP_ADDRESS from env:', process.env.ROLLUP_ADDRESS)
config.contracts.rollup = process.env.ROLLUP_ADDRESS
}
if (process.env.STAKE_TOKEN) {
console.log('Using STAKE_TOKEN from env:', process.env.STAKE_TOKEN)
config.settings.stakeToken = process.env.STAKE_TOKEN
}
}
await validateConfig(config, l1Rpc)
return config
Expand Down Expand Up @@ -138,6 +146,9 @@ export const validateConfig = async (
if (config.settings.stakeToken.length === 0) {
throw new Error('stakeToken address is empty')
}
if ((await l1Rpc.getCode(config.settings.stakeToken)).length <= 2) {
throw new Error('stakeToken address is not a contract')
}
if (config.settings.chainId === 0) {
throw new Error('chainId is 0')
}
Expand Down

0 comments on commit 78c2272

Please sign in to comment.