tendermint/example/nil/nil_app.go

37 lines
792 B
Go
Raw Normal View History

2016-02-26 17:04:28 -08:00
package nilapp
import (
"github.com/tendermint/tmsp/types"
)
type NilApplication struct {
}
func NewNilApplication() *NilApplication {
return &NilApplication{}
}
func (app *NilApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) {
return "nil", nil, nil, nil
2016-02-26 17:04:28 -08:00
}
func (app *NilApplication) SetOption(key string, value string) (log string) {
return ""
}
func (app *NilApplication) AppendTx(tx []byte) types.Result {
return types.NewResultOK(nil, "")
2016-02-26 17:04:28 -08:00
}
func (app *NilApplication) CheckTx(tx []byte) types.Result {
return types.NewResultOK(nil, "")
2016-02-26 17:04:28 -08:00
}
2016-03-23 02:50:29 -07:00
func (app *NilApplication) Commit() types.Result {
return types.NewResultOK([]byte("nil"), "")
2016-02-26 17:04:28 -08:00
}
func (app *NilApplication) Query(query []byte) types.Result {
return types.NewResultOK(nil, "")
2016-02-26 17:04:28 -08:00
}