2019-07-08 16:02:20 +00:00
|
|
|
package evm
|
|
|
|
|
|
|
|
import (
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
2019-07-25 20:38:55 +00:00
|
|
|
abci "github.com/tendermint/tendermint/abci/types"
|
2019-07-08 16:02:20 +00:00
|
|
|
)
|
|
|
|
|
2019-09-27 14:08:45 +00:00
|
|
|
// InitGenesis initializes genesis state based on exported genesis
|
2020-03-09 13:17:23 +00:00
|
|
|
func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState) []abci.ValidatorUpdate {
|
2019-07-25 20:38:55 +00:00
|
|
|
for _, record := range data.Accounts {
|
2020-03-09 13:17:23 +00:00
|
|
|
k.SetCode(ctx, record.Address, record.Code)
|
|
|
|
k.CreateGenesisAccount(ctx, record)
|
2019-07-25 20:38:55 +00:00
|
|
|
}
|
|
|
|
return []abci.ValidatorUpdate{}
|
|
|
|
}
|
|
|
|
|
2019-09-27 14:08:45 +00:00
|
|
|
// ExportGenesis exports genesis state
|
2020-03-09 13:17:23 +00:00
|
|
|
func ExportGenesis(ctx sdk.Context, _ Keeper) GenesisState {
|
2019-07-25 20:38:55 +00:00
|
|
|
return GenesisState{Accounts: nil}
|
|
|
|
}
|