Skip to content

Commit

Permalink
Force Apply Env Var
Browse files Browse the repository at this point in the history
  • Loading branch information
joelsmith-2019 committed Apr 26, 2024
1 parent 7a482f8 commit c14e66f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions ethereum/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ type ChainConfig struct {
}

func (c *ChainConfig) Chain(name string) (types.Chain, error) {
if len(c.MinterPrivateKey) == 0 {
envKey := strings.ToUpper(name) + "_PRIV_KEY"
privKey := os.Getenv(envKey)
envKey := strings.ToUpper(name) + "_PRIV_KEY"
privKey := os.Getenv(envKey)

if len(c.MinterPrivateKey) == 0 || len(privKey) != 0 {
if len(privKey) == 0 {
return nil, fmt.Errorf("env variable %s is empty, priv key not found for chain %s", envKey, name)
} else {
Expand Down
7 changes: 4 additions & 3 deletions noble/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ type ChainConfig struct {
}

func (c *ChainConfig) Chain(name string) (types.Chain, error) {
if len(c.MinterPrivateKey) == 0 {
envKey := strings.ToUpper(name) + "_PRIV_KEY"
privKey := os.Getenv(envKey)
envKey := strings.ToUpper(name) + "_PRIV_KEY"
privKey := os.Getenv(envKey)

if len(c.MinterPrivateKey) == 0 || len(privKey) != 0 {
if len(privKey) == 0 {
return nil, fmt.Errorf("env variable %s is empty, priv key not found for chain %s", envKey, name)
} else {
Expand Down

0 comments on commit c14e66f

Please sign in to comment.