-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a genesis state to x/rollup to allow module specific params to be configured.
- Loading branch information
1 parent
562d332
commit a51efc6
Showing
21 changed files
with
953 additions
and
134 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
Binary file not shown.
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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
syntax = "proto3"; | ||
package rollup.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "amino/amino.proto"; | ||
import "rollup/v1/rollup.proto"; | ||
|
||
option go_package = "github.com/polymerdao/monomer/x/rollup/types"; | ||
|
||
// GenesisState defines the rollup module's genesis state. | ||
message GenesisState { | ||
// params defines all the parameters of the module. | ||
Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package keeper | ||
|
||
import ( | ||
"fmt" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/polymerdao/monomer/x/rollup/types" | ||
) | ||
|
||
// InitGenesis - Init store state from genesis data | ||
func (k *Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) { //nolint:gocritic // hugeParam | ||
if err := k.SetParams(ctx, &state.Params); err != nil { | ||
panic(fmt.Errorf("failed to set params: %w", err)) | ||
} | ||
} | ||
|
||
// ExportGenesis returns a GenesisState for a given context and keeper | ||
func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { //nolint:gocritic // hugeParam | ||
params, err := k.GetParams(ctx) | ||
if err != nil { | ||
panic(fmt.Errorf("failed to get params: %w", err)) | ||
} | ||
|
||
return types.NewGenesisState(*params) | ||
} |
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
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
Oops, something went wrong.