Skip to content

Commit

Permalink
fix(test)_: fix fetching test networks
Browse files Browse the repository at this point in the history
  • Loading branch information
friofry committed Jan 30, 2025
1 parent af5365f commit 5bb8b38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions node/get_status_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ func (n *StatusNode) setupRPCClient() (err error) {
WalletFeed: &n.walletFeed,
}
n.rpcClient, err = rpc.NewClient(config)
if err != nil {
return
}
n.rpcClient.Start(context.Background())
if err != nil {
return
Expand Down
9 changes: 8 additions & 1 deletion rpc/network/db/network_db.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package db

import (
"database/sql"
"fmt"

sq "github.com/Masterminds/squirrel"
Expand Down Expand Up @@ -85,16 +86,22 @@ func (n *NetworksPersistence) GetNetworks(onlyEnabled bool, chainID *uint64) ([]
result := make([]*params.Network, 0, 10)
for rows.Next() {
network := &params.Network{}
var relatedChainID sql.NullInt64
err := rows.Scan(
&network.ChainID, &network.ChainName, &network.RPCURL, &network.FallbackURL,
&network.BlockExplorerURL, &network.IconURL, &network.NativeCurrencyName, &network.NativeCurrencySymbol,
&network.NativeCurrencyDecimals, &network.IsTest, &network.Layer, &network.Enabled, &network.ChainColor,
&network.ShortName, &network.RelatedChainID,
&network.ShortName, &relatedChainID,
)
if err != nil {
return nil, err
}

// Convert sql.NullInt64 to uint64 only if it's valid
if relatedChainID.Valid {
network.RelatedChainID = uint64(relatedChainID.Int64)
}

// Fetch RPC providers for the network
providers, err := n.rpcPersistence.GetRpcProviders(network.ChainID)
if err != nil {
Expand Down

0 comments on commit 5bb8b38

Please sign in to comment.