github.com/okex/exchain@v1.8.0/libs/tendermint/types/events_test.go (about) 1 package types 2 3 import ( 4 "fmt" 5 "testing" 6 7 "github.com/stretchr/testify/assert" 8 ) 9 10 func TestQueryTxFor(t *testing.T) { 11 tx := Tx("foo") 12 height := int64(0) 13 assert.Equal(t, 14 fmt.Sprintf("tm.event='Tx' AND tx.hash='%X'", tx.Hash(height)), 15 EventQueryTxFor(tx, height).String(), 16 ) 17 } 18 19 func TestQueryForEvent(t *testing.T) { 20 assert.Equal(t, 21 "tm.event='NewBlock'", 22 QueryForEvent(EventNewBlock).String(), 23 ) 24 }