From 83f6119cad660132e9166df5b0847bae4985b377 Mon Sep 17 00:00:00 2001 From: Shogo Hyodo Date: Tue, 8 Aug 2023 22:02:30 +0900 Subject: [PATCH] Use tm ResponseCheckTx --- Makefile | 1 - abci/client/client.go | 2 +- abci/client/grpc_client.go | 2 +- abci/client/local_client.go | 4 +- abci/client/mocks/client.go | 10 +- abci/client/socket_client.go | 2 +- abci/cmd/abci-cli/abci-cli.go | 2 +- abci/example/counter/counter.go | 10 +- abci/example/kvstore/kvstore.go | 6 +- abci/example/kvstore/persistent_kvstore.go | 2 +- abci/tests/test_app/main.go | 3 +- abci/types/application.go | 20 +- abci/types/messages.go | 2 +- abci/types/messages_test.go | 8 +- abci/types/mocks/application.go | 8 +- abci/types/result.go | 54 -- abci/types/types.pb.go | 804 ++---------------- blockchain/v0/reactor_test.go | 6 +- consensus/mempool_test.go | 8 +- consensus/replay_test.go | 2 +- consensus/state_test.go | 4 +- mempool/mempool.go | 4 +- mempool/mempool_test.go | 2 +- mempool/v0/cache_test.go | 3 +- mempool/v0/clist_mempool.go | 8 +- mempool/v0/clist_mempool_system_test.go | 4 +- mempool/v0/clist_mempool_test.go | 18 +- proto/ostracon/abci/types.proto | 22 +- proto/ostracon/rpc/grpc/types.proto | 33 - proxy/app_conn.go | 4 +- proxy/mocks/app_conn_mempool.go | 10 +- rpc/client/event_test.go | 3 +- rpc/client/mock/abci.go | 4 +- rpc/client/mock/abci_test.go | 3 +- rpc/client/rpc_test.go | 12 +- rpc/core/mempool_test.go | 24 +- rpc/core/types/responses.go | 7 +- rpc/grpc/api.go | 12 +- rpc/grpc/client_server.go | 8 +- rpc/grpc/grpc_test.go | 3 +- rpc/grpc/types.pb.go | 926 --------------------- rpc/test/helpers.go | 6 +- state/execution.go | 2 +- state/helpers_test.go | 6 +- state/indexer/sink/psql/psql_test.go | 3 +- state/txindex/kv/kv_bench_test.go | 3 +- state/txindex/kv/kv_test.go | 9 +- test/app/grpc_client.go | 4 +- test/e2e/app/app.go | 6 +- 49 files changed, 220 insertions(+), 1889 deletions(-) delete mode 100644 abci/types/result.go delete mode 100644 proto/ostracon/rpc/grpc/types.proto delete mode 100644 rpc/grpc/types.pb.go diff --git a/Makefile b/Makefile index b65eae407..8d2941d3e 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,6 @@ proto-gen: check-proto-deps @echo "Generating Protobuf files" @go run github.com/bufbuild/buf/cmd/buf generate @mv ./proto/ostracon/abci/types.pb.go ./abci/types/ - @mv ./proto/ostracon/rpc/grpc/types.pb.go ./rpc/grpc/ @rm -rf ./proto/tendermint .PHONY: proto-gen diff --git a/abci/client/client.go b/abci/client/client.go index 46dfc761f..098fba5b2 100644 --- a/abci/client/client.go +++ b/abci/client/client.go @@ -54,7 +54,7 @@ type Client interface { InfoSync(types.RequestInfo) (*types.ResponseInfo, error) SetOptionSync(types.RequestSetOption) (*types.ResponseSetOption, error) DeliverTxSync(types.RequestDeliverTx) (*types.ResponseDeliverTx, error) - CheckTxSync(types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) + CheckTxSync(types.RequestCheckTx) (*types.ResponseCheckTx, error) QuerySync(types.RequestQuery) (*types.ResponseQuery, error) CommitSync() (*types.ResponseCommit, error) InitChainSync(types.RequestInitChain) (*types.ResponseInitChain, error) diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index 60a137be1..9dc5a2dfe 100644 --- a/abci/client/grpc_client.go +++ b/abci/client/grpc_client.go @@ -342,7 +342,7 @@ func (cli *grpcClient) DeliverTxSync(params types.RequestDeliverTx) (*types.Resp return reqres.Response.GetDeliverTx(), cli.Error() } -func (cli *grpcClient) CheckTxSync(params types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { +func (cli *grpcClient) CheckTxSync(params types.RequestCheckTx) (*types.ResponseCheckTx, error) { reqres := cli.CheckTxAsync(params, nil) reqres.Wait() return reqres.Response.GetCheckTx(), cli.Error() diff --git a/abci/client/local_client.go b/abci/client/local_client.go index 94b576ffa..6616d70f7 100644 --- a/abci/client/local_client.go +++ b/abci/client/local_client.go @@ -111,7 +111,7 @@ func (app *localClient) CheckTxAsync(req types.RequestCheckTx, cb ResponseCallba reqRes := NewReqRes(ocabci.ToRequestCheckTx(req), cb) - app.Application.CheckTxAsync(req, func(r ocabci.ResponseCheckTx) { + app.Application.CheckTxAsync(req, func(r types.ResponseCheckTx) { res := ocabci.ToResponseCheckTx(r) app.done(reqRes, res) }) @@ -257,7 +257,7 @@ func (app *localClient) DeliverTxSync(req types.RequestDeliverTx) (*types.Respon return &res, nil } -func (app *localClient) CheckTxSync(req types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { +func (app *localClient) CheckTxSync(req types.RequestCheckTx) (*types.ResponseCheckTx, error) { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index 04e3f6dc5..c54f9205b 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -161,19 +161,19 @@ func (_m *Client) CheckTxAsync(_a0 types.RequestCheckTx, _a1 abcicli.ResponseCal } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *Client) CheckTxSync(_a0 types.RequestCheckTx) (*abcitypes.ResponseCheckTx, error) { +func (_m *Client) CheckTxSync(_a0 types.RequestCheckTx) (*types.ResponseCheckTx, error) { ret := _m.Called(_a0) - var r0 *abcitypes.ResponseCheckTx + var r0 *types.ResponseCheckTx var r1 error - if rf, ok := ret.Get(0).(func(types.RequestCheckTx) (*abcitypes.ResponseCheckTx, error)); ok { + if rf, ok := ret.Get(0).(func(types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(types.RequestCheckTx) *abcitypes.ResponseCheckTx); ok { + if rf, ok := ret.Get(0).(func(types.RequestCheckTx) *types.ResponseCheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abcitypes.ResponseCheckTx) + r0 = ret.Get(0).(*types.ResponseCheckTx) } } diff --git a/abci/client/socket_client.go b/abci/client/socket_client.go index 9e85d9194..a8f45158e 100644 --- a/abci/client/socket_client.go +++ b/abci/client/socket_client.go @@ -341,7 +341,7 @@ func (cli *socketClient) DeliverTxSync(req types.RequestDeliverTx) (*types.Respo return reqres.Response.GetDeliverTx(), cli.Error() } -func (cli *socketClient) CheckTxSync(req types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { +func (cli *socketClient) CheckTxSync(req types.RequestCheckTx) (*types.ResponseCheckTx, error) { reqres := cli.queueRequest(ocabci.ToRequestCheckTx(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index dbbb049f3..573cbb0b7 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -776,7 +776,7 @@ func printResponse(cmd *cobra.Command, args []string, rsp response) { } // Always print the status code. - if rsp.Code == ocabci.CodeTypeOK { + if rsp.Code == types.CodeTypeOK { fmt.Printf("-> code: OK\n") } else { fmt.Printf("-> code: %d\n", rsp.Code) diff --git a/abci/example/counter/counter.go b/abci/example/counter/counter.go index d2c004deb..95dc48572 100644 --- a/abci/example/counter/counter.go +++ b/abci/example/counter/counter.go @@ -64,7 +64,7 @@ func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeli return types.ResponseDeliverTx{Code: code.CodeTypeOK} } -func (app *Application) CheckTxSync(req types.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *Application) CheckTxSync(req types.RequestCheckTx) types.ResponseCheckTx { return app.checkTx(req) } @@ -72,10 +72,10 @@ func (app *Application) CheckTxAsync(req types.RequestCheckTx, callback ocabci.C callback(app.checkTx(req)) } -func (app *Application) checkTx(req types.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *Application) checkTx(req types.RequestCheckTx) types.ResponseCheckTx { if app.serial { if len(req.Tx) > 8 { - return ocabci.ResponseCheckTx{ + return types.ResponseCheckTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(req.Tx))} } @@ -83,12 +83,12 @@ func (app *Application) checkTx(req types.RequestCheckTx) ocabci.ResponseCheckTx copy(tx8[len(tx8)-len(req.Tx):], req.Tx) txValue := binary.BigEndian.Uint64(tx8) if txValue < uint64(app.txCount) { - return ocabci.ResponseCheckTx{ + return types.ResponseCheckTx{ Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)} } } - return ocabci.ResponseCheckTx{Code: code.CodeTypeOK} + return types.ResponseCheckTx{Code: code.CodeTypeOK} } func (app *Application) Commit() (resp types.ResponseCommit) { diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index 51f6ecb9d..4f6ff3668 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -117,7 +117,7 @@ func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeli return types.ResponseDeliverTx{Code: code.CodeTypeOK, Events: events} } -func (app *Application) CheckTxSync(req types.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *Application) CheckTxSync(req types.RequestCheckTx) types.ResponseCheckTx { return app.checkTx(req) } @@ -125,8 +125,8 @@ func (app *Application) CheckTxAsync(req types.RequestCheckTx, callback ocabci.C callback(app.checkTx(req)) } -func (app *Application) checkTx(req types.RequestCheckTx) ocabci.ResponseCheckTx { - return ocabci.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1} +func (app *Application) checkTx(req types.RequestCheckTx) types.ResponseCheckTx { + return types.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1} } func (app *Application) Commit() types.ResponseCommit { diff --git a/abci/example/kvstore/persistent_kvstore.go b/abci/example/kvstore/persistent_kvstore.go index 34489fce3..6390e500c 100644 --- a/abci/example/kvstore/persistent_kvstore.go +++ b/abci/example/kvstore/persistent_kvstore.go @@ -81,7 +81,7 @@ func (app *PersistentKVStoreApplication) DeliverTx(req types.RequestDeliverTx) t return app.app.DeliverTx(req) } -func (app *PersistentKVStoreApplication) CheckTxSync(req types.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *PersistentKVStoreApplication) CheckTxSync(req types.RequestCheckTx) types.ResponseCheckTx { return app.app.CheckTxSync(req) } diff --git a/abci/tests/test_app/main.go b/abci/tests/test_app/main.go index 6341c71fd..06d6e75a7 100644 --- a/abci/tests/test_app/main.go +++ b/abci/tests/test_app/main.go @@ -7,8 +7,9 @@ import ( "os/exec" "time" + "github.com/tendermint/tendermint/abci/types" + "github.com/Finschia/ostracon/abci/example/code" - "github.com/Finschia/ostracon/abci/types" ) var abciType string diff --git a/abci/types/application.go b/abci/types/application.go index 9941f4a7f..a530a2319 100644 --- a/abci/types/application.go +++ b/abci/types/application.go @@ -8,7 +8,7 @@ import ( //go:generate ../../scripts/mockery_generate.sh Application -type CheckTxCallback func(ResponseCheckTx) +type CheckTxCallback func(types.ResponseCheckTx) // Application is an interface that enables any finite, deterministic state machine // to be driven by a blockchain-based replication engine via the ABCI. @@ -21,7 +21,7 @@ type Application interface { Query(types.RequestQuery) types.ResponseQuery // Query for state // Mempool Connection - CheckTxSync(types.RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool + CheckTxSync(types.RequestCheckTx) types.ResponseCheckTx // Validate a tx for the mempool CheckTxAsync(types.RequestCheckTx, CheckTxCallback) // Asynchronously validate a tx for the mempool BeginRecheckTx(RequestBeginRecheckTx) ResponseBeginRecheckTx // Signals the beginning of rechecking EndRecheckTx(RequestEndRecheckTx) ResponseEndRecheckTx // Signals the end of rechecking @@ -61,23 +61,23 @@ func (BaseApplication) SetOption(req types.RequestSetOption) types.ResponseSetOp } func (BaseApplication) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx { - return types.ResponseDeliverTx{Code: CodeTypeOK} + return types.ResponseDeliverTx{Code: types.CodeTypeOK} } -func (BaseApplication) CheckTxSync(req types.RequestCheckTx) ResponseCheckTx { - return ResponseCheckTx{Code: CodeTypeOK} +func (BaseApplication) CheckTxSync(req types.RequestCheckTx) types.ResponseCheckTx { + return types.ResponseCheckTx{Code: types.CodeTypeOK} } func (BaseApplication) CheckTxAsync(req types.RequestCheckTx, callback CheckTxCallback) { - callback(ResponseCheckTx{Code: CodeTypeOK}) + callback(types.ResponseCheckTx{Code: types.CodeTypeOK}) } func (BaseApplication) BeginRecheckTx(req RequestBeginRecheckTx) ResponseBeginRecheckTx { - return ResponseBeginRecheckTx{Code: CodeTypeOK} + return ResponseBeginRecheckTx{Code: types.CodeTypeOK} } func (BaseApplication) EndRecheckTx(req RequestEndRecheckTx) ResponseEndRecheckTx { - return ResponseEndRecheckTx{Code: CodeTypeOK} + return ResponseEndRecheckTx{Code: types.CodeTypeOK} } func (BaseApplication) Commit() types.ResponseCommit { @@ -85,7 +85,7 @@ func (BaseApplication) Commit() types.ResponseCommit { } func (BaseApplication) Query(req types.RequestQuery) types.ResponseQuery { - return types.ResponseQuery{Code: CodeTypeOK} + return types.ResponseQuery{Code: types.CodeTypeOK} } func (BaseApplication) InitChain(req types.RequestInitChain) types.ResponseInitChain { @@ -150,7 +150,7 @@ func (app *GRPCApplication) DeliverTx(ctx context.Context, req *types.RequestDel return &res, nil } -func (app *GRPCApplication) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*ResponseCheckTx, error) { +func (app *GRPCApplication) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*types.ResponseCheckTx, error) { res := app.app.CheckTxSync(*req) return &res, nil } diff --git a/abci/types/messages.go b/abci/types/messages.go index 2fbe1355b..5b001e84d 100644 --- a/abci/types/messages.go +++ b/abci/types/messages.go @@ -211,7 +211,7 @@ func ToResponseDeliverTx(res types.ResponseDeliverTx) *Response { } } -func ToResponseCheckTx(res ResponseCheckTx) *Response { +func ToResponseCheckTx(res types.ResponseCheckTx) *Response { return &Response{ Value: &Response_CheckTx{&res}, } diff --git a/abci/types/messages_test.go b/abci/types/messages_test.go index f0f51d927..42a9fb57e 100644 --- a/abci/types/messages_test.go +++ b/abci/types/messages_test.go @@ -18,7 +18,7 @@ func TestMarshalJSON(t *testing.T) { assert.Nil(t, err) // include empty fields. assert.True(t, strings.Contains(string(b), "code")) - r1 := ResponseCheckTx{ + r1 := types.ResponseCheckTx{ Code: 1, Data: []byte("hello"), GasWanted: 43, @@ -34,7 +34,7 @@ func TestMarshalJSON(t *testing.T) { b, err = json.Marshal(&r1) assert.Nil(t, err) - var r2 ResponseCheckTx + var r2 types.ResponseCheckTx err = json.Unmarshal(b, &r2) assert.Nil(t, err) assert.Equal(t, r1, r2) @@ -85,7 +85,7 @@ func TestWriteReadMessage(t *testing.T) { func TestWriteReadMessage2(t *testing.T) { phrase := "hello-world" cases := []proto.Message{ - &ResponseCheckTx{ + &types.ResponseCheckTx{ Data: []byte(phrase), Log: phrase, GasWanted: 10, @@ -106,7 +106,7 @@ func TestWriteReadMessage2(t *testing.T) { err := WriteMessage(c, buf) assert.Nil(t, err) - msg := new(ResponseCheckTx) + msg := new(types.ResponseCheckTx) err = ReadMessage(buf, msg) assert.Nil(t, err) diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index 1dcb0d3d7..349be53b8 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -62,14 +62,14 @@ func (_m *Application) CheckTxAsync(_a0 types.RequestCheckTx, _a1 abcitypes.Chec } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *Application) CheckTxSync(_a0 types.RequestCheckTx) abcitypes.ResponseCheckTx { +func (_m *Application) CheckTxSync(_a0 types.RequestCheckTx) types.ResponseCheckTx { ret := _m.Called(_a0) - var r0 abcitypes.ResponseCheckTx - if rf, ok := ret.Get(0).(func(types.RequestCheckTx) abcitypes.ResponseCheckTx); ok { + var r0 types.ResponseCheckTx + if rf, ok := ret.Get(0).(func(types.RequestCheckTx) types.ResponseCheckTx); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abcitypes.ResponseCheckTx) + r0 = ret.Get(0).(types.ResponseCheckTx) } return r0 diff --git a/abci/types/result.go b/abci/types/result.go deleted file mode 100644 index cb7bec4ba..000000000 --- a/abci/types/result.go +++ /dev/null @@ -1,54 +0,0 @@ -package types - -import ( - "bytes" - "encoding/json" - "github.com/gogo/protobuf/jsonpb" -) - -const ( - CodeTypeOK uint32 = 0 -) - -// IsOK returns true if Code is OK. -func (r ResponseCheckTx) IsOK() bool { - return r.Code == CodeTypeOK -} - -// IsErr returns true if Code is something other than OK. -func (r ResponseCheckTx) IsErr() bool { - return r.Code != CodeTypeOK -} - -//--------------------------------------------------------------------------- -// override JSON marshaling so we emit defaults (ie. disable omitempty) - -var ( - jsonpbMarshaller = jsonpb.Marshaler{ - EnumsAsInts: true, - EmitDefaults: true, - } - jsonpbUnmarshaller = jsonpb.Unmarshaler{} -) - -func (r *ResponseCheckTx) MarshalJSON() ([]byte, error) { - s, err := jsonpbMarshaller.MarshalToString(r) - return []byte(s), err -} - -func (r *ResponseCheckTx) UnmarshalJSON(b []byte) error { - reader := bytes.NewBuffer(b) - return jsonpbUnmarshaller.Unmarshal(reader, r) -} - -// Some compile time assertions to ensure we don't -// have accidental runtime surprises later on. - -// jsonEncodingRoundTripper ensures that asserted -// interfaces implement both MarshalJSON and UnmarshalJSON -type jsonRoundTripper interface { - json.Marshaler - json.Unmarshaler -} - -var _ jsonRoundTripper = (*ResponseCheckTx)(nil) diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 0279dd74c..14f904932 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -484,7 +484,7 @@ type Response_BeginBlock struct { BeginBlock *types.ResponseBeginBlock `protobuf:"bytes,8,opt,name=begin_block,json=beginBlock,proto3,oneof" json:"begin_block,omitempty"` } type Response_CheckTx struct { - CheckTx *ResponseCheckTx `protobuf:"bytes,9,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` + CheckTx *types.ResponseCheckTx `protobuf:"bytes,9,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` } type Response_DeliverTx struct { DeliverTx *types.ResponseDeliverTx `protobuf:"bytes,10,opt,name=deliver_tx,json=deliverTx,proto3,oneof" json:"deliver_tx,omitempty"` @@ -596,7 +596,7 @@ func (m *Response) GetBeginBlock() *types.ResponseBeginBlock { return nil } -func (m *Response) GetCheckTx() *ResponseCheckTx { +func (m *Response) GetCheckTx() *types.ResponseCheckTx { if x, ok := m.GetValue().(*Response_CheckTx); ok { return x.CheckTx } @@ -690,132 +690,6 @@ func (*Response) XXX_OneofWrappers() []interface{} { } } -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"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,proto3" json:"gas_wanted,omitempty"` - GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,proto3" json:"gas_used,omitempty"` - Events []types.Event `protobuf:"bytes,7,rep,name=events,proto3" json:"events,omitempty"` - Codespace string `protobuf:"bytes,8,opt,name=codespace,proto3" json:"codespace,omitempty"` - Sender string `protobuf:"bytes,9,opt,name=sender,proto3" json:"sender,omitempty"` - Priority int64 `protobuf:"varint,10,opt,name=priority,proto3" json:"priority,omitempty"` - // mempool_error is set by Ostracon. - // ABCI applictions creating a ResponseCheckTX should not set mempool_error. - MempoolError string `protobuf:"bytes,11,opt,name=mempool_error,json=mempoolError,proto3" json:"mempool_error,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 fileDescriptor_addf585b2317eb36, []int{4} -} -func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseCheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseCheckTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResponseCheckTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseCheckTx.Merge(m, src) -} -func (m *ResponseCheckTx) XXX_Size() int { - return m.Size() -} -func (m *ResponseCheckTx) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseCheckTx.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseCheckTx proto.InternalMessageInfo - -func (m *ResponseCheckTx) GetCode() uint32 { - if m != nil { - return m.Code - } - 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 - } - return "" -} - -func (m *ResponseCheckTx) GetInfo() string { - if m != nil { - return m.Info - } - return "" -} - -func (m *ResponseCheckTx) GetGasWanted() int64 { - if m != nil { - return m.GasWanted - } - return 0 -} - -func (m *ResponseCheckTx) GetGasUsed() int64 { - if m != nil { - return m.GasUsed - } - return 0 -} - -func (m *ResponseCheckTx) GetEvents() []types.Event { - if m != nil { - return m.Events - } - return nil -} - -func (m *ResponseCheckTx) GetCodespace() string { - if m != nil { - return m.Codespace - } - return "" -} - -func (m *ResponseCheckTx) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *ResponseCheckTx) GetPriority() int64 { - if m != nil { - return m.Priority - } - return 0 -} - -func (m *ResponseCheckTx) GetMempoolError() string { - if m != nil { - return m.MempoolError - } - return "" -} - type ResponseBeginRecheckTx struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` } @@ -824,7 +698,7 @@ func (m *ResponseBeginRecheckTx) Reset() { *m = ResponseBeginRecheckTx{} func (m *ResponseBeginRecheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseBeginRecheckTx) ProtoMessage() {} func (*ResponseBeginRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{5} + return fileDescriptor_addf585b2317eb36, []int{4} } func (m *ResponseBeginRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -868,7 +742,7 @@ func (m *ResponseEndRecheckTx) Reset() { *m = ResponseEndRecheckTx{} } func (m *ResponseEndRecheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseEndRecheckTx) ProtoMessage() {} func (*ResponseEndRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{6} + return fileDescriptor_addf585b2317eb36, []int{5} } func (m *ResponseEndRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -909,7 +783,6 @@ func init() { proto.RegisterType((*RequestBeginRecheckTx)(nil), "ostracon.abci.RequestBeginRecheckTx") proto.RegisterType((*RequestEndRecheckTx)(nil), "ostracon.abci.RequestEndRecheckTx") proto.RegisterType((*Response)(nil), "ostracon.abci.Response") - proto.RegisterType((*ResponseCheckTx)(nil), "ostracon.abci.ResponseCheckTx") proto.RegisterType((*ResponseBeginRecheckTx)(nil), "ostracon.abci.ResponseBeginRecheckTx") proto.RegisterType((*ResponseEndRecheckTx)(nil), "ostracon.abci.ResponseEndRecheckTx") } @@ -917,88 +790,77 @@ func init() { func init() { proto.RegisterFile("ostracon/abci/types.proto", fileDescriptor_addf585b2317eb36) } var fileDescriptor_addf585b2317eb36 = []byte{ - // 1286 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0xdd, 0x8e, 0xdb, 0x44, - 0x14, 0xc7, 0xbd, 0x4d, 0x36, 0x89, 0x4f, 0x3e, 0xba, 0x3d, 0x2d, 0x95, 0x31, 0x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0x56, 0x09, 0x3c, 0x58, 0x23, 0x70, 0x48, 0xcc, 0x77, 0x94, - 0x12, 0x19, 0x08, 0x1e, 0xac, 0x21, 0xb8, 0x91, 0x21, 0x98, 0xc1, 0xe0, 0x1f, 0x37, 0x33, 0x58, - 0x4d, 0xc9, 0x68, 0x9b, 0xf9, 0x20, 0x3c, 0x54, 0x40, 0x78, 0x4f, 0xca, 0xbf, 0xaf, 0x94, 0xcf, - 0x4d, 0x61, 0xa2, 0xa6, 0xf0, 0x35, 0x45, 0xa1, 0x65, 0x62, 0xf8, 0xae, 0x0a, 0xc3, 0x57, 0x15, - 0x8a, 0xf9, 0x38, 0xfc, 0xd7, 0x19, 0x38, 0xbb, 0x52, 0xec, 0x88, 0x50, 0xb4, 0x99, 0x43, 0x25, - 0x09, 0xeb, 0x44, 0x8e, 0xc5, 0x9a, 0x63, 0x71, 0x4b, 0xe2, 0xad, 0x46, 0xe4, 0x18, 0xf7, 0xa0, - 0x30, 0x65, 0x63, 0xc9, 0x2e, 0x9d, 0x88, 0xa1, 0x88, 0x4a, 0xb8, 0xa4, 0x47, 0xd8, 0x69, 0x02, - 0x8c, 0xad, 0x60, 0xf8, 0x8b, 0xe5, 0x71, 0xea, 0x48, 0xec, 0x14, 0xc8, 0xd2, 0x0a, 0x9a, 0x50, - 0x11, 0xb3, 0x45, 0x40, 0x1d, 0xc9, 0x93, 0x02, 0x49, 0xe6, 0xd8, 0x87, 0x12, 0x7d, 0x4c, 0x3d, - 0x1e, 0x18, 0xe5, 0x2b, 0x85, 0xeb, 0xd5, 0x83, 0x8b, 0x6b, 0xcf, 0xa6, 0x27, 0x2e, 0x77, 0x0c, - 0x61, 0x05, 0xff, 0x3d, 0xbf, 0xbc, 0x17, 0x46, 0xdf, 0x64, 0x33, 0x97, 0xd3, 0xd9, 0x9c, 0x9f, - 0x90, 0x28, 0x1f, 0x2f, 0x81, 0x2e, 0xce, 0x11, 0xcc, 0x2d, 0x9b, 0x4a, 0x70, 0xe8, 0xe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, 0x5b, 0x80, 0x57, 0x06, 0x8d, 0x39, 0x9a, 0x28, 0x33, 0x8f, 0xd3, 0xe3, - 0x00, 0x2a, 0xb1, 0x5f, 0x62, 0x66, 0x4b, 0x63, 0x66, 0x9b, 0x2e, 0x3e, 0x80, 0x7a, 0xca, 0xfe, - 0x30, 0x5f, 0xa3, 0x62, 0xe6, 0x74, 0x53, 0xa1, 0x9f, 0x72, 0x43, 0xcc, 0xd7, 0xb8, 0x98, 0x39, - 0xcd, 0x15, 0x7f, 0x86, 0x73, 0x6b, 0xbe, 0x88, 0xf9, 0xfb, 0x18, 0xf3, 0x14, 0x76, 0x8b, 0x33, - 0xc0, 0x75, 0x93, 0xc4, 0x53, 0xb4, 0x35, 0xe6, 0x69, 0xdc, 0x17, 0x7f, 0x82, 0xc6, 0x0a, 0x55, - 0x73, 0x35, 0x39, 0x66, 0x3e, 0x13, 0xc6, 0xef, 0xa0, 0x96, 0xc2, 0x70, 0x8e, 0x86, 0xc7, 0xcc, - 0xe3, 0xc6, 0x9d, 0x3b, 0x4f, 0x5f, 0x34, 0x77, 0x9e, 0xbd, 0x68, 0xee, 0xfc, 0xfd, 0xa2, 0xb9, - 0xf3, 0xdb, 0xcb, 0xa6, 0xf6, 0xec, 0x65, 0x53, 0xfb, 0xf3, 0x65, 0x53, 0xfb, 0xfe, 0xdd, 0xb1, - 0xcb, 0x27, 0x8b, 0x51, 0xdb, 0x66, 0xb3, 0xfd, 0x43, 0xd7, 0x0b, 0xec, 0x89, 0x6b, 0xed, 0x6f, - 0xf8, 0x67, 0x69, 0x54, 0x92, 0x7f, 0xfd, 0xdc, 0xfa, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x25, - 0x02, 0x50, 0x77, 0x12, 0x00, 0x00, + // 1113 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0xdd, 0x6e, 0xe3, 0x44, + 0x14, 0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0xed, + 0x90, 0xc4, 0xba, 0x5b, 0x85, 0xcd, 0xe7, 0xc6, 0x74, 0x49, 0x5a, 0x03, 0x78, 0x3d, 0xf3, 0x00, + 0x78, 0x00, 0x15, 0x9b, 0x18, 0x16, 0x59, 0x84, 0x08, 0x53, 0x93, 0xef, 0x24, 0x60, 0x61, 0x9f, + 0xdf, 0xef, 0x96, 0x5f, 0xfc, 0x7d, 0x4f, 0xd1, 0x43, 0x75, 0xeb, 0x63, 0xb8, 0x9d, 0x71, 0x00, + 0xbc, 0xc3, 0xec, 0x9c, 0x89, 0xed, 0x73, 0xbb, 0x0d, 0x3d, 0x5c, 0xb5, 0x7e, 0x03, 0xd8, 0xd2, + 0x89, 0x37, 0xa7, 0xae, 0x47, 0xb0, 0x0b, 0x35, 0x72, 0x6e, 0x92, 0x00, 0x4a, 0x25, 0xe1, 0x47, + 0x1d, 0xa8, 0x8f, 0x22, 0x25, 0xfb, 0xa2, 0xe2, 0x30, 0xdc, 0x0f, 0xc1, 0x2b, 0x66, 0x68, 0x18, + 0x9e, 0x24, 0xef, 0x41, 0x44, 0xde, 0x0d, 0xe1, 0x47, 0x14, 0x44, 0xad, 0xa0, 0x77, 0x3f, 0x44, + 0x6f, 0x59, 0xf2, 0xb0, 0x14, 0x7b, 0x7b, 0x29, 0xf6, 0x6e, 0x4a, 0xd2, 0x14, 0xc0, 0xb7, 0x97, + 0x82, 0x6f, 0x45, 0x62, 0x22, 0xa0, 0xef, 0x41, 0x44, 0xdf, 0xaa, 0x24, 0xed, 0x15, 0xfc, 0x1e, + 0xa7, 0xf1, 0x1b, 0xa0, 0xf3, 0x81, 0x30, 0x5a, 0xc8, 0xdf, 0x2f, 0x12, 0xfc, 0xad, 0x09, 0xe1, + 0x17, 0x98, 0x64, 0x00, 0xb8, 0x97, 0x02, 0x30, 0x48, 0xde, 0x81, 0x80, 0xc0, 0x5f, 0x25, 0x09, + 0xbc, 0x2d, 0x84, 0x78, 0x58, 0x34, 0x59, 0x08, 0xfe, 0x2c, 0x46, 0xf0, 0x8e, 0xb0, 0x87, 0x84, + 0x39, 0xac, 0x32, 0x78, 0xb0, 0xc6, 0xe0, 0x80, 0x99, 0xef, 0x0a, 0x2d, 0x24, 0x10, 0x1e, 0xac, + 0x41, 0xb8, 0x21, 0x31, 0x94, 0x50, 0xf8, 0xe7, 0x6c, 0x0a, 0x8b, 0x39, 0x19, 0x1e, 0xb3, 0x18, + 0x86, 0x87, 0x02, 0x0c, 0xdf, 0xe4, 0xf6, 0x1f, 0x0a, 0xed, 0x0b, 0x73, 0x58, 0x17, 0x73, 0xf8, + 0xe1, 0x1a, 0x36, 0x13, 0xd5, 0x9a, 0x07, 0xe2, 0x53, 0x11, 0x88, 0x1f, 0x08, 0x1c, 0x8b, 0x91, + 0xf8, 0x23, 0xb8, 0x93, 0x7d, 0x04, 0x44, 0x28, 0x9b, 0xd4, 0x22, 0x9c, 0x88, 0x75, 0x9d, 0x5f, + 0xb7, 0x1e, 0xc1, 0x6e, 0x96, 0x7d, 0x96, 0x76, 0xef, 0xcf, 0x6d, 0xb8, 0x71, 0xd8, 0xed, 0x9d, + 0xb0, 0xb7, 0xe6, 0x98, 0x46, 0xc8, 0x8f, 0x32, 0x23, 0x20, 0xe6, 0x4e, 0xa6, 0x5a, 0x3e, 0x3e, + 0xf1, 0x18, 0x36, 0x39, 0x10, 0x31, 0x7f, 0x54, 0xd5, 0x24, 0x3c, 0x65, 0x87, 0x61, 0x84, 0xc4, + 0xdc, 0xd9, 0x55, 0xcb, 0xc7, 0x2b, 0xea, 0x50, 0x8b, 0x59, 0x89, 0xf2, 0x59, 0x56, 0x2b, 0x80, + 0x5c, 0xe6, 0x19, 0x63, 0x03, 0xe5, 0xb3, 0x9d, 0x56, 0x80, 0x3e, 0x78, 0x0a, 0xd5, 0x90, 0x65, + 0x28, 0x9b, 0x36, 0x35, 0x29, 0x0e, 0xd9, 0x9f, 0x80, 0xc3, 0x19, 0xf3, 0x47, 0x67, 0x4d, 0xc2, + 0x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 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1018,7 +880,7 @@ type ABCIApplicationClient interface { Info(ctx context.Context, in *types.RequestInfo, opts ...grpc.CallOption) (*types.ResponseInfo, error) SetOption(ctx context.Context, in *types.RequestSetOption, opts ...grpc.CallOption) (*types.ResponseSetOption, error) DeliverTx(ctx context.Context, in *types.RequestDeliverTx, opts ...grpc.CallOption) (*types.ResponseDeliverTx, error) - CheckTx(ctx context.Context, in *types.RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) + CheckTx(ctx context.Context, in *types.RequestCheckTx, opts ...grpc.CallOption) (*types.ResponseCheckTx, error) Query(ctx context.Context, in *types.RequestQuery, opts ...grpc.CallOption) (*types.ResponseQuery, error) Commit(ctx context.Context, in *types.RequestCommit, opts ...grpc.CallOption) (*types.ResponseCommit, error) InitChain(ctx context.Context, in *types.RequestInitChain, opts ...grpc.CallOption) (*types.ResponseInitChain, error) @@ -1085,8 +947,8 @@ func (c *aBCIApplicationClient) DeliverTx(ctx context.Context, in *types.Request return out, nil } -func (c *aBCIApplicationClient) CheckTx(ctx context.Context, in *types.RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) { - out := new(ResponseCheckTx) +func (c *aBCIApplicationClient) CheckTx(ctx context.Context, in *types.RequestCheckTx, opts ...grpc.CallOption) (*types.ResponseCheckTx, error) { + out := new(types.ResponseCheckTx) err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/CheckTx", in, out, opts...) if err != nil { return nil, err @@ -1200,7 +1062,7 @@ type ABCIApplicationServer interface { Info(context.Context, *types.RequestInfo) (*types.ResponseInfo, error) SetOption(context.Context, *types.RequestSetOption) (*types.ResponseSetOption, error) DeliverTx(context.Context, *types.RequestDeliverTx) (*types.ResponseDeliverTx, error) - CheckTx(context.Context, *types.RequestCheckTx) (*ResponseCheckTx, error) + CheckTx(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error) Query(context.Context, *types.RequestQuery) (*types.ResponseQuery, error) Commit(context.Context, *types.RequestCommit) (*types.ResponseCommit, error) InitChain(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error) @@ -1233,7 +1095,7 @@ func (*UnimplementedABCIApplicationServer) SetOption(ctx context.Context, req *t func (*UnimplementedABCIApplicationServer) DeliverTx(ctx context.Context, req *types.RequestDeliverTx) (*types.ResponseDeliverTx, error) { return nil, status.Errorf(codes.Unimplemented, "method DeliverTx not implemented") } -func (*UnimplementedABCIApplicationServer) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*ResponseCheckTx, error) { +func (*UnimplementedABCIApplicationServer) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*types.ResponseCheckTx, error) { return nil, status.Errorf(codes.Unimplemented, "method CheckTx not implemented") } func (*UnimplementedABCIApplicationServer) Query(ctx context.Context, req *types.RequestQuery) (*types.ResponseQuery, error) { @@ -2527,105 +2389,6 @@ func (m *Response_EndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { } return len(dAtA) - i, nil } -func (m *ResponseCheckTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseCheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseCheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MempoolError) > 0 { - i -= len(m.MempoolError) - copy(dAtA[i:], m.MempoolError) - i = encodeVarintTypes(dAtA, i, uint64(len(m.MempoolError))) - i-- - dAtA[i] = 0x5a - } - if m.Priority != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Priority)) - i-- - dAtA[i] = 0x50 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0x4a - } - if len(m.Codespace) > 0 { - i -= len(m.Codespace) - copy(dAtA[i:], m.Codespace) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Codespace))) - i-- - dAtA[i] = 0x42 - } - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.GasUsed != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.GasUsed)) - i-- - dAtA[i] = 0x30 - } - if m.GasWanted != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.GasWanted)) - i-- - dAtA[i] = 0x28 - } - if len(m.Info) > 0 { - i -= len(m.Info) - copy(dAtA[i:], m.Info) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Info))) - i-- - dAtA[i] = 0x22 - } - if len(m.Log) > 0 { - i -= len(m.Log) - copy(dAtA[i:], m.Log) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Log))) - i-- - dAtA[i] = 0x1a - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if m.Code != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *ResponseBeginRecheckTx) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3160,57 +2923,6 @@ func (m *Response_EndRecheckTx) Size() (n int) { } return n } -func (m *ResponseCheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovTypes(uint64(m.Code)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Log) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Info) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.GasWanted != 0 { - n += 1 + sovTypes(uint64(m.GasWanted)) - } - if m.GasUsed != 0 { - n += 1 + sovTypes(uint64(m.GasUsed)) - } - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - l = len(m.Codespace) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Priority != 0 { - n += 1 + sovTypes(uint64(m.Priority)) - } - l = len(m.MempoolError) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - func (m *ResponseBeginRecheckTx) Size() (n int) { if m == nil { return 0 @@ -4376,7 +4088,7 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ResponseCheckTx{} + v := &types.ResponseCheckTx{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4718,360 +4430,6 @@ func (m *Response) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseCheckTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseCheckTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Log = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Info = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasWanted", wireType) - } - m.GasWanted = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GasWanted |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) - } - m.GasUsed = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GasUsed |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, types.Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Codespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Codespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) - } - m.Priority = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Priority |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MempoolError", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MempoolError = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *ResponseBeginRecheckTx) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/blockchain/v0/reactor_test.go b/blockchain/v0/reactor_test.go index 99ae4cb0c..ec43b8849 100644 --- a/blockchain/v0/reactor_test.go +++ b/blockchain/v0/reactor_test.go @@ -360,12 +360,12 @@ func (app *testApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx return abci.ResponseDeliverTx{Events: []abci.Event{}} } -func (app *testApp) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { - return ocabci.ResponseCheckTx{} +func (app *testApp) CheckTxSync(req abci.RequestCheckTx) abci.ResponseCheckTx { + return abci.ResponseCheckTx{} } func (app *testApp) CheckTxAsync(req abci.RequestCheckTx, callback ocabci.CheckTxCallback) { - callback(ocabci.ResponseCheckTx{}) + callback(abci.ResponseCheckTx{}) } func (app *testApp) Commit() abci.ResponseCommit { diff --git a/consensus/mempool_test.go b/consensus/mempool_test.go index 589f0ee07..023e1dec0 100644 --- a/consensus/mempool_test.go +++ b/consensus/mempool_test.go @@ -252,7 +252,7 @@ func (app *CounterApplication) DeliverTx(req abci.RequestDeliverTx) abci.Respons return abci.ResponseDeliverTx{Code: code.CodeTypeOK} } -func (app *CounterApplication) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *CounterApplication) CheckTxSync(req abci.RequestCheckTx) abci.ResponseCheckTx { return app.checkTx(req) } @@ -260,17 +260,17 @@ func (app *CounterApplication) CheckTxAsync(req abci.RequestCheckTx, callback oc callback(app.checkTx(req)) } -func (app *CounterApplication) checkTx(req abci.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *CounterApplication) checkTx(req abci.RequestCheckTx) abci.ResponseCheckTx { txValue := txAsUint64(req.Tx) app.mempoolTxCountMtx.Lock() defer app.mempoolTxCountMtx.Unlock() if txValue != uint64(app.mempoolTxCount) { - return ocabci.ResponseCheckTx{ + return abci.ResponseCheckTx{ Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.mempoolTxCount, txValue)} } app.mempoolTxCount++ - return ocabci.ResponseCheckTx{Code: code.CodeTypeOK} + return abci.ResponseCheckTx{Code: code.CodeTypeOK} } func (app *CounterApplication) BeginRecheckTx(ocabci.RequestBeginRecheckTx) ocabci.ResponseBeginRecheckTx { diff --git a/consensus/replay_test.go b/consensus/replay_test.go index 32a977e1c..249691d4d 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -640,7 +640,7 @@ func TestMockProxyApp(t *testing.T) { // TODO: make use of this info // Blocks may include invalid txs. txRes := r.DeliverTx - if txRes.Code == ocabci.CodeTypeOK { + if txRes.Code == abci.CodeTypeOK { validTxs++ } else { logger.Debug("Invalid tx", "code", txRes.Code, "log", txRes.Log) diff --git a/consensus/state_test.go b/consensus/state_test.go index 56fb05913..021d17ee0 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -2100,8 +2100,8 @@ func TestPruneBlocks(t *testing.T) { mockApp := &mocks.Application{} mockApp.On("BeginBlock", mock.Anything).Return(abci.ResponseBeginBlock{}) mockApp.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{}) - mockApp.On("BeginRecheckTx", mock.Anything).Return(ocabci.ResponseBeginRecheckTx{Code: ocabci.CodeTypeOK}) - mockApp.On("EndRecheckTx", mock.Anything).Return(ocabci.ResponseEndRecheckTx{Code: ocabci.CodeTypeOK}) + mockApp.On("BeginRecheckTx", mock.Anything).Return(ocabci.ResponseBeginRecheckTx{Code: abci.CodeTypeOK}) + mockApp.On("EndRecheckTx", mock.Anything).Return(ocabci.ResponseEndRecheckTx{Code: abci.CodeTypeOK}) // Mocking behaviour to response `RetainHeight` for pruneBlocks mockApp.On("Commit", mock.Anything, mock.Anything).Return(abci.ResponseCommit{RetainHeight: 1}) diff --git a/mempool/mempool.go b/mempool/mempool.go index 818039a93..cc4ae4bf1 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -111,7 +111,7 @@ type PreCheckFunc func(types.Tx) error // PostCheckFunc is an optional filter executed after CheckTx and rejects // transaction if false is returned. An example would be to ensure a // transaction doesn't require more gas than available for the block. -type PostCheckFunc func(types.Tx, *ocabci.ResponseCheckTx) error +type PostCheckFunc func(types.Tx, *abci.ResponseCheckTx) error // PreCheckMaxBytes checks that the size of the transaction is smaller or equal // to the expected maxBytes. @@ -130,7 +130,7 @@ func PreCheckMaxBytes(maxBytes int64) PreCheckFunc { // PostCheckMaxGas checks that the wanted gas is smaller or equal to the passed // maxGas. Returns nil if maxGas is -1. func PostCheckMaxGas(maxGas int64) PostCheckFunc { - return func(tx types.Tx, res *ocabci.ResponseCheckTx) error { + return func(tx types.Tx, res *abci.ResponseCheckTx) error { if maxGas == -1 { return nil } diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index b42cae5f4..0406164da 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - abci "github.com/Finschia/ostracon/abci/types" + abci "github.com/tendermint/tendermint/abci/types" ) func TestPostCheckMaxGas(t *testing.T) { diff --git a/mempool/v0/cache_test.go b/mempool/v0/cache_test.go index aa58b2da2..ef87b8fe9 100644 --- a/mempool/v0/cache_test.go +++ b/mempool/v0/cache_test.go @@ -6,8 +6,9 @@ import ( "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/Finschia/ostracon/abci/example/kvstore" - abci "github.com/Finschia/ostracon/abci/types" "github.com/Finschia/ostracon/mempool" "github.com/Finschia/ostracon/proxy" "github.com/Finschia/ostracon/types" diff --git a/mempool/v0/clist_mempool.go b/mempool/v0/clist_mempool.go index 76a38e6a4..ca5d40acc 100644 --- a/mempool/v0/clist_mempool.go +++ b/mempool/v0/clist_mempool.go @@ -224,7 +224,7 @@ func (mem *CListMempool) CheckTxSync( } // CONTRACT: `app.CheckTxSync()` should check whether `GasWanted` is valid (0 <= GasWanted <= block.masGas) - var r *ocabci.ResponseCheckTx + var r *abci.ResponseCheckTx r, err := mem.proxyAppConn.CheckTxSync(abci.RequestCheckTx{Tx: tx}) if err != nil { return err @@ -496,7 +496,7 @@ func (mem *CListMempool) resCbFirstTime( ) { switch r := res.Value.(type) { case *ocabci.Response_CheckTx: - if r.CheckTx.Code == ocabci.CodeTypeOK { + if r.CheckTx.Code == abci.CodeTypeOK { memTx := &mempoolTx{ height: mem.height, gasWanted: r.CheckTx.GasWanted, @@ -550,7 +550,7 @@ func (mem *CListMempool) resCbRecheck(req *ocabci.Request, res *ocabci.Response) } var postCheckErr error - if r.CheckTx.Code == ocabci.CodeTypeOK { + if r.CheckTx.Code == abci.CodeTypeOK { if mem.postCheck == nil { return } @@ -719,7 +719,7 @@ func (mem *CListMempool) Update( } for i, tx := range block.Txs { - if deliverTxResponses[i].Code == ocabci.CodeTypeOK { + if deliverTxResponses[i].Code == abci.CodeTypeOK { // Add valid committed tx to the cache (if missing). _ = mem.cache.Push(tx) } else if !mem.config.KeepInvalidTxsInCache { diff --git a/mempool/v0/clist_mempool_system_test.go b/mempool/v0/clist_mempool_system_test.go index cde9becb5..b76157b77 100644 --- a/mempool/v0/clist_mempool_system_test.go +++ b/mempool/v0/clist_mempool_system_test.go @@ -105,7 +105,7 @@ func createProposalBlockAndDeliverTxs( deliverTxResponses := make([]*abci.ResponseDeliverTx, len(block.Txs)) for i, tx := range block.Txs { deliverTxResponses[i] = &abci.ResponseDeliverTx{ - Code: ocabci.CodeTypeOK, + Code: abci.CodeTypeOK, Data: tx, } } @@ -146,7 +146,7 @@ func receiveTx(ctx context.Context, t *testing.T, }, func(res *ocabci.Response) { resCheckTx := res.GetCheckTx() - if resCheckTx.Code != ocabci.CodeTypeOK && len(resCheckTx.Log) != 0 { + if resCheckTx.Code != abci.CodeTypeOK && len(resCheckTx.Log) != 0 { atomic.AddInt64(&receiveTxCounter.abciFail, 1) } else { atomic.AddInt64(&receiveTxCounter.success, 1) diff --git a/mempool/v0/clist_mempool_test.go b/mempool/v0/clist_mempool_test.go index 137244adb..a789a1768 100644 --- a/mempool/v0/clist_mempool_test.go +++ b/mempool/v0/clist_mempool_test.go @@ -219,7 +219,7 @@ func TestMempoolUpdate(t *testing.T) { // 1. Adds valid txs to the cache { err := mp.Update(newTestBlock(1, []types.Tx{[]byte{0x01}}), - abciResponses(1, ocabci.CodeTypeOK), nil, nil) + abciResponses(1, abci.CodeTypeOK), nil, nil) require.NoError(t, err) err = mp.CheckTxSync([]byte{0x01}, nil, mempool.TxInfo{}) if assert.Error(t, err) { @@ -231,7 +231,7 @@ func TestMempoolUpdate(t *testing.T) { { err := mp.CheckTxSync([]byte{0x02}, nil, mempool.TxInfo{}) require.NoError(t, err) - err = mp.Update(newTestBlock(1, []types.Tx{[]byte{0x02}}), abciResponses(1, ocabci.CodeTypeOK), nil, nil) + err = mp.Update(newTestBlock(1, []types.Tx{[]byte{0x02}}), abciResponses(1, abci.CodeTypeOK), nil, nil) require.NoError(t, err) assert.Zero(t, mp.Size()) } @@ -323,7 +323,7 @@ func TestMempool_KeepInvalidTxsInCache(t *testing.T) { _ = app.DeliverTx(abci.RequestDeliverTx{Tx: a}) _ = app.DeliverTx(abci.RequestDeliverTx{Tx: b}) err = mp.Update(newTestBlock(1, []types.Tx{a, b}), - []*abci.ResponseDeliverTx{{Code: ocabci.CodeTypeOK}, {Code: 2}}, nil, nil) + []*abci.ResponseDeliverTx{{Code: abci.CodeTypeOK}, {Code: 2}}, nil, nil) require.NoError(t, err) // a must be added to the cache @@ -381,7 +381,7 @@ func TestTxsAvailable(t *testing.T) { // since there are still txs left committedTxs, txs := txs[:50], txs[50:] if err := mp.Update(newTestBlock(1, committedTxs), - abciResponses(len(committedTxs), ocabci.CodeTypeOK), nil, nil); err != nil { + abciResponses(len(committedTxs), abci.CodeTypeOK), nil, nil); err != nil { t.Error(err) } ensureFire(t, mp.TxsAvailable(), timeoutMS) @@ -394,7 +394,7 @@ func TestTxsAvailable(t *testing.T) { // now call update with all the txs. it should not fire as there are no txs left committedTxs = append(txs, moreTxs...) // nolint: gocritic if err := mp.Update(newTestBlock(2, committedTxs), - abciResponses(len(committedTxs), ocabci.CodeTypeOK), nil, nil); err != nil { + abciResponses(len(committedTxs), abci.CodeTypeOK), nil, nil); err != nil { t.Error(err) } ensureNoFire(t, mp.TxsAvailable(), timeoutMS) @@ -453,7 +453,7 @@ func TestSerialReap(t *testing.T) { txs = append(txs, txBytes) } if err := mp.Update(newTestBlock(0, txs), - abciResponses(len(txs), ocabci.CodeTypeOK), nil, nil); err != nil { + abciResponses(len(txs), abci.CodeTypeOK), nil, nil); err != nil { t.Error(err) } } @@ -582,7 +582,7 @@ func TestMempoolTxsBytes(t *testing.T) { // 3. zero again after tx is removed by Update err = mp.Update(newTestBlock(1, []types.Tx{[]byte{0x01}}), - abciResponses(1, ocabci.CodeTypeOK), nil, nil) + abciResponses(1, abci.CodeTypeOK), nil, nil) require.NoError(t, err) assert.EqualValues(t, 0, mp.SizeBytes()) @@ -639,7 +639,7 @@ func TestMempoolTxsBytes(t *testing.T) { require.NotEmpty(t, res2.Data) // Pretend like we committed nothing so txBytes gets rechecked and removed. - err = mp.Update(newTestBlock(1, []types.Tx{}), abciResponses(0, ocabci.CodeTypeOK), nil, nil) + err = mp.Update(newTestBlock(1, []types.Tx{}), abciResponses(0, abci.CodeTypeOK), nil, nil) require.NoError(t, err) assert.EqualValues(t, 8, mp.SizeBytes()) @@ -752,7 +752,7 @@ func TestTxMempoolPostCheckError(t *testing.T) { mp, cleanup := newMempoolWithApp(cc) defer cleanup() - mp.postCheck = func(_ types.Tx, _ *ocabci.ResponseCheckTx) error { + mp.postCheck = func(_ types.Tx, _ *abci.ResponseCheckTx) error { return testCase.err } diff --git a/proto/ostracon/abci/types.proto b/proto/ostracon/abci/types.proto index 2ecf1aa13..9f15b8ac4 100644 --- a/proto/ostracon/abci/types.proto +++ b/proto/ostracon/abci/types.proto @@ -59,7 +59,7 @@ message Response { tendermint.abci.ResponseInitChain init_chain = 6; tendermint.abci.ResponseQuery query = 7; tendermint.abci.ResponseBeginBlock begin_block = 8; - ResponseCheckTx check_tx = 9; + tendermint.abci.ResponseCheckTx check_tx = 9; tendermint.abci.ResponseDeliverTx deliver_tx = 10; tendermint.abci.ResponseEndBlock end_block = 11; tendermint.abci.ResponseCommit commit = 12; @@ -72,24 +72,6 @@ message Response { } } -message ResponseCheckTx { - uint32 code = 1; - bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic - int64 gas_wanted = 5 [json_name = "gas_wanted"]; - int64 gas_used = 6 [json_name = "gas_used"]; - repeated tendermint.abci.Event events = 7 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; - string codespace = 8; - string sender = 9; // MEMO: not used, just reservation to implement https://github.com/tendermint/tendermint/pull/6740 first - int64 priority = 10; // MEMO: not used, just reservation to implement https://github.com/tendermint/tendermint/pull/6740 first - - // mempool_error is set by Ostracon. - // ABCI applictions creating a ResponseCheckTX should not set mempool_error. - string mempool_error = 11; -} - message ResponseBeginRecheckTx { uint32 code = 1; } @@ -107,7 +89,7 @@ service ABCIApplication { rpc Info(tendermint.abci.RequestInfo) returns (tendermint.abci.ResponseInfo); rpc SetOption(tendermint.abci.RequestSetOption) returns (tendermint.abci.ResponseSetOption); rpc DeliverTx(tendermint.abci.RequestDeliverTx) returns (tendermint.abci.ResponseDeliverTx); - rpc CheckTx(tendermint.abci.RequestCheckTx) returns (ResponseCheckTx); + rpc CheckTx(tendermint.abci.RequestCheckTx) returns (tendermint.abci.ResponseCheckTx); rpc Query(tendermint.abci.RequestQuery) returns (tendermint.abci.ResponseQuery); rpc Commit(tendermint.abci.RequestCommit) returns (tendermint.abci.ResponseCommit); rpc InitChain(tendermint.abci.RequestInitChain) returns (tendermint.abci.ResponseInitChain); diff --git a/proto/ostracon/rpc/grpc/types.proto b/proto/ostracon/rpc/grpc/types.proto deleted file mode 100644 index 057f2fd03..000000000 --- a/proto/ostracon/rpc/grpc/types.proto +++ /dev/null @@ -1,33 +0,0 @@ -syntax = "proto3"; -package ostracon.rpc.grpc; -option go_package = "github.com/Finschia/ostracon/rpc/grpc;coregrpc"; - -import "ostracon/abci/types.proto"; -import "tendermint/abci/types.proto"; - -//---------------------------------------- -// Request types - -message RequestPing {} - -message RequestBroadcastTx { - bytes tx = 1; -} - -//---------------------------------------- -// Response types - -message ResponsePing {} - -message ResponseBroadcastTx { - ostracon.abci.ResponseCheckTx check_tx = 1; - tendermint.abci.ResponseDeliverTx deliver_tx = 2; -} - -//---------------------------------------- -// Service Definition - -service BroadcastAPI { - rpc Ping(RequestPing) returns (ResponsePing); - rpc BroadcastTx(RequestBroadcastTx) returns (ResponseBroadcastTx); -} diff --git a/proxy/app_conn.go b/proxy/app_conn.go index 21a6060b0..c82fa9cc0 100644 --- a/proxy/app_conn.go +++ b/proxy/app_conn.go @@ -30,7 +30,7 @@ type AppConnMempool interface { Error() error CheckTxAsync(types.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes - CheckTxSync(types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) + CheckTxSync(types.RequestCheckTx) (*types.ResponseCheckTx, error) BeginRecheckTxSync(ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) EndRecheckTxSync(ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) @@ -132,7 +132,7 @@ func (app *appConnMempool) CheckTxAsync(req types.RequestCheckTx, cb abcicli.Res return app.appConn.CheckTxAsync(req, cb) } -func (app *appConnMempool) CheckTxSync(req types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { +func (app *appConnMempool) CheckTxSync(req types.RequestCheckTx) (*types.ResponseCheckTx, error) { return app.appConn.CheckTxSync(req) } diff --git a/proxy/mocks/app_conn_mempool.go b/proxy/mocks/app_conn_mempool.go index 0e3d3958e..ca11cef59 100644 --- a/proxy/mocks/app_conn_mempool.go +++ b/proxy/mocks/app_conn_mempool.go @@ -59,19 +59,19 @@ func (_m *AppConnMempool) CheckTxAsync(_a0 abcitypes.RequestCheckTx, _a1 abcicli } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *AppConnMempool) CheckTxSync(_a0 abcitypes.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (_m *AppConnMempool) CheckTxSync(_a0 abcitypes.RequestCheckTx) (*abcitypes.ResponseCheckTx, error) { ret := _m.Called(_a0) - var r0 *types.ResponseCheckTx + var r0 *abcitypes.ResponseCheckTx var r1 error - if rf, ok := ret.Get(0).(func(abcitypes.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { + if rf, ok := ret.Get(0).(func(abcitypes.RequestCheckTx) (*abcitypes.ResponseCheckTx, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(abcitypes.RequestCheckTx) *types.ResponseCheckTx); ok { + if rf, ok := ret.Get(0).(func(abcitypes.RequestCheckTx) *abcitypes.ResponseCheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseCheckTx) + r0 = ret.Get(0).(*abcitypes.ResponseCheckTx) } } diff --git a/rpc/client/event_test.go b/rpc/client/event_test.go index 3df9ad8ca..e9c94a742 100644 --- a/rpc/client/event_test.go +++ b/rpc/client/event_test.go @@ -10,7 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - abci "github.com/Finschia/ostracon/abci/types" + abci "github.com/tendermint/tendermint/abci/types" + tmrand "github.com/Finschia/ostracon/libs/rand" "github.com/Finschia/ostracon/rpc/client" ctypes "github.com/Finschia/ostracon/rpc/core/types" diff --git a/rpc/client/mock/abci.go b/rpc/client/mock/abci.go index ad0eb48a3..d9f3cf424 100644 --- a/rpc/client/mock/abci.go +++ b/rpc/client/mock/abci.go @@ -63,8 +63,8 @@ func (a ABCIApp) BroadcastTxCommit(ctx context.Context, tx types.Tx) (*ctypes.Re } func (a ABCIApp) BroadcastTxAsync(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error) { - chRes := make(chan ocabci.ResponseCheckTx, 1) - a.App.CheckTxAsync(abci.RequestCheckTx{Tx: tx}, func(res ocabci.ResponseCheckTx) { + chRes := make(chan abci.ResponseCheckTx, 1) + a.App.CheckTxAsync(abci.RequestCheckTx{Tx: tx}, func(res abci.ResponseCheckTx) { chRes <- res }) c := <-chRes diff --git a/rpc/client/mock/abci_test.go b/rpc/client/mock/abci_test.go index 266e8486c..6ac6fef20 100644 --- a/rpc/client/mock/abci_test.go +++ b/rpc/client/mock/abci_test.go @@ -12,7 +12,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" "github.com/Finschia/ostracon/abci/example/kvstore" - ocabci "github.com/Finschia/ostracon/abci/types" "github.com/Finschia/ostracon/libs/bytes" "github.com/Finschia/ostracon/rpc/client" "github.com/Finschia/ostracon/rpc/client/mock" @@ -39,7 +38,7 @@ func TestABCIMock(t *testing.T) { BroadcastCommit: mock.Call{ Args: goodTx, Response: &ctypes.ResultBroadcastTxCommit{ - CheckTx: ocabci.ResponseCheckTx{Data: bytes.HexBytes("stand")}, + CheckTx: abci.ResponseCheckTx{Data: bytes.HexBytes("stand")}, DeliverTx: abci.ResponseDeliverTx{Data: bytes.HexBytes("deliver")}, }, Error: errors.New("bad tx"), diff --git a/rpc/client/rpc_test.go b/rpc/client/rpc_test.go index 91c701d0e..5f1c2d5fc 100644 --- a/rpc/client/rpc_test.go +++ b/rpc/client/rpc_test.go @@ -14,7 +14,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - abci "github.com/Finschia/ostracon/abci/types" + abci "github.com/tendermint/tendermint/abci/types" + + ocabci "github.com/Finschia/ostracon/abci/types" tmjson "github.com/Finschia/ostracon/libs/json" "github.com/Finschia/ostracon/libs/log" tmmath "github.com/Finschia/ostracon/libs/math" @@ -368,11 +370,11 @@ func TestBroadcastTxCommit(t *testing.T) { func TestUnconfirmedTxs(t *testing.T) { _, _, tx := MakeTxKV() - ch := make(chan *abci.Response, 1) + ch := make(chan *ocabci.Response, 1) mempool := node.Mempool() mempool.CheckTxAsync(tx, mempl.TxInfo{}, func(err error) { require.NoError(t, err) - }, func(resp *abci.Response) { + }, func(resp *ocabci.Response) { ch <- resp }) @@ -401,11 +403,11 @@ func TestUnconfirmedTxs(t *testing.T) { func TestNumUnconfirmedTxs(t *testing.T) { _, _, tx := MakeTxKV() - ch := make(chan *abci.Response, 1) + ch := make(chan *ocabci.Response, 1) mempool := node.Mempool() mempool.CheckTxAsync(tx, mempl.TxInfo{}, func(err error) { require.NoError(t, err) - }, func(resp *abci.Response) { + }, func(resp *ocabci.Response) { ch <- resp }) diff --git a/rpc/core/mempool_test.go b/rpc/core/mempool_test.go index fd7a9bf4e..ac4f7fdee 100644 --- a/rpc/core/mempool_test.go +++ b/rpc/core/mempool_test.go @@ -4,8 +4,12 @@ import ( "context" "errors" "fmt" + "net/http" + "sync" + "testing" + "time" + ocabcicli "github.com/Finschia/ostracon/abci/client" - ocabci "github.com/Finschia/ostracon/abci/types" "github.com/Finschia/ostracon/config" "github.com/Finschia/ostracon/libs/log" "github.com/Finschia/ostracon/mempool" @@ -17,10 +21,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" abci "github.com/tendermint/tendermint/abci/types" - "net/http" - "sync" - "testing" - "time" ) type ErrorAssertionFunc func(t assert.TestingT, theError error, contains string, msgAndArgs ...interface{}) bool @@ -104,7 +104,7 @@ func TestBroadcastTxSync(t *testing.T) { tx: tx, }, want: &ctypes.ResultBroadcastTx{ - Code: ocabci.CodeTypeOK, + Code: abci.CodeTypeOK, Data: nil, Log: "", Codespace: "", @@ -128,7 +128,7 @@ func TestBroadcastTxSync(t *testing.T) { env = &Environment{} mockAppConnMempool := &mocks.AppConnMempool{} mockAppConnMempool.On("SetGlobalCallback", mock.Anything) - mockAppConnMempool.On("CheckTxSync", mock.Anything).Return(&ocabci.ResponseCheckTx{}, nil) + mockAppConnMempool.On("CheckTxSync", mock.Anything).Return(&abci.ResponseCheckTx{}, nil) env.Mempool = memv0.NewCListMempool(config.TestConfig().Mempool, mockAppConnMempool, 0) for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -177,7 +177,7 @@ func TestBroadcastTxSyncWithCancelContextForCheckTxSync(t *testing.T) { mockAppConnMempool := &mocks.AppConnMempool{} mockAppConnMempool.On("SetGlobalCallback", mock.Anything) mockAppConnMempool.On("CheckTxSync", mock.Anything).Return( - &ocabci.ResponseCheckTx{Code: abci.CodeTypeOK}, nil).WaitUntil( + &abci.ResponseCheckTx{Code: abci.CodeTypeOK}, nil).WaitUntil( time.After(1000 * time.Millisecond)) // Wait calling the context cancel mockAppConnMempool.On("Error").Return(nil) // Not to use tt.err env.Mempool = memv0.NewCListMempool(config.TestConfig().Mempool, mockAppConnMempool, 0) @@ -222,7 +222,7 @@ func TestBroadcastTxCommit(t *testing.T) { tx: tx, }, want: &ctypes.ResultBroadcastTxCommit{ - CheckTx: ocabci.ResponseCheckTx{ + CheckTx: abci.ResponseCheckTx{ Code: abci.CodeTypeOK, }, DeliverTx: abci.ResponseDeliverTx{ @@ -241,7 +241,7 @@ func TestBroadcastTxCommit(t *testing.T) { tx: tx1, }, want: &ctypes.ResultBroadcastTxCommit{ - CheckTx: ocabci.ResponseCheckTx{ + CheckTx: abci.ResponseCheckTx{ Code: abci.CodeTypeOK + 1, // Not OK }, DeliverTx: abci.ResponseDeliverTx{}, // return empty response @@ -304,7 +304,7 @@ func TestBroadcastTxCommitWithCancelContextForCheckTxSync(t *testing.T) { errRpcContext := rpctypes.Context{HTTPReq: req} height := int64(1) tx := types.Tx{} - resCheckTx := ocabci.ResponseCheckTx{ + resCheckTx := abci.ResponseCheckTx{ Code: abci.CodeTypeOK, } resDeliverTx := abci.ResponseDeliverTx{ @@ -396,7 +396,7 @@ func TestBroadcastTxCommitTimeout(t *testing.T) { tx: tx, }, want: &ctypes.ResultBroadcastTxCommit{ - CheckTx: ocabci.ResponseCheckTx{ + CheckTx: abci.ResponseCheckTx{ Code: abci.CodeTypeOK, }, DeliverTx: abci.ResponseDeliverTx{}, // return empty response diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index c5aee5490..9e1682cd9 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -7,7 +7,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - ocabci "github.com/Finschia/ostracon/abci/types" "github.com/Finschia/ostracon/crypto" "github.com/Finschia/ostracon/libs/bytes" "github.com/Finschia/ostracon/p2p" @@ -181,15 +180,15 @@ type ResultBroadcastTx struct { // CheckTx and DeliverTx results type ResultBroadcastTxCommit struct { - CheckTx ocabci.ResponseCheckTx `json:"check_tx"` + CheckTx abci.ResponseCheckTx `json:"check_tx"` DeliverTx abci.ResponseDeliverTx `json:"deliver_tx"` Hash bytes.HexBytes `json:"hash"` Height int64 `json:"height"` } -// ResultCheckTx wraps ocabci.ResponseCheckTx. +// ResultCheckTx wraps types.ResponseCheckTx. type ResultCheckTx struct { - ocabci.ResponseCheckTx + abci.ResponseCheckTx } // Result of querying for a tx diff --git a/rpc/grpc/api.go b/rpc/grpc/api.go index 8f2dd2b4f..99f3677c6 100644 --- a/rpc/grpc/api.go +++ b/rpc/grpc/api.go @@ -4,8 +4,8 @@ import ( "context" abci "github.com/tendermint/tendermint/abci/types" + core_grpc "github.com/tendermint/tendermint/rpc/grpc" - ocabci "github.com/Finschia/ostracon/abci/types" core "github.com/Finschia/ostracon/rpc/core" rpctypes "github.com/Finschia/ostracon/rpc/jsonrpc/types" ) @@ -13,12 +13,12 @@ import ( type broadcastAPI struct { } -func (bapi *broadcastAPI) Ping(ctx context.Context, req *RequestPing) (*ResponsePing, error) { +func (bapi *broadcastAPI) Ping(ctx context.Context, req *core_grpc.RequestPing) (*core_grpc.ResponsePing, error) { // kvstore so we can check if the server is up - return &ResponsePing{}, nil + return &core_grpc.ResponsePing{}, nil } -func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcastTx) (*ResponseBroadcastTx, error) { +func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *core_grpc.RequestBroadcastTx) (*core_grpc.ResponseBroadcastTx, error) { // NOTE: there's no way to get client's remote address // see https://stackoverflow.com/questions/33684570/session-and-remote-ip-address-in-grpc-go res, err := core.BroadcastTxCommit(&rpctypes.Context{}, req.Tx) @@ -26,8 +26,8 @@ func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcast return nil, err } - return &ResponseBroadcastTx{ - CheckTx: &ocabci.ResponseCheckTx{ + return &core_grpc.ResponseBroadcastTx{ + CheckTx: &abci.ResponseCheckTx{ Code: res.CheckTx.Code, Data: res.CheckTx.Data, Log: res.CheckTx.Log, diff --git a/rpc/grpc/client_server.go b/rpc/grpc/client_server.go index cc7f947d7..df4f90a2c 100644 --- a/rpc/grpc/client_server.go +++ b/rpc/grpc/client_server.go @@ -6,6 +6,8 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" + core_grpc "github.com/tendermint/tendermint/rpc/grpc" + tmnet "github.com/Finschia/ostracon/libs/net" ) @@ -19,19 +21,19 @@ type Config struct { // NOTE: This function blocks - you may want to call it in a go-routine. func StartGRPCServer(ln net.Listener) error { grpcServer := grpc.NewServer() - RegisterBroadcastAPIServer(grpcServer, &broadcastAPI{}) + core_grpc.RegisterBroadcastAPIServer(grpcServer, &broadcastAPI{}) return grpcServer.Serve(ln) } // StartGRPCClient dials the gRPC server using protoAddr and returns a new // BroadcastAPIClient. -func StartGRPCClient(protoAddr string) BroadcastAPIClient { +func StartGRPCClient(protoAddr string) core_grpc.BroadcastAPIClient { //nolint:staticcheck // SA1019 Existing use of deprecated but supported dial option. conn, err := grpc.Dial(protoAddr, grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc)) if err != nil { panic(err) } - return NewBroadcastAPIClient(conn) + return core_grpc.NewBroadcastAPIClient(conn) } func dialerFunc(ctx context.Context, addr string) (net.Conn, error) { diff --git a/rpc/grpc/grpc_test.go b/rpc/grpc/grpc_test.go index ff5f48a1c..b7971fea7 100644 --- a/rpc/grpc/grpc_test.go +++ b/rpc/grpc/grpc_test.go @@ -7,8 +7,9 @@ import ( "github.com/stretchr/testify/require" + core_grpc "github.com/tendermint/tendermint/rpc/grpc" + "github.com/Finschia/ostracon/abci/example/kvstore" - core_grpc "github.com/Finschia/ostracon/rpc/grpc" rpctest "github.com/Finschia/ostracon/rpc/test" ) diff --git a/rpc/grpc/types.pb.go b/rpc/grpc/types.pb.go deleted file mode 100644 index 9c0b7eb82..000000000 --- a/rpc/grpc/types.pb.go +++ /dev/null @@ -1,926 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/rpc/grpc/types.proto - -package coregrpc - -import ( - context "context" - fmt "fmt" - types "github.com/Finschia/ostracon/abci/types" - proto "github.com/gogo/protobuf/proto" - types1 "github.com/tendermint/tendermint/abci/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type RequestPing struct { -} - -func (m *RequestPing) Reset() { *m = RequestPing{} } -func (m *RequestPing) String() string { return proto.CompactTextString(m) } -func (*RequestPing) ProtoMessage() {} -func (*RequestPing) Descriptor() ([]byte, []int) { - return fileDescriptor_907c7db099111068, []int{0} -} -func (m *RequestPing) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestPing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestPing.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RequestPing) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestPing.Merge(m, src) -} -func (m *RequestPing) XXX_Size() int { - return m.Size() -} -func (m *RequestPing) XXX_DiscardUnknown() { - xxx_messageInfo_RequestPing.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestPing proto.InternalMessageInfo - -type RequestBroadcastTx struct { - Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` -} - -func (m *RequestBroadcastTx) Reset() { *m = RequestBroadcastTx{} } -func (m *RequestBroadcastTx) String() string { return proto.CompactTextString(m) } -func (*RequestBroadcastTx) ProtoMessage() {} -func (*RequestBroadcastTx) Descriptor() ([]byte, []int) { - return fileDescriptor_907c7db099111068, []int{1} -} -func (m *RequestBroadcastTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestBroadcastTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestBroadcastTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RequestBroadcastTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestBroadcastTx.Merge(m, src) -} -func (m *RequestBroadcastTx) XXX_Size() int { - return m.Size() -} -func (m *RequestBroadcastTx) XXX_DiscardUnknown() { - xxx_messageInfo_RequestBroadcastTx.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestBroadcastTx proto.InternalMessageInfo - -func (m *RequestBroadcastTx) GetTx() []byte { - if m != nil { - return m.Tx - } - return nil -} - -type ResponsePing struct { -} - -func (m *ResponsePing) Reset() { *m = ResponsePing{} } -func (m *ResponsePing) String() string { return proto.CompactTextString(m) } -func (*ResponsePing) ProtoMessage() {} -func (*ResponsePing) Descriptor() ([]byte, []int) { - return fileDescriptor_907c7db099111068, []int{2} -} -func (m *ResponsePing) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponsePing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponsePing.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResponsePing) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponsePing.Merge(m, src) -} -func (m *ResponsePing) XXX_Size() int { - return m.Size() -} -func (m *ResponsePing) XXX_DiscardUnknown() { - xxx_messageInfo_ResponsePing.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponsePing proto.InternalMessageInfo - -type ResponseBroadcastTx struct { - CheckTx *types.ResponseCheckTx `protobuf:"bytes,1,opt,name=check_tx,json=checkTx,proto3" json:"check_tx,omitempty"` - DeliverTx *types1.ResponseDeliverTx `protobuf:"bytes,2,opt,name=deliver_tx,json=deliverTx,proto3" json:"deliver_tx,omitempty"` -} - -func (m *ResponseBroadcastTx) Reset() { *m = ResponseBroadcastTx{} } -func (m *ResponseBroadcastTx) String() string { return proto.CompactTextString(m) } -func (*ResponseBroadcastTx) ProtoMessage() {} -func (*ResponseBroadcastTx) Descriptor() ([]byte, []int) { - return fileDescriptor_907c7db099111068, []int{3} -} -func (m *ResponseBroadcastTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseBroadcastTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseBroadcastTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResponseBroadcastTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseBroadcastTx.Merge(m, src) -} -func (m *ResponseBroadcastTx) XXX_Size() int { - return m.Size() -} -func (m *ResponseBroadcastTx) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseBroadcastTx.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseBroadcastTx proto.InternalMessageInfo - -func (m *ResponseBroadcastTx) GetCheckTx() *types.ResponseCheckTx { - if m != nil { - return m.CheckTx - } - return nil -} - -func (m *ResponseBroadcastTx) GetDeliverTx() *types1.ResponseDeliverTx { - if m != nil { - return m.DeliverTx - } - return nil -} - -func init() { - proto.RegisterType((*RequestPing)(nil), "ostracon.rpc.grpc.RequestPing") - proto.RegisterType((*RequestBroadcastTx)(nil), "ostracon.rpc.grpc.RequestBroadcastTx") - proto.RegisterType((*ResponsePing)(nil), "ostracon.rpc.grpc.ResponsePing") - proto.RegisterType((*ResponseBroadcastTx)(nil), "ostracon.rpc.grpc.ResponseBroadcastTx") -} - -func init() { proto.RegisterFile("ostracon/rpc/grpc/types.proto", fileDescriptor_907c7db099111068) } - -var fileDescriptor_907c7db099111068 = []byte{ - // 335 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcd, 0x4a, 0x03, 0x31, - 0x14, 0x85, 0x9b, 0x22, 0xfe, 0xdc, 0xd6, 0x82, 0x71, 0xa3, 0x23, 0x46, 0x19, 0x54, 0x5c, 0x65, - 0xa0, 0xae, 0xc4, 0x55, 0xab, 0xf8, 0xb3, 0x2b, 0x43, 0x57, 0x22, 0xc8, 0x34, 0x13, 0xda, 0xa0, - 0x9d, 0x8c, 0x49, 0x2a, 0xe3, 0x5b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4, 0x6e, 0xf0, 0x15, 0x2c, - 0xd9, 0xb8, 0xd8, 0x09, 0x91, 0xef, 0x8f, 0x3a, 0x4b, 0xf0, 0xf6, 0x7e, 0xd5, 0xe7, 0xf3, 0xe2, - 0x3b, 0xa8, 0xb8, 0x63, 0x1e, 0xfe, 0xdd, 0xcf, 0xb1, 0x79, 0x47, 0xff, 0xb4, 0x75, 0x7c, 0xcd, - 0xeb, 0x8f, 0x11, 0x41, 0xc3, 0x11, 0x41, 0x5f, 0x23, 0x82, 0x5e, 0xc7, 0xa4, 0x34, 0x1c, 0x93, - 0xd2, 0xe7, 0x98, 0x94, 0x6e, 0x69, 0x57, 0x98, 0xde, 0xa0, 0x43, 0x99, 0xec, 0x07, 0x97, 0x22, - 0xd1, 0xac, 0x27, 0xa2, 0x60, 0xe1, 0xa9, 0x9c, 0x31, 0xa9, 0xb8, 0x2d, 0x3a, 0xcb, 0x93, 0x3b, - 0x3e, 0xf9, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x26, 0x3a, 0x9b, 0x4f, 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// BroadcastAPIClient is the client API for BroadcastAPI service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type BroadcastAPIClient interface { - Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) - BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) -} - -type broadcastAPIClient struct { - cc *grpc.ClientConn -} - -func NewBroadcastAPIClient(cc *grpc.ClientConn) BroadcastAPIClient { - return &broadcastAPIClient{cc} -} - -func (c *broadcastAPIClient) Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) { - out := new(ResponsePing) - err := c.cc.Invoke(ctx, "/ostracon.rpc.grpc.BroadcastAPI/Ping", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *broadcastAPIClient) BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) { - out := new(ResponseBroadcastTx) - err := c.cc.Invoke(ctx, "/ostracon.rpc.grpc.BroadcastAPI/BroadcastTx", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// BroadcastAPIServer is the server API for BroadcastAPI service. -type BroadcastAPIServer interface { - Ping(context.Context, *RequestPing) (*ResponsePing, error) - BroadcastTx(context.Context, *RequestBroadcastTx) (*ResponseBroadcastTx, error) -} - -// UnimplementedBroadcastAPIServer can be embedded to have forward compatible implementations. -type UnimplementedBroadcastAPIServer struct { -} - -func (*UnimplementedBroadcastAPIServer) Ping(ctx context.Context, req *RequestPing) (*ResponsePing, error) { - return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") -} -func (*UnimplementedBroadcastAPIServer) BroadcastTx(ctx context.Context, req *RequestBroadcastTx) (*ResponseBroadcastTx, error) { - return nil, status.Errorf(codes.Unimplemented, "method BroadcastTx not implemented") -} - -func RegisterBroadcastAPIServer(s *grpc.Server, srv BroadcastAPIServer) { - s.RegisterService(&_BroadcastAPI_serviceDesc, srv) -} - -func _BroadcastAPI_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestPing) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BroadcastAPIServer).Ping(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.rpc.grpc.BroadcastAPI/Ping", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BroadcastAPIServer).Ping(ctx, req.(*RequestPing)) - } - return interceptor(ctx, in, info, handler) -} - -func _BroadcastAPI_BroadcastTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestBroadcastTx) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BroadcastAPIServer).BroadcastTx(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.rpc.grpc.BroadcastAPI/BroadcastTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BroadcastAPIServer).BroadcastTx(ctx, req.(*RequestBroadcastTx)) - } - return interceptor(ctx, in, info, handler) -} - -var _BroadcastAPI_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ostracon.rpc.grpc.BroadcastAPI", - HandlerType: (*BroadcastAPIServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Ping", - Handler: _BroadcastAPI_Ping_Handler, - }, - { - MethodName: "BroadcastTx", - Handler: _BroadcastAPI_BroadcastTx_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "ostracon/rpc/grpc/types.proto", -} - -func (m *RequestPing) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RequestPing) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestPing) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *RequestBroadcastTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RequestBroadcastTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestBroadcastTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tx) > 0 { - i -= len(m.Tx) - copy(dAtA[i:], m.Tx) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ResponsePing) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponsePing) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponsePing) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ResponseBroadcastTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseBroadcastTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseBroadcastTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DeliverTx != nil { - { - size, err := m.DeliverTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.CheckTx != nil { - { - size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *RequestPing) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *RequestBroadcastTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Tx) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ResponsePing) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ResponseBroadcastTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CheckTx != nil { - l = m.CheckTx.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.DeliverTx != nil { - l = m.DeliverTx.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *RequestPing) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestPing: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestPing: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestBroadcastTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestBroadcastTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestBroadcastTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tx = append(m.Tx[:0], dAtA[iNdEx:postIndex]...) - if m.Tx == nil { - m.Tx = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponsePing) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponsePing: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponsePing: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseBroadcastTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseBroadcastTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CheckTx == nil { - m.CheckTx = &types.ResponseCheckTx{} - } - if err := m.CheckTx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeliverTx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DeliverTx == nil { - m.DeliverTx = &types1.ResponseDeliverTx{} - } - if err := m.DeliverTx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index b5f303951..fa6e6cb2e 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -8,6 +8,8 @@ import ( "strings" "time" + core_grpc "github.com/tendermint/tendermint/rpc/grpc" + abci "github.com/Finschia/ostracon/abci/types" cfg "github.com/Finschia/ostracon/config" "github.com/Finschia/ostracon/libs/log" @@ -17,7 +19,7 @@ import ( "github.com/Finschia/ostracon/privval" "github.com/Finschia/ostracon/proxy" ctypes "github.com/Finschia/ostracon/rpc/core/types" - core_grpc "github.com/Finschia/ostracon/rpc/grpc" + occore_grpc "github.com/Finschia/ostracon/rpc/grpc" rpcclient "github.com/Finschia/ostracon/rpc/jsonrpc/client" ) @@ -111,7 +113,7 @@ func GetConfig(forceCreate ...bool) *cfg.Config { func GetGRPCClient() core_grpc.BroadcastAPIClient { grpcAddr := globalConfig.RPC.GRPCListenAddress - return core_grpc.StartGRPCClient(grpcAddr) + return occore_grpc.StartGRPCClient(grpcAddr) } // StartOstracon starts a test ostracon server in a go routine and returns when it is initialized diff --git a/state/execution.go b/state/execution.go index 26afc7687..32e171cf4 100644 --- a/state/execution.go +++ b/state/execution.go @@ -358,7 +358,7 @@ func execBlockOnProxyApp( // TODO: make use of this info // Blocks may include invalid txs. txRes := r.DeliverTx - if txRes.Code == ocabci.CodeTypeOK { + if txRes.Code == abci.CodeTypeOK { validTxs++ } else { logger.Debug("invalid tx", "code", txRes.Code, "log", txRes.Log) diff --git a/state/helpers_test.go b/state/helpers_test.go index 8a216b3fc..85ddf523f 100644 --- a/state/helpers_test.go +++ b/state/helpers_test.go @@ -284,12 +284,12 @@ func (app *testApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx return abci.ResponseDeliverTx{Events: []abci.Event{}} } -func (app *testApp) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { - return ocabci.ResponseCheckTx{} +func (app *testApp) CheckTxSync(req abci.RequestCheckTx) abci.ResponseCheckTx { + return abci.ResponseCheckTx{} } func (app *testApp) CheckTxAsync(req abci.RequestCheckTx, callback ocabci.CheckTxCallback) { - callback(ocabci.ResponseCheckTx{}) + callback(abci.ResponseCheckTx{}) } func (app *testApp) Commit() abci.ResponseCommit { diff --git a/state/indexer/sink/psql/psql_test.go b/state/indexer/sink/psql/psql_test.go index 9fe894d4c..eb6926da2 100644 --- a/state/indexer/sink/psql/psql_test.go +++ b/state/indexer/sink/psql/psql_test.go @@ -20,7 +20,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" - ocabci "github.com/Finschia/ostracon/abci/types" "github.com/Finschia/ostracon/state/txindex" "github.com/Finschia/ostracon/types" @@ -309,7 +308,7 @@ func txResultWithEvents(events []abci.Event) *abci.TxResult { Tx: types.Tx("HELLO WORLD"), Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: ocabci.CodeTypeOK, + Code: abci.CodeTypeOK, Log: "", Events: events, }, diff --git a/state/txindex/kv/kv_bench_test.go b/state/txindex/kv/kv_bench_test.go index d98406af7..9571b4fc8 100644 --- a/state/txindex/kv/kv_bench_test.go +++ b/state/txindex/kv/kv_bench_test.go @@ -10,7 +10,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" - ocabci "github.com/Finschia/ostracon/abci/types" "github.com/Finschia/ostracon/libs/pubsub/query" "github.com/Finschia/ostracon/types" ) @@ -50,7 +49,7 @@ func BenchmarkTxSearch(b *testing.B) { Tx: types.Tx(string(txBz)), Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: ocabci.CodeTypeOK, + Code: abci.CodeTypeOK, Log: "", Events: events, }, diff --git a/state/txindex/kv/kv_test.go b/state/txindex/kv/kv_test.go index 62466deee..deb5348ad 100644 --- a/state/txindex/kv/kv_test.go +++ b/state/txindex/kv/kv_test.go @@ -13,7 +13,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" db "github.com/tendermint/tm-db" - ocabci "github.com/Finschia/ostracon/abci/types" "github.com/Finschia/ostracon/libs/pubsub/query" tmrand "github.com/Finschia/ostracon/libs/rand" "github.com/Finschia/ostracon/state/txindex" @@ -30,7 +29,7 @@ func TestTxIndex(t *testing.T) { Tx: tx, Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: ocabci.CodeTypeOK, Log: "", Events: nil, + Code: abci.CodeTypeOK, Log: "", Events: nil, }, } hash := tx.Hash() @@ -53,7 +52,7 @@ func TestTxIndex(t *testing.T) { Tx: tx2, Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: ocabci.CodeTypeOK, Log: "", Events: nil, + Code: abci.CodeTypeOK, Log: "", Events: nil, }, } hash2 := tx2.Hash() @@ -418,7 +417,7 @@ func txResultWithEvents(events []abci.Event) *abci.TxResult { Tx: tx, Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: ocabci.CodeTypeOK, + Code: abci.CodeTypeOK, Log: "", Events: events, }, @@ -444,7 +443,7 @@ func benchmarkTxIndex(txsCount int64, b *testing.B) { Tx: tx, Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: ocabci.CodeTypeOK, + Code: abci.CodeTypeOK, Log: "", Events: []abci.Event{}, }, diff --git a/test/app/grpc_client.go b/test/app/grpc_client.go index daec4fda3..cffc15093 100644 --- a/test/app/grpc_client.go +++ b/test/app/grpc_client.go @@ -1,14 +1,14 @@ package main import ( + "context" "encoding/hex" "fmt" "os" - "context" + coregrpc "github.com/tendermint/tendermint/rpc/grpc" tmjson "github.com/Finschia/ostracon/libs/json" - coregrpc "github.com/Finschia/ostracon/rpc/grpc" ) var grpcAddr = "tcp://localhost:36656" diff --git a/test/e2e/app/app.go b/test/e2e/app/app.go index b3e2d0441..d1b077845 100644 --- a/test/e2e/app/app.go +++ b/test/e2e/app/app.go @@ -140,10 +140,10 @@ func (app *Application) InitChain(req abci.RequestInitChain) abci.ResponseInitCh } // CheckTx implements ABCI. -func (app *Application) CheckTx(req abci.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *Application) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { _, _, err := parseTx(req.Tx) if err != nil { - return ocabci.ResponseCheckTx{ + return abci.ResponseCheckTx{ Code: code.CodeTypeEncodingError, Log: err.Error(), } @@ -153,7 +153,7 @@ func (app *Application) CheckTx(req abci.RequestCheckTx) ocabci.ResponseCheckTx time.Sleep(app.cfg.CheckTxDelay) } - return ocabci.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1} + return abci.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1} } // DeliverTx implements ABCI.