Skip to content

Commit

Permalink
fix(commitment): add missing msgs to codec (#1066)
Browse files Browse the repository at this point in the history
* fix(commitment): add missing msgs to codec

* chore(commitment): add missing genesis fields
  • Loading branch information
cosmic-vagabond authored Dec 17, 2024
1 parent 44fc47a commit 69d94c9
Show file tree
Hide file tree
Showing 7 changed files with 272 additions and 43 deletions.
189 changes: 170 additions & 19 deletions api/elys/commitment/genesis.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions proto/elys/commitment/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ message GenesisState {
repeated NftHolder nft_holders = 4;
repeated Cadet cadets = 5;
repeated Governor governors = 6;
repeated KolList kol_list = 7;
}
5 changes: 4 additions & 1 deletion x/commitment/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState)
for _, val := range genState.Cadets {
k.SetCadet(ctx, *val)
}

for _, val := range genState.KolList {
k.SetKol(ctx, *val)
}
}

// ExportGenesis returns the module's exported genesis
Expand All @@ -41,6 +43,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {
genesis.Cadets = k.GetAllCadets(ctx)
genesis.Governors = k.GetAllGovernors(ctx)
genesis.NftHolders = k.GetAllNFTHolders(ctx)
genesis.KolList = k.GetAllKol(ctx)

// this line is used by starport scaffolding # genesis/module/export

Expand Down
8 changes: 8 additions & 0 deletions x/commitment/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ func RegisterCodec(cdc *codec.LegacyAmino) {
legacy.RegisterAminoMsg(cdc, &MsgVestNow{}, "commitment/MsgVestNow")
legacy.RegisterAminoMsg(cdc, &MsgUpdateVestingInfo{}, "commitment/MsgUpdateVestingInfo")
legacy.RegisterAminoMsg(cdc, &MsgVestLiquid{}, "commitment/MsgVestLiquid")
legacy.RegisterAminoMsg(cdc, &MsgUpdateEnableVestNow{}, "commitment/MsgUpdateEnableVestNow")
legacy.RegisterAminoMsg(cdc, &MsgUpdateAirdropParams{}, "commitment/MsgUpdateAirdropParams")
legacy.RegisterAminoMsg(cdc, &MsgStake{}, "commitment/MsgStake")
legacy.RegisterAminoMsg(cdc, &MsgUnstake{}, "commitment/MsgUnstake")
legacy.RegisterAminoMsg(cdc, &MsgClaimAirdrop{}, "commitment/MsgClaimAirdrop")
legacy.RegisterAminoMsg(cdc, &MsgClaimKol{}, "commitment/MsgClaimKol")
// this line is used by starport scaffolding # 2
}

Expand All @@ -32,8 +36,12 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
&MsgVestNow{},
&MsgUpdateVestingInfo{},
&MsgVestLiquid{},
&MsgUpdateEnableVestNow{},
&MsgUpdateAirdropParams{},
&MsgStake{},
&MsgUnstake{},
&MsgClaimAirdrop{},
&MsgClaimKol{},
)
// this line is used by starport scaffolding # 3

Expand Down
Loading

0 comments on commit 69d94c9

Please sign in to comment.