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.

23 lines
379 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(EventNewBlock).String(),
  18. )
  19. }