-
Notifications
You must be signed in to change notification settings - Fork 13
/
codec.go
28 lines (24 loc) · 1.32 KB
/
codec.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
package types
import (
"github.com/okx/okbchain/libs/cosmos-sdk/codec"
"github.com/okx/okbchain/libs/system"
)
// RegisterCodec registers concrete types on codec codec
func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterConcrete(MsgWithdrawValidatorCommission{}, system.Chain+"/distribution/MsgWithdrawReward", nil)
cdc.RegisterConcrete(MsgWithdrawDelegatorReward{}, system.Chain+"/distribution/MsgWithdrawDelegatorReward", nil)
cdc.RegisterConcrete(MsgSetWithdrawAddress{}, system.Chain+"/distribution/MsgModifyWithdrawAddress", nil)
cdc.RegisterConcrete(CommunityPoolSpendProposal{}, system.Chain+"/distribution/CommunityPoolSpendProposal", nil)
cdc.RegisterConcrete(ChangeDistributionTypeProposal{}, system.Chain+"/distribution/ChangeDistributionTypeProposal", nil)
cdc.RegisterConcrete(WithdrawRewardEnabledProposal{}, system.Chain+"/distribution/WithdrawRewardEnabledProposal", nil)
cdc.RegisterConcrete(RewardTruncatePrecisionProposal{}, system.Chain+"/distribution/RewardTruncatePrecisionProposal", nil)
cdc.RegisterConcrete(MsgWithdrawDelegatorAllRewards{}, system.Chain+"/distribution/MsgWithdrawDelegatorAllRewards", nil)
}
// ModuleCdc generic sealed codec to be used throughout module
var ModuleCdc *codec.Codec
func init() {
ModuleCdc = codec.New()
RegisterCodec(ModuleCdc)
codec.RegisterCrypto(ModuleCdc)
ModuleCdc.Seal()
}