mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 10:05:18 +00:00
20 lines
724 B
Go
20 lines
724 B
Go
package validatorvesting
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/cosmos/cosmos-sdk/x/auth"
|
|
"github.com/cosmos/cosmos-sdk/x/validator-vesting/internal/types"
|
|
)
|
|
|
|
// InitGenesis stores the account address of each ValidatorVestingAccount in the validator vesting keeper, for faster lookup.
|
|
// CONTRACT: Accounts created by the account keeper must have already been initialized/created
|
|
func InitGenesis(ctx sdk.Context, keeper Keeper, accountKeeper types.AccountKeeper, data GenesisState) {
|
|
data.Accounts = auth.SanitizeGenesisAccounts(data.Accounts)
|
|
for _, a := range data.Accounts {
|
|
vv, ok := a.(ValidatorVestingAccount)
|
|
if ok {
|
|
keeper.SetValidatorVestingAccountKey(ctx, vv.Address)
|
|
}
|
|
}
|
|
}
|