* Refactor CliContext as Context
* Fix lint issues
* Fix goimports
* Fix gov tests
* Resolved ci-lint issues
* Add changelog
* Rename cliCtx to clientCtx
* Fix mocks and routes
* Add changelog
* Update changelog
* Apply suggestions from code review
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
* merge client/rpc/ro{ot,utes}.go
* Update docs
* client/rpc: remove redundant client/rpc.RegisterRPCRoutes
* regenerate mocks
* Update ADRs
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
38 lines
829 B
Go
38 lines
829 B
Go
package client_test
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/cosmos/cosmos-sdk/client"
|
|
)
|
|
|
|
func TestCreateVerifier(t *testing.T) {
|
|
tmpDir, err := ioutil.TempDir("", "example")
|
|
require.NoError(t, err)
|
|
|
|
testCases := []struct {
|
|
name string
|
|
ctx client.Context
|
|
expectErr bool
|
|
}{
|
|
{"no chain ID", client.Context{}, true},
|
|
{"no home directory", client.Context{}.WithChainID("test"), true},
|
|
{"no client or RPC URI", client.Context{HomeDir: tmpDir}.WithChainID("test"), true},
|
|
}
|
|
|
|
for _, tc := range testCases {
|
|
tc := tc
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
verifier, err := client.CreateVerifier(tc.ctx, client.DefaultVerifierCacheSize)
|
|
require.Equal(t, tc.expectErr, err != nil, err)
|
|
|
|
if !tc.expectErr {
|
|
require.NotNil(t, verifier)
|
|
}
|
|
})
|
|
}
|
|
}
|