mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-15 06:11:20 +00:00
Use protobuf enums for CodeType
This commit is contained in:
@ -104,7 +104,7 @@ func (mem *Mempool) CheckTx(tx types.Tx) (err error) {
|
|||||||
func (mem *Mempool) resCb(req *tmsp.Request, res *tmsp.Response) {
|
func (mem *Mempool) resCb(req *tmsp.Request, res *tmsp.Response) {
|
||||||
switch res.Type {
|
switch res.Type {
|
||||||
case tmsp.MessageType_CheckTx:
|
case tmsp.MessageType_CheckTx:
|
||||||
if tmsp.RetCode(res.Code) == tmsp.RetCodeOK {
|
if res.Code == tmsp.CodeType_OK {
|
||||||
mem.counter++
|
mem.counter++
|
||||||
memTx := &mempoolTx{
|
memTx := &mempoolTx{
|
||||||
counter: mem.counter,
|
counter: mem.counter,
|
||||||
|
@ -72,7 +72,7 @@ func TestSerialReap(t *testing.T) {
|
|||||||
txBytes := make([]byte, 8)
|
txBytes := make([]byte, 8)
|
||||||
binary.BigEndian.PutUint64(txBytes, uint64(i))
|
binary.BigEndian.PutUint64(txBytes, uint64(i))
|
||||||
code, result, logStr := appConnCon.AppendTx(txBytes)
|
code, result, logStr := appConnCon.AppendTx(txBytes)
|
||||||
if code != tmsp.RetCodeOK {
|
if code != tmsp.CodeType_OK {
|
||||||
t.Errorf("Error committing tx. Code:%v result:%X log:%v",
|
t.Errorf("Error committing tx. Code:%v result:%X log:%v",
|
||||||
code, result, logStr)
|
code, result, logStr)
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ func (s *State) execBlockOnProxyApp(evsw *events.EventSwitch, proxyAppConn proxy
|
|||||||
// TODO: make use of this info
|
// TODO: make use of this info
|
||||||
// Blocks may include invalid txs.
|
// Blocks may include invalid txs.
|
||||||
// reqAppendTx := req.(tmsp.RequestAppendTx)
|
// reqAppendTx := req.(tmsp.RequestAppendTx)
|
||||||
if tmsp.RetCode(res.Code) == tmsp.RetCodeOK {
|
if res.Code == tmsp.CodeType_OK {
|
||||||
validTxs += 1
|
validTxs += 1
|
||||||
} else {
|
} else {
|
||||||
log.Debug("Invalid tx", "code", res.Code, "log", res.Log)
|
log.Debug("Invalid tx", "code", res.Code, "log", res.Log)
|
||||||
@ -159,7 +159,7 @@ func updateValidatorsWithBlock(lastValSet *types.ValidatorSet, valSet *types.Val
|
|||||||
|
|
||||||
type InvalidTxError struct {
|
type InvalidTxError struct {
|
||||||
Tx types.Tx
|
Tx types.Tx
|
||||||
Code tmsp.RetCode
|
Code tmsp.CodeType
|
||||||
}
|
}
|
||||||
|
|
||||||
func (txErr InvalidTxError) Error() string {
|
func (txErr InvalidTxError) Error() string {
|
||||||
|
Reference in New Issue
Block a user