Skip to content
This repository has been archived by the owner on Jul 15, 2018. It is now read-only.

Commit

Permalink
Revert "Merge pull request #247 from tendermint/bucky/no-gogo"
Browse files Browse the repository at this point in the history
This reverts commit ef79007, reversing
changes made to bcfdd6d.
  • Loading branch information
ebuchman committed Jun 1, 2018
1 parent ef79007 commit 90c3a46
Show file tree
Hide file tree
Showing 23 changed files with 620 additions and 874 deletions.
40 changes: 26 additions & 14 deletions Gopkg.lock

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

11 changes: 2 additions & 9 deletions Gopkg.toml
Expand Up @@ -32,7 +32,7 @@
# Use `~` for only minor version bumps.

[[constraint]]
name = "github.com/golang/protobuf"
name = "github.com/gogo/protobuf"
version = "~1.0.0"

[[constraint]]
Expand All @@ -45,19 +45,12 @@

[[constraint]]
name = "github.com/tendermint/tmlibs"
branch = "develop"
# version = "0.8.1"
version = "0.8.1"

[[constraint]]
name = "google.golang.org/grpc"
version = "~1.7.3"

# this got updated and broke, so locked to an old working commit ...
[[override]]
name = "google.golang.org/genproto"
revision = "7fd901a49ba6a7f87732eb344f6e3c5b19d1b200"


[prune]
go-tests = true
unused-packages = true
9 changes: 5 additions & 4 deletions Makefile
Expand Up @@ -2,10 +2,11 @@ GOTOOLS = \
github.com/mitchellh/gox \
github.com/golang/dep/cmd/dep \
gopkg.in/alecthomas/gometalinter.v2 \
github.com/golang/protobuf/protoc-gen-go
GOTOOLS_CHECK = gox dep gometalinter.v2 protoc protoc-gen-go
github.com/gogo/protobuf/protoc-gen-gogo \
github.com/gogo/protobuf/gogoproto
GOTOOLS_CHECK = gox dep gometalinter.v2 protoc protoc-gen-gogo
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
INCLUDE = -I=. -I=${GOPATH}/src
INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf

all: check get_vendor_deps protoc build test install metalinter

