-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v1.x' into mergify/bp/v1.x/pr-2202
- Loading branch information
Showing
6 changed files
with
53 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
syntax = "proto3"; | ||
package celestia.mint.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "celestia/mint/v1/mint.proto"; | ||
|
||
option go_package = "github.com/celestiaorg/celestia-app/x/mint/types"; | ||
|
||
// GenesisState defines the mint module's genesis state. | ||
message GenesisState { | ||
// minter is a space for holding current inflation information. | ||
Minter minter = 1 [ (gogoproto.nullable) = false ]; | ||
reserved 1; // 1 was previously used for the `Minter` field. | ||
|
||
// BondDenom is the denomination of the token that should be minted. | ||
string bond_denom = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
package types | ||
|
||
import "errors" | ||
|
||
// NewGenesisState creates a new GenesisState object | ||
func NewGenesisState(minter Minter) *GenesisState { | ||
func NewGenesisState(bondDenom string) *GenesisState { | ||
return &GenesisState{ | ||
Minter: minter, | ||
BondDenom: bondDenom, | ||
} | ||
} | ||
|
||
// DefaultGenesisState creates a default GenesisState object | ||
func DefaultGenesisState() *GenesisState { | ||
return &GenesisState{ | ||
Minter: DefaultMinter(), | ||
BondDenom: DefaultBondDenom, | ||
} | ||
} | ||
|
||
// ValidateGenesis validates the provided genesis state to ensure the | ||
// expected invariants holds. | ||
func ValidateGenesis(data GenesisState) error { | ||
return data.Minter.Validate() | ||
if data.BondDenom == "" { | ||
return errors.New("bond denom cannot be empty") | ||
} | ||
return nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.