cosmos-sdk/x/gov/handler_test.go
Neeraj Murarka 2079576cbe
Replaced hardcoded 'cosmos' and 'cosmosvaloper' help references (#7056)
* Replaced hardcoded 'cosmos' and 'cosmosvaloper' help references

* Ran make format target

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-08-17 09:04:50 +00:00

27 lines
636 B
Go

package gov_test
import (
"strings"
"testing"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/stretchr/testify/require"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov"
"github.com/cosmos/cosmos-sdk/x/gov/keeper"
)
func TestInvalidMsg(t *testing.T) {
k := keeper.Keeper{}
h := gov.NewHandler(k)
res, err := h(sdk.NewContext(nil, tmproto.Header{}, false, nil), testdata.NewTestMsg())
require.Error(t, err)
require.Nil(t, res)
require.True(t, strings.Contains(err.Error(), "unrecognized gov message type"))
}