From 7cd5e47eeac47904b9f17f5740b8b0b757835e23 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 24 Oct 2018 10:22:02 -0400 Subject: [PATCH] Remove accounts from genesis --- app/genesis.go | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/app/genesis.go b/app/genesis.go index 972ac8ca..0b59fe14 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -2,9 +2,6 @@ package app import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/cosmos-sdk/x/gov" - "github.com/cosmos/cosmos-sdk/x/stake" "github.com/cosmos/ethermint/types" ) @@ -12,9 +9,7 @@ type ( // GenesisState defines the application's genesis state. It contains all the // information required and accounts to initialize the blockchain. GenesisState struct { - Accounts []GenesisAccount `json:"accounts"` - StakeData stake.GenesisState `json:"stake"` - GovData gov.GenesisState `json:"gov"` + Accounts []GenesisAccount `json:"accounts"` } // GenesisAccount defines an account to be initialized in the genesis state. @@ -25,23 +20,3 @@ type ( Storage types.Storage `json:"storage,omitempty"` } ) - -// NewGenesisAccount returns a reference to a new initialized genesis account. -func NewGenesisAccount(acc *types.Account) GenesisAccount { - return GenesisAccount{ - Address: acc.GetAddress(), - Coins: acc.GetCoins(), - Code: acc.Code, - Storage: acc.Storage, - } -} - -// ToAccount converts a genesis account to an initialized Ethermint account. -func (ga *GenesisAccount) ToAccount() (acc *types.Account) { - base := auth.BaseAccount{ - Address: ga.Address, - Coins: ga.Coins.Sort(), - } - - return types.NewAccount(base, ga.Code, ga.Storage) -}