-
Notifications
You must be signed in to change notification settings - Fork 5
/
msg.go
47 lines (39 loc) · 1.31 KB
/
msg.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package types
// import (
// sdk "github.com/cosmos/cosmos-sdk/types"
// sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
// )
// TODO: Describe your actions, these will implment the interface of `sdk.Msg`
/*
// verify interface at compile time
var _ sdk.Msg = &Msg<Action>{}
// Msg<Action> - struct for unjailing jailed validator
type Msg<Action> struct {
ValidatorAddr sdk.ValAddress `json:"address" yaml:"address"` // address of the validator operator
}
// NewMsg<Action> creates a new Msg<Action> instance
func NewMsg<Action>(validatorAddr sdk.ValAddress) Msg<Action> {
return Msg<Action>{
ValidatorAddr: validatorAddr,
}
}
const <action>Const = "<action>"
// nolint
func (msg Msg<Action>) Route() string { return RouterKey }
func (msg Msg<Action>) Type() string { return <action>Const }
func (msg Msg<Action>) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{sdk.AccAddress(msg.ValidatorAddr)}
}
// GetSignBytes gets the bytes for the message signer to sign on
func (msg Msg<Action>) GetSignBytes() []byte {
bz := ModuleCdc.MustMarshalJSON(msg)
return sdk.MustSortJSON(bz)
}
// ValidateBasic validity check for the AnteHandler
func (msg Msg<Action>) ValidateBasic() error {
if msg.ValidatorAddr.Empty() {
return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "missing validator address")
}
return nil
}
*/