Expand All @@ -19,7 +20,7 @@ protoc:
## If you get the following error,
## "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory"
## See https://stackoverflow.com/a/25518702
protoc $(INCLUDE) --go_out=plugins=grpc:. types/*.proto
protoc $(INCLUDE) --gogo_out=plugins=grpc:. types/*.proto
@echo "--> adding nolint declarations to protobuf generated files"
@awk '/package types/ { print "//nolint: gas"; print; next }1' types/types.pb.go > types/types.pb.go.new
@mv types/types.pb.go.new types/types.pb.go
Expand Down
48 changes: 24 additions & 24 deletions client/local_client.go
Expand Up @@ -53,21 +53,21 @@ func (app *localClient) EchoAsync(msg string) *ReqRes {

func (app *localClient) InfoAsync(req types.RequestInfo) *ReqRes {
app.mtx.Lock()
res := app.Application.Info(types.ToParamsInfo(req))
res := app.Application.Info(req)
app.mtx.Unlock()
return app.callback(
types.ToRequestInfo(req),
types.ToResponseInfo(types.FromResultInfo(res)),
types.ToResponseInfo(res),
)
}

func (app *localClient) SetOptionAsync(req types.RequestSetOption) *ReqRes {
app.mtx.Lock()
res := app.Application.SetOption(types.ToParamsSetOption(req))
res := app.Application.SetOption(req)
app.mtx.Unlock()
return app.callback(
types.ToRequestSetOption(req),
types.ToResponseSetOption(types.FromResultSetOption(res)),
types.ToResponseSetOption(res),
)
}

Expand All @@ -77,7 +77,7 @@ func (app *localClient) DeliverTxAsync(tx []byte) *ReqRes {
app.mtx.Unlock()
return app.callback(
types.ToRequestDeliverTx(tx),
types.ToResponseDeliverTx(types.FromResultDeliverTx(res)),
types.ToResponseDeliverTx(res),
)
}

Expand All @@ -87,17 +87,17 @@ func (app *localClient) CheckTxAsync(tx []byte) *ReqRes {
app.mtx.Unlock()
return app.callback(
types.ToRequestCheckTx(tx),
types.ToResponseCheckTx(types.FromResultCheckTx(res)),
types.ToResponseCheckTx(res),
)
}

func (app *localClient) QueryAsync(req types.RequestQuery) *ReqRes {
app.mtx.Lock()
res := app.Application.Query(types.ToParamsQuery(req))
res := app.Application.Query(req)
app.mtx.Unlock()
return app.callback(
types.ToRequestQuery(req),
types.ToResponseQuery(types.FromResultQuery(res)),
types.ToResponseQuery(res),
)
}

Expand All @@ -107,38 +107,38 @@ func (app *localClient) CommitAsync() *ReqRes {
app.mtx.Unlock()
return app.callback(
types.ToRequestCommit(),
types.ToResponseCommit(types.FromResultCommit(res)),
types.ToResponseCommit(res),
)
}

func (app *localClient) InitChainAsync(req types.RequestInitChain) *ReqRes {
app.mtx.Lock()
res := app.Application.InitChain(types.ToParamsInitChain(req))
res := app.Application.InitChain(req)
reqRes := app.callback(
types.ToRequestInitChain(req),
types.ToResponseInitChain(types.FromResultInitChain(res)),
types.ToResponseInitChain(res),
)
app.mtx.Unlock()
return reqRes
}

func (app *localClient) BeginBlockAsync(req types.RequestBeginBlock) *ReqRes {
app.mtx.Lock()
res := app.Application.BeginBlock(types.ToParamsBeginBlock(req))
res := app.Application.BeginBlock(req)
app.mtx.Unlock()
return app.callback(
types.ToRequestBeginBlock(req),
types.ToResponseBeginBlock(types.FromResultBeginBlock(res)),
types.ToResponseBeginBlock(res),
)
}

func (app *localClient) EndBlockAsync(req types.RequestEndBlock) *ReqRes {
app.mtx.Lock()
res := app.Application.EndBlock(types.ToParamsEndBlock(req))
res := app.Application.EndBlock(req)
app.mtx.Unlock()
return app.callback(
types.ToRequestEndBlock(req),
types.ToResponseEndBlock(types.FromResultEndBlock(res)),
types.ToResponseEndBlock(res),
)
}

Expand All @@ -154,63 +154,63 @@ func (app *localClient) EchoSync(msg string) (*types.ResponseEcho, error) {

func (app *localClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) {
app.mtx.Lock()
res := types.FromResultInfo(app.Application.Info(types.ToParamsInfo(req)))
res := app.Application.Info(req)
app.mtx.Unlock()
return &res, nil
}

func (app *localClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) {
app.mtx.Lock()
res := types.FromResultSetOption(app.Application.SetOption(types.ToParamsSetOption(req)))
res := app.Application.SetOption(req)
app.mtx.Unlock()
return &res, nil
}

func (app *localClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) {
app.mtx.Lock()
res := types.FromResultDeliverTx(app.Application.DeliverTx(tx))
res := app.Application.DeliverTx(tx)
app.mtx.Unlock()
return &res, nil
}

func (app *localClient) CheckTxSync(tx []byte) (*types.ResponseCheckTx, error) {
app.mtx.Lock()
res := types.FromResultCheckTx(app.Application.CheckTx(tx))
res := app.Application.CheckTx(tx)
app.mtx.Unlock()
return &res, nil
}

func (app *localClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) {
app.mtx.Lock()
res := types.FromResultQuery(app.Application.Query(types.ToParamsQuery(req)))
res := app.Application.Query(req)
app.mtx.Unlock()
return &res, nil
}

func (app *localClient) CommitSync() (*types.ResponseCommit, error) {
app.mtx.Lock()
res := types.FromResultCommit(app.Application.Commit())
res := app.Application.Commit()
app.mtx.Unlock()
return &res, nil
}

func (app *localClient) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) {
app.mtx.Lock()
res := types.FromResultInitChain(app.Application.InitChain(types.ToParamsInitChain(req)))
res := app.Application.InitChain(req)
app.mtx.Unlock()
return &res, nil
}

func (app *localClient) BeginBlockSync(req types.RequestBeginBlock) (*types.ResponseBeginBlock, error) {
app.mtx.Lock()
res := types.FromResultBeginBlock(app.Application.BeginBlock(types.ToParamsBeginBlock(req)))
res := app.Application.BeginBlock(req)
app.mtx.Unlock()
return &res, nil
}

func (app *localClient) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) {
app.mtx.Lock()
res := types.FromResultEndBlock(app.Application.EndBlock(types.ToParamsEndBlock(req)))
res := app.Application.EndBlock(req)
app.mtx.Unlock()
return &res, nil
}
Expand Down

0 comments on commit 90c3a46

Please sign in to comment.