adding viper

int

int
This commit is contained in:
Rigel Rozanski
2017-04-25 13:42:22 -04:00
committed by Ethan Buchman
parent 47852122d0
commit cefb2bede0
20 changed files with 218 additions and 162 deletions
+4 -3
View File
@@ -1,11 +1,12 @@
package core
import (
"github.com/spf13/viper"
cfg "github.com/tendermint/go-config"
crypto "github.com/tendermint/go-crypto"
p2p "github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/consensus"
p2p "github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/proxy"
"github.com/tendermint/tendermint/state/txindex"
"github.com/tendermint/tendermint/types"
@@ -34,7 +35,7 @@ var (
// external, thread safe interfaces
eventSwitch types.EventSwitch
proxyAppQuery proxy.AppConnQuery
config cfg.Config
config *viper.Viper
// interfaces defined in types and above
blockStore types.BlockStore
@@ -49,7 +50,7 @@ var (
txIndexer txindex.TxIndexer
)
func SetConfig(c cfg.Config) {
func SetConfig(c *viper.Viper) {
config = c
}
+5 -4
View File
@@ -9,23 +9,24 @@ import (
"testing"
"time"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
logger "github.com/tendermint/tmlibs/logger"
wire "github.com/tendermint/go-wire"
logger "github.com/tendermint/tmlibs/logger"
abci "github.com/tendermint/abci/types"
cfg "github.com/tendermint/go-config"
client "github.com/tendermint/tendermint/rpc/client"
"github.com/tendermint/tendermint/config/tendermint_test"
nm "github.com/tendermint/tendermint/node"
"github.com/tendermint/tendermint/proxy"
client "github.com/tendermint/tendermint/rpc/client"
ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types"
core_grpc "github.com/tendermint/tendermint/rpc/tendermint/grpc"
"github.com/tendermint/tendermint/types"
)
var (
config cfg.Config
config *viper.Viper
)
const tmLogLevel = "error"
@@ -56,7 +57,7 @@ func makeAddrs() (string, string, string) {
}
// GetConfig returns a config for the test cases as a singleton
func GetConfig() cfg.Config {
func GetConfig() *viper.Viper {
if config == nil {
pathname := makePathname()
config = tendermint_test.ResetConfig(pathname)