Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: testnode for bold upgrade #268

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading