Skip to content

Commit

Permalink
op-deployer: Fix invalid intent panic in SR command (#13006)
Browse files Browse the repository at this point in the history
  • Loading branch information
mslipper authored Nov 21, 2024
1 parent 240d0f8 commit 042433b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit 042433b

Please sign in to comment.