diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-02-22 13:14:55 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:57 +0800 |
commit | 11e2de8c43f867764d4dd1146d467cb6e9bf114b (patch) | |
tree | fb821d64098f7c62dabf879f9edfc4490b033a58 /consensus/dexcon/dexcon_test.go | |
parent | af12f1f869609d2f3acf27c9315b6bbe816d9761 (diff) | |
download | dexon-11e2de8c43f867764d4dd1146d467cb6e9bf114b.tar.gz dexon-11e2de8c43f867764d4dd1146d467cb6e9bf114b.tar.zst dexon-11e2de8c43f867764d4dd1146d467cb6e9bf114b.zip |
core: Remove K, Phi and NumChains from Governance (#198)
* change default sync_core.sh
* vendor: sync to latest core
* core: Remove K, Phi and NumChain
Diffstat (limited to 'consensus/dexcon/dexcon_test.go')
-rw-r--r-- | consensus/dexcon/dexcon_test.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/consensus/dexcon/dexcon_test.go b/consensus/dexcon/dexcon_test.go index 7ba1be876..65ed77cc8 100644 --- a/consensus/dexcon/dexcon_test.go +++ b/consensus/dexcon/dexcon_test.go @@ -63,8 +63,7 @@ func (d *DexconTestSuite) SetupTest() { config.NextHalvingSupply = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(2.5e9)) config.LastHalvedAmount = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1.5e9)) config.MiningVelocity = 0.1875 - config.RoundInterval = 3600000 - config.NumChains = 6 + config.RoundLength = 3600 config.MinBlockInterval = 1000 d.config = config @@ -91,15 +90,9 @@ func (d *DexconTestSuite) TestBlockRewardCalculation() { d.s.IncTotalStaked(big.NewInt(1e18)) - // blockReard = miningVelocity * totalStaked * roundInterval / aYear / numBlocksInPrevRound - // 0.1875 * 1e18 * 3600 * 1000 / (86400 * 1000 * 365 * 6 * 3600) = 990930999.4926434 - d.Require().Equal(big.NewInt(990930999), consensus.calculateBlockReward(0, d.stateDB)) - - // Round 1 - d.s.PushRoundHeight(big.NewInt(4000 * 6)) - - // 0.1875 * 1e18 * 3600 * 1000 / (86400 * 1000 * 365 * 6 * 4000) = 891837899 - d.Require().Equal(big.NewInt(891837899), consensus.calculateBlockReward(1, d.stateDB)) + // blockReard = miningVelocity * totalStaked * roundInterval / aYear / numBlocksInCurRound + // 0.1875 * 1e18 * 3600 * 1000 / (86400 * 1000 * 365 * 3600) = 5945585996.96 + d.Require().Equal(big.NewInt(5945585996), consensus.calculateBlockReward(0, d.stateDB)) } func TestDexcon(t *testing.T) { |