Skip to content

Commit

Permalink
refactor: simplify database client access in getEndpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
sundayonah authored and chibie committed Feb 20, 2025
1 parent db84177 commit 7edcb35
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions utils/userop.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,12 +548,9 @@ func eip1559GasPrice(ctx context.Context, client types.RPCClient) (maxFeePerGas,
// getEndpoints fetches bundler and paymaster URLs for the given chain ID from the database
func getEndpoints(chainID int64) (string, string, error) {
ctx := context.Background()
client := storage.GetClient()
if client == nil {
return "", "", fmt.Errorf("database client not initialized")
}

network, err := client.Network.Query().
network, err := storage.Client.Network.
Query().
Where(network.ChainID(chainID)).
Only(ctx)
if err != nil {
Expand Down

0 comments on commit 7edcb35

Please sign in to comment.