diff --git a/starship/cmd/starship/connect.go b/starship/cmd/starship/connect.go index cc2c7da4c..c9c1b7c95 100644 --- a/starship/cmd/starship/connect.go +++ b/starship/cmd/starship/connect.go @@ -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. diff --git a/starship/cmd/starship/main.go b/starship/cmd/starship/main.go index ac1df34b0..93103b738 100644 --- a/starship/cmd/starship/main.go +++ b/starship/cmd/starship/main.go @@ -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" ) diff --git a/starship/cmd/starship/root.go b/starship/cmd/starship/root.go index ed4478f34..d8133d804 100644 --- a/starship/cmd/starship/root.go +++ b/starship/cmd/starship/root.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "github.com/urfave/cli/v2" ) diff --git a/starship/exposer/handler_relayer.go b/starship/exposer/handler_relayer.go index 802fca81b..424282e07 100644 --- a/starship/exposer/handler_relayer.go +++ b/starship/exposer/handler_relayer.go @@ -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 diff --git a/starship/registry/model.go b/starship/registry/model.go index 971ef2b0e..ffc078ab9 100644 --- a/starship/registry/model.go +++ b/starship/registry/model.go @@ -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 { diff --git a/starship/tests/e2e/exposer_test.go b/starship/tests/e2e/exposer_test.go index c23285836..dcf086891 100644 --- a/starship/tests/e2e/exposer_test.go +++ b/starship/tests/e2e/exposer_test.go @@ -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) { @@ -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" { diff --git a/starship/tests/e2e/solana_test.go b/starship/tests/e2e/solana_test.go index 32e05e9b9..91f3c8d99 100644 --- a/starship/tests/e2e/solana_test.go +++ b/starship/tests/e2e/solana_test.go @@ -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"` } @@ -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") } @@ -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") } @@ -118,7 +118,7 @@ func (s *TestSuite) TestSolana_Status() { break } } - + if solanaChain == nil { s.T().Skip("Solana chain not found in config") } @@ -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"]) } } @@ -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"]) } } @@ -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) @@ -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 @@ -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 { @@ -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)) } } @@ -344,4 +344,4 @@ func (s *TestSuite) TestSolana_NetworkHealth() { s.Require().NotNil(response.Result, fmt.Sprintf("%s should return result", test.name)) }) } -} \ No newline at end of file +}