Skip to content

Commit

Permalink
fix: validation in go template
Browse files Browse the repository at this point in the history
  • Loading branch information
shifty11 committed Jan 16, 2024
1 parent 8c9e8d8 commit f576022
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions e2etest/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

const testName = "Kyvejs e2e tests"

func setup(t *testing.T, log *zap.Logger) ([]utils.TestConfig, string, *cosmos.CosmosChain, *interchaintest.Interchain, *utils.Executor) {
func setup(t *testing.T, log *zap.Logger) ([]utils.TestConfig, string, *cosmos.CosmosChain, *interchaintest.Interchain, *cosmos.Broadcaster) {
ctx := context.Background()
g := NewWithT(t)

Expand Down Expand Up @@ -104,7 +104,7 @@ func setup(t *testing.T, log *zap.Logger) ([]utils.TestConfig, string, *cosmos.C
tcfgs = append(tcfgs, *cfg)
}

return tcfgs, network, kyveChain, interchain, executor
return tcfgs, network, kyveChain, interchain, broadcaster
}

func removeFolders(tmpIntegrations []utils.TmpIntegration) error {
Expand Down Expand Up @@ -150,7 +150,6 @@ func bootstrapTmpIntegrations(t *testing.T, log *zap.Logger, protocolBuilder *ut
}

func TestProtocolNode(t *testing.T) {
g := NewWithT(t)
log := zaptest.NewLogger(t)
protocolBuilder := utils.NewProtocolBuilder(testName, log)
t.Cleanup(func() {
Expand All @@ -163,7 +162,7 @@ func TestProtocolNode(t *testing.T) {
// Create integrations for all available templates in kystrap
bootstrapTmpIntegrations(t, log, protocolBuilder)

testConfigs, network, kyveChain, interchain, executor := setup(t, log)
testConfigs, network, kyveChain, interchain, broadcaster := setup(t, log)

t.Parallel()
t.Cleanup(func() {
Expand All @@ -178,7 +177,7 @@ func TestProtocolNode(t *testing.T) {
t.Run(fmt.Sprintf("Test protol runtime for %s", testConfig.Integration.Name), func(t *testing.T) {
// This will run the test in parallel
t.Parallel()

g := NewWithT(t)
protocolRunner := utils.NewProtocolRunner(testConfig, network, kyveChain.GetAPIAddress(), kyveChain.GetRPCAddress())

g.Expect(protocolRunner.RunProtocolNodes()).To(BeNil())
Expand All @@ -188,6 +187,7 @@ func TestProtocolNode(t *testing.T) {
log.Error(err.Error())
}
}()
executor := utils.NewExecutor(g, log, kyveChain, broadcaster)

// Create 3 protocol nodes
executor.CreateProtocolNode(testConfig.Alice.ProtocolNode)
Expand Down
5 changes: 3 additions & 2 deletions e2etest/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package utils
import (
"encoding/json"
"fmt"
"os"
"path/filepath"

"github.com/creasty/defaults"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"gopkg.in/yaml.v3"
"os"
"path/filepath"
)

// integrationsPath is the path to the integrations folder
Expand Down
2 changes: 1 addition & 1 deletion e2etest/utils/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (pc *ProtocolBuilder) BuildDependencies() error {
defer cli.Close()

// Build all the images concurrently
configs := append([]DockerImage{protocolImage, testapiImage, kystrapImage})
configs := []DockerImage{protocolImage, testapiImage, kystrapImage}
errChs := make([]chan error, len(configs))
for i, img := range configs {
errChs[i] = make(chan error)
Expand Down
2 changes: 1 addition & 1 deletion tools/kystrap/templates/go/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (t *{{ .name | ToPascal }}Server) ValidateDataItem(ctx context.Context, req
}

// Check if the proposedDataItem and validationDataItem are equal
if !reflect.DeepEqual(proposed, validation) {
if reflect.DeepEqual(proposed, validation) {
return &pb.ValidateDataItemResponse{Vote: bundlestypes.VOTE_TYPE_VALID}, nil
}

Expand Down

0 comments on commit f576022

Please sign in to comment.