Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sunify committed Dec 4, 2018
1 parent 4bbdc0f commit 303c6df
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 67 deletions.
100 changes: 46 additions & 54 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@

[prune]
go-tests = true
unused-packages = true
unused-packages = true
2 changes: 1 addition & 1 deletion abci/client/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func (cli *grpcClient) CheckBridgeAsync(params types.RequestCheckBridge) *ReqRes
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{&types.Response_CheckBridge{res}})
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_CheckBridge{res}})
}

func (cli *grpcClient) finishAsyncCall(req *types.Request, res *types.Response) *ReqRes {
Expand Down
8 changes: 4 additions & 4 deletions abci/example/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ func testStream(t *testing.T, app types.Application) {
numDeliverTxs := 20000

// Start the listener
server := abciserver.NewSocketServer("unix://test.sock", app)
server := abciserver.NewSocketServer("unix://test1.sock", app)
server.SetLogger(log.TestingLogger().With("module", "abci-server"))
if err := server.Start(); err != nil {
require.NoError(t, err, "Error starting socket server")
}
defer server.Stop()

// Connect to the socket
client := abcicli.NewSocketClient("unix://test.sock", false)
client := abcicli.NewSocketClient("unix://test1.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())
Expand Down Expand Up @@ -115,15 +115,15 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) {
numDeliverTxs := 2000

// Start the listener
server := abciserver.NewGRPCServer("unix://test.sock", app)
server := abciserver.NewGRPCServer("unix://test1.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())
}
defer server.Stop()

// Connect to the socket
conn, err := grpc.Dial("unix://test.sock", grpc.WithInsecure(), grpc.WithDialer(dialerFunc))
conn, err := grpc.Dial("unix://test1.sock", grpc.WithInsecure(), grpc.WithDialer(dialerFunc))
if err != nil {
t.Fatalf("Error dialing GRPC server: %v", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion abci/example/kvstore/kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (app *KVStoreApplication) CheckTx(tx []byte) types.ResponseCheckTx {
}

func (app *KVStoreApplication) CheckBridge(req types.RequestCheckBridge) types.ResponseCheckBridge {
return types.ResponseCheckBridge{1}
return types.ResponseCheckBridge{Status: 1}
}

func (app *KVStoreApplication) Commit() types.ResponseCommit {
Expand Down
2 changes: 1 addition & 1 deletion abci/tests/benchmarks/parallel/parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func main() {

conn, err := cmn.Connect("unix://test.sock")
conn, err := cmn.Connect("unix://test1.sock")
if err != nil {
log.Fatal(err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion abci/tests/benchmarks/simple/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func main() {

conn, err := cmn.Connect("unix://test.sock")
conn, err := cmn.Connect("unix://test1.sock")
if err != nil {
log.Fatal(err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion consensus/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func TestReactorWithEvidence(t *testing.T) {

// Make ConsensusState
blockExec := sm.NewBlockExecutor(stateDB, log.TestingLogger(), proxyAppConnCon, mempool, evpool)
cs := NewConsensusState(thisConfig.Consensus, state, blockExec, blockStore, mempool, evpool)
cs := NewConsensusState(thisConfig.Consensus, state, blockExec, blockStore, mempool, evpool, proxyAppConnCon)
cs.SetLogger(log.TestingLogger().With("module", "consensus"))
cs.SetPrivValidator(pv)

Expand Down
2 changes: 1 addition & 1 deletion consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ func (cs *ConsensusState) enterPropose(height int64, round int) {
if cs.isProposer() {
logger.Info("enterPropose: Our turn to propose", "proposer", cs.Validators.GetProposer().Address, "privValidator", cs.privValidator)
if height%32 == 0 {
rsp, err := cs.proxyApp.CheckBridgeSync(abci.RequestCheckBridge{int32(round)})
rsp, err := cs.proxyApp.CheckBridgeSync(abci.RequestCheckBridge{Height: int32(round)})
if err != nil {
logger.Error("Error in proxyAppConn.EndBlock", "err", err)
return
Expand Down
2 changes: 1 addition & 1 deletion libs/common/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// Connect dials the given address and returns a net.Conn. The protoAddr argument should be prefixed with the protocol,
// eg. "tcp://127.0.0.1:8080" or "unix:///tmp/test.sock"
// eg. "tcp://127.0.0.1:8080" or "unix:///tmp/test1.sock"
func Connect(protoAddr string) (net.Conn, error) {
proto, address := ProtocolAndAddress(protoAddr)
conn, err := net.Dial(proto, address)
Expand Down
Loading

0 comments on commit 303c6df

Please sign in to comment.