remove viper from blockchain and state

This commit is contained in:
Ethan Buchman
2017-04-28 23:50:24 -04:00
parent 56a1a2d917
commit 29c0e6e4f4
4 changed files with 10 additions and 12 deletions

View File

@ -6,7 +6,6 @@ import (
"sync"
"time"
"github.com/spf13/viper"
abci "github.com/tendermint/abci/types"
cmn "github.com/tendermint/tmlibs/common"
dbm "github.com/tendermint/tmlibs/db"
@ -169,10 +168,10 @@ func (s *State) GetValidators() (*types.ValidatorSet, *types.ValidatorSet) {
// Load the most recent state from "state" db,
// or create a new one (and save) from genesis.
func GetState(config *viper.Viper, stateDB dbm.DB) *State {
func GetState(stateDB dbm.DB, genesisFile string) *State {
state := LoadState(stateDB)
if state == nil {
state = MakeGenesisStateFromFile(stateDB, config.GetString("genesis_file"))
state = MakeGenesisStateFromFile(stateDB, genesisFile)
state.Save()
}