aboutsummaryrefslogtreecommitdiffstats
path: root/simulation/config/config.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-11-05 18:02:53 +0800
committerJimmy Hu <jimmy.hu@dexon.org>2018-11-05 18:02:53 +0800
commitcd9f3011f58af965b910c0a1b0e27b22ccb30f23 (patch)
tree99838cb962d92bb78def33af2e7fd4583ae5770b /simulation/config/config.go
parentc4541185c1d2502dffe09de1af52594f6fae16a6 (diff)
downloaddexon-consensus-cd9f3011f58af965b910c0a1b0e27b22ccb30f23.tar
dexon-consensus-cd9f3011f58af965b910c0a1b0e27b22ccb30f23.tar.gz
dexon-consensus-cd9f3011f58af965b910c0a1b0e27b22ccb30f23.tar.bz2
dexon-consensus-cd9f3011f58af965b910c0a1b0e27b22ccb30f23.tar.lz
dexon-consensus-cd9f3011f58af965b910c0a1b0e27b22ccb30f23.tar.xz
dexon-consensus-cd9f3011f58af965b910c0a1b0e27b22ccb30f23.tar.zst
dexon-consensus-cd9f3011f58af965b910c0a1b0e27b22ccb30f23.zip
test: move simulation.network to test package (#297)
Diffstat (limited to 'simulation/config/config.go')
-rw-r--r--simulation/config/config.go15
1 files changed, 3 insertions, 12 deletions
diff --git a/simulation/config/config.go b/simulation/config/config.go
index 8083bee..5a548f1 100644
--- a/simulation/config/config.go
+++ b/simulation/config/config.go
@@ -21,19 +21,10 @@ import (
"math"
"os"
+ "github.com/dexon-foundation/dexon-consensus/core/test"
"github.com/naoina/toml"
)
-// NetworkType is the simulation network type.
-type NetworkType string
-
-// NetworkType enums.
-const (
- NetworkTypeTCP NetworkType = "tcp"
- NetworkTypeTCPLocal NetworkType = "tcp-local"
- NetworkTypeFake NetworkType = "fake"
-)
-
// Consensus settings.
type Consensus struct {
PhiRatio float32
@@ -61,7 +52,7 @@ type Node struct {
// Networking config.
type Networking struct {
- Type NetworkType
+ Type test.NetworkType
PeerServer string
Mean float64
@@ -110,7 +101,7 @@ func GenerateDefault(path string) error {
MaxBlock: math.MaxUint64,
},
Networking: Networking{
- Type: NetworkTypeTCPLocal,
+ Type: test.NetworkTypeTCPLocal,
PeerServer: "127.0.0.1",
Mean: 100,
Sigma: 10,