Browse Source

fixes from review

pull/1780/head
Ethan Buchman 8 years ago
parent
commit
5dabeffb35
4 changed files with 11 additions and 9 deletions
  1. +1
    -2
      example/block_aware/block_aware_test.go
  2. +3
    -4
      example/example_test.go
  3. +2
    -2
      tests/test_app/app.go
  4. +5
    -1
      types/validators.go

+ 1
- 2
example/block_aware/block_aware_test.go View File

@ -27,11 +27,10 @@ func TestChainAware(t *testing.T) {
// Connect to the socket
client := abcicli.NewSocketClient("unix://test.sock", false)
client.SetLogger(log.TestingLogger().With("module", "abci-client"))
if _, err := client.Start(); err != nil {
t.Fatalf("Error starting socket client: %v", err.Error())
}
client.SetLogger(log.TestingLogger().With("module", "abci-client"))
client.Start()
defer client.Stop()
n := uint64(5)


+ 3
- 4
example/example_test.go View File

@ -39,19 +39,18 @@ func testStream(t *testing.T, app types.Application) {
// Start the listener
server := server.NewSocketServer("unix://test.sock", app)
server.SetLogger(log.TestingLogger().With("module", "abci-server"))
if _, err := server.Start(); err != nil {
t.Fatalf("Error starting socket server: %v", err.Error())
}
server.SetLogger(log.TestingLogger().With("module", "abci-server"))
defer server.Stop()
// Connect to the socket
client := abcicli.NewSocketClient("unix://test.sock", false)
client.SetLogger(log.TestingLogger().With("module", "abci-client"))
if _, err := client.Start(); err != nil {
t.Fatalf("Error starting socket client: %v", err.Error())
}
client.SetLogger(log.TestingLogger().With("module", "abci-client"))
client.Start()
defer client.Stop()
done := make(chan struct{})
@ -113,10 +112,10 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) {
// Start the listener
server := server.NewGRPCServer("unix://test.sock", app)
server.SetLogger(log.TestingLogger().With("module", "abci-server"))
if _, err := server.Start(); err != nil {
t.Fatalf("Error starting GRPC server: %v", err.Error())
}
server.SetLogger(log.TestingLogger().With("module", "abci-server"))
defer server.Stop()
// Connect to the socket


+ 2
- 2
tests/test_app/app.go View File

@ -38,12 +38,12 @@ func startClient(abciType string) abcicli.Client {
if err != nil {
panic(err.Error())
}
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
client.SetLogger(logger.With("module", "abcicli"))
if _, err := client.Start(); err != nil {
panic("connecting to abci_app: " + err.Error())
}
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
client.SetLogger(logger.With("module", "abcicli"))
return client
}


+ 5
- 1
types/validators.go View File

@ -5,6 +5,7 @@ import (
"encoding/json"
"github.com/tendermint/go-wire/data"
cmn "github.com/tendermint/tmlibs/common"
)
// validators implements sort
@ -38,6 +39,9 @@ func ValidatorsString(vs Validators) string {
for i, v := range vs {
s[i] = validatorPretty{v.PubKey, v.Power}
}
b, _ := json.Marshal(s)
b, err := json.Marshal(s)
if err != nil {
cmn.PanicSanity(err.Error())
}
return string(b)
}

Loading…
Cancel
Save