Browse Source

add tests for events public funcs

Refs #693
pull/1936/head
Anton Kaliaev 6 years ago
parent
commit
80399e60fb
No known key found for this signature in database GPG Key ID: 7B6881D965918214
1 changed files with 23 additions and 0 deletions
  1. +23
    -0
      types/events_test.go

+ 23
- 0
types/events_test.go View File

@ -0,0 +1,23 @@
package types
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestQueryTxFor(t *testing.T) {
tx := Tx("foo")
assert.Equal(t,
fmt.Sprintf("tm.event='Tx' AND tx.hash='%X'", tx.Hash()),
EventQueryTxFor(tx).String(),
)
}
func TestQueryForEvent(t *testing.T) {
assert.Equal(t,
"tm.event='NewBlock'",
QueryForEvent(EventNewBlock).String(),
)
}

Loading…
Cancel
Save