mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-30 21:21:39 +00:00
remove viper from proxy
This commit is contained in:
@ -4,8 +4,6 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
|
||||
abcicli "github.com/tendermint/abci/client"
|
||||
"github.com/tendermint/abci/example/dummy"
|
||||
"github.com/tendermint/abci/types"
|
||||
@ -64,15 +62,12 @@ func (r *remoteClientCreator) NewABCIClient() (abcicli.Client, error) {
|
||||
//-----------------------------------------------------------------
|
||||
// default
|
||||
|
||||
func DefaultClientCreator(config *viper.Viper) ClientCreator {
|
||||
addr := config.GetString("proxy_app")
|
||||
transport := config.GetString("abci")
|
||||
|
||||
func DefaultClientCreator(addr, transport, dbDir string) ClientCreator {
|
||||
switch addr {
|
||||
case "dummy":
|
||||
return NewLocalClientCreator(dummy.NewDummyApplication())
|
||||
case "persistent_dummy":
|
||||
return NewLocalClientCreator(dummy.NewPersistentDummyApplication(config.GetString("db_dir")))
|
||||
return NewLocalClientCreator(dummy.NewPersistentDummyApplication(dbDir))
|
||||
case "nilapp":
|
||||
return NewLocalClientCreator(types.NewBaseApplication())
|
||||
default:
|
||||
|
@ -1,7 +1,6 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"github.com/spf13/viper"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
)
|
||||
|
||||
@ -16,8 +15,8 @@ type AppConns interface {
|
||||
Query() AppConnQuery
|
||||
}
|
||||
|
||||
func NewAppConns(config *viper.Viper, clientCreator ClientCreator, handshaker Handshaker) AppConns {
|
||||
return NewMultiAppConn(config, clientCreator, handshaker)
|
||||
func NewAppConns(clientCreator ClientCreator, handshaker Handshaker) AppConns {
|
||||
return NewMultiAppConn(clientCreator, handshaker)
|
||||
}
|
||||
|
||||
//-----------------------------
|
||||
@ -34,8 +33,6 @@ type Handshaker interface {
|
||||
type multiAppConn struct {
|
||||
cmn.BaseService
|
||||
|
||||
config *viper.Viper
|
||||
|
||||
handshaker Handshaker
|
||||
|
||||
mempoolConn *appConnMempool
|
||||
@ -46,9 +43,8 @@ type multiAppConn struct {
|
||||
}
|
||||
|
||||
// Make all necessary abci connections to the application
|
||||
func NewMultiAppConn(config *viper.Viper, clientCreator ClientCreator, handshaker Handshaker) *multiAppConn {
|
||||
func NewMultiAppConn(clientCreator ClientCreator, handshaker Handshaker) *multiAppConn {
|
||||
multiAppConn := &multiAppConn{
|
||||
config: config,
|
||||
handshaker: handshaker,
|
||||
clientCreator: clientCreator,
|
||||
}
|
||||
|
Reference in New Issue
Block a user