-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regen Network/Slashing protobuf #5627
Changes from 53 commits
76757e0
a0eaa7a
0c6ca19
ab7fc9e
fbf33e8
e8617dc
3b7110b
89b5834
1cb8cc8
2909f11
c9ddfbd
d286da4
c601f08
af6b876
5fb7442
25f7f97
12111ae
af95b29
ba3ee92
d90bb3e
2ca862f
5395ce8
21b9cba
5a5fd73
bdd9368
525ad52
c6bb9ae
486e7a1
d035a18
5130ecd
bb6d8c8
3dac3b6
6d62019
ef7cb62
9ce0db2
ae47cb7
30673c0
1480c46
606dd29
07815e1
247af97
4628a98
24addfa
b111389
e870c7b
e3897cf
8fbc455
32aa41b
cd0b99d
fb1a0da
33bc104
750e613
53b45e0
5b9cc9f
ae52ace
28e2556
7e34c0c
e68f3f0
4360aee
04ff0b5
85b3a20
47c5fb5
65b5622
9e7b6ed
a836c0e
db992df
73271ff
e5f10e1
4c5e070
44559dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import ( | |
"github.com/cosmos/cosmos-sdk/x/auth/vesting" | ||
distr "github.com/cosmos/cosmos-sdk/x/distribution" | ||
"github.com/cosmos/cosmos-sdk/x/params" | ||
"github.com/cosmos/cosmos-sdk/x/slashing" | ||
"github.com/cosmos/cosmos-sdk/x/staking" | ||
) | ||
|
||
|
@@ -15,6 +16,7 @@ type AppCodec struct { | |
amino *codec.Codec | ||
|
||
Params *params.Codec | ||
Slashing *slashing.Codec | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do think we should have something more generic when modules don't actually do anything special with their codec. What do you think @alexanderbez ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file should be removed as the new design does not contain this struct. you can see here: https://github.com/cosmos/cosmos-sdk/blob/08502d6d98bff3872916f8b69cde2d255351d3fb/simapp/codec/codec.go |
||
Staking *staking.Codec | ||
Distribution *distr.Codec | ||
} | ||
|
@@ -26,6 +28,7 @@ func NewAppCodec() *AppCodec { | |
amino: amino, | ||
Params: params.NewCodec(amino), | ||
Staking: staking.NewCodec(amino), | ||
Slashing: slashing.NewCodec(amino), | ||
Distribution: distr.NewCodec(amino), | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ func handleMsgUnjail(ctx sdk.Context, msg MsgUnjail, k Keeper) (*sdk.Result, err | |
sdk.NewEvent( | ||
sdk.EventTypeMessage, | ||
sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), | ||
sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddr.String()), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert |
||
sdk.NewAttribute(sdk.AttributeKeySender, string(msg.ValidatorAddr)), | ||
), | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,7 @@ func querySigningInfos(ctx sdk.Context, req abci.RequestQuery, k Keeper) ([]byte | |
return false | ||
}) | ||
|
||
start, end := client.Paginate(len(signingInfos), params.Page, params.Limit, int(k.sk.MaxValidators(ctx))) | ||
start, end := client.Paginate(len(signingInfos), int(params.Page), int(params.Limit), int(k.sk.MaxValidators(ctx))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unnecessary conversion (from |
||
if start < 0 || end < 0 { | ||
signingInfos = []types.ValidatorSigningInfo{} | ||
} else { | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -9,12 +9,22 @@ func RegisterCodec(cdc *codec.Codec) { | |||||||
cdc.RegisterConcrete(MsgUnjail{}, "cosmos-sdk/MsgUnjail", nil) | ||||||||
} | ||||||||
|
||||||||
// ModuleCdc defines the module codec | ||||||||
var ModuleCdc *codec.Codec | ||||||||
type Codec struct { | ||||||||
codec.Marshaler | ||||||||
// Keep reference to the amino codec to allow backwards compatibility along | ||||||||
// with type, and interface registration. | ||||||||
|
||||||||
amino *codec.Codec | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
} | ||||||||
|
||||||||
func NewCodec(amino *codec.Codec) *Codec { | ||||||||
return &Codec{Marshaler: codec.NewHybridCodec(amino), amino: amino} | ||||||||
} | ||||||||
|
||||||||
var ModuleCdc *Codec | ||||||||
|
||||||||
func init() { | ||||||||
ModuleCdc = codec.New() | ||||||||
RegisterCodec(ModuleCdc) | ||||||||
codec.RegisterCrypto(ModuleCdc) | ||||||||
ModuleCdc.Seal() | ||||||||
ModuleCdc = NewCodec(codec.New()) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clean/remove comments |
||||||||
RegisterCodec(ModuleCdc.amino) | ||||||||
ModuleCdc.amino.Seal() | ||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,6 @@ import ( | |
// verify interface at compile time | ||
var _ sdk.Msg = &MsgUnjail{} | ||
|
||
// MsgUnjail - struct for unjailing jailed validator | ||
type MsgUnjail struct { | ||
ValidatorAddr sdk.ValAddress `json:"address" yaml:"address"` // address of the validator operator | ||
} | ||
|
||
// NewMsgUnjail creates a new MsgUnjail instance | ||
func NewMsgUnjail(validatorAddr sdk.ValAddress) MsgUnjail { | ||
return MsgUnjail{ | ||
|
@@ -37,5 +32,6 @@ func (msg MsgUnjail) ValidateBasic() error { | |
if msg.ValidatorAddr.Empty() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert |
||
return ErrBadValidatorAddr | ||
} | ||
|
||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this line added?