21 lines
508 B
Go
21 lines
508 B
Go
|
package genaccounts
|
||
|
|
||
|
import (
|
||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||
|
)
|
||
|
|
||
|
// initialize accounts and deliver genesis transactions
|
||
|
func InitGenesis(ctx sdk.Context, cdc *codec.Codec,
|
||
|
accountKeeper AccountKeeper, genesisState GenesisState) {
|
||
|
|
||
|
genesisState.Sanitize()
|
||
|
|
||
|
// load the accounts
|
||
|
for _, gacc := range genesisState.Accounts {
|
||
|
acc := gacc.ToAccount()
|
||
|
acc = accountKeeper.NewAccount(ctx, acc) // set account number
|
||
|
accountKeeper.SetAccount(ctx, acc)
|
||
|
}
|
||
|
}
|