https://github.com/tendermint/tendermint
Raw File
Tip revision: c2908ef785bb5ca6e015910368e4b7a32821b9ff authored by Callum Waters on 18 June 2021, 09:44:39 UTC
release: prepare changelog for v0.34.11 (#6597)
Tip revision: c2908ef
events_test.go
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(),
	)
	assert.Equal(t,
		"tm.event='NewEvidence'",
		QueryForEvent(EventNewEvidence).String(),
	)
}
back to top