diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-17 09:12:50 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:23 +0800 |
commit | 9493109f2be4507605e6b17e406bf8fd147ab3c8 (patch) | |
tree | 84fee3d1fb2095ff5ba793bdfccba89970bc8f89 /params/gen_dexcon_config.go | |
parent | 9ee92eff068b09246ab6446efa39abfc0c7bd8a8 (diff) | |
download | go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar.gz go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar.bz2 go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar.lz go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar.xz go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar.zst go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.zip |
dex: implement recovery mechanism (#258)
* dex: implement recovery mechanism
The DEXON recovery protocol allows us to use the Ethereum blockchain as a
fallback consensus chain to coordinate recovery.
* fix
Diffstat (limited to 'params/gen_dexcon_config.go')
-rw-r--r-- | params/gen_dexcon_config.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/params/gen_dexcon_config.go b/params/gen_dexcon_config.go index 1afe11f56..38753916a 100644 --- a/params/gen_dexcon_config.go +++ b/params/gen_dexcon_config.go @@ -22,6 +22,7 @@ func (d DexconConfig) MarshalJSON() ([]byte, error) { MiningVelocity float32 `json:"miningVelocity"` NextHalvingSupply *math.HexOrDecimal256 `json:"nextHalvingSupply"` LastHalvedAmount *math.HexOrDecimal256 `json:"lastHalvedAmount"` + MinGasPrice *math.HexOrDecimal256 `json:"minGasPrice"` BlockGasLimit uint64 `json:"blockGasLimit"` LambdaBA uint64 `json:"lambdaBA"` LambdaDKG uint64 `json:"lambdaDKG"` @@ -30,7 +31,6 @@ func (d DexconConfig) MarshalJSON() ([]byte, error) { RoundLength uint64 `json:"roundLength"` MinBlockInterval uint64 `json:"minBlockInterval"` FineValues []*math.HexOrDecimal256 `json:"fineValues"` - MinGasPrice *math.HexOrDecimal256 `json:"minGasPrice"` } var enc DexconConfig enc.GenesisCRSText = d.GenesisCRSText @@ -40,6 +40,7 @@ func (d DexconConfig) MarshalJSON() ([]byte, error) { enc.MiningVelocity = d.MiningVelocity enc.NextHalvingSupply = (*math.HexOrDecimal256)(d.NextHalvingSupply) enc.LastHalvedAmount = (*math.HexOrDecimal256)(d.LastHalvedAmount) + enc.MinGasPrice = (*math.HexOrDecimal256)(d.MinGasPrice) enc.BlockGasLimit = d.BlockGasLimit enc.LambdaBA = d.LambdaBA enc.LambdaDKG = d.LambdaDKG @@ -53,7 +54,6 @@ func (d DexconConfig) MarshalJSON() ([]byte, error) { enc.FineValues[k] = (*math.HexOrDecimal256)(v) } } - enc.MinGasPrice = (*math.HexOrDecimal256)(d.MinGasPrice) return json.Marshal(&enc) } @@ -67,6 +67,7 @@ func (d *DexconConfig) UnmarshalJSON(input []byte) error { MiningVelocity *float32 `json:"miningVelocity"` NextHalvingSupply *math.HexOrDecimal256 `json:"nextHalvingSupply"` LastHalvedAmount *math.HexOrDecimal256 `json:"lastHalvedAmount"` + MinGasPrice *math.HexOrDecimal256 `json:"minGasPrice"` BlockGasLimit *uint64 `json:"blockGasLimit"` LambdaBA *uint64 `json:"lambdaBA"` LambdaDKG *uint64 `json:"lambdaDKG"` @@ -75,7 +76,6 @@ func (d *DexconConfig) UnmarshalJSON(input []byte) error { RoundLength *uint64 `json:"roundLength"` MinBlockInterval *uint64 `json:"minBlockInterval"` FineValues []*math.HexOrDecimal256 `json:"fineValues"` - MinGasPrice *math.HexOrDecimal256 `json:"minGasPrice"` } var dec DexconConfig if err := json.Unmarshal(input, &dec); err != nil { @@ -102,6 +102,9 @@ func (d *DexconConfig) UnmarshalJSON(input []byte) error { if dec.LastHalvedAmount != nil { d.LastHalvedAmount = (*big.Int)(dec.LastHalvedAmount) } + if dec.MinGasPrice != nil { + d.MinGasPrice = (*big.Int)(dec.MinGasPrice) + } if dec.BlockGasLimit != nil { d.BlockGasLimit = *dec.BlockGasLimit } @@ -129,8 +132,5 @@ func (d *DexconConfig) UnmarshalJSON(input []byte) error { d.FineValues[k] = (*big.Int)(v) } } - if dec.MinGasPrice != nil { - d.MinGasPrice = (*big.Int)(dec.MinGasPrice) - } return nil } |