Added new Flush request/response type

This commit is contained in:
Jae Kwon
2015-11-08 15:18:58 -08:00
parent 0bd4061cf6
commit ef93c95853
2 changed files with 42 additions and 17 deletions

View File

@ -4,22 +4,24 @@ import "github.com/tendermint/go-wire"
const (
requestTypeEcho = byte(0x01)
requestTypeAppendTx = byte(0x02)
requestTypeGetHash = byte(0x03)
requestTypeCommit = byte(0x04)
requestTypeRollback = byte(0x05)
requestTypeSetEventsMode = byte(0x06)
requestTypeAddListener = byte(0x07)
requestTypeRemListener = byte(0x08)
requestTypeFlush = byte(0x02)
requestTypeAppendTx = byte(0x03)
requestTypeGetHash = byte(0x04)
requestTypeCommit = byte(0x05)
requestTypeRollback = byte(0x06)
requestTypeSetEventsMode = byte(0x07)
requestTypeAddListener = byte(0x08)
requestTypeRemListener = byte(0x09)
responseTypeEcho = byte(0x11)
responseTypeAppendTx = byte(0x12)
responseTypeGetHash = byte(0x13)
responseTypeCommit = byte(0x14)
responseTypeRollback = byte(0x15)
responseTypeSetEventsMode = byte(0x16)
responseTypeAddListener = byte(0x17)
responseTypeRemListener = byte(0x18)
responseTypeFlush = byte(0x12)
responseTypeAppendTx = byte(0x13)
responseTypeGetHash = byte(0x14)
responseTypeCommit = byte(0x15)
responseTypeRollback = byte(0x16)
responseTypeSetEventsMode = byte(0x17)
responseTypeAddListener = byte(0x18)
responseTypeRemListener = byte(0x19)
responseTypeException = byte(0x20)
responseTypeEvent = byte(0x21)
@ -31,6 +33,9 @@ type RequestEcho struct {
Message string
}
type RequestFlush struct {
}
type RequestAppendTx struct {
TxBytes []byte
}
@ -61,6 +66,7 @@ type Request interface {
}
func (_ RequestEcho) AssertRequestType() {}
func (_ RequestFlush) AssertRequestType() {}
func (_ RequestAppendTx) AssertRequestType() {}
func (_ RequestGetHash) AssertRequestType() {}
func (_ RequestCommit) AssertRequestType() {}
@ -72,6 +78,7 @@ func (_ RequestRemListener) AssertRequestType() {}
var _ = wire.RegisterInterface(
struct{ Request }{},
wire.ConcreteType{RequestEcho{}, requestTypeEcho},
wire.ConcreteType{RequestFlush{}, requestTypeFlush},
wire.ConcreteType{RequestAppendTx{}, requestTypeAppendTx},
wire.ConcreteType{RequestGetHash{}, requestTypeGetHash},
wire.ConcreteType{RequestCommit{}, requestTypeCommit},
@ -88,6 +95,9 @@ type ResponseEcho struct {
Message string
}
type ResponseFlush struct {
}
type ResponseAppendTx struct {
RetCode
}
@ -130,6 +140,7 @@ type Response interface {
}
func (_ ResponseEcho) AssertResponseType() {}
func (_ ResponseFlush) AssertResponseType() {}
func (_ ResponseAppendTx) AssertResponseType() {}
func (_ ResponseGetHash) AssertResponseType() {}
func (_ ResponseCommit) AssertResponseType() {}
@ -143,6 +154,7 @@ func (_ ResponseEvent) AssertResponseType() {}
var _ = wire.RegisterInterface(
struct{ Response }{},
wire.ConcreteType{ResponseEcho{}, responseTypeEcho},
wire.ConcreteType{ResponseFlush{}, responseTypeFlush},
wire.ConcreteType{ResponseAppendTx{}, responseTypeAppendTx},
wire.ConcreteType{ResponseGetHash{}, responseTypeGetHash},
wire.ConcreteType{ResponseCommit{}, responseTypeCommit},