Skip to content

Commit

Permalink
Merge PR #5465: Remove dep Events from TxResponse type
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez authored Jan 3, 2020
1 parent a5fc7d6 commit fe9e50d
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions types/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ type TxResponse struct {
GasUsed int64 `json:"gas_used,omitempty"`
Tx Tx `json:"tx,omitempty"`
Timestamp string `json:"timestamp,omitempty"`

// DEPRECATED: Remove in the next next major release in favor of using the
// ABCIMessageLog.Events field.
Events StringEvents `json:"events,omitempty"`
}

// NewResponseResultTx returns a TxResponse given a ResultTx from tendermint
Expand All @@ -108,7 +104,6 @@ func NewResponseResultTx(res *ctypes.ResultTx, tx Tx, timestamp string) TxRespon
Info: res.TxResult.Info,
GasWanted: res.TxResult.GasWanted,
GasUsed: res.TxResult.GasUsed,
Events: StringifyEvents(res.TxResult.Events),
Tx: tx,
Timestamp: timestamp,
}
Expand Down Expand Up @@ -151,7 +146,6 @@ func newTxResponseCheckTx(res *ctypes.ResultBroadcastTxCommit) TxResponse {
Info: res.CheckTx.Info,
GasWanted: res.CheckTx.GasWanted,
GasUsed: res.CheckTx.GasUsed,
Events: StringifyEvents(res.CheckTx.Events),
}
}

Expand All @@ -178,7 +172,6 @@ func newTxResponseDeliverTx(res *ctypes.ResultBroadcastTxCommit) TxResponse {
Info: res.DeliverTx.Info,
GasWanted: res.DeliverTx.GasWanted,
GasUsed: res.DeliverTx.GasUsed,
Events: StringifyEvents(res.DeliverTx.Events),
}
}

Expand Down Expand Up @@ -206,51 +199,37 @@ func (r TxResponse) String() string {
if r.Height > 0 {
sb.WriteString(fmt.Sprintf(" Height: %d\n", r.Height))
}

if r.TxHash != "" {
sb.WriteString(fmt.Sprintf(" TxHash: %s\n", r.TxHash))
}

if r.Code > 0 {
sb.WriteString(fmt.Sprintf(" Code: %d\n", r.Code))
}

if r.Data != "" {
sb.WriteString(fmt.Sprintf(" Data: %s\n", r.Data))
}

if r.RawLog != "" {
sb.WriteString(fmt.Sprintf(" Raw Log: %s\n", r.RawLog))
}

if r.Logs != nil {
sb.WriteString(fmt.Sprintf(" Logs: %s\n", r.Logs))
}

if r.Info != "" {
sb.WriteString(fmt.Sprintf(" Info: %s\n", r.Info))
}

if r.GasWanted != 0 {
sb.WriteString(fmt.Sprintf(" GasWanted: %d\n", r.GasWanted))
}

if r.GasUsed != 0 {
sb.WriteString(fmt.Sprintf(" GasUsed: %d\n", r.GasUsed))
}

if r.Codespace != "" {
sb.WriteString(fmt.Sprintf(" Codespace: %s\n", r.Codespace))
}

if r.Timestamp != "" {
sb.WriteString(fmt.Sprintf(" Timestamp: %s\n", r.Timestamp))
}

if len(r.Events) > 0 {
sb.WriteString(fmt.Sprintf(" Events: \n%s\n", r.Events.String()))
}

return strings.TrimSpace(sb.String())
}

Expand Down

0 comments on commit fe9e50d

Please sign in to comment.