Skip to content

Commit

Permalink
set apikey to empty string if none
Browse files Browse the repository at this point in the history
  • Loading branch information
augustbleeds committed Mar 11, 2024
1 parent 879a575 commit 5dfb386
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions relayer/pkg/chainlink/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (c *Chain) SetDefaults() {
type Node struct {
Name *string
URL *config.URL
// only if rpc url needs api key passed in header
// optional, only if rpc url needs api key passed in header
APIKey *string
}

Expand Down Expand Up @@ -225,11 +225,17 @@ func setFromNode(n, f *Node) {
}

func legacyNode(n *Node, id string) db.Node {
var apiKey string
if n.APIKey == nil {
apiKey = ""
} else {
apiKey = *n.APIKey
}
return db.Node{
Name: *n.Name,
ChainID: id,
URL: (*url.URL)(n.URL).String(),
APIKey: *n.APIKey,
APIKey: apiKey,
}
}

Expand Down

0 comments on commit 5dfb386

Please sign in to comment.