From 6684a1873003bb9d2f24b4c09c5c1c47518df564 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 May 2016 00:08:41 -0400 Subject: [PATCH] fix test --- switch_test.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/switch_test.go b/switch_test.go index 04664979..783d2fd9 100644 --- a/switch_test.go +++ b/switch_test.go @@ -7,10 +7,21 @@ import ( "time" . "github.com/tendermint/go-common" + cfg "github.com/tendermint/go-config" "github.com/tendermint/go-crypto" "github.com/tendermint/go-wire" ) +var ( + config cfg.Config +) + +func init() { + config = cfg.NewMapConfig(nil) + setConfigDefaults(config) + +} + type PeerMessage struct { PeerKey string Bytes []byte @@ -74,7 +85,7 @@ func makeSwitchPair(t testing.TB, initSwitch func(*Switch) *Switch) (*Switch, *S s2PrivKey := crypto.GenPrivKeyEd25519() // Create two switches that will be interconnected. - s1 := initSwitch(NewSwitch()) + s1 := initSwitch(NewSwitch(config)) s1.SetNodeInfo(&NodeInfo{ PubKey: s1PrivKey.PubKey().(crypto.PubKeyEd25519), Moniker: "switch1", @@ -82,7 +93,7 @@ func makeSwitchPair(t testing.TB, initSwitch func(*Switch) *Switch) (*Switch, *S Version: "123.123.123", }) s1.SetNodePrivKey(s1PrivKey) - s2 := initSwitch(NewSwitch()) + s2 := initSwitch(NewSwitch(config)) s2.SetNodeInfo(&NodeInfo{ PubKey: s2PrivKey.PubKey().(crypto.PubKeyEd25519), Moniker: "switch2",