aboutsummaryrefslogtreecommitdiffstats
path: root/params/config.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-10-18 21:22:45 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:50 +0800
commit98d400f5e003b5b8589f73ac7c196f11708f09eb (patch)
tree30f8a13727563fdc529b9fd5fbb25df552b5a076 /params/config.go
parent4d5e408a6634a08fcab122735c25d30d3170d932 (diff)
downloaddexon-98d400f5e003b5b8589f73ac7c196f11708f09eb.tar
dexon-98d400f5e003b5b8589f73ac7c196f11708f09eb.tar.gz
dexon-98d400f5e003b5b8589f73ac7c196f11708f09eb.tar.bz2
dexon-98d400f5e003b5b8589f73ac7c196f11708f09eb.tar.lz
dexon-98d400f5e003b5b8589f73ac7c196f11708f09eb.tar.xz
dexon-98d400f5e003b5b8589f73ac7c196f11708f09eb.tar.zst
dexon-98d400f5e003b5b8589f73ac7c196f11708f09eb.zip
params: load blockReward from genesis JSON file
Diffstat (limited to 'params/config.go')
-rw-r--r--params/config.go7
1 files changed, 7 insertions, 0 deletions
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",