From 6bd36c8719da8c62791911b8af0a374e2ac44c7c Mon Sep 17 00:00:00 2001 From: Alexander Bezobchuk Date: Tue, 14 Jul 2020 11:55:19 -0400 Subject: [PATCH] Merge PR #6702: x/slashing: In-Process CLI Integration Tests --- proto/cosmos/gov/gov.proto | 20 +-- proto/cosmos/slashing/slashing.proto | 53 ++++--- x/distribution/types/query.pb.go | 2 +- x/slashing/client/cli/cli_test.go | 214 ++++++++++++++++++++++++--- x/slashing/client/cli/query.go | 32 ++-- x/slashing/client/cli/tx.go | 15 +- x/slashing/module.go | 8 +- x/slashing/types/slashing.pb.go | 103 +++++++------ 8 files changed, 316 insertions(+), 131 deletions(-) diff --git a/proto/cosmos/gov/gov.proto b/proto/cosmos/gov/gov.proto index afc599e11f..165e283c8b 100644 --- a/proto/cosmos/gov/gov.proto +++ b/proto/cosmos/gov/gov.proto @@ -17,7 +17,7 @@ option (gogoproto.goproto_getters_all) = false; message MsgSubmitProposal { option (gogoproto.equal) = true; - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; repeated cosmos.Coin initial_deposit = 2 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", @@ -31,9 +31,9 @@ message MsgVote { option (gogoproto.equal) = true; uint64 proposal_id = 1 [ + (gogoproto.jsontag) = "proposal_id", (gogoproto.customname) = "ProposalID", - (gogoproto.moretags) = "yaml:\"proposal_id\"", - (gogoproto.jsontag) = "proposal_id" + (gogoproto.moretags) = "yaml:\"proposal_id\"" ]; bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; VoteOption option = 3; @@ -44,11 +44,11 @@ message MsgDeposit { option (gogoproto.equal) = true; uint64 proposal_id = 1 [ + (gogoproto.jsontag) = "proposal_id", (gogoproto.customname) = "ProposalID", - (gogoproto.moretags) = "yaml:\"proposal_id\"", - (gogoproto.jsontag) = "proposal_id" + (gogoproto.moretags) = "yaml:\"proposal_id\"" ]; - bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; repeated cosmos.Coin amount = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } @@ -94,13 +94,13 @@ message Deposit { // Proposal defines the core field members of a governance proposal message Proposal { - option (gogoproto.equal) = true; + option (gogoproto.equal) = true; uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID", (gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; - google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; - ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; - TallyResult final_tally_result = 4 + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; + ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; + TallyResult final_tally_result = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""]; google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"submit_time\""]; diff --git a/proto/cosmos/slashing/slashing.proto b/proto/cosmos/slashing/slashing.proto index f5ad699eb6..c6ef3bc4be 100644 --- a/proto/cosmos/slashing/slashing.proto +++ b/proto/cosmos/slashing/slashing.proto @@ -23,19 +23,15 @@ message ValidatorSigningInfo { option (gogoproto.goproto_stringer) = false; bytes address = 1 [ - (gogoproto.casttype) = - "github.com/cosmos/cosmos-sdk/types.ConsAddress" // validator consensus address + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress" // validator consensus address ]; // height at which validator was first a candidate OR was unjailed int64 start_height = 2 [(gogoproto.moretags) = "yaml:\"start_height\""]; // index offset into signed block bit array int64 index_offset = 3 [(gogoproto.moretags) = "yaml:\"index_offset\""]; // timestamp validator cannot be unjailed until - google.protobuf.Timestamp jailed_until = 4 [ - (gogoproto.moretags) = "yaml:\"jailed_until\"", - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false - ]; + google.protobuf.Timestamp jailed_until = 4 + [(gogoproto.moretags) = "yaml:\"jailed_until\"", (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; // whether or not a validator has been tombstoned (killed out of validator set) bool tombstoned = 5; // missed blocks counter (to avoid scanning the array every time) @@ -43,23 +39,26 @@ message ValidatorSigningInfo { } // Params - used for initializing default parameter for slashing at genesis -message Params{ - int64 signed_blocks_window = 1 [(gogoproto.jsontag) = "json:\"signed_blocks_window\"", - (gogoproto.moretags) = "yaml:\"signed_blocks_window\""]; - bytes min_signed_per_window = 2 [(gogoproto.jsontag) = "json:\"min_signed_per_window\"", - (gogoproto.moretags) = "yaml:\"min_signed_per_window\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false]; - google.protobuf.Duration downtime_jail_duration = 3 [(gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "json:\"downtime_jail_duration\"", - (gogoproto.moretags) = "yaml:\"downtime_jail_duration\""]; - bytes slash_fraction_double_sign = 4 [(gogoproto.jsontag) = "json:\"slash_fraction_double_sign\"", - (gogoproto.moretags) = "yaml:\"slash_fraction_double_sign\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false]; - bytes slash_fraction_downtime = 5 [(gogoproto.jsontag) = "json:\"slash_fraction_downtime\"", - (gogoproto.moretags) = "yaml:\"slash_fraction_downtime\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false]; -} \ No newline at end of file +message Params { + int64 signed_blocks_window = 1 [(gogoproto.moretags) = "yaml:\"signed_blocks_window\""]; + bytes min_signed_per_window = 2 [ + (gogoproto.moretags) = "yaml:\"min_signed_per_window\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + google.protobuf.Duration downtime_jail_duration = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"downtime_jail_duration\"" + ]; + bytes slash_fraction_double_sign = 4 [ + (gogoproto.moretags) = "yaml:\"slash_fraction_double_sign\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + bytes slash_fraction_downtime = 5 [ + (gogoproto.moretags) = "yaml:\"slash_fraction_downtime\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} diff --git a/x/distribution/types/query.pb.go b/x/distribution/types/query.pb.go index 308572a1ee..2726686e9f 100644 --- a/x/distribution/types/query.pb.go +++ b/x/distribution/types/query.pb.go @@ -7,10 +7,10 @@ import ( context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - grpc1 "github.com/gogo/protobuf/grpc" types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/slashing/client/cli/cli_test.go b/x/slashing/client/cli/cli_test.go index 9e0674f5a4..2e27bf7403 100644 --- a/x/slashing/client/cli/cli_test.go +++ b/x/slashing/client/cli/cli_test.go @@ -1,34 +1,208 @@ -// +build cli_test - package cli_test import ( + "context" + "fmt" + "strings" "testing" - "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + tmcli "github.com/tendermint/tendermint/libs/cli" - cli "github.com/cosmos/cosmos-sdk/tests/cli" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/testutil" + "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/slashing/client/testutil" + "github.com/cosmos/cosmos-sdk/x/slashing/client/cli" ) -func TestCLISlashingGetParams(t *testing.T) { - t.SkipNow() // TODO: Bring back once viper is refactored. - t.Parallel() - f := cli.InitFixtures(t) +type IntegrationTestSuite struct { + suite.Suite - // start simd server - proc := f.SDStart() - t.Cleanup(func() { proc.Stop(false) }) + cfg network.Config + network *network.Network +} - params := testutil.QuerySlashingParams(f) - require.Equal(t, int64(100), params.SignedBlocksWindow) - require.Equal(t, sdk.NewDecWithPrec(5, 1), params.MinSignedPerWindow) +// SetupSuite executes bootstrapping logic before all the tests, i.e. once before +// the entire suite, start executing. +func (s *IntegrationTestSuite) SetupSuite() { + s.T().Log("setting up integration test suite") - sinfo := testutil.QuerySigningInfo(f, f.SDTendermint("show-validator")) - require.Equal(t, int64(0), sinfo.StartHeight) - require.False(t, sinfo.Tombstoned) + cfg := network.DefaultConfig() + cfg.NumValidators = 1 - // Cleanup testing directories - f.Cleanup() + s.cfg = cfg + s.network = network.New(s.T(), cfg) + + _, err := s.network.WaitForHeight(1) + s.Require().NoError(err) +} + +// TearDownSuite performs cleanup logic after all the tests, i.e. once after the +// entire suite, has finished executing. +func (s *IntegrationTestSuite) TearDownSuite() { + s.T().Log("tearing down integration test suite") + s.network.Cleanup() +} + +func (s *IntegrationTestSuite) TestGetCmdQuerySigningInfo() { + val := s.network.Validators[0] + + valConsPubKey, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, val.PubKey) + s.Require().NoError(err) + + testCases := []struct { + name string + args []string + expectErr bool + expectedOutput string + }{ + {"invalid address", []string{"foo"}, true, ``}, + { + "valid address (default output)", + []string{ + valConsPubKey, + fmt.Sprintf("--%s=1", flags.FlagHeight), + }, + false, + fmt.Sprintf(`{"address":"%s","jailed_until":"1970-01-01T00:00:00Z"}`, sdk.ConsAddress(val.PubKey.Address())), + }, + { + "valid address (text output)", + []string{ + valConsPubKey, + fmt.Sprintf("--%s=text", tmcli.OutputFlag), + fmt.Sprintf("--%s=1", flags.FlagHeight), + }, + false, + fmt.Sprintf(`address: %s +jailed_until: "1970-01-01T00:00:00Z"`, sdk.ConsAddress(val.PubKey.Address())), + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.GetCmdQuerySigningInfo() + _, out := testutil.ApplyMockIO(cmd) + + clientCtx := val.ClientCtx.WithOutput(out) + + ctx := context.Background() + ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) + + out.Reset() + cmd.SetArgs(tc.args) + + err := cmd.ExecuteContext(ctx) + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) + } + }) + } +} + +func (s *IntegrationTestSuite) TestGetCmdQueryParams() { + val := s.network.Validators[0] + + testCases := []struct { + name string + args []string + expectedOutput string + }{ + { + "default output", + []string{}, + `{"signed_blocks_window":"100","min_signed_per_window":"0.500000000000000000","downtime_jail_duration":"600000000000","slash_fraction_double_sign":"0.050000000000000000","slash_fraction_downtime":"0.010000000000000000"}`, + }, + { + "text output", + []string{fmt.Sprintf("--%s=text", tmcli.OutputFlag)}, + `downtime_jail_duration: "600000000000" +min_signed_per_window: "0.500000000000000000" +signed_blocks_window: "100" +slash_fraction_double_sign: "0.050000000000000000" +slash_fraction_downtime: "0.010000000000000000"`, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.GetCmdQueryParams() + _, out := testutil.ApplyMockIO(cmd) + + clientCtx := val.ClientCtx.WithOutput(out) + + ctx := context.Background() + ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) + + out.Reset() + cmd.SetArgs(tc.args) + + s.Require().NoError(cmd.ExecuteContext(ctx)) + s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) + }) + } +} + +func (s *IntegrationTestSuite) TestNewUnjailTxCmd() { + val := s.network.Validators[0] + + testCases := []struct { + name string + args []string + expectErr bool + respType fmt.Stringer + expectedCode uint32 + }{ + { + "valid transaction", + []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), // sync mode as there are no funds yet + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + false, &sdk.TxResponse{}, 0, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.NewUnjailTxCmd() + _, out := testutil.ApplyMockIO(cmd) + + clientCtx := val.ClientCtx.WithOutput(out) + + ctx := context.Background() + ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) + + out.Reset() + cmd.SetArgs(tc.args) + + err := cmd.ExecuteContext(ctx) + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + s.Require().NoError(clientCtx.JSONMarshaler.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) + + txResp := tc.respType.(*sdk.TxResponse) + s.Require().Equal(tc.expectedCode, txResp.Code, out.String()) + } + }) + } +} + +func TestIntegrationTestSuite(t *testing.T) { + suite.Run(t, new(IntegrationTestSuite)) } diff --git a/x/slashing/client/cli/query.go b/x/slashing/client/cli/query.go index 4952ed37ef..0aaf060d6d 100644 --- a/x/slashing/client/cli/query.go +++ b/x/slashing/client/cli/query.go @@ -8,14 +8,13 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" ) // GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command { +func GetQueryCmd() *cobra.Command { // Group slashing queries under a subcommand slashingQueryCmd := &cobra.Command{ Use: types.ModuleName, @@ -26,8 +25,8 @@ func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command { } slashingQueryCmd.AddCommand( - GetCmdQuerySigningInfo(queryRoute, cdc), - GetCmdQueryParams(cdc), + GetCmdQuerySigningInfo(), + GetCmdQueryParams(), ) return slashingQueryCmd @@ -35,7 +34,7 @@ func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command { } // GetCmdQuerySigningInfo implements the command to query signing info. -func GetCmdQuerySigningInfo(storeName string, cdc *codec.Codec) *cobra.Command { +func GetCmdQuerySigningInfo() *cobra.Command { cmd := &cobra.Command{ Use: "signing-info [validator-conspub]", Short: "Query a validator's signing information", @@ -45,7 +44,11 @@ $ query slashing signing-info cosmosvalconspub1zcjduepqfhvwcmt7p06fvdge `), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.NewContext().WithCodec(cdc).WithJSONMarshaler(cdc) + clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx, err := client.ReadQueryCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } pk, err := sdk.GetPubKeyFromBech32(sdk.Bech32PubKeyTypeConsPub, args[0]) if err != nil { @@ -55,7 +58,7 @@ $ query slashing signing-info cosmosvalconspub1zcjduepqfhvwcmt7p06fvdge consAddr := sdk.ConsAddress(pk.Address()) key := types.ValidatorSigningInfoKey(consAddr) - res, _, err := clientCtx.QueryStore(key, storeName) + res, _, err := clientCtx.QueryStore(key, types.StoreKey) if err != nil { return err } @@ -80,7 +83,7 @@ $ query slashing signing-info cosmosvalconspub1zcjduepqfhvwcmt7p06fvdge } // GetCmdQueryParams implements a command to fetch slashing parameters. -func GetCmdQueryParams(cdc *codec.Codec) *cobra.Command { +func GetCmdQueryParams() *cobra.Command { cmd := &cobra.Command{ Use: "params", Short: "Query the current slashing parameters", @@ -90,16 +93,23 @@ func GetCmdQueryParams(cdc *codec.Codec) *cobra.Command { $ query slashing params `), RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.NewContext().WithCodec(cdc).WithJSONMarshaler(cdc) + clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx, err := client.ReadQueryCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } - route := fmt.Sprintf("custom/%s/parameters", types.QuerierRoute) + route := fmt.Sprintf("custom/%s/parameters", types.StoreKey) res, _, err := clientCtx.QueryWithData(route, nil) if err != nil { return err } var params types.Params - cdc.MustUnmarshalJSON(res, ¶ms) + if err := clientCtx.JSONMarshaler.UnmarshalJSON(res, ¶ms); err != nil { + return err + } + return clientCtx.PrintOutput(params) }, } diff --git a/x/slashing/client/cli/tx.go b/x/slashing/client/cli/tx.go index bc992b3049..842c5a508a 100644 --- a/x/slashing/client/cli/tx.go +++ b/x/slashing/client/cli/tx.go @@ -11,7 +11,7 @@ import ( ) // NewTxCmd returns a root CLI command handler for all x/slashing transaction commands. -func NewTxCmd(clientCtx client.Context) *cobra.Command { +func NewTxCmd() *cobra.Command { slashingTxCmd := &cobra.Command{ Use: types.ModuleName, Short: "Slashing transaction subcommands", @@ -20,11 +20,11 @@ func NewTxCmd(clientCtx client.Context) *cobra.Command { RunE: client.ValidateCmd, } - slashingTxCmd.AddCommand(NewUnjailTxCmd(clientCtx)) + slashingTxCmd.AddCommand(NewUnjailTxCmd()) return slashingTxCmd } -func NewUnjailTxCmd(clientCtx client.Context) *cobra.Command { +func NewUnjailTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: "unjail", Args: cobra.NoArgs, @@ -34,15 +34,20 @@ func NewUnjailTxCmd(clientCtx client.Context) *cobra.Command { $ tx slashing unjail --from mykey `, RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := clientCtx.InitWithInput(cmd.InOrStdin()) + clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx, err := client.ReadTxCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } valAddr := clientCtx.GetFromAddress() + msg := types.NewMsgUnjail(sdk.ValAddress(valAddr)) if err := msg.ValidateBasic(); err != nil { return err } - return tx.GenerateOrBroadcastTx(clientCtx, msg) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } diff --git a/x/slashing/module.go b/x/slashing/module.go index 66563f6dac..c9a86cf33b 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -70,13 +70,13 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout } // GetTxCmd returns the root tx command for the slashing module. -func (AppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { - return cli.NewTxCmd(clientCtx) +func (AppModuleBasic) GetTxCmd(_ client.Context) *cobra.Command { + return cli.NewTxCmd() } // GetQueryCmd returns no root query command for the slashing module. -func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { - return cli.GetQueryCmd(types.StoreKey, clientCtx.Codec) +func (AppModuleBasic) GetQueryCmd(_ client.Context) *cobra.Command { + return cli.GetQueryCmd() } //____________________________________________________________________________ diff --git a/x/slashing/types/slashing.pb.go b/x/slashing/types/slashing.pb.go index 784a6da3f3..93d5ed02b5 100644 --- a/x/slashing/types/slashing.pb.go +++ b/x/slashing/types/slashing.pb.go @@ -166,11 +166,11 @@ func (m *ValidatorSigningInfo) GetMissedBlocksCounter() int64 { // Params - used for initializing default parameter for slashing at genesis type Params struct { - SignedBlocksWindow int64 `protobuf:"varint,1,opt,name=signed_blocks_window,json=signedBlocksWindow,proto3" json:"json:\"signed_blocks_window\"" yaml:"signed_blocks_window"` - MinSignedPerWindow github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=min_signed_per_window,json=minSignedPerWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"json:\"min_signed_per_window\"" yaml:"min_signed_per_window"` - DowntimeJailDuration time.Duration `protobuf:"bytes,3,opt,name=downtime_jail_duration,json=downtimeJailDuration,proto3,stdduration" json:"json:\"downtime_jail_duration\"" yaml:"downtime_jail_duration"` - SlashFractionDoubleSign github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=slash_fraction_double_sign,json=slashFractionDoubleSign,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"json:\"slash_fraction_double_sign\"" yaml:"slash_fraction_double_sign"` - SlashFractionDowntime github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=slash_fraction_downtime,json=slashFractionDowntime,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"json:\"slash_fraction_downtime\"" yaml:"slash_fraction_downtime"` + SignedBlocksWindow int64 `protobuf:"varint,1,opt,name=signed_blocks_window,json=signedBlocksWindow,proto3" json:"signed_blocks_window,omitempty" yaml:"signed_blocks_window"` + MinSignedPerWindow github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=min_signed_per_window,json=minSignedPerWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_signed_per_window" yaml:"min_signed_per_window"` + DowntimeJailDuration time.Duration `protobuf:"bytes,3,opt,name=downtime_jail_duration,json=downtimeJailDuration,proto3,stdduration" json:"downtime_jail_duration" yaml:"downtime_jail_duration"` + SlashFractionDoubleSign github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=slash_fraction_double_sign,json=slashFractionDoubleSign,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction_double_sign" yaml:"slash_fraction_double_sign"` + SlashFractionDowntime github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=slash_fraction_downtime,json=slashFractionDowntime,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction_downtime" yaml:"slash_fraction_downtime"` } func (m *Params) Reset() { *m = Params{} } @@ -229,54 +229,51 @@ func init() { func init() { proto.RegisterFile("cosmos/slashing/slashing.proto", fileDescriptor_3d04e6c6c2071212) } var fileDescriptor_3d04e6c6c2071212 = []byte{ - // 738 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x3d, 0x4f, 0xdb, 0x5a, - 0x18, 0xce, 0x21, 0xf7, 0xe6, 0x72, 0x9d, 0x5c, 0xae, 0x64, 0x42, 0x49, 0x03, 0xf8, 0x04, 0x0f, - 0x55, 0x16, 0x1c, 0x89, 0x6e, 0x19, 0x2a, 0xd5, 0xa0, 0xaa, 0xa5, 0x5f, 0xc8, 0x7c, 0x54, 0xea, - 0x50, 0xcb, 0x89, 0x1d, 0xe7, 0x80, 0x7d, 0x4e, 0xe4, 0x73, 0x52, 0x60, 0xed, 0x2f, 0x60, 0x44, - 0xea, 0x02, 0x5b, 0xd5, 0xbd, 0x5b, 0x7f, 0x00, 0x23, 0x63, 0xd5, 0xc1, 0xad, 0xc2, 0x52, 0x65, - 0xcc, 0xc8, 0x54, 0x9d, 0x73, 0x6c, 0x88, 0x20, 0xa9, 0x60, 0x8a, 0xdf, 0xe7, 0x79, 0x3f, 0x9e, - 0xf7, 0xc3, 0x8e, 0xa2, 0x35, 0x09, 0x0d, 0x09, 0xad, 0xd1, 0xc0, 0xa1, 0x6d, 0x84, 0xfd, 0xcb, - 0x07, 0xa3, 0x13, 0x11, 0x46, 0xd4, 0xff, 0x25, 0x6f, 0xa4, 0x70, 0xb9, 0xe8, 0x13, 0x9f, 0x08, - 0xae, 0xc6, 0x9f, 0xa4, 0x5b, 0x59, 0xf3, 0x09, 0xf1, 0x03, 0xaf, 0x26, 0xac, 0x46, 0xb7, 0x55, - 0x73, 0xbb, 0x91, 0xc3, 0x10, 0xc1, 0x09, 0x0f, 0xaf, 0xf3, 0x0c, 0x85, 0x1e, 0x65, 0x4e, 0xd8, - 0x91, 0x0e, 0xfa, 0x07, 0xa0, 0xfc, 0xfb, 0x92, 0xfa, 0x5b, 0x78, 0xc7, 0x41, 0x81, 0xda, 0x55, - 0xa6, 0xde, 0x3b, 0x01, 0x72, 0x1d, 0x46, 0x22, 0xdb, 0x71, 0xdd, 0xa8, 0x04, 0x2a, 0xa0, 0x5a, - 0x30, 0x5f, 0xf5, 0x63, 0xf8, 0x0f, 0xb7, 0x3d, 0x4a, 0x07, 0x31, 0x9c, 0x3a, 0x70, 0xc2, 0xa0, - 0xae, 0x27, 0x80, 0x7e, 0x11, 0xc3, 0x25, 0x1f, 0xb1, 0x76, 0xb7, 0x61, 0x34, 0x49, 0x58, 0x4b, - 0x3a, 0x93, 0x3f, 0x4b, 0xd4, 0xdd, 0xad, 0xb1, 0x83, 0x8e, 0x47, 0x8d, 0x6d, 0x27, 0x78, 0x2c, - 0x23, 0xac, 0xff, 0x2e, 0xab, 0x70, 0x44, 0xff, 0x9a, 0x55, 0x8a, 0xdb, 0x29, 0xb2, 0x81, 0x7c, - 0x8c, 0xb0, 0xff, 0x0c, 0xb7, 0x88, 0xfa, 0x42, 0x49, 0xab, 0x26, 0x42, 0x96, 0x2f, 0x62, 0x68, - 0xdc, 0xa2, 0xd6, 0x0a, 0xc1, 0x34, 0x2d, 0x96, 0xa6, 0x50, 0xeb, 0x4a, 0x81, 0x32, 0x27, 0x62, - 0x76, 0xdb, 0x43, 0x7e, 0x9b, 0x95, 0x26, 0x2a, 0xa0, 0x9a, 0x35, 0x67, 0x07, 0x31, 0x9c, 0x96, - 0x0d, 0x0d, 0xb3, 0xba, 0x95, 0x17, 0xe6, 0x53, 0x61, 0xf1, 0x58, 0x84, 0x5d, 0x6f, 0xdf, 0x26, - 0xad, 0x16, 0xf5, 0x58, 0x29, 0x7b, 0x3d, 0x76, 0x98, 0xd5, 0xad, 0xbc, 0x30, 0x5f, 0x0b, 0x4b, - 0x7d, 0xa7, 0x14, 0xf8, 0x74, 0x3d, 0xd7, 0xee, 0x62, 0x86, 0x82, 0xd2, 0x5f, 0x15, 0x50, 0xcd, - 0x2f, 0x97, 0x0d, 0xb9, 0x1b, 0x23, 0xdd, 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1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x65, 0xdc, 0x1c, 0x45, 0x06, - 0x00, 0x00, + // 693 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xbd, 0x6f, 0xd3, 0x4e, + 0x18, 0xce, 0x35, 0xfd, 0xf5, 0x57, 0x2e, 0xa1, 0x48, 0x6e, 0x4a, 0x43, 0x00, 0x5f, 0xf0, 0x80, + 0xc2, 0x50, 0x47, 0x2a, 0x5b, 0x37, 0xdc, 0x0a, 0xf1, 0x4d, 0x71, 0x3f, 0x90, 0x18, 0xb0, 0x9c, + 0xf8, 0xe2, 0x1c, 0xb5, 0xef, 0x22, 0xdf, 0x99, 0xb6, 0x6c, 0x30, 0x31, 0x76, 0xec, 0xd8, 0x91, + 0x3f, 0x82, 0x3f, 0xa0, 0x63, 0x47, 0xc4, 0x60, 0x50, 0xba, 0x20, 0xc6, 0x6c, 0x74, 0x42, 0xbe, + 0xb3, 0xdb, 0xa8, 0x4d, 0x51, 0x3b, 0xd9, 0xef, 0xf3, 0xbc, 0x5f, 0xf7, 0x3e, 0xef, 0x1d, 0xd4, + 0xdb, 0x8c, 0x87, 0x8c, 0x37, 0x79, 0xe0, 0xf2, 0x2e, 0xa1, 0xfe, 0xf1, 0x8f, 0xd9, 0x8b, 0x98, + 0x60, 0xda, 0x35, 0xc5, 0x9b, 0x39, 0x5c, 0xab, 0xf8, 0xcc, 0x67, 0x92, 0x6b, 0xa6, 0x7f, 0xca, + 0xad, 0xa6, 0xfb, 0x8c, 0xf9, 0x01, 0x6e, 0x4a, 0xab, 0x15, 0x77, 0x9a, 0x5e, 0x1c, 0xb9, 0x82, + 0x30, 0x9a, 0xf1, 0xe8, 0x34, 0x2f, 0x48, 0x88, 0xb9, 0x70, 0xc3, 0x9e, 0x72, 0x30, 0x3e, 0x01, + 0x78, 0xe5, 0x39, 0xf7, 0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0x7b, + 0x6c, 0x93, 0xa6, 0x97, 0xc7, 0x49, 0x27, 0xef, 0xe4, 0xd7, 0x4c, 0xee, 0x41, 0x69, 0xfe, 0xc6, + 0x19, 0x2d, 0x97, 0x32, 0x07, 0xeb, 0x5e, 0x26, 0xe5, 0x6d, 0x55, 0x74, 0x74, 0x1a, 0x63, 0x37, + 0x15, 0xb5, 0x92, 0x93, 0x4f, 0x5c, 0x12, 0xe4, 0x09, 0xb4, 0x1d, 0x00, 0x6b, 0xf2, 0x15, 0x70, + 0x3a, 0x91, 0xdb, 0x4e, 0x21, 0xc7, 0x63, 0x71, 0x2b, 0xc0, 0xb2, 0x79, 0xb9, 0x4c, 0x65, 0x6b, + 0xe5, 0xd2, 0x43, 0xb8, 0x93, 0xe9, 0x70, 0x6e, 0x66, 0xc3, 0x9e, 0x95, 0xe4, 0xc3, 0x8c, 0x5b, + 0x92, 0x54, 0x3a, 0x19, 0xed, 0x33, 0x80, 0xb3, 0x67, 0x02, 0x55, 0xeb, 0x72, 0xfd, 0xca, 0xd6, + 0xf2, 0xa5, 0xfb, 0xd1, 0xcf, 0xe9, 0x47, 0xa5, 0x35, 0xec, 0x99, 0x53, 0xcd, 0x28, 0xdc, 0x7a, + 0xfa, 0xa5, 0xaf, 0x83, 0xfd, 0xbe, 0x0e, 0x0e, 0xfa, 0x3a, 0xf8, 0xd9, 0xd7, 0xc1, 0xce, 0xa1, + 0x5e, 0x38, 0x38, 0xd4, 0x0b, 0xdf, 0x0e, 0xf5, 0xc2, 0x9b, 0x7f, 0x3f, 0x4b, 0x5b, 0x27, 0xaf, + 0xaf, 0xec, 0xa4, 0x35, 0x21, 0xe5, 0xbb, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x37, 0x9f, + 0x23, 0x9d, 0x05, 0x00, 0x00, } func (this *MsgUnjail) Equal(that interface{}) bool {