mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 18:15:19 +00:00
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
|
package testutil
|
||
|
|
||
|
import (
|
||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||
|
"github.com/kava-labs/kava/app"
|
||
|
|
||
|
kavaminttypes "github.com/kava-labs/kava/x/kavamint/types"
|
||
|
)
|
||
|
|
||
|
// KavamintGenesisBuilder is a tool for creating a mint genesis state.
|
||
|
// Helper methods add values onto a default genesis state.
|
||
|
// All methods are immutable and return updated copies of the builder.
|
||
|
type KavamintGenesisBuilder struct {
|
||
|
kavaminttypes.GenesisState
|
||
|
}
|
||
|
|
||
|
var _ GenesisBuilder = (*KavamintGenesisBuilder)(nil)
|
||
|
|
||
|
func NewKavamintGenesisBuilder() KavamintGenesisBuilder {
|
||
|
gen := kavaminttypes.DefaultGenesisState()
|
||
|
gen.Params.CommunityPoolInflation = sdk.ZeroDec()
|
||
|
gen.Params.StakingRewardsApy = sdk.ZeroDec()
|
||
|
|
||
|
return KavamintGenesisBuilder{
|
||
|
GenesisState: *gen,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (builder KavamintGenesisBuilder) Build() kavaminttypes.GenesisState {
|
||
|
return builder.GenesisState
|
||
|
}
|
||
|
|
||
|
func (builder KavamintGenesisBuilder) BuildMarshalled(cdc codec.JSONCodec) app.GenesisState {
|
||
|
built := builder.Build()
|
||
|
|
||
|
return app.GenesisState{
|
||
|
kavaminttypes.ModuleName: cdc.MustMarshalJSON(&built),
|
||
|
}
|
||
|
}
|