Merge PR #6609: x/auth: CLI Remove Viper
This commit is contained in:
@@ -2,6 +2,7 @@ package cli
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -15,12 +16,14 @@ import (
|
||||
|
||||
func TestGetCommandEncode(t *testing.T) {
|
||||
encodingConfig := simappparams.MakeEncodingConfig()
|
||||
clientCtx := client.Context{}
|
||||
clientCtx = clientCtx.
|
||||
clientCtx := client.Context{}.
|
||||
WithTxGenerator(encodingConfig.TxGenerator).
|
||||
WithJSONMarshaler(encodingConfig.Marshaler)
|
||||
|
||||
cmd := GetEncodeCommand(clientCtx)
|
||||
cmd.SetErr(ioutil.Discard)
|
||||
cmd.SetOut(ioutil.Discard)
|
||||
|
||||
authtypes.RegisterCodec(encodingConfig.Amino)
|
||||
sdk.RegisterCodec(encodingConfig.Amino)
|
||||
|
||||
@@ -43,12 +46,13 @@ func TestGetCommandEncode(t *testing.T) {
|
||||
func TestGetCommandDecode(t *testing.T) {
|
||||
encodingConfig := simappparams.MakeEncodingConfig()
|
||||
|
||||
clientCtx := client.Context{}
|
||||
clientCtx = clientCtx.
|
||||
clientCtx := client.Context{}.
|
||||
WithTxGenerator(encodingConfig.TxGenerator).
|
||||
WithJSONMarshaler(encodingConfig.Marshaler)
|
||||
|
||||
cmd := GetDecodeCommand(clientCtx)
|
||||
cmd.SetErr(ioutil.Discard)
|
||||
cmd.SetOut(ioutil.Discard)
|
||||
|
||||
sdk.RegisterCodec(encodingConfig.Amino)
|
||||
|
||||
@@ -67,6 +71,6 @@ func TestGetCommandDecode(t *testing.T) {
|
||||
base64Encoded := base64.StdEncoding.EncodeToString(txBytes)
|
||||
|
||||
// Execute the command
|
||||
err = runDecodeTxString(clientCtx)(cmd, []string{base64Encoded})
|
||||
require.NoError(t, err)
|
||||
cmd.SetArgs([]string{base64Encoded})
|
||||
require.NoError(t, cmd.Execute())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user