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.

27 lines
489 B

  1. package types
  2. import (
  3. "fmt"
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestQueryTxFor(t *testing.T) {
  8. tx := Tx("foo")
  9. assert.Equal(t,
  10. fmt.Sprintf("tm.event = 'Tx' AND tx.hash = '%X'", tx.Hash()),
  11. EventQueryTxFor(tx).String(),
  12. )
  13. }
  14. func TestQueryForEvent(t *testing.T) {
  15. assert.Equal(t,
  16. "tm.event = 'NewBlock'",
  17. QueryForEvent(EventNewBlockValue).String(),
  18. )
  19. assert.Equal(t,
  20. "tm.event = 'NewEvidence'",
  21. QueryForEvent(EventNewEvidenceValue).String(),
  22. )
  23. }