792c1ff756
* evm: params * setup * bump commit * fixes * increase gas usage * tests * evm denom param * more config updates * update genesis * update ante handler * csdb param test * more tests and fixes * update statedb.Copy * lint * additional test * fix importer tests * fix AnteHandler test * minor update * revert * undo gas update * stringer test * changelog * fix csdb index error (#493) * attempt to fix * cleanup * add idx check * update csdb.Copy * update default hash * update querier * update rpc tests * fix estimate gas test Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: noot <elizabethjbinks@gmail.com>
53 lines
798 B
Go
53 lines
798 B
Go
package types
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestParamsValidate(t *testing.T) {
|
|
testCases := []struct {
|
|
name string
|
|
params Params
|
|
expError bool
|
|
}{
|
|
{"default", DefaultParams(), false},
|
|
{
|
|
"valid",
|
|
NewParams("ara"),
|
|
false,
|
|
},
|
|
{
|
|
"empty",
|
|
Params{},
|
|
true,
|
|
},
|
|
{
|
|
"invalid evm denom",
|
|
Params{
|
|
EvmDenom: "@!#!@$!@5^32",
|
|
},
|
|
true,
|
|
},
|
|
}
|
|
|
|
for _, tc := range testCases {
|
|
err := tc.params.Validate()
|
|
|
|
if tc.expError {
|
|
require.Error(t, err, tc.name)
|
|
} else {
|
|
require.NoError(t, err, tc.name)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestParamsValidatePriv(t *testing.T) {
|
|
require.Error(t, validateEVMDenom(false))
|
|
}
|
|
|
|
func TestParams_String(t *testing.T) {
|
|
require.Equal(t, "evm_denom: aphoton\n", DefaultParams().String())
|
|
}
|