From 728414e66ec46345f7b2e8a763026d435fe123a9 Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Wed, 20 Nov 2024 15:47:59 -0700 Subject: [PATCH] op-deployer: Fix invalid intent panic in SR command --- op-deployer/pkg/deployer/inspect/superchain_registry.go | 4 ++++ op-deployer/pkg/deployer/state/intent.go | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/op-deployer/pkg/deployer/inspect/superchain_registry.go b/op-deployer/pkg/deployer/inspect/superchain_registry.go index 7a6fe384db64..e5ee56568b59 100644 --- a/op-deployer/pkg/deployer/inspect/superchain_registry.go +++ b/op-deployer/pkg/deployer/inspect/superchain_registry.go @@ -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"] = "" diff --git a/op-deployer/pkg/deployer/state/intent.go b/op-deployer/pkg/deployer/state/intent.go index 860944666e9e..86e6cfc1ed47 100644 --- a/op-deployer/pkg/deployer/state/intent.go +++ b/op-deployer/pkg/deployer/state/intent.go @@ -1,6 +1,7 @@ package state import ( + "errors" "fmt" "math/big" @@ -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