From d779f5aead9e91b97c8d05136ddb7a6bd84f4276 Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Mon, 25 Feb 2019 18:27:34 +0800 Subject: core: Fixed gas price (#205) * core/vm: update abi * core/vm: add MinGasPrice to gov * params: Add MinGasPrice to Config * dex: SuggestPrice from Governance * test: add minGasPrice to genesis.json * core: check underpriced tx * dex: verify with gas price --- params/gen_dexcon_config.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'params/gen_dexcon_config.go') diff --git a/params/gen_dexcon_config.go b/params/gen_dexcon_config.go index 566ed9fcd..1afe11f56 100644 --- a/params/gen_dexcon_config.go +++ b/params/gen_dexcon_config.go @@ -30,6 +30,7 @@ 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 @@ -52,6 +53,7 @@ func (d DexconConfig) MarshalJSON() ([]byte, error) { enc.FineValues[k] = (*math.HexOrDecimal256)(v) } } + enc.MinGasPrice = (*math.HexOrDecimal256)(d.MinGasPrice) return json.Marshal(&enc) } @@ -73,6 +75,7 @@ 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 { @@ -126,5 +129,8 @@ 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 } -- cgit