Skip to content

Commit

Permalink
add community genesis state type
Browse files Browse the repository at this point in the history
  • Loading branch information
rhuairahrighairidh committed Sep 7, 2023
1 parent ae94479 commit 8136591
Show file tree
Hide file tree
Showing 4 changed files with 391 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@
- [kava/community/v1beta1/params.proto](#kava/community/v1beta1/params.proto)
- [Params](#kava.community.v1beta1.Params)

- [kava/community/v1beta1/genesis.proto](#kava/community/v1beta1/genesis.proto)
- [GenesisState](#kava.community.v1beta1.GenesisState)

- [kava/community/v1beta1/proposal.proto](#kava/community/v1beta1/proposal.proto)
- [CommunityCDPRepayDebtProposal](#kava.community.v1beta1.CommunityCDPRepayDebtProposal)
- [CommunityCDPWithdrawCollateralProposal](#kava.community.v1beta1.CommunityCDPWithdrawCollateralProposal)
Expand Down Expand Up @@ -2906,6 +2909,37 @@ Params defines the parameters of the community module.



<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->

<!-- end services -->



<a name="kava/community/v1beta1/genesis.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## kava/community/v1beta1/genesis.proto



<a name="kava.community.v1beta1.GenesisState"></a>

### GenesisState
GenesisState defines the community module's genesis state.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `params` | [Params](#kava.community.v1beta1.Params) | | params defines all the paramaters related to commmunity |





<!-- end messages -->

<!-- end enums -->
Expand Down
13 changes: 13 additions & 0 deletions proto/kava/community/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";
package kava.community.v1beta1;

import "gogoproto/gogo.proto";
import "kava/community/v1beta1/params.proto";

option go_package = "github.com/kava-labs/kava/x/community/types";

// GenesisState defines the community module's genesis state.
message GenesisState {
// params defines all the paramaters related to commmunity
Params params = 1 [(gogoproto.nullable) = false];
}
20 changes: 20 additions & 0 deletions x/community/types/genesis.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package types

// NewGenesisState returns a new genesis state object
func NewGenesisState(params Params) GenesisState {
return GenesisState{
Params: params,
}
}

// DefaultGenesisState returns default genesis state
func DefaultGenesisState() GenesisState {
return NewGenesisState(
DefaultParams(),
)
}

// Validate checks the params are valid
func (gs GenesisState) Validate() error {
return gs.Params.Validate()
}
Loading

0 comments on commit 8136591

Please sign in to comment.