diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-12-18 20:25:58 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:54 +0800 |
commit | a6fd9c42d0d2632961f1f8adfe9db85ac125d294 (patch) | |
tree | 329aa6351559fc38db674879265ca3102ca74e43 /params/gen_dexcon_config.go | |
parent | 2e36ada5739437b6860d3978ac3e19f4073d94be (diff) | |
download | go-tangerine-a6fd9c42d0d2632961f1f8adfe9db85ac125d294.tar go-tangerine-a6fd9c42d0d2632961f1f8adfe9db85ac125d294.tar.gz go-tangerine-a6fd9c42d0d2632961f1f8adfe9db85ac125d294.tar.bz2 go-tangerine-a6fd9c42d0d2632961f1f8adfe9db85ac125d294.tar.lz go-tangerine-a6fd9c42d0d2632961f1f8adfe9db85ac125d294.tar.xz go-tangerine-a6fd9c42d0d2632961f1f8adfe9db85ac125d294.tar.zst go-tangerine-a6fd9c42d0d2632961f1f8adfe9db85ac125d294.zip |
core: vm: add undelegate fund lockup mechanism (#94)
Only allow a user to withdraw funds after a certain lockup
period. This way, the fund of a bad actor could be confiscated before he
could escape.
Diffstat (limited to 'params/gen_dexcon_config.go')
-rw-r--r-- | params/gen_dexcon_config.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/params/gen_dexcon_config.go b/params/gen_dexcon_config.go index 9cd9395cc..55d98ba37 100644 --- a/params/gen_dexcon_config.go +++ b/params/gen_dexcon_config.go @@ -18,6 +18,7 @@ func (d DexconConfig) MarshalJSON() ([]byte, error) { GenesisCRSText string `json:"genesisCRSText"` Owner common.Address `json:"owner"` MinStake *math.HexOrDecimal256 `json:"minStake"` + LockupPeriod uint64 `json:"lockupPeriod"` BlockReward *math.HexOrDecimal256 `json:"blockReward"` BlockGasLimit uint64 `json:"blockGasLimit"` NumChains uint32 `json:"numChains"` @@ -34,6 +35,7 @@ func (d DexconConfig) MarshalJSON() ([]byte, error) { enc.GenesisCRSText = d.GenesisCRSText enc.Owner = d.Owner enc.MinStake = (*math.HexOrDecimal256)(d.MinStake) + enc.LockupPeriod = d.LockupPeriod enc.BlockReward = (*math.HexOrDecimal256)(d.BlockReward) enc.BlockGasLimit = d.BlockGasLimit enc.NumChains = d.NumChains @@ -54,6 +56,7 @@ func (d *DexconConfig) UnmarshalJSON(input []byte) error { GenesisCRSText *string `json:"genesisCRSText"` Owner *common.Address `json:"owner"` MinStake *math.HexOrDecimal256 `json:"minStake"` + LockupPeriod *uint64 `json:"lockupPeriod"` BlockReward *math.HexOrDecimal256 `json:"blockReward"` BlockGasLimit *uint64 `json:"blockGasLimit"` NumChains *uint32 `json:"numChains"` @@ -79,6 +82,9 @@ func (d *DexconConfig) UnmarshalJSON(input []byte) error { if dec.MinStake != nil { d.MinStake = (*big.Int)(dec.MinStake) } + if dec.LockupPeriod != nil { + d.LockupPeriod = *dec.LockupPeriod + } if dec.BlockReward != nil { d.BlockReward = (*big.Int)(dec.BlockReward) } |