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

Commit ef79007

Browse files
authored
Merge pull request #247 from tendermint/bucky/no-gogo
Bucky/no gogo
2 parents bcfdd6d + 6e3191f commit ef79007

23 files changed

+874
-620
lines changed

Gopkg.lock

Lines changed: 14 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# Use `~` for only minor version bumps.
3333

3434
[[constraint]]
35-
name = "github.com/gogo/protobuf"
35+
name = "github.com/golang/protobuf"
3636
version = "~1.0.0"
3737

3838
[[constraint]]
@@ -45,12 +45,19 @@
4545

4646
[[constraint]]
4747
name = "github.com/tendermint/tmlibs"
48-
version = "0.8.1"
48+
branch = "develop"
49+
# version = "0.8.1"
4950

5051
[[constraint]]
5152
name = "google.golang.org/grpc"
5253
version = "~1.7.3"
5354

55+
# this got updated and broke, so locked to an old working commit ...
56+
[[override]]
57+
name = "google.golang.org/genproto"
58+
revision = "7fd901a49ba6a7f87732eb344f6e3c5b19d1b200"
59+
60+
5461
[prune]
5562
go-tests = true
5663
unused-packages = true

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ GOTOOLS = \
22
github.com/mitchellh/gox \
33
github.com/golang/dep/cmd/dep \
44
gopkg.in/alecthomas/gometalinter.v2 \
5-
github.com/gogo/protobuf/protoc-gen-gogo \
6-
github.com/gogo/protobuf/gogoproto
7-
GOTOOLS_CHECK = gox dep gometalinter.v2 protoc protoc-gen-gogo
5+
github.com/golang/protobuf/protoc-gen-go
6+
GOTOOLS_CHECK = gox dep gometalinter.v2 protoc protoc-gen-go
87
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
9-
INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf
8+
INCLUDE = -I=. -I=${GOPATH}/src
109

1110
all: check get_vendor_deps protoc build test install metalinter
1211

