From b025c13f67cb3c26d015d8f8dc0bac910855a39d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 6 Feb 2017 19:08:37 -0500 Subject: [PATCH 1/3] drop BlockchainAware --- client/local_client.go | 25 ++----- .../block_aware_app.go} | 0 .../block_aware_test.go} | 0 example/counter/counter.go | 10 +++ example/dummy/dummy.go | 10 +++ example/dummy/dummy_test.go | 5 +- example/nil/nil_app.go | 10 +++ server/socket_server.go | 16 ++--- types/application.go | 68 ++++++------------- 9 files changed, 64 insertions(+), 80 deletions(-) rename example/{chain_aware/chain_aware_app.go => block_aware/block_aware_app.go} (100%) rename example/{chain_aware/chain_aware_test.go => block_aware/block_aware_test.go} (100%) diff --git a/client/local_client.go b/client/local_client.go index a34fde10d..1150db4a1 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -111,9 +111,7 @@ func (app *localClient) CommitAsync() *ReqRes { func (app *localClient) InitChainAsync(validators []*types.Validator) *ReqRes { app.mtx.Lock() - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.InitChain(validators) - } + app.Application.InitChain(validators) reqRes := app.callback( types.ToRequestInitChain(validators), types.ToResponseInitChain(), @@ -124,9 +122,7 @@ func (app *localClient) InitChainAsync(validators []*types.Validator) *ReqRes { func (app *localClient) BeginBlockAsync(hash []byte, header *types.Header) *ReqRes { app.mtx.Lock() - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.BeginBlock(hash, header) - } + app.Application.BeginBlock(hash, header) app.mtx.Unlock() return app.callback( types.ToRequestBeginBlock(hash, header), @@ -136,10 +132,7 @@ func (app *localClient) BeginBlockAsync(hash []byte, header *types.Header) *ReqR func (app *localClient) EndBlockAsync(height uint64) *ReqRes { app.mtx.Lock() - var resEndBlock types.ResponseEndBlock - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - resEndBlock = bcApp.EndBlock(height) - } + resEndBlock := app.Application.EndBlock(height) app.mtx.Unlock() return app.callback( types.ToRequestEndBlock(height), @@ -201,27 +194,21 @@ func (app *localClient) CommitSync() (res types.Result) { func (app *localClient) InitChainSync(validators []*types.Validator) (err error) { app.mtx.Lock() - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.InitChain(validators) - } + app.Application.InitChain(validators) app.mtx.Unlock() return nil } func (app *localClient) BeginBlockSync(hash []byte, header *types.Header) (err error) { app.mtx.Lock() - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.BeginBlock(hash, header) - } + app.Application.BeginBlock(hash, header) app.mtx.Unlock() return nil } func (app *localClient) EndBlockSync(height uint64) (resEndBlock types.ResponseEndBlock, err error) { app.mtx.Lock() - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - resEndBlock = bcApp.EndBlock(height) - } + resEndBlock = app.Application.EndBlock(height) app.mtx.Unlock() return resEndBlock, nil } diff --git a/example/chain_aware/chain_aware_app.go b/example/block_aware/block_aware_app.go similarity index 100% rename from example/chain_aware/chain_aware_app.go rename to example/block_aware/block_aware_app.go diff --git a/example/chain_aware/chain_aware_test.go b/example/block_aware/block_aware_test.go similarity index 100% rename from example/chain_aware/chain_aware_test.go rename to example/block_aware/block_aware_test.go diff --git a/example/counter/counter.go b/example/counter/counter.go index a55a1fd1b..8fce72e2a 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -80,3 +80,13 @@ func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.Response return types.ResponseQuery{Log: Fmt("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} } } + +func (app *CounterApplication) InitChain(validators []*types.Validator) { +} + +func (app *CounterApplication) BeginBlock(hash []byte, header *types.Header) { +} + +func (app *CounterApplication) EndBlock(height uint64) types.ResponseEndBlock { + return types.ResponseEndBlock{} +} diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index ac2bd4623..73c938e79 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -70,3 +70,13 @@ func (app *DummyApplication) Query(reqQuery types.RequestQuery) (resQuery types. return } } + +func (app *DummyApplication) InitChain(validators []*types.Validator) { +} + +func (app *DummyApplication) BeginBlock(hash []byte, header *types.Header) { +} + +func (app *DummyApplication) EndBlock(height uint64) types.ResponseEndBlock { + return types.ResponseEndBlock{} +} diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index 7ca12a6e5..fbbf97a59 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -180,14 +180,13 @@ func makeApplyBlock(t *testing.T, dummy types.Application, heightInt int, diff [ Height: height, } - dummyChain := dummy.(types.BlockchainAware) // hmm... - dummyChain.BeginBlock(hash, header) + dummy.BeginBlock(hash, header) for _, tx := range txs { if r := dummy.DeliverTx(tx); r.IsErr() { t.Fatal(r) } } - resEndBlock := dummyChain.EndBlock(height) + resEndBlock := dummy.EndBlock(height) dummy.Commit() valsEqual(t, diff, resEndBlock.Diffs) diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go index 95ac8d598..5285cc39a 100644 --- a/example/nil/nil_app.go +++ b/example/nil/nil_app.go @@ -34,3 +34,13 @@ func (app *NilApplication) Commit() types.Result { func (app *NilApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { return resQuery } + +func (app *NilApplication) InitChain(validators []*types.Validator) { +} + +func (app *NilApplication) BeginBlock(hash []byte, header *types.Header) { +} + +func (app *NilApplication) EndBlock(height uint64) types.ResponseEndBlock { + return types.ResponseEndBlock{} +} diff --git a/server/socket_server.go b/server/socket_server.go index 46114027b..bc1980e2d 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -187,22 +187,14 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types resQuery := s.app.Query(*r.Query) responses <- types.ToResponseQuery(resQuery) case *types.Request_InitChain: - if app, ok := s.app.(types.BlockchainAware); ok { - app.InitChain(r.InitChain.Validators) - } + s.app.InitChain(r.InitChain.Validators) responses <- types.ToResponseInitChain() case *types.Request_BeginBlock: - if app, ok := s.app.(types.BlockchainAware); ok { - app.BeginBlock(r.BeginBlock.Hash, r.BeginBlock.Header) - } + s.app.BeginBlock(r.BeginBlock.Hash, r.BeginBlock.Header) responses <- types.ToResponseBeginBlock() case *types.Request_EndBlock: - if app, ok := s.app.(types.BlockchainAware); ok { - resEndBlock := app.EndBlock(r.EndBlock.Height) - responses <- types.ToResponseEndBlock(resEndBlock) - } else { - responses <- types.ToResponseEndBlock(types.ResponseEndBlock{}) - } + resEndBlock := s.app.EndBlock(r.EndBlock.Height) + responses <- types.ToResponseEndBlock(resEndBlock) default: responses <- types.ToResponseException("Unknown request") } diff --git a/types/application.go b/types/application.go index 404437fed..b45305f8d 100644 --- a/types/application.go +++ b/types/application.go @@ -6,42 +6,25 @@ import ( // Applications type Application interface { - - // Return application info - Info() ResponseInfo - - // Set application option (e.g. mode=mempool, mode=consensus) - SetOption(key string, value string) (log string) - - // Deliver a tx - DeliverTx(tx []byte) Result - - // Validate a tx for the mempool - CheckTx(tx []byte) Result - - // Query for state - Query(reqQuery RequestQuery) ResponseQuery - - // Return the application Merkle root hash - Commit() Result -} - -// Some applications can choose to implement BlockchainAware -type BlockchainAware interface { - - // Initialize blockchain - // validators: genesis validators from TendermintCore - InitChain(validators []*Validator) - - // Signals the beginning of a block - BeginBlock(hash []byte, header *Header) - - // Signals the end of a block - // diffs: changed validators from app to TendermintCore - EndBlock(height uint64) ResponseEndBlock + // Info/Query Connection + Info() ResponseInfo // Return application info + SetOption(key string, value string) (log string) // Set application option + Query(reqQuery RequestQuery) ResponseQuery // Query for state + + // Mempool Connection + CheckTx(tx []byte) Result // Validate a tx for the mempool + + // Consensus Connection + InitChain(validators []*Validator) // Initialize blockchain with validators from TendermintCore + BeginBlock(hash []byte, header *Header) // Signals the beginning of a block + DeliverTx(tx []byte) Result // Deliver a tx for full processing + EndBlock(height uint64) ResponseEndBlock // Signals the end of a block, returns changes to the validator set + Commit() Result // Commit the state and return the application Merkle root hash } //------------------------------------ + +// GRPC wrapper for application type GRPCApplication struct { app Application } @@ -88,23 +71,16 @@ func (app *GRPCApplication) Commit(ctx context.Context, req *RequestCommit) (*Re } func (app *GRPCApplication) InitChain(ctx context.Context, req *RequestInitChain) (*ResponseInitChain, error) { - if chainAware, ok := app.app.(BlockchainAware); ok { - chainAware.InitChain(req.Validators) - } - return &ResponseInitChain{}, nil + app.app.InitChain(req.Validators) + return &ResponseInitChain{}, nil // NOTE: empty return } func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*ResponseBeginBlock, error) { - if chainAware, ok := app.app.(BlockchainAware); ok { - chainAware.BeginBlock(req.Hash, req.Header) - } - return &ResponseBeginBlock{}, nil + app.app.BeginBlock(req.Hash, req.Header) + return &ResponseBeginBlock{}, nil // NOTE: empty return } func (app *GRPCApplication) EndBlock(ctx context.Context, req *RequestEndBlock) (*ResponseEndBlock, error) { - if chainAware, ok := app.app.(BlockchainAware); ok { - resEndBlock := chainAware.EndBlock(req.Height) - return &resEndBlock, nil - } - return &ResponseEndBlock{}, nil + resEndBlock := app.app.EndBlock(req.Height) + return &resEndBlock, nil } From b6afa8d85bab43b65c628d5416a48905e7450396 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 6 Feb 2017 19:20:33 -0500 Subject: [PATCH 2/3] Query: Height -> LastHeight --- README.md | 6 +- cmd/abci-cli/abci-cli.go | 34 +++--- types/types.pb.go | 247 ++++++++++++++++++++------------------- types/types.proto | 6 +- 4 files changed, 147 insertions(+), 146 deletions(-) diff --git a/README.md b/README.md index c002b1416..af66fecc0 100644 --- a/README.md +++ b/README.md @@ -76,16 +76,16 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil * `Path (string)`: Path of request, like an HTTP GET path. Can be used with or in liue of Data. * Apps MUST interpret '/store' as a query by key on the underlying store. The key SHOULD be specified in the Data field. * Apps SHOULD allow queries over specific types like '/accounts/...' or '/votes/...' - * `Height (uint64)`: The block height for which you want the query (default=0 returns data for the latest committed block) + * `LastHeight (uint64)`: The block height for which you want the query (default=0 returns data for the latest committed block). Note that the corresponding Merkle root hash will only be included in the header of the next block (ie. `LastHeight + 1`) * `Prove (bool)`: Return Merkle proof with response if possible * __Returns__: * `Code (uint32)`: Response code * `Key ([]byte)`: The key of the matching data * `Value ([]byte)`: The value of the matching data * `Proof ([]byte)`: Proof for the data, if requested - * `Height (uint64)`: The block height from which data was derived + * `LastHeight (uint64)`: The block height from which data was derived. The Merkle root for the proof is included in block `LastHeight + 1` * `Log (string)`: Debug or error message - *Please note* The current implementation of go-merkle doesn't support querying proofs from past blocks, so for the present moment, any height other than 0 will return an error. Hopefully this will be improved soon(ish) + *Please note* The current implementation of go-merkle doesn't support querying proofs from past blocks, so for the present moment, any height other than 0 will return an error (recall height=0 defaults to latest block). Hopefully this will be improved soon(ish) #### Info * __Returns__: diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 0168bea4a..e4fd50be0 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -17,13 +17,13 @@ import ( // Structure for data passed to print response. type response struct { - Data []byte - Code types.CodeType - Key []byte - Value []byte - Log string - Height string - Proof []byte + Data []byte + Code types.CodeType + Key []byte + Value []byte + Log string + LastHeight string + Proof []byte } // client is a global variable so it can be reused by the console @@ -299,20 +299,20 @@ func cmdQuery(c *cli.Context) error { return err } resQuery, err := client.QuerySync(types.RequestQuery{ - Data: queryBytes, - Path: "/store", // TOOD expose - Height: 0, // TODO expose + Data: queryBytes, + Path: "/store", // TOOD expose + LastHeight: 0, // TODO expose //Prove: true, // TODO expose }) if err != nil { return err } printResponse(c, response{ - Code: resQuery.Code, - Key: resQuery.Key, - Value: resQuery.Value, - Log: resQuery.Log, - Height: fmt.Sprintf("%v", resQuery.Height), + Code: resQuery.Code, + Key: resQuery.Key, + Value: resQuery.Value, + Log: resQuery.Log, + LastHeight: fmt.Sprintf("%v", resQuery.LastHeight), //Proof: resQuery.Proof, }) return nil @@ -346,8 +346,8 @@ func printResponse(c *cli.Context, rsp response) { if rsp.Log != "" { fmt.Printf("-> log: %s\n", rsp.Log) } - if rsp.Height != "" { - fmt.Printf("-> height: %s\n", rsp.Height) + if rsp.LastHeight != "" { + fmt.Printf("-> height: %s\n", rsp.LastHeight) } if rsp.Proof != nil { fmt.Printf("-> proof: %X\n", rsp.Proof) diff --git a/types/types.pb.go b/types/types.pb.go index e0ae1076b..3458c27c1 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -716,10 +716,10 @@ func (m *RequestCheckTx) GetTx() []byte { } type RequestQuery struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` - Height uint64 `protobuf:"varint,3,opt,name=height" json:"height,omitempty"` - Prove bool `protobuf:"varint,4,opt,name=prove" json:"prove,omitempty"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` + LastHeight uint64 `protobuf:"varint,3,opt,name=last_height,json=lastHeight" json:"last_height,omitempty"` + Prove bool `protobuf:"varint,4,opt,name=prove" json:"prove,omitempty"` } func (m *RequestQuery) Reset() { *m = RequestQuery{} } @@ -741,9 +741,9 @@ func (m *RequestQuery) GetPath() string { return "" } -func (m *RequestQuery) GetHeight() uint64 { +func (m *RequestQuery) GetLastHeight() uint64 { if m != nil { - return m.Height + return m.LastHeight } return 0 } @@ -1411,13 +1411,13 @@ func (m *ResponseCheckTx) GetLog() string { } type ResponseQuery struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` - Height uint64 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` - Log string `protobuf:"bytes,7,opt,name=log" json:"log,omitempty"` + Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` + Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` + Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` + LastHeight uint64 `protobuf:"varint,6,opt,name=last_height,json=lastHeight" json:"last_height,omitempty"` + Log string `protobuf:"bytes,7,opt,name=log" json:"log,omitempty"` } func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } @@ -1460,9 +1460,9 @@ func (m *ResponseQuery) GetProof() []byte { return nil } -func (m *ResponseQuery) GetHeight() uint64 { +func (m *ResponseQuery) GetLastHeight() uint64 { if m != nil { - return m.Height + return m.LastHeight } return 0 } @@ -2129,112 +2129,113 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1711 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x4b, 0x6f, 0xe4, 0xc6, - 0x11, 0x16, 0xe7, 0x3d, 0x35, 0xd2, 0xa8, 0x55, 0x1a, 0x49, 0xd4, 0x24, 0x87, 0x05, 0x03, 0xc7, - 0xda, 0x8d, 0xb3, 0x1b, 0xc8, 0x70, 0xb0, 0x8a, 0x83, 0x00, 0xd2, 0xae, 0xbc, 0x1a, 0x18, 0xde, - 0x55, 0xe8, 0xb5, 0x2f, 0x09, 0x32, 0xa0, 0x86, 0x3d, 0x33, 0x8c, 0xa8, 0x26, 0x97, 0x6c, 0xca, - 0x52, 0x7e, 0x83, 0xef, 0xf9, 0x09, 0xb9, 0x07, 0xc8, 0x29, 0xf7, 0x00, 0x79, 0x3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, 0xf1, 0x79, 0x0a, 0x19, 0x58, 0xfd, 0x98, 0x1f, 0x6d, 0x98, 0xa7, 0xe9, + 0x78, 0xd4, 0xf4, 0x50, 0xf5, 0x46, 0x1f, 0x55, 0x8e, 0xc8, 0xf8, 0x51, 0x82, 0x49, 0x58, 0xf9, + 0x3f, 0xc0, 0xa8, 0x7a, 0x10, 0xa7, 0x20, 0xb3, 0xf7, 0xdd, 0xa6, 0x07, 0xfe, 0x68, 0xe3, 0x88, + 0x8d, 0xe7, 0x79, 0x90, 0xc3, 0x8d, 0xcf, 0xfc, 0xd1, 0xe6, 0x41, 0x1b, 0x3f, 0xce, 0x70, 0x11, + 0x37, 0x3c, 0xf6, 0x47, 0x9b, 0x66, 0xed, 0x9b, 0x96, 0xfc, 0x1f, 0xe9, 0xc3, 0xff, 0x05, 0x00, + 0x00, 0xff, 0xff, 0x3a, 0x61, 0xc1, 0xbf, 0x5c, 0x12, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 3eea82ea6..67cd32499 100644 --- a/types/types.proto +++ b/types/types.proto @@ -115,7 +115,7 @@ message RequestCheckTx{ message RequestQuery{ bytes data = 1; string path = 2; - uint64 height = 3; + uint64 last_height = 3; bool prove = 4; } @@ -192,11 +192,11 @@ message ResponseCheckTx{ message ResponseQuery{ CodeType code = 1; - int64 index = 2; + int64 index = 2; bytes key = 3; bytes value = 4; bytes proof = 5; - uint64 height = 6; + uint64 last_height = 6; string log = 7; } From e909cafa0bc208a9bc14d599c955d1bb6e8ff94e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 13 Feb 2017 18:48:59 -0500 Subject: [PATCH 3/3] BaseApplication --- example/block_aware/block_aware_app.go | 26 ++------------- example/counter/counter.go | 12 ++----- example/dummy/dummy.go | 16 ++------- example/example_test.go | 9 +++-- example/nil/nil_app.go | 46 -------------------------- types/base_app.go | 42 +++++++++++++++++++++++ 6 files changed, 52 insertions(+), 99 deletions(-) delete mode 100644 example/nil/nil_app.go create mode 100644 types/base_app.go diff --git a/example/block_aware/block_aware_app.go b/example/block_aware/block_aware_app.go index 90a7a4402..454c3560b 100644 --- a/example/block_aware/block_aware_app.go +++ b/example/block_aware/block_aware_app.go @@ -30,6 +30,8 @@ func main() { } type ChainAwareApplication struct { + types.BaseApplication + beginCount int endCount int } @@ -38,26 +40,6 @@ func NewChainAwareApplication() *ChainAwareApplication { return &ChainAwareApplication{} } -func (app *ChainAwareApplication) Info() types.ResponseInfo { - return types.ResponseInfo{} -} - -func (app *ChainAwareApplication) SetOption(key string, value string) (log string) { - return "" -} - -func (app *ChainAwareApplication) DeliverTx(tx []byte) types.Result { - return types.NewResultOK(nil, "") -} - -func (app *ChainAwareApplication) CheckTx(tx []byte) types.Result { - return types.NewResultOK(nil, "") -} - -func (app *ChainAwareApplication) Commit() types.Result { - return types.NewResultOK([]byte("nil"), "") -} - func (app *ChainAwareApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { return types.ResponseQuery{ Value: []byte(cmn.Fmt("%d,%d", app.beginCount, app.endCount)), @@ -73,7 +55,3 @@ func (app *ChainAwareApplication) EndBlock(height uint64) (resEndBlock types.Res app.endCount++ return } - -func (app *ChainAwareApplication) InitChain(vals []*types.Validator) { - return -} diff --git a/example/counter/counter.go b/example/counter/counter.go index 8fce72e2a..fa0bab58c 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -9,6 +9,8 @@ import ( ) type CounterApplication struct { + types.BaseApplication + hashCount int txCount int serial bool @@ -80,13 +82,3 @@ func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.Response return types.ResponseQuery{Log: Fmt("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} } } - -func (app *CounterApplication) InitChain(validators []*types.Validator) { -} - -func (app *CounterApplication) BeginBlock(hash []byte, header *types.Header) { -} - -func (app *CounterApplication) EndBlock(height uint64) types.ResponseEndBlock { - return types.ResponseEndBlock{} -} diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 73c938e79..fd66250bb 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -9,6 +9,8 @@ import ( ) type DummyApplication struct { + types.BaseApplication + state merkle.Tree } @@ -21,10 +23,6 @@ func (app *DummyApplication) Info() (resInfo types.ResponseInfo) { return types.ResponseInfo{Data: fmt.Sprintf("{\"size\":%v}", app.state.Size())} } -func (app *DummyApplication) SetOption(key string, value string) (log string) { - return "" -} - // tx is either "key=value" or just arbitrary bytes func (app *DummyApplication) DeliverTx(tx []byte) types.Result { parts := strings.Split(string(tx), "=") @@ -70,13 +68,3 @@ func (app *DummyApplication) Query(reqQuery types.RequestQuery) (resQuery types. return } } - -func (app *DummyApplication) InitChain(validators []*types.Validator) { -} - -func (app *DummyApplication) BeginBlock(hash []byte, header *types.Header) { -} - -func (app *DummyApplication) EndBlock(height uint64) types.ResponseEndBlock { - return types.ResponseEndBlock{} -} diff --git a/example/example_test.go b/example/example_test.go index 26921083a..9f18c421e 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -14,7 +14,6 @@ import ( "github.com/tendermint/abci/client" "github.com/tendermint/abci/example/dummy" - nilapp "github.com/tendermint/abci/example/nil" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" cmn "github.com/tendermint/go-common" @@ -25,14 +24,14 @@ func TestDummy(t *testing.T) { testStream(t, dummy.NewDummyApplication()) } -func TestNilApp(t *testing.T) { - fmt.Println("### Testing NilApp") - testStream(t, nilapp.NewNilApplication()) +func TestBaseApp(t *testing.T) { + fmt.Println("### Testing BaseApp") + testStream(t, types.NewBaseApplication()) } func TestGRPC(t *testing.T) { fmt.Println("### Testing GRPC") - testGRPCSync(t, types.NewGRPCApplication(nilapp.NewNilApplication())) + testGRPCSync(t, types.NewGRPCApplication(types.NewBaseApplication())) } func testStream(t *testing.T, app types.Application) { diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go deleted file mode 100644 index 5285cc39a..000000000 --- a/example/nil/nil_app.go +++ /dev/null @@ -1,46 +0,0 @@ -package nilapp - -import ( - "github.com/tendermint/abci/types" -) - -type NilApplication struct { -} - -func NewNilApplication() *NilApplication { - return &NilApplication{} -} - -func (app *NilApplication) Info() (resInfo types.ResponseInfo) { - return -} - -func (app *NilApplication) SetOption(key string, value string) (log string) { - return "" -} - -func (app *NilApplication) DeliverTx(tx []byte) types.Result { - return types.NewResultOK(nil, "") -} - -func (app *NilApplication) CheckTx(tx []byte) types.Result { - return types.NewResultOK(nil, "") -} - -func (app *NilApplication) Commit() types.Result { - return types.NewResultOK([]byte("nil"), "") -} - -func (app *NilApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { - return resQuery -} - -func (app *NilApplication) InitChain(validators []*types.Validator) { -} - -func (app *NilApplication) BeginBlock(hash []byte, header *types.Header) { -} - -func (app *NilApplication) EndBlock(height uint64) types.ResponseEndBlock { - return types.ResponseEndBlock{} -} diff --git a/types/base_app.go b/types/base_app.go new file mode 100644 index 000000000..1d4f84b8a --- /dev/null +++ b/types/base_app.go @@ -0,0 +1,42 @@ +package types + +type BaseApplication struct { +} + +func NewBaseApplication() *BaseApplication { + return &BaseApplication{} +} + +func (app *BaseApplication) Info() (resInfo ResponseInfo) { + return +} + +func (app *BaseApplication) SetOption(key string, value string) (log string) { + return "" +} + +func (app *BaseApplication) DeliverTx(tx []byte) Result { + return NewResultOK(nil, "") +} + +func (app *BaseApplication) CheckTx(tx []byte) Result { + return NewResultOK(nil, "") +} + +func (app *BaseApplication) Commit() Result { + return NewResultOK([]byte("nil"), "") +} + +func (app *BaseApplication) Query(reqQuery RequestQuery) (resQuery ResponseQuery) { + return +} + +func (app *BaseApplication) InitChain(validators []*Validator) { +} + +func (app *BaseApplication) BeginBlock(hash []byte, header *Header) { +} + +func (app *BaseApplication) EndBlock(height uint64) (resEndBlock ResponseEndBlock) { + return +}