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

op-deployer: Fix invalid intent panic in SR command #13006

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions op-deployer/pkg/deployer/inspect/superchain_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ func SuperchainRegistryCLI(cliCtx *cli.Context) error {
return fmt.Errorf("failed to read intent: %w", err)
}

if err := globalIntent.Check(); err != nil {
return fmt.Errorf("intent check failed: %w", err)
}

envVars := map[string]string{}
envVars["SCR_CHAIN_NAME"] = ""
envVars["SCR_CHAIN_SHORT_NAME"] = ""
Expand Down
5 changes: 3 additions & 2 deletions op-deployer/pkg/deployer/state/intent.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package state

import (
"errors"
"fmt"
"math/big"

Expand Down Expand Up @@ -67,11 +68,11 @@ func (c *Intent) Check() error {
}

if c.L1ContractsLocator == nil {
c.L1ContractsLocator = artifacts.DefaultL1ContractsLocator
return errors.New("l1ContractsLocator must be set")
}

if c.L2ContractsLocator == nil {
c.L2ContractsLocator = artifacts.DefaultL2ContractsLocator
return errors.New("l2ContractsLocator must be set")
}

var err error
Expand Down