From 98d400f5e003b5b8589f73ac7c196f11708f09eb Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Thu, 18 Oct 2018 21:22:45 +0800 Subject: params: load blockReward from genesis JSON file --- params/config.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'params/config.go') diff --git a/params/config.go b/params/config.go index 34dba2901..8a9fa1827 100644 --- a/params/config.go +++ b/params/config.go @@ -21,6 +21,7 @@ import ( "math/big" "github.com/dexon-foundation/dexon/common" + "github.com/dexon-foundation/dexon/common/math" ) // Genesis hashes to enforce below configs on. @@ -218,6 +219,8 @@ func (c *CliqueConfig) String() string { return "clique" } +//go:generate gencodec -type DexconConfig -field-override dexconConfigSpecMarshaling -out gen_dexcon_config.go + // DexconConfig is the consensus engine configs for DEXON consensus. type DexconConfig struct { GenesisCRSText string `json:"genesisCRSText"` @@ -234,6 +237,10 @@ type DexconConfig struct { BlockReward *big.Int `json:"blockReward"` } +type dexconConfigSpecMarshaling struct { + BlockReward *math.HexOrDecimal256 +} + // String implements the stringer interface, returning the consensus engine details. func (d *DexconConfig) String() string { return fmt.Sprintf("{GenesisCRSText: %v NumChains: %v LambdaBA: %v LambdaDKG: %v K: %v PhiRatio: %v NotarySetSize: %v DKGSetSize: %v RoundInterval: %v MinBlockInterval: %v MaxBlockInterval: %v BlockReward: %v", -- cgit v1.2.3