Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion starship/cmd/starship/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package main
import (
"context"
"fmt"
"go.uber.org/zap"
"os"
"os/exec"
"strings"
"sync"

"go.uber.org/zap"
)

// File responsible for having functions that will perform kubectl port-froward.
Expand Down
2 changes: 1 addition & 1 deletion starship/cmd/starship/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package main

import (
"gopkg.in/yaml.v3"
"os"

"go.uber.org/zap"
"gopkg.in/yaml.v3"
"helm.sh/helm/v3/pkg/cli"
)

Expand Down
1 change: 1 addition & 0 deletions starship/cmd/starship/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"

"github.com/urfave/cli/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion starship/exposer/handler_relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package main
import (
"context"
"fmt"
"go.uber.org/zap"

pb "github.com/hyperweb-io/starship/exposer/exposer"
"go.uber.org/zap"
)

// CreateChannel function runs the hermes command to create a channel between 2 given chains
Expand Down
3 changes: 2 additions & 1 deletion starship/registry/model.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
pb "github.com/hyperweb-io/starship/registry/registry"
"sort"
"strings"

pb "github.com/hyperweb-io/starship/registry/registry"
)

type ChannelPort struct {
Expand Down
8 changes: 4 additions & 4 deletions starship/tests/e2e/exposer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/types/known/structpb"
"net/http"
urlpkg "net/url"

"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
pb "github.com/hyperweb-io/starship/exposer/exposer"
"google.golang.org/protobuf/types/known/structpb"
)

func (s *TestSuite) MakeExposerRequest(chain *Chain, req *http.Request, unmarshal proto.Message) {
Expand Down Expand Up @@ -48,7 +48,7 @@ func (s *TestSuite) TestExposer_GetGenesisFile() {
s.T().Log("running test for /genesis endpoint for exposer")

chain := s.config.Chains[0]
if chain.Ports.Exposer == 0{
if chain.Ports.Exposer == 0 {
s.T().Skip("skipping /node_id test since no exposer")
}
if chain.Name == "solana" {
Expand Down
44 changes: 22 additions & 22 deletions starship/tests/e2e/solana_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ type VoteAccount struct {

// ClusterNode represents a cluster node
type ClusterNode struct {
Pubkey string `json:"pubkey"`
Gossip string `json:"gossip"`
TPU string `json:"tpu"`
TPUForwards string `json:"tpuForwards"`
TVU string `json:"tvu"`
RPC string `json:"rpc"`
Pubsub string `json:"pubsub"`
Version string `json:"version"`
FeatureSet uint32 `json:"featureSet"`
Pubkey string `json:"pubkey"`
Gossip string `json:"gossip"`
TPU string `json:"tpu"`
TPUForwards string `json:"tpuForwards"`
TVU string `json:"tvu"`
RPC string `json:"rpc"`
Pubsub string `json:"pubsub"`
Version string `json:"version"`
FeatureSet uint32 `json:"featureSet"`
ShredVersion uint16 `json:"shredVersion"`
}

Expand All @@ -57,7 +57,7 @@ func (s *TestSuite) MakeSolanaRPCRequest(method string, params []interface{}, re
break
}
}

if solanaChain == nil {
s.T().Skip("Solana chain not found in config")
}
Expand Down Expand Up @@ -93,7 +93,7 @@ func (s *TestSuite) MakeSolanaExposerRequest(endpoint string, response interface
break
}
}

if solanaChain == nil {
s.T().Skip("Solana chain not found in config")
}
Expand All @@ -118,7 +118,7 @@ func (s *TestSuite) TestSolana_Status() {
break
}
}

if solanaChain == nil {
s.T().Skip("Solana chain not found in config")
}
Expand Down Expand Up @@ -175,14 +175,14 @@ func (s *TestSuite) TestSolana_VoteAccounts() {
// Parse the result
result := response.Result.(map[string]interface{})
current := result["current"].([]interface{})

// Assert that we have at least one vote account (bootstrap validator)
s.Require().GreaterOrEqual(len(current), 1, "Should have at least one active vote account")

// Log vote account details
for i, account := range current {
acc := account.(map[string]interface{})
s.T().Logf("Vote Account %d: %s (Node: %s, Stake: %v)",
s.T().Logf("Vote Account %d: %s (Node: %s, Stake: %v)",
i+1, acc["votePubkey"], acc["nodePubkey"], acc["activatedStake"])
}
}
Expand All @@ -200,14 +200,14 @@ func (s *TestSuite) TestSolana_ClusterNodes() {

// Parse the result
nodes := response.Result.([]interface{})

// Assert that we have at least one node
s.Require().GreaterOrEqual(len(nodes), 1, "Should have at least one cluster node")

// Log cluster node details
for i, node := range nodes {
n := node.(map[string]interface{})
s.T().Logf("Cluster Node %d: %s (Gossip: %s, RPC: %s, Version: %s)",
s.T().Logf("Cluster Node %d: %s (Gossip: %s, RPC: %s, Version: %s)",
i+1, n["pubkey"], n["gossip"], n["rpc"], n["version"])
}
}
Expand Down Expand Up @@ -244,7 +244,7 @@ func (s *TestSuite) TestSolana_Faucet() {
s.Require().Nil(balanceResponse.Error, "RPC should not return error")
s.Require().Equal("2.0", balanceResponse.JSONRPC)
s.Require().Equal(1, balanceResponse.ID)

// Parse balance result
balanceResult := balanceResponse.Result.(map[string]interface{})
balance := balanceResult["value"].(float64)
Expand Down Expand Up @@ -289,7 +289,7 @@ func (s *TestSuite) TestSolana_ValidatorCount() {
result := response.Result.(map[string]interface{})
current := result["current"].([]interface{})
delinquent := result["delinquent"].([]interface{})

currentValidators := len(current)
delinquentValidators := len(delinquent)
totalValidators := currentValidators + delinquentValidators
Expand All @@ -300,7 +300,7 @@ func (s *TestSuite) TestSolana_ValidatorCount() {

// Assert that we have at least the bootstrap validator
s.Require().GreaterOrEqual(currentValidators, 1, "Should have at least one current validator (bootstrap)")

// If you have multiple validators configured, check for them
var solanaChain *Chain
for _, chain := range s.config.Chains {
Expand All @@ -309,10 +309,10 @@ func (s *TestSuite) TestSolana_ValidatorCount() {
break
}
}

if solanaChain != nil && solanaChain.NumValidators > 1 {
expectedValidators := solanaChain.NumValidators
s.Require().GreaterOrEqual(totalValidators, expectedValidators,
s.Require().GreaterOrEqual(totalValidators, expectedValidators,
fmt.Sprintf("Should have at least %d validators", expectedValidators))
}
}
Expand Down Expand Up @@ -344,4 +344,4 @@ func (s *TestSuite) TestSolana_NetworkHealth() {
s.Require().NotNil(response.Result, fmt.Sprintf("%s should return result", test.name))
})
}
}
}