diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-02-20 12:53:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 12:53:18 +0800 |
commit | 8ef4fc213703620fbfa13890dee042d40eea8545 (patch) | |
tree | ba9a07d2423314396e5677b7294122caa505ae9a /simulation/config/utils.go | |
parent | 2cf18fd299ea0fc270b213343314cab652cac271 (diff) | |
download | dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.gz dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.bz2 dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.lz dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.xz dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.zst dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.zip |
core: switch round by block height (#450)
Diffstat (limited to 'simulation/config/utils.go')
-rw-r--r-- | simulation/config/utils.go | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/simulation/config/utils.go b/simulation/config/utils.go index 9d97fbd..f8f1eec 100644 --- a/simulation/config/utils.go +++ b/simulation/config/utils.go @@ -27,8 +27,6 @@ import ( // StateChangeTypeFromString convert a string to test.StateChangeType. func StateChangeTypeFromString(s string) test.StateChangeType { switch s { - case "num_chains": - return test.StateChangeNumChains case "lambda_ba": return test.StateChangeLambdaBA case "lambda_dkg": @@ -37,10 +35,6 @@ func StateChangeTypeFromString(s string) test.StateChangeType { return test.StateChangeRoundInterval case "min_block_interval": return test.StateChangeMinBlockInterval - case "k": - return test.StateChangeK - case "phi_ratio": - return test.StateChangePhiRatio case "notary_set_size": return test.StateChangeNotarySetSize case "dkg_set_size": @@ -54,27 +48,19 @@ func StateChangeTypeFromString(s string) test.StateChangeType { func StateChangeValueFromString( t test.StateChangeType, v string) interface{} { switch t { - case test.StateChangeNumChains, test.StateChangeNotarySetSize, - test.StateChangeDKGSetSize: + case test.StateChangeNotarySetSize, test.StateChangeDKGSetSize: ret, err := strconv.ParseUint(v, 10, 32) if err != nil { panic(err) } return uint32(ret) case test.StateChangeLambdaBA, test.StateChangeLambdaDKG, - test.StateChangeRoundInterval, test.StateChangeMinBlockInterval, - test.StateChangeK: + test.StateChangeRoundInterval, test.StateChangeMinBlockInterval: ret, err := strconv.ParseInt(v, 10, 32) if err != nil { panic(err) } return int(ret) - case test.StateChangePhiRatio: - ret, err := strconv.ParseFloat(v, 32) - if err != nil { - panic(err) - } - return float32(ret) } panic(fmt.Errorf("unsupported state change type %s", t)) } |