/
msgs.go
216 lines (174 loc) · 5.78 KB
/
msgs.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
var (
_ sdk.Msg = &MsgLiquidStake{}
_ sdk.Msg = &MsgLiquidUnstake{}
_ sdk.Msg = &MsgRedeem{}
_ sdk.Msg = &MsgClaim{}
_ sdk.Msg = &MsgRecreateICA{}
_ sdk.Msg = &MsgJumpStart{}
_ sdk.Msg = &MsgChangeModuleState{}
_ sdk.Msg = &MsgReportSlashing{}
)
// Route should return the name of the module
func (m *MsgLiquidStake) Route() string { return RouterKey }
// Type should return the action
func (m *MsgLiquidStake) Type() string { return MsgTypeLiquidStake }
// ValidateBasic performs stateless checks
func (m *MsgLiquidStake) ValidateBasic() error {
return nil
}
// GetSignBytes encodes the message for signing
func (m *MsgLiquidStake) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(m))
}
// GetSigners defines whose signature is required
func (m *MsgLiquidStake) GetSigners() []sdk.AccAddress {
acc, err := sdk.AccAddressFromBech32(m.DelegatorAddress)
if err != nil {
panic(err)
}
return []sdk.AccAddress{acc}
}
// Route should return the name of the module
func (m *MsgLiquidUnstake) Route() string { return RouterKey }
// Type should return the action
func (m *MsgLiquidUnstake) Type() string { return MsgTypeLiquidUnstake }
// ValidateBasic performs stateless checks
func (m *MsgLiquidUnstake) ValidateBasic() error {
return nil
}
// GetSignBytes encodes the message for signing
func (m *MsgLiquidUnstake) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(m))
}
// GetSigners defines whose signature is required
func (m *MsgLiquidUnstake) GetSigners() []sdk.AccAddress {
acc, err := sdk.AccAddressFromBech32(m.DelegatorAddress)
if err != nil {
panic(err)
}
return []sdk.AccAddress{acc}
}
// Route should return the name of the module
func (m *MsgRedeem) Route() string { return RouterKey }
// Type should return the action
func (m *MsgRedeem) Type() string { return MsgTypeRedeem }
// ValidateBasic performs stateless checks
func (m *MsgRedeem) ValidateBasic() error {
return nil
}
// GetSignBytes encodes the message for signing
func (m *MsgRedeem) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(m))
}
// GetSigners defines whose signature is required
func (m *MsgRedeem) GetSigners() []sdk.AccAddress {
acc, err := sdk.AccAddressFromBech32(m.DelegatorAddress)
if err != nil {
panic(err)
}
return []sdk.AccAddress{acc}
}
// Route should return the name of the module
func (m *MsgClaim) Route() string { return RouterKey }
// Type should return the action
func (m *MsgClaim) Type() string { return MsgTypeClaim }
// ValidateBasic performs stateless checks
func (m *MsgClaim) ValidateBasic() error {
return nil
}
// GetSignBytes encodes the message for signing
func (m *MsgClaim) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(m))
}
// GetSigners defines whose signature is required
func (m *MsgClaim) GetSigners() []sdk.AccAddress {
acc, err := sdk.AccAddressFromBech32(m.DelegatorAddress)
if err != nil {
panic(err)
}
return []sdk.AccAddress{acc}
}
// Route should return the name of the module
func (m *MsgRecreateICA) Route() string { return RouterKey }
// Type should return the action
func (m *MsgRecreateICA) Type() string { return MsgTypeRecreateICA }
// ValidateBasic performs stateless checks
func (m *MsgRecreateICA) ValidateBasic() error {
return nil
}
// GetSignBytes encodes the message for signing
func (m *MsgRecreateICA) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(m))
}
// GetSigners defines whose signature is required
func (m *MsgRecreateICA) GetSigners() []sdk.AccAddress {
acc, err := sdk.AccAddressFromBech32(m.FromAddress)
if err != nil {
panic(err)
}
return []sdk.AccAddress{acc}
}
// Route should return the name of the module
func (m *MsgJumpStart) Route() string { return RouterKey }
// Type should return the action
func (m *MsgJumpStart) Type() string { return MsgTypeJumpStart }
// ValidateBasic performs stateless checks
func (m *MsgJumpStart) ValidateBasic() error {
return nil
}
// GetSignBytes encodes the message for signing
func (m *MsgJumpStart) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(m))
}
// GetSigners defines whose signature is required
func (m *MsgJumpStart) GetSigners() []sdk.AccAddress {
acc, err := sdk.AccAddressFromBech32(m.PstakeAddress)
if err != nil {
panic(err)
}
return []sdk.AccAddress{acc}
}
// Route should return the name of the module
func (m *MsgChangeModuleState) Route() string { return RouterKey }
// Type should return the action
func (m *MsgChangeModuleState) Type() string { return MsgTypeChangeModuleState }
// ValidateBasic performs stateless checks
func (m *MsgChangeModuleState) ValidateBasic() error {
return nil
}
// GetSignBytes encodes the message for signing
func (m *MsgChangeModuleState) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(m))
}
// GetSigners defines whose signature is required
func (m *MsgChangeModuleState) GetSigners() []sdk.AccAddress {
acc, err := sdk.AccAddressFromBech32(m.PstakeAddress)
if err != nil {
panic(err)
}
return []sdk.AccAddress{acc}
}
// Route should return the name of the module
func (m *MsgReportSlashing) Route() string { return RouterKey }
// Type should return the action
func (m *MsgReportSlashing) Type() string { return MsgTypeReportSlashing }
// ValidateBasic performs stateless checks
func (m *MsgReportSlashing) ValidateBasic() error {
return nil
}
// GetSignBytes encodes the message for signing
func (m *MsgReportSlashing) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(m))
}
// GetSigners defines whose signature is required
func (m *MsgReportSlashing) GetSigners() []sdk.AccAddress {
acc, err := sdk.AccAddressFromBech32(m.PstakeAddress)
if err != nil {
panic(err)
}
return []sdk.AccAddress{acc}
}