@@ -20,7 +19,7 @@ protoc:
2019
## If you get the following error,
2120
## "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory"
2221
## See https://stackoverflow.com/a/25518702
23-
protoc $(INCLUDE) --gogo_out=plugins=grpc:. types/*.proto
22+
protoc $(INCLUDE) --go_out=plugins=grpc:. types/*.proto
2423
@echo "--> adding nolint declarations to protobuf generated files"
2524
@awk '/package types/ { print "//nolint: gas"; print; next }1' types/types.pb.go > types/types.pb.go.new
2625
@mv types/types.pb.go.new types/types.pb.go

client/local_client.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,21 @@ func (app *localClient) EchoAsync(msg string) *ReqRes {
5353

5454
func (app *localClient) InfoAsync(req types.RequestInfo) *ReqRes {
5555
app.mtx.Lock()
56-
res := app.Application.Info(req)
56+
res := app.Application.Info(types.ToParamsInfo(req))
5757
app.mtx.Unlock()
5858
return app.callback(
5959
types.ToRequestInfo(req),
60-
types.ToResponseInfo(res),
60+
types.ToResponseInfo(types.FromResultInfo(res)),
6161
)
6262
}
6363

6464
func (app *localClient) SetOptionAsync(req types.RequestSetOption) *ReqRes {
6565
app.mtx.Lock()
66-
res := app.Application.SetOption(req)
66+
res := app.Application.SetOption(types.ToParamsSetOption(req))
6767
app.mtx.Unlock()
6868
return app.callback(
6969
types.ToRequestSetOption(req),
70-
types.ToResponseSetOption(res),
70+
types.ToResponseSetOption(types.FromResultSetOption(res)),
7171
)
7272
}
7373

@@ -77,7 +77,7 @@ func (app *localClient) DeliverTxAsync(tx []byte) *ReqRes {
7777
app.mtx.Unlock()
7878
return app.callback(
7979
types.ToRequestDeliverTx(tx),
80-
types.ToResponseDeliverTx(res),
80+
types.ToResponseDeliverTx(types.FromResultDeliverTx(res)),
8181
)
8282
}
8383

@@ -87,17 +87,17 @@ func (app *localClient) CheckTxAsync(tx []byte) *ReqRes {
8787
app.mtx.Unlock()
8888
return app.callback(
8989
types.ToRequestCheckTx(tx),
90-
types.ToResponseCheckTx(res),
90+
types.ToResponseCheckTx(types.FromResultCheckTx(res)),
9191
)
9292
}
9393

9494
func (app *localClient) QueryAsync(req types.RequestQuery) *ReqRes {
9595
app.mtx.Lock()
96-
res := app.Application.Query(req)
96+
res := app.Application.Query(types.ToParamsQuery(req))
9797
app.mtx.Unlock()
9898
return app.callback(
9999
types.ToRequestQuery(req),
100-
types.ToResponseQuery(res),
100+
types.ToResponseQuery(types.FromResultQuery(res)),
101101
)
102102
}
103103

@@ -107,38 +107,38 @@ func (app *localClient) CommitAsync() *ReqRes {
107107
app.mtx.Unlock()
108108
return app.callback(
109109
types.ToRequestCommit(),
110-
types.ToResponseCommit(res),
110+
types.ToResponseCommit(types.FromResultCommit(res)),
111111
)
112112
}
113113

114114
func (app *localClient) InitChainAsync(req types.RequestInitChain) *ReqRes {
115115
app.mtx.Lock()
116-
res := app.Application.InitChain(req)
116+
res := app.Application.InitChain(types.ToParamsInitChain(req))
117117
reqRes := app.callback(
118118
types.ToRequestInitChain(req),
119-
types.ToResponseInitChain(res),
119+
types.ToResponseInitChain(types.FromResultInitChain(res)),
120120
)
121121
app.mtx.Unlock()
122122
return reqRes
123123
}
124124

125125
func (app *localClient) BeginBlockAsync(req types.RequestBeginBlock) *ReqRes {
126126
app.mtx.Lock()
127-
res := app.Application.BeginBlock(req)
127+
res := app.Application.BeginBlock(types.ToParamsBeginBlock(req))
128128
app.mtx.Unlock()
129129
return app.callback(
130130
types.ToRequestBeginBlock(req),
131-
types.ToResponseBeginBlock(res),
131+
types.ToResponseBeginBlock(types.FromResultBeginBlock(res)),
132132
)
133133
}
134134

135135
func (app *localClient) EndBlockAsync(req types.RequestEndBlock) *ReqRes {
136136
app.mtx.Lock()
137-
res := app.Application.EndBlock(req)
137+
res := app.Application.EndBlock(types.ToParamsEndBlock(req))
138138
app.mtx.Unlock()
139139
return app.callback(
140140
types.ToRequestEndBlock(req),
141-
types.ToResponseEndBlock(res),
141+
types.ToResponseEndBlock(types.FromResultEndBlock(res)),
142142
)
143143
}
144144

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

155155
func (app *localClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) {
156156
app.mtx.Lock()
157-
res := app.Application.Info(req)
157+
res := types.FromResultInfo(app.Application.Info(types.ToParamsInfo(req)))
158158
app.mtx.Unlock()
159159
return &res, nil
160160
}
161161

162162
func (app *localClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) {
163163
app.mtx.Lock()
164-
res := app.Application.SetOption(req)
164+
res := types.FromResultSetOption(app.Application.SetOption(types.ToParamsSetOption(req)))
165165
app.mtx.Unlock()
166166
return &res, nil
167167
}
168168

169169
func (app *localClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) {
170170
app.mtx.Lock()
171-
res := app.Application.DeliverTx(tx)
171+
res := types.FromResultDeliverTx(app.Application.DeliverTx(tx))
172172
app.mtx.Unlock()
173173
return &res, nil
174174
}
175175

176176
func (app *localClient) CheckTxSync(tx []byte) (*types.ResponseCheckTx, error) {
177177
app.mtx.Lock()
178-
res := app.Application.CheckTx(tx)
178+
res := types.FromResultCheckTx(app.Application.CheckTx(tx))
179179
app.mtx.Unlock()
180180
return &res, nil
181181
}
182182

183183
func (app *localClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) {
184184
app.mtx.Lock()
185-
res := app.Application.Query(req)
185+
res := types.FromResultQuery(app.Application.Query(types.ToParamsQuery(req)))
186186
app.mtx.Unlock()
187187
return &res, nil
188188
}
189189

190190
func (app *localClient) CommitSync() (*types.ResponseCommit, error) {
191191
app.mtx.Lock()
192-
res := app.Application.Commit()
192+
res := types.FromResultCommit(app.Application.Commit())
193193
app.mtx.Unlock()
194194
return &res, nil
195195
}
196196

197197
func (app *localClient) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) {
198198
app.mtx.Lock()
199-
res := app.Application.InitChain(req)
199+
res := types.FromResultInitChain(app.Application.InitChain(types.ToParamsInitChain(req)))
200200
app.mtx.Unlock()
201201
return &res, nil
202202
}
203203

204204
func (app *localClient) BeginBlockSync(req types.RequestBeginBlock) (*types.ResponseBeginBlock, error) {
205205
app.mtx.Lock()
206-
res := app.Application.BeginBlock(req)
206+
res := types.FromResultBeginBlock(app.Application.BeginBlock(types.ToParamsBeginBlock(req)))
207207
app.mtx.Unlock()
208208
return &res, nil
209209
}
210210

211211
func (app *localClient) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) {
212212
app.mtx.Lock()
213-
res := app.Application.EndBlock(req)
213+
res := types.FromResultEndBlock(app.Application.EndBlock(types.ToParamsEndBlock(req)))
214214
app.mtx.Unlock()
215215
return &res, nil
216216
}

0 commit comments

Comments
 (0)