x/Slashing: gRPC query service (#6597)
* Add grpc methods - slashing * Add slashing grpc queries * Add tests * Remove duplicate declarations * Add signing infos * Update query test * Use suite for grpc tests * Update godoc Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
3c76084bf5
commit
a0daec2d94
|
@ -0,0 +1,52 @@
|
|||
syntax = "proto3";
|
||||
package cosmos.slashing;
|
||||
|
||||
import "cosmos/query/pagination.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/slashing/slashing.proto";
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types";
|
||||
|
||||
// Query provides defines the gRPC querier service
|
||||
service Query {
|
||||
// Params queries the parameters of slashing module
|
||||
rpc Params (QueryParamsRequest) returns (QueryParamsResponse){}
|
||||
|
||||
// SigningInfo queries the signing info of given cons address
|
||||
rpc SigningInfo (QuerySigningInfoRequest) returns (QuerySigningInfoResponse) {}
|
||||
|
||||
// SigningInfos queries signing info of all validators
|
||||
rpc SigningInfos (QuerySigningInfosRequest) returns (QuerySigningInfosResponse) {}
|
||||
}
|
||||
|
||||
// QueryParamsRequest is the request type for the Query/Parameters RPC method
|
||||
message QueryParamsRequest{}
|
||||
|
||||
// QueryParamsResponse is the response type for the Query/Parameters RPC method
|
||||
message QueryParamsResponse{
|
||||
cosmos.slashing.Params params = 1[(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC method
|
||||
message QuerySigningInfoRequest{
|
||||
// cons_address is the address to query signing info of
|
||||
bytes cons_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"];
|
||||
}
|
||||
|
||||
// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC method
|
||||
message QuerySigningInfoResponse{
|
||||
// val_signing_info is the signing info of requested val cons address
|
||||
cosmos.slashing.ValidatorSigningInfo val_signing_info = 1[(gogoproto.nullable)= false];
|
||||
}
|
||||
|
||||
// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC method
|
||||
message QuerySigningInfosRequest{
|
||||
cosmos.query.PageRequest req = 1;
|
||||
}
|
||||
|
||||
// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC method
|
||||
message QuerySigningInfosResponse{
|
||||
// info is the signing info of all validators
|
||||
repeated cosmos.slashing.ValidatorSigningInfo info = 1[(gogoproto.nullable)= false];
|
||||
cosmos.query.PageResponse res =2;
|
||||
}
|
|
@ -5,6 +5,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types";
|
|||
option (gogoproto.equal_all) = true;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// MsgUnjail - struct for unjailing jailed validator
|
||||
|
@ -40,3 +41,25 @@ message ValidatorSigningInfo {
|
|||
// missed blocks counter (to avoid scanning the array every time)
|
||||
int64 missed_blocks_counter = 6 [(gogoproto.moretags) = "yaml:\"missed_blocks_counter\""];
|
||||
}
|
||||
|
||||
// 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];
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/store/prefix"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/query"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
var _ types.QueryServer = Keeper{}
|
||||
|
||||
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
|
||||
if req == nil {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "empty request")
|
||||
}
|
||||
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
params := k.GetParams(ctx)
|
||||
|
||||
return &types.QueryParamsResponse{Params: params}, nil
|
||||
}
|
||||
|
||||
func (k Keeper) SigningInfo(c context.Context, req *types.QuerySigningInfoRequest) (*types.QuerySigningInfoResponse, error) {
|
||||
if req == nil {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "empty request")
|
||||
}
|
||||
|
||||
if req.ConsAddress == nil {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "invalid request")
|
||||
}
|
||||
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
signingInfo, found := k.GetValidatorSigningInfo(ctx, req.ConsAddress)
|
||||
if !found {
|
||||
return nil, status.Errorf(codes.NotFound, "SigningInfo not found for validator %s", req.ConsAddress)
|
||||
}
|
||||
|
||||
return &types.QuerySigningInfoResponse{ValSigningInfo: signingInfo}, nil
|
||||
}
|
||||
|
||||
func (k Keeper) SigningInfos(c context.Context, req *types.QuerySigningInfosRequest) (*types.QuerySigningInfosResponse, error) {
|
||||
if req == nil {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "empty request")
|
||||
}
|
||||
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
var signInfos []types.ValidatorSigningInfo
|
||||
|
||||
sigInfoStore := prefix.NewStore(store, types.ValidatorSigningInfoKeyPrefix)
|
||||
res, err := query.Paginate(sigInfoStore, req.Req, func(key []byte, value []byte) error {
|
||||
var info types.ValidatorSigningInfo
|
||||
err := k.cdc.UnmarshalBinaryBare(value, &info)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
signInfos = append(signInfos, info)
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &types.QuerySigningInfosResponse{Info: signInfos, Res: res}, nil
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
package keeper_test
|
||||
|
||||
import (
|
||||
gocontext "context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/query"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
type SlashingTestSuite struct {
|
||||
suite.Suite
|
||||
|
||||
app *simapp.SimApp
|
||||
ctx sdk.Context
|
||||
queryClient types.QueryClient
|
||||
addrDels []sdk.AccAddress
|
||||
}
|
||||
|
||||
func (suite *SlashingTestSuite) SetupTest() {
|
||||
app := simapp.Setup(false)
|
||||
ctx := app.BaseApp.NewContext(false, abci.Header{})
|
||||
|
||||
app.AccountKeeper.SetParams(ctx, authtypes.DefaultParams())
|
||||
app.BankKeeper.SetSendEnabled(ctx, true)
|
||||
app.SlashingKeeper.SetParams(ctx, keeper.TestParams())
|
||||
|
||||
addrDels := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.TokensFromConsensusPower(200))
|
||||
|
||||
info1 := types.NewValidatorSigningInfo(sdk.ConsAddress(addrDels[0]), int64(4), int64(3),
|
||||
time.Unix(2, 0), false, int64(10))
|
||||
info2 := types.NewValidatorSigningInfo(sdk.ConsAddress(addrDels[1]), int64(5), int64(4),
|
||||
time.Unix(2, 0), false, int64(10))
|
||||
|
||||
app.SlashingKeeper.SetValidatorSigningInfo(ctx, sdk.ConsAddress(addrDels[0]), info1)
|
||||
app.SlashingKeeper.SetValidatorSigningInfo(ctx, sdk.ConsAddress(addrDels[1]), info2)
|
||||
|
||||
suite.app = app
|
||||
suite.ctx = ctx
|
||||
suite.addrDels = addrDels
|
||||
|
||||
queryHelper := baseapp.NewQueryServerTestHelper(ctx, app.InterfaceRegistry())
|
||||
types.RegisterQueryServer(queryHelper, app.SlashingKeeper)
|
||||
queryClient := types.NewQueryClient(queryHelper)
|
||||
suite.queryClient = queryClient
|
||||
}
|
||||
|
||||
func (suite *SlashingTestSuite) TestGRPCQueryParams() {
|
||||
queryClient := suite.queryClient
|
||||
paramsResp, err := queryClient.Params(gocontext.Background(), &types.QueryParamsRequest{})
|
||||
|
||||
suite.NoError(err)
|
||||
suite.Equal(keeper.TestParams(), paramsResp.Params)
|
||||
}
|
||||
|
||||
func (suite *SlashingTestSuite) TestGRPCSigningInfo() {
|
||||
queryClient := suite.queryClient
|
||||
|
||||
infoResp, err := queryClient.SigningInfo(gocontext.Background(), &types.QuerySigningInfoRequest{ConsAddress: nil})
|
||||
suite.Error(err)
|
||||
suite.Nil(infoResp)
|
||||
|
||||
consAddr := sdk.ConsAddress(suite.addrDels[0])
|
||||
info, found := suite.app.SlashingKeeper.GetValidatorSigningInfo(suite.ctx, consAddr)
|
||||
suite.True(found)
|
||||
|
||||
infoResp, err = queryClient.SigningInfo(gocontext.Background(),
|
||||
&types.QuerySigningInfoRequest{ConsAddress: consAddr})
|
||||
suite.NoError(err)
|
||||
suite.Equal(info, infoResp.ValSigningInfo)
|
||||
}
|
||||
|
||||
func (suite *SlashingTestSuite) TestGRPCSigningInfos() {
|
||||
queryClient := suite.queryClient
|
||||
|
||||
var signingInfos []types.ValidatorSigningInfo
|
||||
|
||||
suite.app.SlashingKeeper.IterateValidatorSigningInfos(suite.ctx, func(consAddr sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool) {
|
||||
signingInfos = append(signingInfos, info)
|
||||
return false
|
||||
})
|
||||
|
||||
// verify all values are returned without pagination
|
||||
var infoResp, err = queryClient.SigningInfos(gocontext.Background(),
|
||||
&types.QuerySigningInfosRequest{Req: nil})
|
||||
suite.NoError(err)
|
||||
suite.Equal(signingInfos, infoResp.Info)
|
||||
|
||||
infoResp, err = queryClient.SigningInfos(gocontext.Background(),
|
||||
&types.QuerySigningInfosRequest{Req: &query.PageRequest{Limit: 1, CountTotal: true}})
|
||||
suite.NoError(err)
|
||||
suite.Len(infoResp.Info, 1)
|
||||
suite.Equal(signingInfos[0], infoResp.Info[0])
|
||||
suite.NotNil(infoResp.Res.NextKey)
|
||||
suite.Equal(uint64(2), infoResp.Res.Total)
|
||||
}
|
||||
|
||||
func TestSlashingTestSuite(t *testing.T) {
|
||||
suite.Run(t, new(SlashingTestSuite))
|
||||
}
|
|
@ -34,15 +34,6 @@ func ParamKeyTable() paramtypes.KeyTable {
|
|||
return paramtypes.NewKeyTable().RegisterParamSet(&Params{})
|
||||
}
|
||||
|
||||
// Params - used for initializing default parameter for slashing at genesis
|
||||
type Params struct {
|
||||
SignedBlocksWindow int64 `json:"signed_blocks_window" yaml:"signed_blocks_window"`
|
||||
MinSignedPerWindow sdk.Dec `json:"min_signed_per_window" yaml:"min_signed_per_window"`
|
||||
DowntimeJailDuration time.Duration `json:"downtime_jail_duration" yaml:"downtime_jail_duration"`
|
||||
SlashFractionDoubleSign sdk.Dec `json:"slash_fraction_double_sign" yaml:"slash_fraction_double_sign"`
|
||||
SlashFractionDowntime sdk.Dec `json:"slash_fraction_downtime" yaml:"slash_fraction_downtime"`
|
||||
}
|
||||
|
||||
// NewParams creates a new Params object
|
||||
func NewParams(
|
||||
signedBlocksWindow int64, minSignedPerWindow sdk.Dec, downtimeJailDuration time.Duration,
|
||||
|
@ -58,19 +49,6 @@ func NewParams(
|
|||
}
|
||||
}
|
||||
|
||||
// String implements the stringer interface for Params
|
||||
func (p Params) String() string {
|
||||
return fmt.Sprintf(`Slashing Params:
|
||||
SignedBlocksWindow: %d
|
||||
MinSignedPerWindow: %s
|
||||
DowntimeJailDuration: %s
|
||||
SlashFractionDoubleSign: %s
|
||||
SlashFractionDowntime: %s`,
|
||||
p.SignedBlocksWindow, p.MinSignedPerWindow,
|
||||
p.DowntimeJailDuration, p.SlashFractionDoubleSign,
|
||||
p.SlashFractionDowntime)
|
||||
}
|
||||
|
||||
// ParamSetPairs - Implements params.ParamSet
|
||||
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
|
||||
return paramtypes.ParamSetPairs{
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,6 +10,7 @@ import (
|
|||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
|
||||
_ "github.com/golang/protobuf/ptypes/duration"
|
||||
_ "github.com/golang/protobuf/ptypes/timestamp"
|
||||
io "io"
|
||||
math "math"
|
||||
|
@ -163,45 +164,119 @@ func (m *ValidatorSigningInfo) GetMissedBlocksCounter() int64 {
|
|||
return 0
|
||||
}
|
||||
|
||||
// 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"`
|
||||
}
|
||||
|
||||
func (m *Params) Reset() { *m = Params{} }
|
||||
func (m *Params) String() string { return proto.CompactTextString(m) }
|
||||
func (*Params) ProtoMessage() {}
|
||||
func (*Params) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_3d04e6c6c2071212, []int{2}
|
||||
}
|
||||
func (m *Params) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Params.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *Params) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Params.Merge(m, src)
|
||||
}
|
||||
func (m *Params) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Params) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Params.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Params proto.InternalMessageInfo
|
||||
|
||||
func (m *Params) GetSignedBlocksWindow() int64 {
|
||||
if m != nil {
|
||||
return m.SignedBlocksWindow
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Params) GetDowntimeJailDuration() time.Duration {
|
||||
if m != nil {
|
||||
return m.DowntimeJailDuration
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgUnjail)(nil), "cosmos.slashing.MsgUnjail")
|
||||
proto.RegisterType((*ValidatorSigningInfo)(nil), "cosmos.slashing.ValidatorSigningInfo")
|
||||
proto.RegisterType((*Params)(nil), "cosmos.slashing.Params")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("cosmos/slashing/slashing.proto", fileDescriptor_3d04e6c6c2071212) }
|
||||
|
||||
var fileDescriptor_3d04e6c6c2071212 = []byte{
|
||||
// 476 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xbf, 0x6f, 0xd4, 0x30,
|
||||
0x14, 0xc7, 0xcf, 0x1c, 0x94, 0xe2, 0x3b, 0x8a, 0x94, 0x16, 0x11, 0x9d, 0x90, 0x1d, 0x65, 0xba,
|
||||
0xa5, 0x89, 0x54, 0xb6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
0xcd, 0xe5, 0xf8, 0x58, 0x25, 0x63, 0x59, 0x09, 0x4d, 0x4b, 0x77, 0xc3, 0x3c, 0xc2, 0x5b, 0xd6,
|
||||
0xf8, 0xb1, 0x35, 0xfa, 0x6b, 0x9a, 0x1f, 0x6f, 0x5b, 0x1e, 0x19, 0xbc, 0x6f, 0xe9, 0x68, 0xf3,
|
||||
0xf3, 0x39, 0xee, 0xfc, 0x3c, 0xc7, 0x20, 0x7a, 0xf1, 0x65, 0x8e, 0xc0, 0xc5, 0x1c, 0x81, 0xcb,
|
||||
0x39, 0x02, 0x3f, 0xe6, 0x08, 0x9c, 0x2d, 0x50, 0xe7, 0x72, 0x81, 0x3a, 0xdf, 0x16, 0xa8, 0xf3,
|
||||
0xee, 0xdf, 0xa3, 0x71, 0x72, 0x33, 0xe1, 0xa6, 0x73, 0xe9, 0x86, 0xf9, 0x8e, 0x27, 0xbf, 0x03,
|
||||
0x00, 0x00, 0xff, 0xff, 0xe3, 0x3b, 0x55, 0x14, 0x01, 0x03, 0x00, 0x00,
|
||||
// 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, 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 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, 0x8d, 0xb1, 0x99, 0xee, 0xc6, 0x84, 0xa7, 0x31, 0xcc,
|
||||
0x5c, 0xe5, 0x1e, 0x8e, 0xd6, 0x0f, 0x7f, 0x40, 0x60, 0xe5, 0x25, 0xb4, 0xc5, 0x11, 0x55, 0x53,
|
||||
0x14, 0x46, 0xc2, 0x06, 0x65, 0x04, 0x7b, 0x6e, 0xe9, 0xef, 0x0a, 0xa8, 0x4e, 0x5a, 0x43, 0x88,
|
||||
0xba, 0xa9, 0xcc, 0x84, 0x88, 0x52, 0xcf, 0xb5, 0x1b, 0x01, 0x69, 0xee, 0x52, 0xbb, 0x49, 0xba,
|
||||
0x98, 0x79, 0x51, 0x29, 0x27, 0x9a, 0xa8, 0x0c, 0x62, 0x38, 0x2f, 0x0b, 0x8d, 0x74, 0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x40, 0x29, 0x8b, 0xcf, 0x8c,
|
||||
0xdd, 0x8a, 0x9c, 0x26, 0x87, 0x6c, 0x97, 0x74, 0x1b, 0x81, 0x27, 0xda, 0x13, 0xd7, 0x5a, 0x30,
|
||||
0xf7, 0xef, 0x3c, 0xc6, 0xc5, 0x64, 0xd1, 0x63, 0x33, 0x73, 0xd1, 0x8b, 0xc9, 0xba, 0xc7, 0x3b,
|
||||
0x59, 0xb3, 0x82, 0x7c, 0x92, 0x70, 0xab, 0x82, 0xe2, 0x03, 0x56, 0x3f, 0x03, 0x65, 0xf6, 0x46,
|
||||
0xa0, 0xec, 0x4f, 0xbc, 0x04, 0x05, 0x33, 0xba, 0xb3, 0x68, 0x6d, 0x8c, 0x68, 0x99, 0x96, 0x2b,
|
||||
0xd6, 0xc6, 0x28, 0x4e, 0x3c, 0xac, 0x99, 0x6b, 0x72, 0x25, 0x6e, 0x3e, 0xff, 0xd4, 0xd3, 0xc0,
|
||||
0x69, 0x4f, 0x03, 0x67, 0x3d, 0x0d, 0xfc, 0xec, 0x69, 0xe0, 0xf0, 0x5c, 0xcb, 0x9c, 0x9d, 0x6b,
|
||||
0x99, 0x6f, 0xe7, 0x5a, 0xe6, 0xed, 0x9f, 0x3f, 0x9f, 0xfb, 0x57, 0xff, 0x12, 0x42, 0x6b, 0x23,
|
||||
0x27, 0xce, 0xe4, 0xe1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x65, 0xdc, 0x1c, 0x45, 0x06,
|
||||
0x00, 0x00,
|
||||
}
|
||||
|
||||
func (this *MsgUnjail) Equal(that interface{}) bool {
|
||||
|
@ -267,6 +342,42 @@ func (this *ValidatorSigningInfo) Equal(that interface{}) bool {
|
|||
}
|
||||
return true
|
||||
}
|
||||
func (this *Params) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
return this == nil
|
||||
}
|
||||
|
||||
that1, ok := that.(*Params)
|
||||
if !ok {
|
||||
that2, ok := that.(Params)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
return this == nil
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if this.SignedBlocksWindow != that1.SignedBlocksWindow {
|
||||
return false
|
||||
}
|
||||
if !this.MinSignedPerWindow.Equal(that1.MinSignedPerWindow) {
|
||||
return false
|
||||
}
|
||||
if this.DowntimeJailDuration != that1.DowntimeJailDuration {
|
||||
return false
|
||||
}
|
||||
if !this.SlashFractionDoubleSign.Equal(that1.SlashFractionDoubleSign) {
|
||||
return false
|
||||
}
|
||||
if !this.SlashFractionDowntime.Equal(that1.SlashFractionDowntime) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (m *MsgUnjail) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
|
@ -360,6 +471,72 @@ func (m *ValidatorSigningInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Params) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Params) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
{
|
||||
size := m.SlashFractionDowntime.Size()
|
||||
i -= size
|
||||
if _, err := m.SlashFractionDowntime.MarshalTo(dAtA[i:]); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i = encodeVarintSlashing(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
{
|
||||
size := m.SlashFractionDoubleSign.Size()
|
||||
i -= size
|
||||
if _, err := m.SlashFractionDoubleSign.MarshalTo(dAtA[i:]); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i = encodeVarintSlashing(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DowntimeJailDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DowntimeJailDuration):])
|
||||
if err2 != nil {
|
||||
return 0, err2
|
||||
}
|
||||
i -= n2
|
||||
i = encodeVarintSlashing(dAtA, i, uint64(n2))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
{
|
||||
size := m.MinSignedPerWindow.Size()
|
||||
i -= size
|
||||
if _, err := m.MinSignedPerWindow.MarshalTo(dAtA[i:]); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i = encodeVarintSlashing(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
if m.SignedBlocksWindow != 0 {
|
||||
i = encodeVarintSlashing(dAtA, i, uint64(m.SignedBlocksWindow))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintSlashing(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovSlashing(v)
|
||||
base := offset
|
||||
|
@ -411,6 +588,26 @@ func (m *ValidatorSigningInfo) Size() (n int) {
|
|||
return n
|
||||
}
|
||||
|
||||
func (m *Params) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.SignedBlocksWindow != 0 {
|
||||
n += 1 + sovSlashing(uint64(m.SignedBlocksWindow))
|
||||
}
|
||||
l = m.MinSignedPerWindow.Size()
|
||||
n += 1 + l + sovSlashing(uint64(l))
|
||||
l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.DowntimeJailDuration)
|
||||
n += 1 + l + sovSlashing(uint64(l))
|
||||
l = m.SlashFractionDoubleSign.Size()
|
||||
n += 1 + l + sovSlashing(uint64(l))
|
||||
l = m.SlashFractionDowntime.Size()
|
||||
n += 1 + l + sovSlashing(uint64(l))
|
||||
return n
|
||||
}
|
||||
|
||||
func sovSlashing(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
|
@ -701,6 +898,210 @@ func (m *ValidatorSigningInfo) Unmarshal(dAtA []byte) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Params) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSlashing
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Params: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field SignedBlocksWindow", wireType)
|
||||
}
|
||||
m.SignedBlocksWindow = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSlashing
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.SignedBlocksWindow |= int64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field MinSignedPerWindow", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSlashing
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthSlashing
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthSlashing
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.MinSignedPerWindow.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field DowntimeJailDuration", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSlashing
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthSlashing
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthSlashing
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.DowntimeJailDuration, dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field SlashFractionDoubleSign", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSlashing
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthSlashing
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthSlashing
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.SlashFractionDoubleSign.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field SlashFractionDowntime", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSlashing
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthSlashing
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthSlashing
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.SlashFractionDowntime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipSlashing(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthSlashing
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthSlashing
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipSlashing(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
|
Loading…
Reference in New Issue