merge/rebase fixes
This commit is contained in:
parent
ee449a94c8
commit
799efb0629
11
node/node.go
11
node/node.go
|
@ -7,6 +7,7 @@ import (
|
|||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
. "github.com/tendermint/go-common"
|
||||
|
@ -332,21 +333,21 @@ func getState() *sm.State {
|
|||
|
||||
// Get a connection to the proxyAppConn addr.
|
||||
// Check the current hash, and panic if it doesn't match.
|
||||
func getProxyApp(addr string, hash []byte) (proxyAppCtx proxy.AppContext) {
|
||||
func getProxyApp(addr string, hash []byte) (proxyAppConn proxy.AppConn) {
|
||||
// use local app (for testing)
|
||||
if addr == "local" {
|
||||
app := example.NewCounterApplication(true)
|
||||
appCtx := app.Open()
|
||||
proxyAppCtx = proxy.NewLocalAppContext(appCtx)
|
||||
mtx := new(sync.Mutex)
|
||||
proxyAppConn = proxy.NewLocalAppConn(mtx, app)
|
||||
} else {
|
||||
proxyConn, err := Connect(addr)
|
||||
if err != nil {
|
||||
Exit(Fmt("Failed to connect to proxy for mempool: %v", err))
|
||||
}
|
||||
remoteApp := proxy.NewRemoteAppContext(proxyConn, 1024)
|
||||
remoteApp := proxy.NewRemoteAppConn(proxyConn, 1024)
|
||||
remoteApp.Start()
|
||||
|
||||
proxyAppCtx = remoteApp
|
||||
proxyAppConn = remoteApp
|
||||
}
|
||||
|
||||
// Check the hash
|
||||
|
|
|
@ -6,10 +6,15 @@ import (
|
|||
|
||||
"github.com/tendermint/go-p2p"
|
||||
_ "github.com/tendermint/tendermint/config/tendermint_test"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
func TestNodeStartStop(t *testing.T) {
|
||||
|
||||
// Get PrivValidator
|
||||
privValidatorFile := config.GetString("priv_validator_file")
|
||||
privValidator := types.LoadOrGenPrivValidator(privValidatorFile)
|
||||
|
||||
// Create & start node
|
||||
n := NewNode(privValidator)
|
||||
l := p2p.NewDefaultListener("tcp", config.GetString("node_laddr"), config.GetBool("skip_upnp"))
|
||||
|
|
|
@ -56,7 +56,9 @@ func init() {
|
|||
// create a new node and sleep forever
|
||||
func newNode(ready chan struct{}) {
|
||||
// Create & start node
|
||||
node = nm.NewNode()
|
||||
privValidatorFile := config.GetString("priv_validator_file")
|
||||
privValidator := types.LoadOrGenPrivValidator(privValidatorFile)
|
||||
node = nm.NewNode(privValidator)
|
||||
l := p2p.NewDefaultListener("tcp", config.GetString("node_laddr"), true)
|
||||
node.AddListener(l)
|
||||
node.Start()
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
. "github.com/tendermint/go-common"
|
||||
"github.com/tendermint/tendermint/events"
|
||||
"github.com/tendermint/go-events"
|
||||
"github.com/tendermint/tendermint/proxy"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
tmsp "github.com/tendermint/tmsp/types"
|
||||
|
@ -90,7 +90,7 @@ func (s *State) execBlockOnProxyApp(evsw *events.EventSwitch, proxyAppConn proxy
|
|||
log.Warn("Error computing proxyAppConn hash", "error", err)
|
||||
return err
|
||||
}
|
||||
log.Info("ExecBlock got %v valid txs and %v invalid txs", validTxs, invalidTxs)
|
||||
log.Info(Fmt("ExecBlock got %v valid txs and %v invalid txs", validTxs, invalidTxs))
|
||||
|
||||
// Set the state's new AppHash
|
||||
s.AppHash = hash
|
||||
|
|
|
@ -8,7 +8,6 @@ import (
|
|||
|
||||
. "github.com/tendermint/go-common"
|
||||
dbm "github.com/tendermint/go-db"
|
||||
"github.com/tendermint/go-events"
|
||||
"github.com/tendermint/go-wire"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
|
|
@ -43,7 +43,7 @@ type PrivValidator struct {
|
|||
|
||||
// PrivKey should be empty if a Signer other than the default is being used.
|
||||
PrivKey crypto.PrivKey `json:"priv_key"`
|
||||
Signer
|
||||
Signer `json:"-"`
|
||||
|
||||
// For persistence.
|
||||
// Overloaded for testing.
|
||||
|
|
Loading…
Reference in New Issue