Remove accounts from genesis
This commit is contained in:
parent
3a65d53d35
commit
7cd5e47eea
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user