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

Bucky/no gogo #247

Merged
merged 9 commits into from
May 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 14 additions & 26 deletions Gopkg.lock

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

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

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

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

[[constraint]]
name = "github.com/tendermint/tmlibs"
version = "0.8.1"
branch = "develop"
# 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: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ GOTOOLS = \
github.com/mitchellh/gox \
github.com/golang/dep/cmd/dep \
gopkg.in/alecthomas/gometalinter.v2 \
github.com/gogo/protobuf/protoc-gen-gogo \
github.com/gogo/protobuf/gogoproto
GOTOOLS_CHECK = gox dep gometalinter.v2 protoc protoc-gen-gogo
github.com/golang/protobuf/protoc-gen-go
GOTOOLS_CHECK = gox dep gometalinter.v2 protoc protoc-gen-go
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf
INCLUDE = -I=. -I=${GOPATH}/src

all: check get_vendor_deps protoc build test install metalinter

Expand All @@ -20,7 +19,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) --gogo_out=plugins=grpc:. types/*.proto
protoc $(INCLUDE) --go_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
Original file line number Diff line number Diff line change
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(req)
res := app.Application.Info(types.ToParamsInfo(req))
app.mtx.Unlock()
return app.callback(
types.ToRequestInfo(req),
types.ToResponseInfo(res),
types.ToResponseInfo(types.FromResultInfo(res)),
)
}

func (app *localClient) SetOptionAsync(req types.RequestSetOption) *ReqRes {
app.mtx.Lock()
res := app.Application.SetOption(req)
res := app.Application.SetOption(types.ToParamsSetOption(req))
app.mtx.Unlock()
return app.callback(
types.ToRequestSetOption(req),
types.ToResponseSetOption(res),
types.ToResponseSetOption(types.FromResultSetOption(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(res),
types.ToResponseDeliverTx(types.FromResultDeliverTx(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(res),
types.ToResponseCheckTx(types.FromResultCheckTx(res)),
)
}

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

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

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

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

func (app *localClient) EndBlockAsync(req types.RequestEndBlock) *ReqRes {
app.mtx.Lock()
res := app.Application.EndBlock(req)
res := app.Application.EndBlock(types.ToParamsEndBlock(req))
app.mtx.Unlock()
return app.callback(
types.ToRequestEndBlock(req),
types.ToResponseEndBlock(res),
types.ToResponseEndBlock(types.FromResultEndBlock(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 := app.Application.Info(req)
res := types.FromResultInfo(app.Application.Info(types.ToParamsInfo(req)))
app.mtx.Unlock()
return &res, nil
}

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

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

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

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

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

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

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

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