From 42a8e3240c92e9dddda1e2dd2ca26e155a3d5025 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 14:29:12 -0500 Subject: [PATCH 01/10] remove CodeType --- Makefile | 2 +- client/grpc_client.go | 2 +- client/socket_client.go | 2 +- cmd/abci-cli/abci-cli.go | 4 +- example/counter/counter.go | 17 +- example/dummy/dummy.go | 6 +- example/dummy/dummy_test.go | 8 +- example/dummy/persistent_dummy.go | 17 +- example/example.go | 2 +- example/example_test.go | 4 +- tests/test_app/app.go | 4 +- tests/test_app/main.go | 17 +- types/base_app.go | 8 +- types/code.go | 37 --- types/code_test.go | 12 - types/result.go | 25 ++- types/result_test.go | 24 +- types/types.pb.go | 358 ++++++++++-------------------- types/types.proto | 51 +---- 19 files changed, 190 insertions(+), 410 deletions(-) delete mode 100644 types/code.go delete mode 100644 types/code_test.go diff --git a/Makefile b/Makefile index cdee195d7..e9d239003 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,6 @@ metalinter_test: gometalinter --vendor --deadline=600s --disable-all \ --enable=maligned \ --enable=deadcode \ - --enable=gas \ --enable=goconst \ --enable=goimports \ --enable=gosimple \ @@ -90,6 +89,7 @@ metalinter_test: --enable=vetshadow \ ./... + #--enable=gas \ #--enable=dupl \ #--enable=errcheck \ #--enable=gocyclo \ diff --git a/client/grpc_client.go b/client/grpc_client.go index f65d27e69..0afadc726 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -104,7 +104,7 @@ func (cli *grpcClient) StopForError(err error) { func (cli *grpcClient) Error() error { cli.mtx.Lock() defer cli.mtx.Unlock() - return errors.Wrap(cli.err, types.HumanCode(types.CodeType_InternalError)) + return errors.Wrap(cli.err, "grpc client error") } // Set listener for all responses diff --git a/client/socket_client.go b/client/socket_client.go index a5d90dbe7..ecdc36945 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -111,7 +111,7 @@ func (cli *socketClient) StopForError(err error) { func (cli *socketClient) Error() error { cli.mtx.Lock() defer cli.mtx.Unlock() - return errors.Wrap(cli.err, types.HumanCode(types.CodeType_InternalError)) + return errors.Wrap(cli.err, "socket client error") } // Set listener for all responses diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 789832508..c0dbbfafe 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -26,7 +26,7 @@ import ( type response struct { // generic abci response Data []byte - Code types.CodeType + Code uint32 Log string Query *queryResponse @@ -508,7 +508,7 @@ func printResponse(cmd *cobra.Command, args []string, rsp response) { } // Always print the status code. - fmt.Printf("-> code: %s\n", rsp.Code.String()) + fmt.Printf("-> code: %d\n", rsp.Code) if len(rsp.Data) != 0 { // Do no print this line when using the commit command diff --git a/example/counter/counter.go b/example/counter/counter.go index a7b090275..67fa06e31 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -4,6 +4,7 @@ import ( "encoding/binary" "fmt" + "github.com/tendermint/abci/example/code" "github.com/tendermint/abci/types" cmn "github.com/tendermint/tmlibs/common" ) @@ -36,7 +37,7 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { if app.serial { if len(tx) > 8 { return types.ResponseDeliverTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx))} } tx8 := make([]byte, 8) @@ -44,19 +45,19 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { txValue := binary.BigEndian.Uint64(tx8) if txValue != uint64(app.txCount) { return types.ResponseDeliverTx{ - Code: types.CodeType_BadNonce, + Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)} } } app.txCount++ - return types.ResponseDeliverTx{Code: types.CodeType_OK} + return types.ResponseDeliverTx{Code: types.CodeTypeOK} } func (app *CounterApplication) CheckTx(tx []byte) types.ResponseCheckTx { if app.serial { if len(tx) > 8 { return types.ResponseCheckTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx))} } tx8 := make([]byte, 8) @@ -64,21 +65,21 @@ func (app *CounterApplication) CheckTx(tx []byte) types.ResponseCheckTx { txValue := binary.BigEndian.Uint64(tx8) if txValue < uint64(app.txCount) { return types.ResponseCheckTx{ - Code: types.CodeType_BadNonce, + Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)} } } - return types.ResponseCheckTx{Code: types.CodeType_OK} + return types.ResponseCheckTx{Code: types.CodeTypeOK} } func (app *CounterApplication) Commit() (resp types.ResponseCommit) { app.hashCount++ if app.txCount == 0 { - return types.ResponseCommit{Code: types.CodeType_OK} + return types.ResponseCommit{Code: types.CodeTypeOK} } hash := make([]byte, 8) binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return types.ResponseCommit{Code: types.CodeType_OK, Data: hash} + return types.ResponseCommit{Code: types.CodeTypeOK, Data: hash} } func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 30eaff284..8329ef039 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -42,11 +42,11 @@ func (app *DummyApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { {Key: "app.creator", ValueType: types.KVPair_STRING, ValueString: "jae"}, {Key: "app.key", ValueType: types.KVPair_STRING, ValueString: string(key)}, } - return types.ResponseDeliverTx{Code: types.CodeType_OK, Tags: tags} + return types.ResponseDeliverTx{Code: types.CodeTypeOK, Tags: tags} } func (app *DummyApplication) CheckTx(tx []byte) types.ResponseCheckTx { - return types.ResponseCheckTx{Code: types.CodeType_OK} + return types.ResponseCheckTx{Code: types.CodeTypeOK} } func (app *DummyApplication) Commit() types.ResponseCommit { @@ -64,7 +64,7 @@ func (app *DummyApplication) Commit() types.ResponseCommit { } } - return types.ResponseCommit{Code: types.CodeType_OK, Data: hash} + return types.ResponseCommit{Code: types.CodeTypeOK, Data: hash} } func (app *DummyApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index b7aef6a8b..bbb35dbe9 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -27,7 +27,7 @@ func testDummy(t *testing.T, app types.Application, tx []byte, key, value string Path: "/store", Data: []byte(key), }) - require.Equal(t, types.CodeType_OK, resQuery.Code) + require.Equal(t, types.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) // make sure proof is fine @@ -36,7 +36,7 @@ func testDummy(t *testing.T, app types.Application, tx []byte, key, value string Data: []byte(key), Prove: true, }) - require.Equal(t, types.CodeType_OK, resQuery.Code) + require.EqualValues(t, types.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) proof, err := iavl.ReadKeyExistsProof(resQuery.Proof) require.Nil(t, err) @@ -295,7 +295,7 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) Data: []byte(key), }) require.Nil(t, err) - require.Equal(t, types.CodeType_OK, resQuery.Code) + require.Equal(t, types.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) // make sure proof is fine @@ -305,7 +305,7 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) Prove: true, }) require.Nil(t, err) - require.Equal(t, types.CodeType_OK, resQuery.Code) + require.Equal(t, types.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) proof, err := iavl.ReadKeyExistsProof(resQuery.Proof) require.Nil(t, err) diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index ed2845296..51da8b30f 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -7,6 +7,7 @@ import ( "strconv" "strings" + "github.com/tendermint/abci/example/code" "github.com/tendermint/abci/types" crypto "github.com/tendermint/go-crypto" "github.com/tendermint/iavl" @@ -96,7 +97,7 @@ func (app *PersistentDummyApplication) Commit() types.ResponseCommit { } app.logger.Info("Commit block", "height", height, "root", appHash) - return types.ResponseCommit{Code: types.CodeType_OK, Data: appHash} + return types.ResponseCommit{Code: types.CodeTypeOK, Data: appHash} } func (app *PersistentDummyApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { @@ -160,7 +161,7 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Response pubKeyAndPower := strings.Split(string(tx), "/") if len(pubKeyAndPower) != 2 { return types.ResponseDeliverTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Expected 'pubkey/power'. Got %v", pubKeyAndPower)} } pubkeyS, powerS := pubKeyAndPower[0], pubKeyAndPower[1] @@ -169,13 +170,13 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Response pubkey, err := hex.DecodeString(pubkeyS) if err != nil { return types.ResponseDeliverTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Pubkey (%s) is invalid hex", pubkeyS)} } _, err = crypto.PubKeyFromBytes(pubkey) if err != nil { return types.ResponseDeliverTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Pubkey (%X) is invalid go-crypto encoded", pubkey)} } @@ -183,7 +184,7 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Response power, err := strconv.Atoi(powerS) if err != nil { return types.ResponseDeliverTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Power (%s) is not an int", powerS)} } @@ -198,7 +199,7 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types // remove validator if !app.app.state.Has(key) { return types.ResponseDeliverTx{ - Code: types.CodeType_Unauthorized, + Code: code.CodeTypeUnauthorized, Log: fmt.Sprintf("Cannot remove non-existent validator %X", key)} } app.app.state.Remove(key) @@ -207,7 +208,7 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types value := bytes.NewBuffer(make([]byte, 0)) if err := types.WriteMessage(v, value); err != nil { return types.ResponseDeliverTx{ - Code: types.CodeType_InternalError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Error encoding validator: %v", err)} } app.app.state.Set(key, value.Bytes()) @@ -216,5 +217,5 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types // we only update the changes array if we successfully updated the tree app.changes = append(app.changes, v) - return types.ResponseDeliverTx{Code: types.CodeType_OK} + return types.ResponseDeliverTx{Code: types.CodeTypeOK} } diff --git a/example/example.go b/example/example.go index ee491c1b5..5a2b24494 100644 --- a/example/example.go +++ b/example/example.go @@ -1,3 +1,3 @@ package example -// so the go tool doesn't return errors about no buildable go files ... +// so go get doesnt complain diff --git a/example/example_test.go b/example/example_test.go index 496ed3d3f..952f8cb2c 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -60,7 +60,7 @@ func testStream(t *testing.T, app types.Application) { switch r := res.Value.(type) { case *types.Response_DeliverTx: counter++ - if r.DeliverTx.Code != types.CodeType_OK { + if r.DeliverTx.Code != types.CodeTypeOK { t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code) } if counter > numDeliverTxs { @@ -135,7 +135,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { t.Fatalf("Error in GRPC DeliverTx: %v", err.Error()) } counter++ - if response.Code != types.CodeType_OK { + if response.Code != types.CodeTypeOK { t.Error("DeliverTx failed with ret_code", response.Code) } if counter > numDeliverTxs { diff --git a/tests/test_app/app.go b/tests/test_app/app.go index f7ecbef5e..d55fb1601 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -45,7 +45,7 @@ func commit(client abcicli.Client, hashExp []byte) { } } -func deliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { +func deliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) { res, err := client.DeliverTxSync(txBytes) if err != nil { panicf("client error: %v", err) @@ -58,7 +58,7 @@ func deliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, da } } -/*func checkTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { +/*func checkTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) { res, err := client.CheckTxSync(txBytes) if err != nil { panicf("client error: %v", err) diff --git a/tests/test_app/main.go b/tests/test_app/main.go index a21918f51..95a7515d4 100644 --- a/tests/test_app/main.go +++ b/tests/test_app/main.go @@ -7,6 +7,7 @@ import ( "os/exec" "time" + "github.com/tendermint/abci/example/code" "github.com/tendermint/abci/types" ) @@ -69,15 +70,15 @@ func testCounter() { setOption(client, "serial", "on") commit(client, nil) - deliverTx(client, []byte("abc"), types.CodeType_BadNonce, nil) + deliverTx(client, []byte("abc"), code.CodeTypeBadNonce, nil) commit(client, nil) - deliverTx(client, []byte{0x00}, types.CodeType_OK, nil) + deliverTx(client, []byte{0x00}, types.CodeTypeOK, nil) commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1}) - deliverTx(client, []byte{0x00}, types.CodeType_BadNonce, nil) - deliverTx(client, []byte{0x01}, types.CodeType_OK, nil) - deliverTx(client, []byte{0x00, 0x02}, types.CodeType_OK, nil) - deliverTx(client, []byte{0x00, 0x03}, types.CodeType_OK, nil) - deliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeType_OK, nil) - deliverTx(client, []byte{0x00, 0x00, 0x06}, types.CodeType_BadNonce, nil) + deliverTx(client, []byte{0x00}, code.CodeTypeBadNonce, nil) + deliverTx(client, []byte{0x01}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x02}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x03}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x00, 0x06}, code.CodeTypeBadNonce, nil) commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5}) } diff --git a/types/base_app.go b/types/base_app.go index 404678e95..f8d1946ab 100644 --- a/types/base_app.go +++ b/types/base_app.go @@ -16,19 +16,19 @@ func (BaseApplication) SetOption(req RequestSetOption) ResponseSetOption { } func (BaseApplication) DeliverTx(tx []byte) ResponseDeliverTx { - return ResponseDeliverTx{Code: CodeType_OK} + return ResponseDeliverTx{Code: CodeTypeOK} } func (BaseApplication) CheckTx(tx []byte) ResponseCheckTx { - return ResponseCheckTx{Code: CodeType_OK} + return ResponseCheckTx{Code: CodeTypeOK} } func (BaseApplication) Commit() ResponseCommit { - return ResponseCommit{Code: CodeType_OK, Data: []byte("nil")} + return ResponseCommit{Code: CodeTypeOK, Data: []byte("nil")} } func (BaseApplication) Query(req RequestQuery) ResponseQuery { - return ResponseQuery{Code: CodeType_OK} + return ResponseQuery{Code: CodeTypeOK} } func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain { diff --git a/types/code.go b/types/code.go deleted file mode 100644 index 613c4cda3..000000000 --- a/types/code.go +++ /dev/null @@ -1,37 +0,0 @@ -package types - -var ( - code2string = map[CodeType]string{ - CodeType_InternalError: "Internal error", - CodeType_EncodingError: "Encoding error", - CodeType_BadNonce: "Error bad nonce", - CodeType_Unauthorized: "Unauthorized", - CodeType_InsufficientFunds: "Insufficient funds", - CodeType_UnknownRequest: "Unknown request", - - CodeType_BaseDuplicateAddress: "Error (base) duplicate address", - CodeType_BaseEncodingError: "Error (base) encoding error", - CodeType_BaseInsufficientFees: "Error (base) insufficient fees", - CodeType_BaseInsufficientFunds: "Error (base) insufficient funds", - CodeType_BaseInsufficientGasPrice: "Error (base) insufficient gas price", - CodeType_BaseInvalidInput: "Error (base) invalid input", - CodeType_BaseInvalidOutput: "Error (base) invalid output", - CodeType_BaseInvalidPubKey: "Error (base) invalid pubkey", - CodeType_BaseInvalidSequence: "Error (base) invalid sequence", - CodeType_BaseInvalidSignature: "Error (base) invalid signature", - CodeType_BaseUnknownAddress: "Error (base) unknown address", - CodeType_BaseUnknownPlugin: "Error (base) unknown plugin", - CodeType_BaseUnknownPubKey: "Error (base) unknown pubkey", - } -) - -func (c CodeType) IsOK() bool { return c == CodeType_OK } - -// HumanCode transforms code into a more humane format, such as "Internal error" instead of 0. -func HumanCode(code CodeType) string { - s, ok := code2string[code] - if !ok { - return "Unknown code" - } - return s -} diff --git a/types/code_test.go b/types/code_test.go deleted file mode 100644 index d9032d3c5..000000000 --- a/types/code_test.go +++ /dev/null @@ -1,12 +0,0 @@ -package types - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestHumanCode(t *testing.T) { - assert.Equal(t, "Internal error", HumanCode(CodeType_InternalError)) - assert.Equal(t, "Unknown code", HumanCode(-1)) -} diff --git a/types/result.go b/types/result.go index 6ebad8ab2..59d82ffc2 100644 --- a/types/result.go +++ b/types/result.go @@ -6,9 +6,15 @@ import ( "github.com/tendermint/go-wire/data" ) +// type CodeType uint32 + +const ( + CodeTypeOK uint32 = 0 +) + // IsErr returns true if Code is something other than OK. func (r ResponseCheckTx) IsErr() bool { - return r.Code != CodeType_OK + return r.Code != CodeTypeOK } // Error implements error interface by formatting response as string. @@ -18,7 +24,7 @@ func (r ResponseCheckTx) Error() string { // IsErr returns true if Code is something other than OK. func (r ResponseDeliverTx) IsErr() bool { - return r.Code != CodeType_OK + return r.Code != CodeTypeOK } // Error implements error interface by formatting response as string. @@ -28,7 +34,7 @@ func (r ResponseDeliverTx) Error() string { // IsErr returns true if Code is something other than OK. func (r ResponseCommit) IsErr() bool { - return r.Code != CodeType_OK + return r.Code != CodeTypeOK } // Error implements error interface by formatting response as string. @@ -36,19 +42,14 @@ func (r ResponseCommit) Error() string { return fmtError(r.Code, r.Log) } -func fmtError(code CodeType, log string) string { - codeAsStr, ok := code2string[code] - if ok { - return fmt.Sprintf("%s (%d): %s", codeAsStr, code, log) - } else { - return fmt.Sprintf("Unknown error (%d): %s", code, log) - } +func fmtError(code uint32, log string) string { + return fmt.Sprintf("Error code (%d): %s", code, log) } // ResultQuery is a wrapper around ResponseQuery using data.Bytes instead of // raw byte slices. type ResultQuery struct { - Code CodeType `json:"code"` + Code uint32 `json:"code"` Index int64 `json:"index"` Key data.Bytes `json:"key"` Value data.Bytes `json:"value"` @@ -72,7 +73,7 @@ func (r *ResponseQuery) Result() *ResultQuery { // IsErr returns true if Code is something other than OK. func (r *ResultQuery) IsErr() bool { - return r.Code != CodeType_OK + return r.Code != CodeTypeOK } // Error implements error interface by formatting result as string. diff --git a/types/result_test.go b/types/result_test.go index 14f334c49..7791cf526 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -8,7 +8,7 @@ import ( func TestResultQuery(t *testing.T) { orig := &ResponseQuery{ - Code: CodeType_OK, + Code: CodeTypeOK, Index: 0, Key: []byte("hello"), Value: []byte("world"), @@ -18,7 +18,7 @@ func TestResultQuery(t *testing.T) { assert.False(t, res.IsErr()) orig = &ResponseQuery{ - Code: CodeType_BadNonce, + Code: 1, Index: 0, Key: []byte("hello"), Value: []byte("world"), @@ -27,50 +27,50 @@ func TestResultQuery(t *testing.T) { } res = orig.Result() assert.True(t, res.IsErr()) - assert.Equal(t, "Error bad nonce (3): bad", res.Error()) + assert.Equal(t, "Error code (1): bad", res.Error()) } func TestResponseDeliverTx(t *testing.T) { res := ResponseDeliverTx{ - Code: CodeType_OK, + Code: CodeTypeOK, Data: []byte("Victor Mancha"), } assert.False(t, res.IsErr()) res = ResponseDeliverTx{ - Code: CodeType_InternalError, + Code: 1, Log: "bad", } assert.True(t, res.IsErr()) - assert.Equal(t, "Internal error (1): bad", res.Error()) + assert.Equal(t, "Error code (1): bad", res.Error()) } func TestResponseCheckTx(t *testing.T) { res := ResponseCheckTx{ - Code: CodeType_OK, + Code: CodeTypeOK, Data: []byte("Talos"), } assert.False(t, res.IsErr()) res = ResponseCheckTx{ - Code: CodeType_InternalError, + Code: 1, Log: "bad", } assert.True(t, res.IsErr()) - assert.Equal(t, "Internal error (1): bad", res.Error()) + assert.Equal(t, "Error code (1): bad", res.Error()) } func TestResponseCommit(t *testing.T) { res := ResponseCommit{ - Code: CodeType_OK, + Code: CodeTypeOK, Data: []byte("Old Lace"), } assert.False(t, res.IsErr()) res = ResponseCommit{ - Code: CodeType_Unauthorized, + Code: 1, Log: "bad", } assert.True(t, res.IsErr()) - assert.Equal(t, "Unauthorized (4): bad", res.Error()) + assert.Equal(t, "Error code (1): bad", res.Error()) } diff --git a/types/types.pb.go b/types/types.pb.go index e433d1986..454f8dd77 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -40,7 +40,6 @@ It has these top-level messages: Validator KVPair */ -//nolint: gas package types import proto "github.com/golang/protobuf/proto" @@ -63,114 +62,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package -type CodeType int32 - -const ( - CodeType_OK CodeType = 0 - // General response codes, 0 ~ 99 - CodeType_InternalError CodeType = 1 - CodeType_EncodingError CodeType = 2 - CodeType_BadNonce CodeType = 3 - CodeType_Unauthorized CodeType = 4 - CodeType_InsufficientFunds CodeType = 5 - CodeType_UnknownRequest CodeType = 6 - // Reserved for basecoin, 100 ~ 199 - CodeType_BaseDuplicateAddress CodeType = 101 - CodeType_BaseEncodingError CodeType = 102 - CodeType_BaseInsufficientFees CodeType = 103 - CodeType_BaseInsufficientFunds CodeType = 104 - CodeType_BaseInsufficientGasPrice CodeType = 105 - CodeType_BaseInvalidInput CodeType = 106 - CodeType_BaseInvalidOutput CodeType = 107 - CodeType_BaseInvalidPubKey CodeType = 108 - CodeType_BaseInvalidSequence CodeType = 109 - CodeType_BaseInvalidSignature CodeType = 110 - CodeType_BaseUnknownAddress CodeType = 111 - CodeType_BaseUnknownPubKey CodeType = 112 - CodeType_BaseUnknownPlugin CodeType = 113 - // Reserved for governance, 200 ~ 299 - CodeType_GovUnknownEntity CodeType = 201 - CodeType_GovUnknownGroup CodeType = 202 - CodeType_GovUnknownProposal CodeType = 203 - CodeType_GovDuplicateGroup CodeType = 204 - CodeType_GovDuplicateMember CodeType = 205 - CodeType_GovDuplicateProposal CodeType = 206 - CodeType_GovDuplicateVote CodeType = 207 - CodeType_GovInvalidMember CodeType = 208 - CodeType_GovInvalidVote CodeType = 209 - CodeType_GovInvalidVotingPower CodeType = 210 -) - -var CodeType_name = map[int32]string{ - 0: "OK", - 1: "InternalError", - 2: "EncodingError", - 3: "BadNonce", - 4: "Unauthorized", - 5: "InsufficientFunds", - 6: "UnknownRequest", - 101: "BaseDuplicateAddress", - 102: "BaseEncodingError", - 103: "BaseInsufficientFees", - 104: "BaseInsufficientFunds", - 105: "BaseInsufficientGasPrice", - 106: "BaseInvalidInput", - 107: "BaseInvalidOutput", - 108: "BaseInvalidPubKey", - 109: "BaseInvalidSequence", - 110: "BaseInvalidSignature", - 111: "BaseUnknownAddress", - 112: "BaseUnknownPubKey", - 113: "BaseUnknownPlugin", - 201: "GovUnknownEntity", - 202: "GovUnknownGroup", - 203: "GovUnknownProposal", - 204: "GovDuplicateGroup", - 205: "GovDuplicateMember", - 206: "GovDuplicateProposal", - 207: "GovDuplicateVote", - 208: "GovInvalidMember", - 209: "GovInvalidVote", - 210: "GovInvalidVotingPower", -} -var CodeType_value = map[string]int32{ - "OK": 0, - "InternalError": 1, - "EncodingError": 2, - "BadNonce": 3, - "Unauthorized": 4, - "InsufficientFunds": 5, - "UnknownRequest": 6, - "BaseDuplicateAddress": 101, - "BaseEncodingError": 102, - "BaseInsufficientFees": 103, - "BaseInsufficientFunds": 104, - "BaseInsufficientGasPrice": 105, - "BaseInvalidInput": 106, - "BaseInvalidOutput": 107, - "BaseInvalidPubKey": 108, - "BaseInvalidSequence": 109, - "BaseInvalidSignature": 110, - "BaseUnknownAddress": 111, - "BaseUnknownPubKey": 112, - "BaseUnknownPlugin": 113, - "GovUnknownEntity": 201, - "GovUnknownGroup": 202, - "GovUnknownProposal": 203, - "GovDuplicateGroup": 204, - "GovDuplicateMember": 205, - "GovDuplicateProposal": 206, - "GovDuplicateVote": 207, - "GovInvalidMember": 208, - "GovInvalidVote": 209, - "GovInvalidVotingPower": 210, -} - -func (x CodeType) String() string { - return proto.EnumName(CodeType_name, int32(x)) -} -func (CodeType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - type KVPair_Type int32 const ( @@ -1320,7 +1211,7 @@ func (m *ResponseSetOption) GetLog() string { } type ResponseDeliverTx struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` Tags []*KVPair `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` @@ -1331,11 +1222,11 @@ func (m *ResponseDeliverTx) String() string { return proto.CompactTex func (*ResponseDeliverTx) ProtoMessage() {} func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } -func (m *ResponseDeliverTx) GetCode() CodeType { +func (m *ResponseDeliverTx) GetCode() uint32 { if m != nil { return m.Code } - return CodeType_OK + return 0 } func (m *ResponseDeliverTx) GetData() []byte { @@ -1360,11 +1251,11 @@ func (m *ResponseDeliverTx) GetTags() []*KVPair { } type ResponseCheckTx struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` - Gas uint64 `protobuf:"varint,4,opt,name=gas" json:"gas,omitempty"` - Fee uint64 `protobuf:"varint,5,opt,name=fee" json:"fee,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Gas uint64 `protobuf:"varint,4,opt,name=gas" json:"gas,omitempty"` + Fee uint64 `protobuf:"varint,5,opt,name=fee" json:"fee,omitempty"` } func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } @@ -1372,11 +1263,11 @@ func (m *ResponseCheckTx) String() string { return proto.CompactTextS func (*ResponseCheckTx) ProtoMessage() {} func (*ResponseCheckTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } -func (m *ResponseCheckTx) GetCode() CodeType { +func (m *ResponseCheckTx) GetCode() uint32 { if m != nil { return m.Code } - return CodeType_OK + return 0 } func (m *ResponseCheckTx) GetData() []byte { @@ -1408,13 +1299,13 @@ func (m *ResponseCheckTx) GetFee() uint64 { } type ResponseQuery struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` - Height uint64 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` - Log string `protobuf:"bytes,7,opt,name=log" json:"log,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` + Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` + Height uint64 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` + Log string `protobuf:"bytes,7,opt,name=log" json:"log,omitempty"` } func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } @@ -1422,11 +1313,11 @@ func (m *ResponseQuery) String() string { return proto.CompactTextStr func (*ResponseQuery) ProtoMessage() {} func (*ResponseQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } -func (m *ResponseQuery) GetCode() CodeType { +func (m *ResponseQuery) GetCode() uint32 { if m != nil { return m.Code } - return CodeType_OK + return 0 } func (m *ResponseQuery) GetIndex() int64 { @@ -1472,9 +1363,9 @@ func (m *ResponseQuery) GetLog() string { } type ResponseCommit struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` } func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } @@ -1482,11 +1373,11 @@ func (m *ResponseCommit) String() string { return proto.CompactTextSt func (*ResponseCommit) ProtoMessage() {} func (*ResponseCommit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } -func (m *ResponseCommit) GetCode() CodeType { +func (m *ResponseCommit) GetCode() uint32 { if m != nil { return m.Code } - return CodeType_OK + return 0 } func (m *ResponseCommit) GetData() []byte { @@ -1758,7 +1649,6 @@ func init() { proto.RegisterType((*PartSetHeader)(nil), "types.PartSetHeader") proto.RegisterType((*Validator)(nil), "types.Validator") proto.RegisterType((*KVPair)(nil), "types.KVPair") - proto.RegisterEnum("types.CodeType", CodeType_name, CodeType_value) proto.RegisterEnum("types.KVPair_Type", KVPair_Type_name, KVPair_Type_value) } @@ -2167,115 +2057,93 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1755 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x49, 0x6f, 0xdb, 0xce, - 0x15, 0x37, 0x25, 0x6a, 0x7b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xe9, 0x82, 0xd5, 0x08, 0x22, - 0x82, 0x5b, 0x3a, 0x78, 0x42, 0x6e, 0xb0, 0xdf, 0x67, 0xb3, 0x4e, 0xa5, 0xc8, 0xf2, 0x48, 0xca, - 0x2f, 0x67, 0xdc, 0xd2, 0x89, 0x08, 0xb4, 0x0b, 0xf5, 0xc1, 0x18, 0x0f, 0xae, 0xb9, 0x5d, 0x55, - 0xd8, 0xad, 0x65, 0xed, 0x0e, 0xb9, 0x54, 0x58, 0xd5, 0x06, 0x72, 0x88, 0x76, 0xa0, 0x3a, 0x70, - 0xa7, 0x53, 0xc2, 0x3a, 0x35, 0x61, 0xd1, 0xce, 0x59, 0x08, 0xd9, 0xe9, 0x82, 0xa5, 0xb4, 0xf8, - 0x71, 0xbd, 0x0f, 0xb1, 0x7f, 0xdb, 0xa9, 0x17, 0x1d, 0xd7, 0x5f, 0xb8, 0x88, 0x1f, 0x97, 0xd0, - 0xe1, 0x5b, 0x21, 0x94, 0xb0, 0xfe, 0x60, 0x6c, 0x13, 0xda, 0x69, 0x14, 0x6d, 0xa5, 0x47, 0x09, - 0x3b, 0xe4, 0x62, 0xbe, 0x15, 0x12, 0x11, 0xe8, 0x25, 0x2c, 0x5e, 0xe1, 0x11, 0xa1, 0xfd, 0xab, - 0x89, 0x3b, 0xb8, 0xee, 0x80, 0x30, 0xed, 0x64, 0x4d, 0x0f, 0xb8, 0xc2, 0x01, 0x97, 0x9f, 0x2e, - 0x58, 0x70, 0x15, 0x53, 0xe8, 0x39, 0x34, 0x30, 0x75, 0x94, 0xe9, 0xa2, 0x30, 0x5d, 0xcf, 0x45, - 0x00, 0x75, 0x22, 0xc3, 0x3a, 0x56, 0xe3, 0x83, 0x1a, 0x54, 0x6e, 0xec, 0x49, 0x88, 0xcd, 0x47, - 0xb0, 0x98, 0x8a, 0x14, 0xd4, 0x81, 0xda, 0x14, 0x07, 0x81, 0x3d, 0xc2, 0x22, 0x9c, 0x1a, 0x56, - 0x44, 0x9a, 0x2d, 0x68, 0xa6, 0xe3, 0x24, 0x65, 0xc8, 0x63, 0x81, 0x1b, 0xde, 0x60, 0x3f, 0xe0, - 0x01, 0xa0, 0x0c, 0x15, 0x69, 0xfe, 0x01, 0x8c, 0x7c, 0x10, 0x20, 0x03, 0xca, 0xd7, 0xf8, 0x56, - 0x69, 0xf2, 0x21, 0x6a, 0x2b, 0x87, 0x44, 0x68, 0x36, 0x2c, 0xe5, 0x9d, 0x19, 0xdb, 0xc6, 0x61, - 0x80, 0x5a, 0x50, 0x62, 0x33, 0x61, 0xda, 0xb4, 0x4a, 0x6c, 0x66, 0xde, 0x87, 0x56, 0xf6, 0xca, - 0xef, 0x68, 0x38, 0xb1, 0xeb, 0xe2, 0xce, 0x10, 0x02, 0xdd, 0xb1, 0x99, 0xad, 0x34, 0xc4, 0x98, - 0xf3, 0x3c, 0x9b, 0x8d, 0xd5, 0xf2, 0x62, 0x8c, 0xd6, 0xa1, 0x3a, 0xc6, 0x64, 0x34, 0x66, 0x22, - 0x07, 0x74, 0x4b, 0x51, 0xdc, 0x57, 0xcf, 0x77, 0x6f, 0xb0, 0x08, 0xf5, 0xba, 0x25, 0x09, 0x73, - 0x19, 0x96, 0x32, 0x81, 0x64, 0x1e, 0xc5, 0xce, 0xc7, 0x17, 0x8f, 0x7e, 0x0b, 0x70, 0x63, 0x4f, - 0x88, 0x63, 0x33, 0xd7, 0x0f, 0x3a, 0xda, 0xfd, 0xf2, 0xd6, 0xe2, 0xae, 0xa1, 0xee, 0xeb, 0x5d, - 0x24, 0xb0, 0x52, 0x3a, 0xe6, 0x19, 0xac, 0xdc, 0x89, 0x01, 0xee, 0xed, 0xd8, 0x0e, 0xc6, 0xd1, - 0x0e, 0xf8, 0x18, 0x3d, 0xe4, 0xde, 0xda, 0x0e, 0xf6, 0x55, 0x76, 0x2f, 0xa9, 0x69, 0x4f, 0x05, - 0xd3, 0x52, 0x42, 0x73, 0x1b, 0x96, 0x73, 0x81, 0x91, 0xda, 0xa7, 0x96, 0x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x44, 0x0a, 0x5f, 0xab, 0x99, 0x3a, - 0xa2, 0x36, 0x56, 0x4b, 0xee, 0xee, 0xaf, 0xbc, 0x96, 0xa5, 0xd3, 0xfc, 0x33, 0x9e, 0x9a, 0xb9, - 0x9a, 0xc4, 0x45, 0x9c, 0xe0, 0x66, 0x1b, 0xd0, 0xdd, 0xcc, 0x95, 0x35, 0x3b, 0x9b, 0x93, 0xe8, - 0x57, 0x50, 0x71, 0xc8, 0x70, 0x38, 0xbf, 0x6a, 0x49, 0xb1, 0xf9, 0xef, 0x12, 0x54, 0x65, 0xcd, - 0x41, 0x9b, 0x1c, 0xff, 0x6c, 0x42, 0xfb, 0xc4, 0x89, 0xf2, 0x4e, 0xd0, 0x3d, 0x27, 0x75, 0x26, - 0xa5, 0xcc, 0x99, 0x20, 0xd0, 0x19, 0x99, 0x62, 0x95, 0x32, 0x62, 0x8c, 0x36, 0xa0, 0x46, 0xc3, - 0x69, 0x9f, 0xcd, 0xa2, 0x2b, 0xaf, 0xd2, 0x70, 0x7a, 0x39, 0x0b, 0xd0, 0x2e, 0x2c, 0xa5, 0x12, - 0x88, 0x38, 0x0a, 0xd8, 0x5b, 0xca, 0x35, 0xe1, 0x77, 0xef, 0xc8, 0x5a, 0x8c, 0x53, 0xa9, 0xe7, - 0xa0, 0x2d, 0x10, 0x99, 0xd5, 0x97, 0xe0, 0x29, 0x33, 0xae, 0x2a, 0xce, 0xad, 0xc5, 0xf9, 0x0a, - 0x5d, 0x79, 0x41, 0xbd, 0x07, 0x0d, 0x7e, 0x92, 0x52, 0xa5, 0x26, 0x54, 0xea, 0x9c, 0x21, 0x84, - 0x8f, 0x60, 0x39, 0x29, 0xd2, 0x52, 0xa5, 0x2e, 0x67, 0x49, 0xd8, 0x42, 0x71, 0x13, 0xea, 0x71, - 0x66, 0x37, 0x84, 0x46, 0xcd, 0x56, 0x09, 0xdd, 0x83, 0x9a, 0x72, 0xb1, 0xb0, 0xa0, 0x3f, 0x86, - 0x8a, 0x67, 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 0x28, 0x7e, 0x0c, 0xe8, 0xce, 0x69, 0xbf, 0xf9, 0xf1, 0xc8, 0x1e, 0xa1, - 0xe8, 0x1f, 0xbf, 0x5b, 0xd8, 0x51, 0xa3, 0xe7, 0x50, 0x55, 0x35, 0xba, 0xf0, 0x1d, 0xa1, 0x5b, - 0xdc, 0xb7, 0xf3, 0x4d, 0x26, 0xbf, 0x83, 0xf3, 0x1e, 0x08, 0xba, 0x73, 0x3b, 0x72, 0xb4, 0x0f, - 0x90, 0xfa, 0x11, 0x9c, 0xfb, 0x4c, 0xd0, 0x9d, 0xdf, 0x97, 0xa3, 0x97, 0x50, 0x4f, 0xfe, 0xfd, - 0x8a, 0x1f, 0x0b, 0xba, 0xf3, 0x5a, 0xf3, 0xab, 0xaa, 0x78, 0x87, 0x7a, 0xf6, 0x53, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x3c, 0xa1, 0xc6, 0x00, 0x9c, 0x12, 0x00, 0x00, + // 1395 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x97, 0x4b, 0x6f, 0xdb, 0x46, + 0x10, 0x80, 0x2d, 0x89, 0x7a, 0x70, 0xe4, 0x87, 0xb2, 0x71, 0x13, 0x46, 0xb9, 0x24, 0x04, 0xd2, + 0xd8, 0x69, 0xea, 0xb4, 0x0e, 0x52, 0xc4, 0x4d, 0x51, 0xc0, 0x4e, 0xd2, 0x4a, 0x0d, 0x90, 0xa6, + 0x1b, 0x23, 0x57, 0x81, 0x16, 0x57, 0x12, 0x61, 0x99, 0x64, 0xc8, 0x95, 0x2b, 0xff, 0x87, 0xdc, + 0x7b, 0xee, 0xa9, 0x40, 0x7f, 0x48, 0x7f, 0x57, 0x31, 0xb3, 0xcb, 0xa7, 0xc9, 0x1c, 0xda, 0x0b, + 0xb1, 0xb3, 0x33, 0xb3, 0xdc, 0xc7, 0xcc, 0xb7, 0xb3, 0x70, 0x43,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17, 0xd0, 0xcb, 0xaa, 0xdf, 0xea, 0xe7, 0xd2, 0xb0, 0xae, 0x38, 0x39, + 0xeb, 0xd0, 0x4b, 0xfc, 0xe9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0x66, 0x37, 0xca, 0x9e, + 0x0f, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 7b2c75e32..48608cd40 100644 --- a/types/types.proto +++ b/types/types.proto @@ -3,49 +3,6 @@ package types; // This file is copied from http://github.com/tendermint/abci -//---------------------------------------- -// Code types - -enum CodeType { - OK = 0; - - // General response codes, 0 ~ 99 - InternalError = 1; - EncodingError = 2; - BadNonce = 3; - Unauthorized = 4; - InsufficientFunds = 5; - UnknownRequest = 6; - - // Reserved for basecoin, 100 ~ 199 - BaseDuplicateAddress = 101; - BaseEncodingError = 102; - BaseInsufficientFees = 103; - BaseInsufficientFunds = 104; - BaseInsufficientGasPrice = 105; - BaseInvalidInput = 106; - BaseInvalidOutput = 107; - BaseInvalidPubKey = 108; - BaseInvalidSequence = 109; - BaseInvalidSignature = 110; - BaseUnknownAddress = 111; - BaseUnknownPubKey = 112; - BaseUnknownPlugin = 113; - - // Reserved for governance, 200 ~ 299 - GovUnknownEntity = 201; - GovUnknownGroup = 202; - GovUnknownProposal = 203; - GovDuplicateGroup = 204; - GovDuplicateMember = 205; - GovDuplicateProposal = 206; - GovDuplicateVote = 207; - GovInvalidMember = 208; - GovInvalidVote = 209; - GovInvalidVotingPower = 210; - -} - //---------------------------------------- // Request types @@ -156,14 +113,14 @@ message ResponseSetOption{ } message ResponseDeliverTx{ - CodeType code = 1; + uint32 code = 1; bytes data = 2; string log = 3; repeated KVPair tags = 4; } message ResponseCheckTx{ - CodeType code = 1; + uint32 code = 1; bytes data = 2; string log = 3; uint64 gas = 4; @@ -171,7 +128,7 @@ message ResponseCheckTx{ } message ResponseQuery{ - CodeType code = 1; + uint32 code = 1; int64 index = 2; bytes key = 3; bytes value = 4; @@ -181,7 +138,7 @@ message ResponseQuery{ } message ResponseCommit{ - CodeType code = 1; + uint32 code = 1; bytes data = 2; string log = 3; } From 308cb8e4547ba31aef96e45a46b24f6399bc5d74 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 14:30:21 -0500 Subject: [PATCH 02/10] use gogo/protobuf --- Makefile | 6 +- types/messages.go | 2 +- types/types.pb.go | 197 +++++++++++++++++++++++----------------------- 3 files changed, 101 insertions(+), 104 deletions(-) diff --git a/Makefile b/Makefile index e9d239003..32e8df4ee 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ GOTOOLS = \ github.com/mitchellh/gox \ github.com/Masterminds/glide \ github.com/alecthomas/gometalinter \ - github.com/ckaznocha/protoc-gen-lint + github.com/ckaznocha/protoc-gen-lint \ + github.com/gogo/protobuf/protoc-gen-gogo all: install test @@ -17,13 +18,12 @@ install_protoc: make install && \ cd .. && \ rm -rf protobuf-3.4.1 - go get github.com/golang/protobuf/protoc-gen-go protoc: ## On "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" ## ldconfig (may require sudo) ## https://stackoverflow.com/a/25518702 - protoc --go_out=plugins=grpc:. types/*.proto + protoc --gogo_out=plugins=grpc:. types/*.proto install: @ go install ./cmd/... diff --git a/types/messages.go b/types/messages.go index 77ad538ed..7b9c81f97 100644 --- a/types/messages.go +++ b/types/messages.go @@ -3,7 +3,7 @@ package types import ( "io" - "github.com/golang/protobuf/proto" + "github.com/gogo/protobuf/proto" wire "github.com/tendermint/go-wire" ) diff --git a/types/types.pb.go b/types/types.pb.go index 454f8dd77..149c060ad 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -1,6 +1,5 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: types/types.proto -// DO NOT EDIT! /* Package types is a generated protocol buffer package. @@ -42,14 +41,12 @@ It has these top-level messages: */ package types -import proto "github.com/golang/protobuf/proto" +import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -60,7 +57,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type KVPair_Type int32 @@ -81,7 +78,7 @@ var KVPair_Type_value = map[string]int32{ func (x KVPair_Type) String() string { return proto.EnumName(KVPair_Type_name, int32(x)) } -func (KVPair_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{29, 0} } +func (KVPair_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptorTypes, []int{29, 0} } type Request struct { // Types that are valid to be assigned to Value: @@ -102,7 +99,7 @@ type Request struct { func (m *Request) Reset() { *m = Request{} } func (m *Request) String() string { return proto.CompactTextString(m) } func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{0} } type isRequest_Value interface { isRequest_Value() @@ -260,57 +257,57 @@ func _Request_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { // value switch x := m.Value.(type) { case *Request_Echo: - b.EncodeVarint(1<<3 | proto.WireBytes) + _ = b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Echo); err != nil { return err } case *Request_Flush: - b.EncodeVarint(2<<3 | proto.WireBytes) + _ = b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Flush); err != nil { return err } case *Request_Info: - b.EncodeVarint(3<<3 | proto.WireBytes) + _ = b.EncodeVarint(3<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Info); err != nil { return err } case *Request_SetOption: - b.EncodeVarint(4<<3 | proto.WireBytes) + _ = b.EncodeVarint(4<<3 | proto.WireBytes) if err := b.EncodeMessage(x.SetOption); err != nil { return err } case *Request_DeliverTx: - b.EncodeVarint(5<<3 | proto.WireBytes) + _ = b.EncodeVarint(5<<3 | proto.WireBytes) if err := b.EncodeMessage(x.DeliverTx); err != nil { return err } case *Request_CheckTx: - b.EncodeVarint(6<<3 | proto.WireBytes) + _ = b.EncodeVarint(6<<3 | proto.WireBytes) if err := b.EncodeMessage(x.CheckTx); err != nil { return err } case *Request_Commit: - b.EncodeVarint(7<<3 | proto.WireBytes) + _ = b.EncodeVarint(7<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Commit); err != nil { return err } case *Request_Query: - b.EncodeVarint(8<<3 | proto.WireBytes) + _ = b.EncodeVarint(8<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Query); err != nil { return err } case *Request_InitChain: - b.EncodeVarint(9<<3 | proto.WireBytes) + _ = b.EncodeVarint(9<<3 | proto.WireBytes) if err := b.EncodeMessage(x.InitChain); err != nil { return err } case *Request_BeginBlock: - b.EncodeVarint(10<<3 | proto.WireBytes) + _ = b.EncodeVarint(10<<3 | proto.WireBytes) if err := b.EncodeMessage(x.BeginBlock); err != nil { return err } case *Request_EndBlock: - b.EncodeVarint(11<<3 | proto.WireBytes) + _ = b.EncodeVarint(11<<3 | proto.WireBytes) if err := b.EncodeMessage(x.EndBlock); err != nil { return err } @@ -484,13 +481,13 @@ func _Request_OneofSizer(msg proto.Message) (n int) { } type RequestEcho struct { - Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } func (m *RequestEcho) Reset() { *m = RequestEcho{} } func (m *RequestEcho) String() string { return proto.CompactTextString(m) } func (*RequestEcho) ProtoMessage() {} -func (*RequestEcho) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (*RequestEcho) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{1} } func (m *RequestEcho) GetMessage() string { if m != nil { @@ -505,16 +502,16 @@ type RequestFlush struct { func (m *RequestFlush) Reset() { *m = RequestFlush{} } func (m *RequestFlush) String() string { return proto.CompactTextString(m) } func (*RequestFlush) ProtoMessage() {} -func (*RequestFlush) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (*RequestFlush) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{2} } type RequestInfo struct { - Version string `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` } func (m *RequestInfo) Reset() { *m = RequestInfo{} } func (m *RequestInfo) String() string { return proto.CompactTextString(m) } func (*RequestInfo) ProtoMessage() {} -func (*RequestInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (*RequestInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{3} } func (m *RequestInfo) GetVersion() string { if m != nil { @@ -524,14 +521,14 @@ func (m *RequestInfo) GetVersion() string { } type RequestSetOption struct { - Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } func (*RequestSetOption) ProtoMessage() {} -func (*RequestSetOption) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (*RequestSetOption) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{4} } func (m *RequestSetOption) GetKey() string { if m != nil { @@ -554,7 +551,7 @@ type RequestDeliverTx struct { func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } func (*RequestDeliverTx) ProtoMessage() {} -func (*RequestDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +func (*RequestDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{5} } func (m *RequestDeliverTx) GetTx() []byte { if m != nil { @@ -570,7 +567,7 @@ type RequestCheckTx struct { func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } func (*RequestCheckTx) ProtoMessage() {} -func (*RequestCheckTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (*RequestCheckTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{6} } func (m *RequestCheckTx) GetTx() []byte { if m != nil { @@ -581,15 +578,15 @@ func (m *RequestCheckTx) GetTx() []byte { type RequestQuery struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` - Height uint64 `protobuf:"varint,3,opt,name=height" json:"height,omitempty"` - Prove bool `protobuf:"varint,4,opt,name=prove" json:"prove,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` } func (m *RequestQuery) Reset() { *m = RequestQuery{} } func (m *RequestQuery) String() string { return proto.CompactTextString(m) } func (*RequestQuery) ProtoMessage() {} -func (*RequestQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } +func (*RequestQuery) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{7} } func (m *RequestQuery) GetData() []byte { if m != nil { @@ -625,7 +622,7 @@ type RequestCommit struct { func (m *RequestCommit) Reset() { *m = RequestCommit{} } func (m *RequestCommit) String() string { return proto.CompactTextString(m) } func (*RequestCommit) ProtoMessage() {} -func (*RequestCommit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +func (*RequestCommit) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{8} } type RequestInitChain struct { Validators []*Validator `protobuf:"bytes,1,rep,name=validators" json:"validators,omitempty"` @@ -634,7 +631,7 @@ type RequestInitChain struct { func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } func (*RequestInitChain) ProtoMessage() {} -func (*RequestInitChain) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } +func (*RequestInitChain) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{9} } func (m *RequestInitChain) GetValidators() []*Validator { if m != nil { @@ -651,7 +648,7 @@ type RequestBeginBlock struct { func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } func (*RequestBeginBlock) ProtoMessage() {} -func (*RequestBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } +func (*RequestBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{10} } func (m *RequestBeginBlock) GetHash() []byte { if m != nil { @@ -668,13 +665,13 @@ func (m *RequestBeginBlock) GetHeader() *Header { } type RequestEndBlock struct { - Height uint64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"` + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` } func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } func (*RequestEndBlock) ProtoMessage() {} -func (*RequestEndBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } +func (*RequestEndBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{11} } func (m *RequestEndBlock) GetHeight() uint64 { if m != nil { @@ -703,7 +700,7 @@ type Response struct { func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } +func (*Response) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{12} } type isResponse_Value interface { isResponse_Value() @@ -873,62 +870,62 @@ func _Response_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { // value switch x := m.Value.(type) { case *Response_Exception: - b.EncodeVarint(1<<3 | proto.WireBytes) + _ = b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Exception); err != nil { return err } case *Response_Echo: - b.EncodeVarint(2<<3 | proto.WireBytes) + _ = b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Echo); err != nil { return err } case *Response_Flush: - b.EncodeVarint(3<<3 | proto.WireBytes) + _ = b.EncodeVarint(3<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Flush); err != nil { return err } case *Response_Info: - b.EncodeVarint(4<<3 | proto.WireBytes) + _ = b.EncodeVarint(4<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Info); err != nil { return err } case *Response_SetOption: - b.EncodeVarint(5<<3 | proto.WireBytes) + _ = b.EncodeVarint(5<<3 | proto.WireBytes) if err := b.EncodeMessage(x.SetOption); err != nil { return err } case *Response_DeliverTx: - b.EncodeVarint(6<<3 | proto.WireBytes) + _ = b.EncodeVarint(6<<3 | proto.WireBytes) if err := b.EncodeMessage(x.DeliverTx); err != nil { return err } case *Response_CheckTx: - b.EncodeVarint(7<<3 | proto.WireBytes) + _ = b.EncodeVarint(7<<3 | proto.WireBytes) if err := b.EncodeMessage(x.CheckTx); err != nil { return err } case *Response_Commit: - b.EncodeVarint(8<<3 | proto.WireBytes) + _ = b.EncodeVarint(8<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Commit); err != nil { return err } case *Response_Query: - b.EncodeVarint(9<<3 | proto.WireBytes) + _ = b.EncodeVarint(9<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Query); err != nil { return err } case *Response_InitChain: - b.EncodeVarint(10<<3 | proto.WireBytes) + _ = b.EncodeVarint(10<<3 | proto.WireBytes) if err := b.EncodeMessage(x.InitChain); err != nil { return err } case *Response_BeginBlock: - b.EncodeVarint(11<<3 | proto.WireBytes) + _ = b.EncodeVarint(11<<3 | proto.WireBytes) if err := b.EncodeMessage(x.BeginBlock); err != nil { return err } case *Response_EndBlock: - b.EncodeVarint(12<<3 | proto.WireBytes) + _ = b.EncodeVarint(12<<3 | proto.WireBytes) if err := b.EncodeMessage(x.EndBlock); err != nil { return err } @@ -1115,13 +1112,13 @@ func _Response_OneofSizer(msg proto.Message) (n int) { } type ResponseException struct { - Error string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } func (m *ResponseException) Reset() { *m = ResponseException{} } func (m *ResponseException) String() string { return proto.CompactTextString(m) } func (*ResponseException) ProtoMessage() {} -func (*ResponseException) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } +func (*ResponseException) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{13} } func (m *ResponseException) GetError() string { if m != nil { @@ -1131,13 +1128,13 @@ func (m *ResponseException) GetError() string { } type ResponseEcho struct { - Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } func (*ResponseEcho) ProtoMessage() {} -func (*ResponseEcho) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } +func (*ResponseEcho) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{14} } func (m *ResponseEcho) GetMessage() string { if m != nil { @@ -1152,19 +1149,19 @@ type ResponseFlush struct { func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } func (*ResponseFlush) ProtoMessage() {} -func (*ResponseFlush) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } +func (*ResponseFlush) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{15} } type ResponseInfo struct { - Data string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` - LastBlockHeight uint64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight" json:"last_block_height,omitempty"` + Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + LastBlockHeight uint64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` LastBlockAppHash []byte `protobuf:"bytes,4,opt,name=last_block_app_hash,json=lastBlockAppHash,proto3" json:"last_block_app_hash,omitempty"` } func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } func (*ResponseInfo) ProtoMessage() {} -func (*ResponseInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } +func (*ResponseInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{16} } func (m *ResponseInfo) GetData() string { if m != nil { @@ -1195,13 +1192,13 @@ func (m *ResponseInfo) GetLastBlockAppHash() []byte { } type ResponseSetOption struct { - Log string `protobuf:"bytes,1,opt,name=log" json:"log,omitempty"` + Log string `protobuf:"bytes,1,opt,name=log,proto3" json:"log,omitempty"` } func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } func (*ResponseSetOption) ProtoMessage() {} -func (*ResponseSetOption) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } +func (*ResponseSetOption) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{17} } func (m *ResponseSetOption) GetLog() string { if m != nil { @@ -1211,16 +1208,16 @@ func (m *ResponseSetOption) GetLog() string { } type ResponseDeliverTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` Tags []*KVPair `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` } func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } func (*ResponseDeliverTx) ProtoMessage() {} -func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } +func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{18} } func (m *ResponseDeliverTx) GetCode() uint32 { if m != nil { @@ -1251,17 +1248,17 @@ func (m *ResponseDeliverTx) GetTags() []*KVPair { } type ResponseCheckTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` - Gas uint64 `protobuf:"varint,4,opt,name=gas" json:"gas,omitempty"` - Fee uint64 `protobuf:"varint,5,opt,name=fee" json:"fee,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Gas uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` + Fee uint64 `protobuf:"varint,5,opt,name=fee,proto3" json:"fee,omitempty"` } func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseCheckTx) ProtoMessage() {} -func (*ResponseCheckTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } +func (*ResponseCheckTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{19} } func (m *ResponseCheckTx) GetCode() uint32 { if m != nil { @@ -1299,19 +1296,19 @@ func (m *ResponseCheckTx) GetFee() uint64 { } type ResponseQuery struct { - Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` - Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` - Height uint64 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` - Log string `protobuf:"bytes,7,opt,name=log" json:"log,omitempty"` + Height uint64 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` + Log string `protobuf:"bytes,7,opt,name=log,proto3" json:"log,omitempty"` } func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } func (*ResponseQuery) ProtoMessage() {} -func (*ResponseQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } +func (*ResponseQuery) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{20} } func (m *ResponseQuery) GetCode() uint32 { if m != nil { @@ -1363,15 +1360,15 @@ func (m *ResponseQuery) GetLog() string { } type ResponseCommit struct { - Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` } func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } func (*ResponseCommit) ProtoMessage() {} -func (*ResponseCommit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } +func (*ResponseCommit) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{21} } func (m *ResponseCommit) GetCode() uint32 { if m != nil { @@ -1400,7 +1397,7 @@ type ResponseInitChain struct { func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } func (*ResponseInitChain) ProtoMessage() {} -func (*ResponseInitChain) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } +func (*ResponseInitChain) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{22} } type ResponseBeginBlock struct { } @@ -1408,7 +1405,7 @@ type ResponseBeginBlock struct { func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } func (*ResponseBeginBlock) ProtoMessage() {} -func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } +func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{23} } type ResponseEndBlock struct { Diffs []*Validator `protobuf:"bytes,1,rep,name=diffs" json:"diffs,omitempty"` @@ -1417,7 +1414,7 @@ type ResponseEndBlock struct { func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } func (*ResponseEndBlock) ProtoMessage() {} -func (*ResponseEndBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } +func (*ResponseEndBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{24} } func (m *ResponseEndBlock) GetDiffs() []*Validator { if m != nil { @@ -1427,10 +1424,10 @@ func (m *ResponseEndBlock) GetDiffs() []*Validator { } type Header struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId" json:"chain_id,omitempty"` - Height uint64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` - Time uint64 `protobuf:"varint,3,opt,name=time" json:"time,omitempty"` - NumTxs uint64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs" json:"num_txs,omitempty"` + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Time uint64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"` + NumTxs uint64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` LastBlockId *BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId" json:"last_block_id,omitempty"` LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` @@ -1441,7 +1438,7 @@ type Header struct { func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } +func (*Header) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{25} } func (m *Header) GetChainId() string { if m != nil { @@ -1514,7 +1511,7 @@ type BlockID struct { func (m *BlockID) Reset() { *m = BlockID{} } func (m *BlockID) String() string { return proto.CompactTextString(m) } func (*BlockID) ProtoMessage() {} -func (*BlockID) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } +func (*BlockID) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{26} } func (m *BlockID) GetHash() []byte { if m != nil { @@ -1531,14 +1528,14 @@ func (m *BlockID) GetParts() *PartSetHeader { } type PartSetHeader struct { - Total uint64 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"` + Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` } func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } func (*PartSetHeader) ProtoMessage() {} -func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } +func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{27} } func (m *PartSetHeader) GetTotal() uint64 { if m != nil { @@ -1556,13 +1553,13 @@ func (m *PartSetHeader) GetHash() []byte { type Validator struct { PubKey []byte `protobuf:"bytes,1,opt,name=pubKey,proto3" json:"pubKey,omitempty"` - Power uint64 `protobuf:"varint,2,opt,name=power" json:"power,omitempty"` + Power uint64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` } func (m *Validator) Reset() { *m = Validator{} } func (m *Validator) String() string { return proto.CompactTextString(m) } func (*Validator) ProtoMessage() {} -func (*Validator) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } +func (*Validator) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{28} } func (m *Validator) GetPubKey() []byte { if m != nil { @@ -1579,16 +1576,16 @@ func (m *Validator) GetPower() uint64 { } type KVPair struct { - Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - ValueType KVPair_Type `protobuf:"varint,2,opt,name=value_type,json=valueType,enum=types.KVPair_Type" json:"value_type,omitempty"` - ValueString string `protobuf:"bytes,3,opt,name=value_string,json=valueString" json:"value_string,omitempty"` - ValueInt int64 `protobuf:"varint,4,opt,name=value_int,json=valueInt" json:"value_int,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + ValueType KVPair_Type `protobuf:"varint,2,opt,name=value_type,json=valueType,proto3,enum=types.KVPair_Type" json:"value_type,omitempty"` + ValueString string `protobuf:"bytes,3,opt,name=value_string,json=valueString,proto3" json:"value_string,omitempty"` + ValueInt int64 `protobuf:"varint,4,opt,name=value_int,json=valueInt,proto3" json:"value_int,omitempty"` } func (m *KVPair) Reset() { *m = KVPair{} } func (m *KVPair) String() string { return proto.CompactTextString(m) } func (*KVPair) ProtoMessage() {} -func (*KVPair) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } +func (*KVPair) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{29} } func (m *KVPair) GetKey() string { if m != nil { @@ -2054,9 +2051,9 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ Metadata: "types/types.proto", } -func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } +func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) } -var fileDescriptor0 = []byte{ +var fileDescriptorTypes = []byte{ // 1395 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x97, 0x4b, 0x6f, 0xdb, 0x46, 0x10, 0x80, 0x2d, 0x89, 0x7a, 0x70, 0xe4, 0x87, 0xb2, 0x71, 0x13, 0x46, 0xb9, 0x24, 0x04, 0xd2, From 24fbe291ab2d1b6d562b133b3c7251323888c1a6 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 15:17:54 -0500 Subject: [PATCH 03/10] update glide; update services for new signature --- cmd/abci-cli/abci-cli.go | 6 ++--- example/dummy/dummy_test.go | 8 +++---- example/example_test.go | 6 ++--- glide.lock | 46 ++++++++++++++++++++----------------- glide.yaml | 2 +- tests/client_server_test.go | 4 ++-- tests/test_app/app.go | 2 +- 7 files changed, 39 insertions(+), 35 deletions(-) diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index c0dbbfafe..cc60a4bc3 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -88,7 +88,7 @@ var RootCmd = &cobra.Command{ return err } client.SetLogger(logger.With("module", "abci-client")) - if _, err := client.Start(); err != nil { + if err := client.Start(); err != nil { return err } } @@ -457,7 +457,7 @@ func cmdCounter(cmd *cobra.Command, args []string) error { return err } srv.SetLogger(logger.With("module", "abci-server")) - if _, err := srv.Start(); err != nil { + if err := srv.Start(); err != nil { return err } @@ -487,7 +487,7 @@ func cmdDummy(cmd *cobra.Command, args []string) error { return err } srv.SetLogger(logger.With("module", "abci-server")) - if _, err := srv.Start(); err != nil { + if err := srv.Start(); err != nil { return err } diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index bbb35dbe9..65970ecd7 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -212,14 +212,14 @@ func makeSocketClientServer(app types.Application, name string) (abcicli.Client, server := abciserver.NewSocketServer(socket, app) server.SetLogger(logger.With("module", "abci-server")) - if _, err := server.Start(); err != nil { + if err := server.Start(); err != nil { return nil, nil, err } // Connect to the socket client := abcicli.NewSocketClient(socket, false) client.SetLogger(logger.With("module", "abci-client")) - if _, err := client.Start(); err != nil { + if err := client.Start(); err != nil { server.Stop() return nil, nil, err } @@ -235,13 +235,13 @@ func makeGRPCClientServer(app types.Application, name string) (abcicli.Client, c gapp := types.NewGRPCApplication(app) server := abciserver.NewGRPCServer(socket, gapp) server.SetLogger(logger.With("module", "abci-server")) - if _, err := server.Start(); err != nil { + if err := server.Start(); err != nil { return nil, nil, err } client := abcicli.NewGRPCClient(socket, true) client.SetLogger(logger.With("module", "abci-client")) - if _, err := client.Start(); err != nil { + if err := client.Start(); err != nil { server.Stop() return nil, nil, err } diff --git a/example/example_test.go b/example/example_test.go index 952f8cb2c..7fd3bb520 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -40,7 +40,7 @@ func testStream(t *testing.T, app types.Application) { // Start the listener server := abciserver.NewSocketServer("unix://test.sock", app) server.SetLogger(log.TestingLogger().With("module", "abci-server")) - if _, err := server.Start(); err != nil { + if err := server.Start(); err != nil { t.Fatalf("Error starting socket server: %v", err.Error()) } defer server.Stop() @@ -48,7 +48,7 @@ func testStream(t *testing.T, app types.Application) { // 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 { + if err := client.Start(); err != nil { t.Fatalf("Error starting socket client: %v", err.Error()) } defer client.Stop() @@ -113,7 +113,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { // Start the listener server := abciserver.NewGRPCServer("unix://test.sock", app) server.SetLogger(log.TestingLogger().With("module", "abci-server")) - if _, err := server.Start(); err != nil { + if err := server.Start(); err != nil { t.Fatalf("Error starting GRPC server: %v", err.Error()) } defer server.Stop() diff --git a/glide.lock b/glide.lock index 80dbc4835..b4a2125e9 100644 --- a/glide.lock +++ b/glide.lock @@ -1,14 +1,12 @@ -hash: 5501ab3d7136aa8fb425c995d45221849b33aefab76c5d2c192e721dad28da38 -updated: 2017-11-14T18:23:41.2024073Z +hash: eb1802c17bab227061f9198f2a738ad6e2bb676cefdd5729dc2ac90d5d10e610 +updated: 2017-11-30T15:00:40.216000076-05:00 imports: - name: github.com/btcsuite/btcd - version: b8df516b4b267acf2de46be593a9d948d1d2c420 + version: 8cea3866d0f7fb12d567a20744942c0d078c7d15 subpackages: - btcec -- name: github.com/btcsuite/fastsha256 - version: 637e656429416087660c84436a2a035d69d54e2e - name: github.com/go-kit/kit - version: d67bb4c202e3b91377d1079b110a6c9ce23ab2f8 + version: e3b2152e0063c5f05efea89ecbe297852af2a92d subpackages: - log - log/level @@ -16,15 +14,21 @@ imports: - name: github.com/go-logfmt/logfmt version: 390ab7935ee28ec6b286364bba9b4dd6410cb3d5 - name: github.com/go-playground/locales - version: 1e5f1161c6416a5ff48840eb8724a394e48cc534 + version: e4cbcb5d0652150d40ad0646651076b6bd2be4f6 subpackages: - currency - name: github.com/go-playground/universal-translator version: 71201497bace774495daed26a3874fd339e0b538 - name: github.com/go-stack/stack - version: 100eb0c0a9c5b306ca2fb4f165df21d80ada4b82 + version: 259ab82a6cad3992b4e21ff5cac294ccb06474bc +- name: github.com/gogo/protobuf + version: 342cbe0a04158f6dcb03ca0079991a51a4248c02 + subpackages: + - gogoproto + - proto + - protoc-gen-gogo/descriptor - name: github.com/golang/protobuf - version: 1643683e1b54a9e88ad26d98f81400c8c9d9f4f9 + version: 1e59b77b52bf8e4b449a57e6f79f21226d571845 subpackages: - proto - ptypes @@ -44,9 +48,9 @@ imports: - name: github.com/spf13/cobra version: 7b2c5ac9fc04fc5efafb60700713d4fa609b777b - name: github.com/spf13/pflag - version: 80fe0fb4eba54167e2ccae1c6c950e72abf61b73 + version: 4c012f6dcd9546820e378d0bdda4d8fc772cdfea - name: github.com/syndtr/goleveldb - version: 8c81ea47d4c41a385645e133e15510fc6a2a74b4 + version: adf24ef3f94bd13ec4163060b21a5678f22b429b subpackages: - leveldb - leveldb/cache @@ -61,27 +65,27 @@ imports: - leveldb/table - leveldb/util - name: github.com/tendermint/ed25519 - version: 1f52c6f8b8a5c7908aff4497c186af344b428925 + version: d8387025d2b9d158cf4efb07e7ebf814bcce2057 subpackages: - edwards25519 - extra25519 - name: github.com/tendermint/go-crypto version: b4f04f196cd719660e43b91202cd60d9a95b1837 - name: github.com/tendermint/go-wire - version: 1c96861c03231361546944d883d99593b2e6b408 + version: 7d50b38b3815efe313728de77e2995c8813ce13f subpackages: - data - name: github.com/tendermint/iavl version: 595f3dcd5b6cd4a292e90757ae6d367fd7a6e653 - name: github.com/tendermint/tmlibs - version: 2442a0a698d271d5cf5d6a8e7c1db20335e959c1 + version: 21fb7819891997c96838308b4eba5a50b07ff03f subpackages: - common - db - log - process - name: golang.org/x/crypto - version: c7af5bf2638a1164f2eb5467c39c6cffbd13a02e + version: 9f005a07e0d31d45e6656d241bb5c0f2efd4bc94 subpackages: - nacl/secretbox - openpgp/armor @@ -90,7 +94,7 @@ imports: - ripemd160 - salsa20/salsa - name: golang.org/x/net - version: cd69bc3fc700721b709c3a59e16e24c67b58f6ff + version: 9dfe39835686865bff950a07b394c12a98ddc811 subpackages: - context - http2 @@ -100,14 +104,14 @@ imports: - lex/httplex - trace - name: golang.org/x/text - version: 470f45bf29f4147d6fbd7dfd0a02a848e49f5bf4 + version: 88f656faf3f37f690df1a32515b479415e1a6769 subpackages: - secure/bidirule - transform - unicode/bidi - unicode/norm - name: google.golang.org/genproto - version: f676e0f3ac6395ff1a529ae59a6670878a8371a6 + version: 891aceb7c239e72692819142dfca057bdcbfcb96 subpackages: - googleapis/rpc/status - name: google.golang.org/grpc @@ -130,10 +134,10 @@ imports: - tap - transport - name: gopkg.in/go-playground/validator.v9 - version: 6d8c18553ea1ac493d049edd6f102f52e618f085 + version: 61caf9d3038e1af346dbf5c2e16f6678e1548364 testImports: - name: github.com/davecgh/go-spew - version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9 + version: 04cdfd42973bb9c8589fd6a731800cf222fde1a9 subpackages: - spew - name: github.com/pmezard/go-difflib @@ -141,7 +145,7 @@ testImports: subpackages: - difflib - name: github.com/stretchr/testify - version: 69483b4bd14f5845b5a1e55bca19e954e827f1d0 + version: 2aa2c176b9dab406a6970f6a55f513e8a8c8b18f subpackages: - assert - require diff --git a/glide.yaml b/glide.yaml index ce8057234..f4a796cf3 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,6 +1,6 @@ package: github.com/tendermint/abci import: -- package: github.com/golang/protobuf +- package: github.com/gogo/protobuf subpackages: - proto - package: github.com/spf13/cobra diff --git a/tests/client_server_test.go b/tests/client_server_test.go index cc946fcef..646c8b609 100644 --- a/tests/client_server_test.go +++ b/tests/client_server_test.go @@ -17,11 +17,11 @@ func TestClientServerNoAddrPrefix(t *testing.T) { server, err := abciserver.NewServer(addr, transport, app) assert.NoError(t, err, "expected no error on NewServer") - _, err = server.Start() + err = server.Start() assert.NoError(t, err, "expected no error on server.Start") client, err := abciclient.NewClient(addr, transport, true) assert.NoError(t, err, "expected no error on NewClient") - _, err = client.Start() + err = client.Start() assert.NoError(t, err, "expected no error on client.Start") } diff --git a/tests/test_app/app.go b/tests/test_app/app.go index d55fb1601..f04036216 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -18,7 +18,7 @@ func startClient(abciType string) abcicli.Client { } logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) client.SetLogger(logger.With("module", "abcicli")) - if _, err := client.Start(); err != nil { + if err := client.Start(); err != nil { panicf("connecting to abci_app: %v", err.Error()) } From 81e4effbdb8f42ebd4806c17936fc07efce04148 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 15:31:10 -0500 Subject: [PATCH 04/10] types: use data.Bytes directly in type.proto via gogo/protobuf. wow --- Makefile | 5 +- glide.lock | 6 +- glide.yaml | 2 +- types/base_app.go | 2 +- types/result.go | 41 ++----- types/result_test.go | 8 +- types/types.pb.go | 266 +++++++++++++++++++------------------------ types/types.proto | 15 ++- 8 files changed, 143 insertions(+), 202 deletions(-) diff --git a/Makefile b/Makefile index 32e8df4ee..e6a7af362 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,8 @@ GOTOOLS = \ github.com/Masterminds/glide \ github.com/alecthomas/gometalinter \ github.com/ckaznocha/protoc-gen-lint \ - github.com/gogo/protobuf/protoc-gen-gogo + github.com/gogo/protobuf/protoc-gen-gogo \ + github.com/gogo/protobuf/gogoproto all: install test @@ -23,7 +24,7 @@ protoc: ## On "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" ## ldconfig (may require sudo) ## https://stackoverflow.com/a/25518702 - protoc --gogo_out=plugins=grpc:. types/*.proto + protoc -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf --gogo_out=plugins=grpc:. types/*.proto install: @ go install ./cmd/... diff --git a/glide.lock b/glide.lock index b4a2125e9..d52acc7b5 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: eb1802c17bab227061f9198f2a738ad6e2bb676cefdd5729dc2ac90d5d10e610 -updated: 2017-11-30T15:00:40.216000076-05:00 +hash: 971ad090f3190ffd759deecf118a0eaefe7eceb4b1a8057800e332712fc1a7c2 +updated: 2017-11-30T15:29:31.740172292-05:00 imports: - name: github.com/btcsuite/btcd version: 8cea3866d0f7fb12d567a20744942c0d078c7d15 @@ -72,7 +72,7 @@ imports: - name: github.com/tendermint/go-crypto version: b4f04f196cd719660e43b91202cd60d9a95b1837 - name: github.com/tendermint/go-wire - version: 7d50b38b3815efe313728de77e2995c8813ce13f + version: 3f073b1a9c841d9b88d03ca8181f61278188adca subpackages: - data - name: github.com/tendermint/iavl diff --git a/glide.yaml b/glide.yaml index f4a796cf3..aeb6b674f 100644 --- a/glide.yaml +++ b/glide.yaml @@ -7,7 +7,7 @@ import: - package: github.com/tendermint/go-crypto version: develop - package: github.com/tendermint/go-wire - version: develop + version: data-bytes-marshal-unmarshal subpackages: - data - package: github.com/tendermint/iavl diff --git a/types/base_app.go b/types/base_app.go index f8d1946ab..1998e9dcb 100644 --- a/types/base_app.go +++ b/types/base_app.go @@ -24,7 +24,7 @@ func (BaseApplication) CheckTx(tx []byte) ResponseCheckTx { } func (BaseApplication) Commit() ResponseCommit { - return ResponseCommit{Code: CodeTypeOK, Data: []byte("nil")} + return ResponseCommit{Code: CodeTypeOK} } func (BaseApplication) Query(req RequestQuery) ResponseQuery { diff --git a/types/result.go b/types/result.go index 59d82ffc2..3344b27c0 100644 --- a/types/result.go +++ b/types/result.go @@ -2,8 +2,6 @@ package types import ( "fmt" - - "github.com/tendermint/go-wire/data" ) // type CodeType uint32 @@ -42,41 +40,16 @@ func (r ResponseCommit) Error() string { return fmtError(r.Code, r.Log) } -func fmtError(code uint32, log string) string { - return fmt.Sprintf("Error code (%d): %s", code, log) -} - -// ResultQuery is a wrapper around ResponseQuery using data.Bytes instead of -// raw byte slices. -type ResultQuery struct { - Code uint32 `json:"code"` - Index int64 `json:"index"` - Key data.Bytes `json:"key"` - Value data.Bytes `json:"value"` - Proof data.Bytes `json:"proof"` - Height uint64 `json:"height"` - Log string `json:"log"` -} - -// Result converts response query to ResultQuery. -func (r *ResponseQuery) Result() *ResultQuery { - return &ResultQuery{ - Code: r.Code, - Index: r.Index, - Key: r.Key, - Value: r.Value, - Proof: r.Proof, - Height: r.Height, - Log: r.Log, - } -} - // IsErr returns true if Code is something other than OK. -func (r *ResultQuery) IsErr() bool { +func (r ResponseQuery) IsErr() bool { return r.Code != CodeTypeOK } -// Error implements error interface by formatting result as string. -func (r *ResultQuery) Error() string { +// Error implements error interface by formatting response as string. +func (r ResponseQuery) Error() string { return fmtError(r.Code, r.Log) } + +func fmtError(code uint32, log string) string { + return fmt.Sprintf("Error code (%d): %s", code, log) +} diff --git a/types/result_test.go b/types/result_test.go index 7791cf526..b7da838cc 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -6,18 +6,17 @@ import ( "github.com/stretchr/testify/assert" ) -func TestResultQuery(t *testing.T) { - orig := &ResponseQuery{ +func TestResponseQuery(t *testing.T) { + res := ResponseQuery{ Code: CodeTypeOK, Index: 0, Key: []byte("hello"), Value: []byte("world"), Height: 1, } - res := orig.Result() assert.False(t, res.IsErr()) - orig = &ResponseQuery{ + res = ResponseQuery{ Code: 1, Index: 0, Key: []byte("hello"), @@ -25,7 +24,6 @@ func TestResultQuery(t *testing.T) { Height: 1, Log: "bad", } - res = orig.Result() assert.True(t, res.IsErr()) assert.Equal(t, "Error code (1): bad", res.Error()) } diff --git a/types/types.pb.go b/types/types.pb.go index 149c060ad..61a56cacf 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -44,6 +44,9 @@ package types import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" +import _ "github.com/gogo/protobuf/gogoproto" + +import github_com_tendermint_go_wire_data "github.com/tendermint/go-wire/data" import context "golang.org/x/net/context" import grpc "google.golang.org/grpc" @@ -1208,10 +1211,10 @@ func (m *ResponseSetOption) GetLog() string { } type ResponseDeliverTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Tags []*KVPair `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,2,opt,name=data,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"data"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Tags []*KVPair `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` } func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } @@ -1226,13 +1229,6 @@ func (m *ResponseDeliverTx) GetCode() uint32 { return 0 } -func (m *ResponseDeliverTx) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - func (m *ResponseDeliverTx) GetLog() string { if m != nil { return m.Log @@ -1248,11 +1244,11 @@ func (m *ResponseDeliverTx) GetTags() []*KVPair { } type ResponseCheckTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Gas uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` - Fee uint64 `protobuf:"varint,5,opt,name=fee,proto3" json:"fee,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,2,opt,name=data,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"data"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Gas uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` + Fee uint64 `protobuf:"varint,5,opt,name=fee,proto3" json:"fee,omitempty"` } func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } @@ -1267,13 +1263,6 @@ func (m *ResponseCheckTx) GetCode() uint32 { return 0 } -func (m *ResponseCheckTx) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - func (m *ResponseCheckTx) GetLog() string { if m != nil { return m.Log @@ -1296,13 +1285,13 @@ func (m *ResponseCheckTx) GetFee() uint64 { } type ResponseQuery struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` - Height uint64 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` - Log string `protobuf:"bytes,7,opt,name=log,proto3" json:"log,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + Key github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,3,opt,name=key,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"key"` + Value github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,4,opt,name=value,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"value"` + Proof github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,5,opt,name=proof,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"proof"` + Height uint64 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` + Log string `protobuf:"bytes,7,opt,name=log,proto3" json:"log,omitempty"` } func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } @@ -1324,27 +1313,6 @@ func (m *ResponseQuery) GetIndex() int64 { return 0 } -func (m *ResponseQuery) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *ResponseQuery) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *ResponseQuery) GetProof() []byte { - if m != nil { - return m.Proof - } - return nil -} - func (m *ResponseQuery) GetHeight() uint64 { if m != nil { return m.Height @@ -1360,9 +1328,9 @@ func (m *ResponseQuery) GetLog() string { } type ResponseCommit struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,2,opt,name=data,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"data"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` } func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } @@ -1377,13 +1345,6 @@ func (m *ResponseCommit) GetCode() uint32 { return 0 } -func (m *ResponseCommit) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - func (m *ResponseCommit) GetLog() string { if m != nil { return m.Log @@ -2054,93 +2015,98 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) } var fileDescriptorTypes = []byte{ - // 1395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x97, 0x4b, 0x6f, 0xdb, 0x46, - 0x10, 0x80, 0x2d, 0x89, 0x7a, 0x70, 0xe4, 0x87, 0xb2, 0x71, 0x13, 0x46, 0xb9, 0x24, 0x04, 0xd2, - 0xd8, 0x69, 0xea, 0xb4, 0x0e, 0x52, 0xc4, 0x4d, 0x51, 0xc0, 0x4e, 0xd2, 0x4a, 0x0d, 0x90, 0xa6, - 0x1b, 0x23, 0x57, 0x81, 0x16, 0x57, 0x12, 0x61, 0x99, 0x64, 0xc8, 0x95, 0x2b, 0xff, 0x87, 0xdc, - 0x7b, 0xee, 0xa9, 0x40, 0x7f, 0x48, 0x7f, 0x57, 0x31, 0xb3, 0xcb, 0xa7, 0xc9, 0x1c, 0xda, 0x0b, - 0xb1, 0xb3, 0x33, 0xb3, 0xdc, 0xc7, 0xcc, 0xb7, 0xb3, 0x70, 0x43, 0x5e, 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, 0xcb, 0xaa, 0xdf, 0xea, 0xe7, 0xd2, 0xb0, 0xae, 0x38, 0x39, - 0xeb, 0xd0, 0x4b, 0xfc, 0xe9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0x66, 0x37, 0xca, 0x9e, - 0x0f, 0x00, 0x00, + // 1485 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x8e, 0x13, 0x47, + 0x10, 0x5e, 0xdb, 0xe3, 0xbf, 0xf2, 0xfe, 0x98, 0x66, 0x03, 0xc6, 0x1c, 0x80, 0x91, 0x08, 0xbb, + 0x04, 0xd6, 0x64, 0x11, 0x11, 0x1b, 0xa2, 0x48, 0x6b, 0x16, 0x62, 0x0b, 0x89, 0x90, 0x61, 0xc5, + 0xd5, 0x1a, 0x7b, 0xda, 0xf6, 0x08, 0x7b, 0x66, 0x98, 0x69, 0x2f, 0x5e, 0x29, 0x8f, 0xc0, 0x3d, + 0xe7, 0xe4, 0x12, 0x29, 0x2f, 0x90, 0x37, 0x88, 0xf2, 0x0c, 0x39, 0xf0, 0x2c, 0x51, 0x55, 0xf7, + 0xfc, 0xee, 0x0c, 0x07, 0x0e, 0x5c, 0x56, 0x5d, 0x5d, 0xf5, 0xb5, 0xab, 0x7a, 0xaa, 0xbf, 0xaa, + 0x5a, 0xb8, 0x24, 0xce, 0x3d, 0x1e, 0xf4, 0xe8, 0xef, 0x81, 0xe7, 0xbb, 0xc2, 0x65, 0x55, 0x12, + 0xba, 0xf7, 0x67, 0xb6, 0x98, 0xaf, 0xc6, 0x07, 0x13, 0x77, 0xd9, 0x9b, 0xb9, 0x33, 0xb7, 0x47, + 0xda, 0xf1, 0x6a, 0x4a, 0x12, 0x09, 0xb4, 0x92, 0x28, 0xfd, 0x1f, 0x0d, 0xea, 0x06, 0x7f, 0xb7, + 0xe2, 0x81, 0x60, 0x7b, 0xa0, 0xf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, 0xc8, + 0x30, 0x77, 0xee, 0xec, 0xe6, 0xf7, 0x79, 0x18, 0x64, 0x3c, 0x3e, 0x14, 0x0d, 0x94, 0xdd, 0xc2, + 0x0e, 0x8e, 0x1d, 0x03, 0x24, 0x06, 0x87, 0xc2, 0xb1, 0xb2, 0x5b, 0xdc, 0xc7, 0xb1, 0x27, 0xd0, + 0x88, 0x67, 0x85, 0xfc, 0xe1, 0xb2, 0x5b, 0xd4, 0xca, 0x8d, 0x6b, 0xf4, 0x0f, 0x8b, 0x87, 0xff, + 0x07, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xbb, 0x93, 0x98, 0xfb, 0x10, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 48608cd40..2754a3624 100644 --- a/types/types.proto +++ b/types/types.proto @@ -1,6 +1,9 @@ syntax = "proto3"; package types; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + + // This file is copied from http://github.com/tendermint/abci //---------------------------------------- @@ -114,14 +117,14 @@ message ResponseSetOption{ message ResponseDeliverTx{ uint32 code = 1; - bytes data = 2; + bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; string log = 3; repeated KVPair tags = 4; } message ResponseCheckTx{ uint32 code = 1; - bytes data = 2; + bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; string log = 3; uint64 gas = 4; uint64 fee = 5; @@ -130,16 +133,16 @@ message ResponseCheckTx{ message ResponseQuery{ uint32 code = 1; int64 index = 2; - bytes key = 3; - bytes value = 4; - bytes proof = 5; + bytes key = 3 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; + bytes value = 4 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; + bytes proof = 5 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; uint64 height = 6; string log = 7; } message ResponseCommit{ uint32 code = 1; - bytes data = 2; + bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; string log = 3; } From 550d6a6081dbdc0c4acee7f101f1828852ddca8f Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 15:37:31 -0500 Subject: [PATCH 05/10] shame: forgot to add new code pkg --- example/code/code.go | 9 +++++++++ example/counter/counter.go | 8 ++++---- example/dummy/dummy.go | 7 ++++--- example/dummy/dummy_test.go | 17 ++++++++++------- example/dummy/persistent_dummy.go | 4 ++-- example/example_test.go | 10 ++++++---- 6 files changed, 35 insertions(+), 20 deletions(-) create mode 100644 example/code/code.go diff --git a/example/code/code.go b/example/code/code.go new file mode 100644 index 000000000..94e9d015e --- /dev/null +++ b/example/code/code.go @@ -0,0 +1,9 @@ +package code + +// Return codes for the examples +const ( + CodeTypeOK uint32 = 0 + CodeTypeEncodingError uint32 = 1 + CodeTypeBadNonce uint32 = 2 + CodeTypeUnauthorized uint32 = 3 +) diff --git a/example/counter/counter.go b/example/counter/counter.go index 67fa06e31..0978799e8 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -50,7 +50,7 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { } } app.txCount++ - return types.ResponseDeliverTx{Code: types.CodeTypeOK} + return types.ResponseDeliverTx{Code: code.CodeTypeOK} } func (app *CounterApplication) CheckTx(tx []byte) types.ResponseCheckTx { @@ -69,17 +69,17 @@ func (app *CounterApplication) CheckTx(tx []byte) types.ResponseCheckTx { Log: fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)} } } - return types.ResponseCheckTx{Code: types.CodeTypeOK} + return types.ResponseCheckTx{Code: code.CodeTypeOK} } func (app *CounterApplication) Commit() (resp types.ResponseCommit) { app.hashCount++ if app.txCount == 0 { - return types.ResponseCommit{Code: types.CodeTypeOK} + return types.ResponseCommit{Code: code.CodeTypeOK} } hash := make([]byte, 8) binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return types.ResponseCommit{Code: types.CodeTypeOK, Data: hash} + return types.ResponseCommit{Code: code.CodeTypeOK, Data: hash} } func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 8329ef039..fdb4851cf 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" + "github.com/tendermint/abci/example/code" "github.com/tendermint/abci/types" wire "github.com/tendermint/go-wire" "github.com/tendermint/iavl" @@ -42,11 +43,11 @@ func (app *DummyApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { {Key: "app.creator", ValueType: types.KVPair_STRING, ValueString: "jae"}, {Key: "app.key", ValueType: types.KVPair_STRING, ValueString: string(key)}, } - return types.ResponseDeliverTx{Code: types.CodeTypeOK, Tags: tags} + return types.ResponseDeliverTx{Code: code.CodeTypeOK, Tags: tags} } func (app *DummyApplication) CheckTx(tx []byte) types.ResponseCheckTx { - return types.ResponseCheckTx{Code: types.CodeTypeOK} + return types.ResponseCheckTx{Code: code.CodeTypeOK} } func (app *DummyApplication) Commit() types.ResponseCommit { @@ -64,7 +65,7 @@ func (app *DummyApplication) Commit() types.ResponseCommit { } } - return types.ResponseCommit{Code: types.CodeTypeOK, Data: hash} + return types.ResponseCommit{Code: code.CodeTypeOK, Data: hash} } func (app *DummyApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index 65970ecd7..738da6e85 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -7,12 +7,15 @@ import ( "testing" "github.com/stretchr/testify/require" - abcicli "github.com/tendermint/abci/client" - abciserver "github.com/tendermint/abci/server" - "github.com/tendermint/abci/types" + "github.com/tendermint/iavl" cmn "github.com/tendermint/tmlibs/common" "github.com/tendermint/tmlibs/log" + + abcicli "github.com/tendermint/abci/client" + "github.com/tendermint/abci/example/code" + abciserver "github.com/tendermint/abci/server" + "github.com/tendermint/abci/types" ) func testDummy(t *testing.T, app types.Application, tx []byte, key, value string) { @@ -27,7 +30,7 @@ func testDummy(t *testing.T, app types.Application, tx []byte, key, value string Path: "/store", Data: []byte(key), }) - require.Equal(t, types.CodeTypeOK, resQuery.Code) + require.Equal(t, code.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) // make sure proof is fine @@ -36,7 +39,7 @@ func testDummy(t *testing.T, app types.Application, tx []byte, key, value string Data: []byte(key), Prove: true, }) - require.EqualValues(t, types.CodeTypeOK, resQuery.Code) + require.EqualValues(t, code.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) proof, err := iavl.ReadKeyExistsProof(resQuery.Proof) require.Nil(t, err) @@ -295,7 +298,7 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) Data: []byte(key), }) require.Nil(t, err) - require.Equal(t, types.CodeTypeOK, resQuery.Code) + require.Equal(t, code.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) // make sure proof is fine @@ -305,7 +308,7 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) Prove: true, }) require.Nil(t, err) - require.Equal(t, types.CodeTypeOK, resQuery.Code) + require.Equal(t, code.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) proof, err := iavl.ReadKeyExistsProof(resQuery.Proof) require.Nil(t, err) diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 51da8b30f..1d72bea14 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -97,7 +97,7 @@ func (app *PersistentDummyApplication) Commit() types.ResponseCommit { } app.logger.Info("Commit block", "height", height, "root", appHash) - return types.ResponseCommit{Code: types.CodeTypeOK, Data: appHash} + return types.ResponseCommit{Code: code.CodeTypeOK, Data: appHash} } func (app *PersistentDummyApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { @@ -217,5 +217,5 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types // we only update the changes array if we successfully updated the tree app.changes = append(app.changes, v) - return types.ResponseDeliverTx{Code: types.CodeTypeOK} + return types.ResponseDeliverTx{Code: code.CodeTypeOK} } diff --git a/example/example_test.go b/example/example_test.go index 7fd3bb520..dfa38a398 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -11,12 +11,14 @@ import ( "golang.org/x/net/context" + cmn "github.com/tendermint/tmlibs/common" + "github.com/tendermint/tmlibs/log" + abcicli "github.com/tendermint/abci/client" + "github.com/tendermint/abci/example/code" "github.com/tendermint/abci/example/dummy" abciserver "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" - cmn "github.com/tendermint/tmlibs/common" - "github.com/tendermint/tmlibs/log" ) func TestDummy(t *testing.T) { @@ -60,7 +62,7 @@ func testStream(t *testing.T, app types.Application) { switch r := res.Value.(type) { case *types.Response_DeliverTx: counter++ - if r.DeliverTx.Code != types.CodeTypeOK { + if r.DeliverTx.Code != code.CodeTypeOK { t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code) } if counter > numDeliverTxs { @@ -135,7 +137,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { t.Fatalf("Error in GRPC DeliverTx: %v", err.Error()) } counter++ - if response.Code != types.CodeTypeOK { + if response.Code != code.CodeTypeOK { t.Error("DeliverTx failed with ret_code", response.Code) } if counter > numDeliverTxs { From 10031f57d5ae773f5d2013e94f03d9c35a785b1f Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 17:20:36 -0500 Subject: [PATCH 06/10] fix grpc version; add log_level and some logging --- client/grpc_client.go | 2 ++ cmd/abci-cli/abci-cli.go | 66 ++++++++++++++++++++++------------------ glide.lock | 20 ++++++------ glide.yaml | 5 ++- server/grpc_server.go | 1 + tests/test_app/test.sh | 5 +++ tests/test_cli/test.sh | 2 +- 7 files changed, 60 insertions(+), 41 deletions(-) diff --git a/client/grpc_client.go b/client/grpc_client.go index 0afadc726..308a9e139 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -60,6 +60,7 @@ RETRY_LOOP: continue RETRY_LOOP } + cli.Logger.Info("Dialed server. Waiting for echo.", "addr", cli.addr) client := types.NewABCIApplicationClient(conn) ENSURE_CONNECTED: @@ -68,6 +69,7 @@ RETRY_LOOP: if err == nil { break ENSURE_CONNECTED } + cli.Logger.Info("Echo failed", "err", err) time.Sleep(time.Second * echoRetryIntervalSeconds) } diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index cc60a4bc3..25786b377 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -10,46 +10,32 @@ import ( "os/exec" "strings" + "github.com/spf13/cobra" + + cmn "github.com/tendermint/tmlibs/common" + "github.com/tendermint/tmlibs/log" + abcicli "github.com/tendermint/abci/client" "github.com/tendermint/abci/example/counter" "github.com/tendermint/abci/example/dummy" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" "github.com/tendermint/abci/version" - cmn "github.com/tendermint/tmlibs/common" - "github.com/tendermint/tmlibs/log" - - "github.com/spf13/cobra" ) -// Structure for data passed to print response. -type response struct { - // generic abci response - Data []byte - Code uint32 - Log string - - Query *queryResponse -} - -type queryResponse struct { - Key []byte - Value []byte - Height uint64 - Proof []byte -} - // client is a global variable so it can be reused by the console -var client abcicli.Client - -var logger log.Logger +var ( + client abcicli.Client + logger log.Logger +) // flags var ( // global - address string - abci string - verbose bool + address string + abci string + verbose bool // for the println output + logLevel string // for the logger // query path string @@ -79,7 +65,11 @@ var RootCmd = &cobra.Command{ } if logger == nil { - logger = log.NewFilter(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), log.AllowError()) + allowLevel, err := log.AllowLevel(logLevel) + if err != nil { + return err + } + logger = log.NewFilter(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), allowLevel) } if client == nil { var err error @@ -96,6 +86,23 @@ var RootCmd = &cobra.Command{ }, } +// Structure for data passed to print response. +type response struct { + // generic abci response + Data []byte + Code uint32 + Log string + + Query *queryResponse +} + +type queryResponse struct { + Key []byte + Value []byte + Height uint64 + Proof []byte +} + func Execute() error { addGlobalFlags() addCommands() @@ -103,9 +110,10 @@ func Execute() error { } func addGlobalFlags() { - RootCmd.PersistentFlags().StringVarP(&address, "address", "", "tcp://127.0.0.1:46658", "Address of application socket") + RootCmd.PersistentFlags().StringVarP(&address, "address", "", "tcp://0.0.0.0:46658", "Address of application socket") RootCmd.PersistentFlags().StringVarP(&abci, "abci", "", "socket", "Either socket or grpc") RootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Print the command and results as if it were a console session") + RootCmd.PersistentFlags().StringVarP(&logLevel, "log_level", "", "debug", "Set the logger level") } func addQueryFlags() { diff --git a/glide.lock b/glide.lock index d52acc7b5..f96fd1c08 100644 --- a/glide.lock +++ b/glide.lock @@ -1,8 +1,8 @@ -hash: 971ad090f3190ffd759deecf118a0eaefe7eceb4b1a8057800e332712fc1a7c2 -updated: 2017-11-30T15:29:31.740172292-05:00 +hash: 6cb2c869c8ce7d9e43b1e8930b9b1bc974ebb3d36d4b704fc78b77efba956a13 +updated: 2017-11-30T17:08:29.176515576-05:00 imports: - name: github.com/btcsuite/btcd - version: 8cea3866d0f7fb12d567a20744942c0d078c7d15 + version: 2e60448ffcc6bf78332d1fe590260095f554dd78 subpackages: - btcec - name: github.com/go-kit/kit @@ -44,7 +44,7 @@ imports: - name: github.com/kr/logfmt version: b84e30acd515aadc4b783ad4ff83aff3299bdfe0 - name: github.com/pkg/errors - version: 645ef00459ed84a119197bfb8d8205042c6df63d + version: f15c970de5b76fac0b59abb32d62c17cc7bed265 - name: github.com/spf13/cobra version: 7b2c5ac9fc04fc5efafb60700713d4fa609b777b - name: github.com/spf13/pflag @@ -72,7 +72,7 @@ imports: - name: github.com/tendermint/go-crypto version: b4f04f196cd719660e43b91202cd60d9a95b1837 - name: github.com/tendermint/go-wire - version: 3f073b1a9c841d9b88d03ca8181f61278188adca + version: 5ab49b4c6ad674da6b81442911cf713ef0afb544 subpackages: - data - name: github.com/tendermint/iavl @@ -85,7 +85,7 @@ imports: - log - process - name: golang.org/x/crypto - version: 9f005a07e0d31d45e6656d241bb5c0f2efd4bc94 + version: 94eea52f7b742c7cbe0b03b22f0c4c8631ece122 subpackages: - nacl/secretbox - openpgp/armor @@ -94,7 +94,7 @@ imports: - ripemd160 - salsa20/salsa - name: golang.org/x/net - version: 9dfe39835686865bff950a07b394c12a98ddc811 + version: a8b9294777976932365dabb6640cf1468d95c70f subpackages: - context - http2 @@ -104,18 +104,18 @@ imports: - lex/httplex - trace - name: golang.org/x/text - version: 88f656faf3f37f690df1a32515b479415e1a6769 + version: 75cc3cad82b5f47d3fb229ddda8c5167da14f294 subpackages: - secure/bidirule - transform - unicode/bidi - unicode/norm - name: google.golang.org/genproto - version: 891aceb7c239e72692819142dfca057bdcbfcb96 + version: 7f0da29060c682909f650ad8ed4e515bd74fa12a subpackages: - googleapis/rpc/status - name: google.golang.org/grpc - version: f7bf885db0b7479a537ec317c6e48ce53145f3db + version: 401e0e00e4bb830a10496d64cd95e068c5bf50de subpackages: - balancer - codes diff --git a/glide.yaml b/glide.yaml index aeb6b674f..88f49dde4 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,13 +1,15 @@ package: github.com/tendermint/abci import: - package: github.com/gogo/protobuf + version: v0.5 subpackages: - proto - package: github.com/spf13/cobra + version: v0.0.1 - package: github.com/tendermint/go-crypto version: develop - package: github.com/tendermint/go-wire - version: data-bytes-marshal-unmarshal + version: develop subpackages: - data - package: github.com/tendermint/iavl @@ -23,6 +25,7 @@ import: subpackages: - context - package: google.golang.org/grpc + version: v1.7.3 testImport: - package: github.com/stretchr/testify subpackages: diff --git a/server/grpc_server.go b/server/grpc_server.go index 077f0e525..e7dad15cf 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -42,6 +42,7 @@ func (s *GRPCServer) OnStart() error { if err != nil { return err } + s.Logger.Info("Listening", "proto", s.proto, "addr", s.addr) s.listener = ln s.server = grpc.NewServer() types.RegisterABCIApplicationServer(s.server, s.app) diff --git a/tests/test_app/test.sh b/tests/test_app/test.sh index 5b523fefe..230c94163 100755 --- a/tests/test_app/test.sh +++ b/tests/test_app/test.sh @@ -11,11 +11,16 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" # Change into that dir because we expect that. cd "$DIR" +echo "RUN COUNTER OVER SOCKET" # test golang counter ABCI_APP="counter" go run ./*.go +echo "----------------------" + +echo "RUN COUNTER OVER GRPC" # test golang counter via grpc ABCI_APP="counter --abci=grpc" ABCI="grpc" go run ./*.go +echo "----------------------" # test nodejs counter # TODO: fix node app diff --git a/tests/test_cli/test.sh b/tests/test_cli/test.sh index f6259148d..ed00b9d72 100644 --- a/tests/test_cli/test.sh +++ b/tests/test_cli/test.sh @@ -17,7 +17,7 @@ function testExample() { echo "Example $N: $APP" $APP &> /dev/null & sleep 2 - abci-cli --verbose batch < "$INPUT" > "${INPUT}.out.new" + abci-cli --log_level=error --verbose batch < "$INPUT" > "${INPUT}.out.new" killall "$3" pre=$(shasum < "${INPUT}.out") From f00a19eaad06917edd719e935d81780d0f9c2ed9 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 17:36:16 -0500 Subject: [PATCH 07/10] fix tutorial output to remove code msg --- tests/test_cli/ex2.abci.out | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_cli/ex2.abci.out b/tests/test_cli/ex2.abci.out index 40e10f83e..741dd7b72 100644 --- a/tests/test_cli/ex2.abci.out +++ b/tests/test_cli/ex2.abci.out @@ -11,14 +11,14 @@ -> code: OK > check_tx 0x00 --> code: BadNonce +-> code: 2 -> log: Invalid nonce. Expected >= 1, got 0 > deliver_tx 0x01 -> code: OK > deliver_tx 0x04 --> code: BadNonce +-> code: 2 -> log: Invalid nonce. Expected 2, got 4 > info From e3f6666ecc83aa5bbc22cb6d19b1fcb9455b5440 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 17:48:05 -0500 Subject: [PATCH 08/10] update changelog; add rudis script for safe keeping --- .gitignore | 1 + CHANGELOG.md | 9 +++-- example/example.go | 2 +- types/protoreplace/protoreplace.go | 55 ++++++++++++++++++++++++++++++ types/result.go | 2 -- 5 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 types/protoreplace/protoreplace.go diff --git a/.gitignore b/.gitignore index 62f28681c..ea27eda1c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ vendor .glide +types/types.pb.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 6937eaeb4..28dd29473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,15 +4,20 @@ BREAKING CHANGES: - [client] all XxxSync methods now return (ResponseXxx, error) - - [types] Application: all methods now take RequestXxx and return (ResponseXxx, error). + - [types] all methods on Application interface now take RequestXxx and return (ResponseXxx, error). - Except `CheckTx`/`DeliverTx`, which takes a `tx []byte` argument. - Except `Commit`, which takes no arguments. - - [types] removed Result + - [types] removed Result and ResultQuery + - [types] removed CodeType - only `0 == OK` is defined here, everything else is left to convention at the application level + - [types] switched to using `gogo/protobuf` for code generation + - [types] use `customtype` feature of `gogo/protobuf` to replace `[]byte` with `data.Bytes` in all generated types :) + - this eliminates the need for additional types like ResultQuery FEATURES: - [types] added Tags field to ResponseDeliverTx - [types] added Gas and Fee fields to ResponseCheckTx - [dummy] DeliverTx returns tags + - [abci-cli] added `log_level` flag to control the logger ## 0.7.1 (November 14, 2017) diff --git a/example/example.go b/example/example.go index 5a2b24494..ee491c1b5 100644 --- a/example/example.go +++ b/example/example.go @@ -1,3 +1,3 @@ package example -// so go get doesnt complain +// so the go tool doesn't return errors about no buildable go files ... diff --git a/types/protoreplace/protoreplace.go b/types/protoreplace/protoreplace.go new file mode 100644 index 000000000..c859098f8 --- /dev/null +++ b/types/protoreplace/protoreplace.go @@ -0,0 +1,55 @@ +package main + +// +build ignore + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "os/exec" + "regexp" + "strings" +) + +// This script replaces most `[]byte` with `data.Bytes` in a `.pb.go` file. +// It was written before we realized we could use `gogo/protobuf` to achieve +// this more natively. So it's here for safe keeping in case we ever need to +// abandon `gogo/protobuf`. + +func main() { + bytePattern := regexp.MustCompile("[[][]]byte") + const oldPath = "types/types.pb.go" + const tmpPath = "types/types.pb.new" + content, err := ioutil.ReadFile(oldPath) + if err != nil { + panic("cannot read " + oldPath) + os.Exit(1) + } + lines := bytes.Split(content, []byte("\n")) + outFile, _ := os.Create(tmpPath) + wroteImport := false + for _, line_bytes := range lines { + line := string(line_bytes) + gotPackageLine := strings.HasPrefix(line, "package ") + writeImportTime := strings.HasPrefix(line, "import ") + containsDescriptor := strings.Contains(line, "Descriptor") + containsByteArray := strings.Contains(line, "[]byte") + if containsByteArray && !containsDescriptor { + line = string(bytePattern.ReplaceAll([]byte(line), []byte("data.Bytes"))) + } + if writeImportTime && !wroteImport { + wroteImport = true + fmt.Fprintf(outFile, "import \"github.com/tendermint/go-wire/data\"\n") + + } + if gotPackageLine { + fmt.Fprintf(outFile, "%s\n", "//nolint: gas") + } + fmt.Fprintf(outFile, "%s\n", line) + } + outFile.Close() + os.Remove(oldPath) + os.Rename(tmpPath, oldPath) + exec.Command("goimports", "-w", oldPath) +} diff --git a/types/result.go b/types/result.go index 3344b27c0..3f3fdd827 100644 --- a/types/result.go +++ b/types/result.go @@ -4,8 +4,6 @@ import ( "fmt" ) -// type CodeType uint32 - const ( CodeTypeOK uint32 = 0 ) From ed393f9934c0c78d098b4935814582370a1efd4f Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 17:49:53 -0500 Subject: [PATCH 09/10] abci-cli: print OK if code is 0 --- CHANGELOG.md | 1 + cmd/abci-cli/abci-cli.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28dd29473..8dba7032b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ BREAKING CHANGES: - [types] switched to using `gogo/protobuf` for code generation - [types] use `customtype` feature of `gogo/protobuf` to replace `[]byte` with `data.Bytes` in all generated types :) - this eliminates the need for additional types like ResultQuery + - [abci-cli] codes are printed as their number instead of a message, except for `code == 0`, which is still printed as `OK` FEATURES: - [types] added Tags field to ResponseDeliverTx diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 25786b377..ef8b90635 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -516,7 +516,12 @@ func printResponse(cmd *cobra.Command, args []string, rsp response) { } // Always print the status code. - fmt.Printf("-> code: %d\n", rsp.Code) + if rsp.Code == types.CodeTypeOK { + fmt.Printf("-> code: OK\n") + } else { + fmt.Printf("-> code: %d\n", rsp.Code) + + } if len(rsp.Data) != 0 { // Do no print this line when using the commit command From 5d2838ebab9d81e6c888922ab11fb4c894e8b827 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 20:17:06 -0500 Subject: [PATCH 10/10] fix from review --- client/grpc_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/grpc_client.go b/client/grpc_client.go index 308a9e139..9328fa326 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -69,7 +69,7 @@ RETRY_LOOP: if err == nil { break ENSURE_CONNECTED } - cli.Logger.Info("Echo failed", "err", err) + cli.Logger.Error("Echo failed", "err", err) time.Sleep(time.Second * echoRetryIntervalSeconds) }