You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.5 KiB

  1. package types
  2. const (
  3. CodeTypeOK uint32 = 0
  4. )
  5. // IsOK returns true if Code is OK.
  6. func (r ResponseCheckTx) IsOK() bool {
  7. return r.Code == CodeTypeOK
  8. }
  9. // IsErr returns true if Code is something other than OK.
  10. func (r ResponseCheckTx) IsErr() bool {
  11. return r.Code != CodeTypeOK
  12. }
  13. // IsOK returns true if Code is OK.
  14. func (r ResponseDeliverTx) IsOK() bool {
  15. return r.Code == CodeTypeOK
  16. }
  17. // IsErr returns true if Code is something other than OK.
  18. func (r ResponseDeliverTx) IsErr() bool {
  19. return r.Code != CodeTypeOK
  20. }
  21. // IsOK returns true if Code is OK.
  22. func (r ResponseQuery) IsOK() bool {
  23. return r.Code == CodeTypeOK
  24. }
  25. // IsErr returns true if Code is something other than OK.
  26. func (r ResponseQuery) IsErr() bool {
  27. return r.Code != CodeTypeOK
  28. }
  29. //----------------------------------------------------
  30. // IsOK returns true if Code is OK.
  31. func (r ResultCheckTx) IsOK() bool {
  32. return r.Code == CodeTypeOK
  33. }
  34. // IsErr returns true if Code is something other than OK.
  35. func (r ResultCheckTx) IsErr() bool {
  36. return r.Code != CodeTypeOK
  37. }
  38. // IsOK returns true if Code is OK.
  39. func (r ResultDeliverTx) IsOK() bool {
  40. return r.Code == CodeTypeOK
  41. }
  42. // IsErr returns true if Code is something other than OK.
  43. func (r ResultDeliverTx) IsErr() bool {
  44. return r.Code != CodeTypeOK
  45. }
  46. // IsOK returns true if Code is OK.
  47. func (r ResultQuery) IsOK() bool {
  48. return r.Code == CodeTypeOK
  49. }
  50. // IsErr returns true if Code is something other than OK.
  51. func (r ResultQuery) IsErr() bool {
  52. return r.Code != CodeTypeOK
  53. }