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>2018-12-19 20:54:27 +0800
commitab787f1ea7365b2befe6cd1bc9135637c32ec453 (patch)
tree46a169a06932e86c7da6efe53c51215ce6d994d1 /params/config.go
parent61bd9d4acef98adedc72543b40be8468d167f6c7 (diff)
downloaddexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar.gz
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar.bz2
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar.lz
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar.xz
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar.zst
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.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 86f89de35..24be741d9 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.
@@ -186,6 +187,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"`
@@ -202,6 +205,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",