diff --git a/app/lib/dup/indexer.js b/app/lib/dup/indexer.js index f9a71abd7630fee7c8a9573453ad22368740bee9..ad23ea20d8c9fe33361b0e9dfd56d092d9ddb194 100644 --- a/app/lib/dup/indexer.js +++ b/app/lib/dup/indexer.js @@ -840,7 +840,7 @@ const indexer = module.exports = { } else if (HEAD.udReevalTime != HEAD_1.udReevalTime) { // DUG const previousUB = HEAD_1.unitBase; - HEAD.dividend = Math.ceil(HEAD_1.dividend + Math.pow(conf.c, 2) * Math.ceil(HEAD_1.mass / Math.pow(10, previousUB)) / HEAD.membersCount); + HEAD.dividend = Math.ceil(HEAD_1.dividend + Math.pow(conf.c, 2) * Math.ceil(HEAD_1.mass / Math.pow(10, previousUB)) / HEAD.membersCount / (conf.dtReeval / conf.dt)); } else { HEAD.dividend = HEAD_1.dividend; } diff --git a/test/fast/block/protocol-brg13-dividend.js b/test/fast/block/protocol-brg13-dividend.js index fb2bedf1ec972ad7db405b7094aed3eed867c4a8..5673b9806be2ce640e1fcbc87f044d4c6a849413 100644 --- a/test/fast/block/protocol-brg13-dividend.js +++ b/test/fast/block/protocol-brg13-dividend.js @@ -25,7 +25,7 @@ describe("Protocol BR_G13 - dividend", function(){ })); it('block with medianTime == udTime', () => co(function*(){ - const conf = { dt: 100, c: 0.0488 }; + const conf = { dt: 100, dtReeval: 100, c: 0.0488 }; const HEAD_1 = { number: 59, udTime: 1500000900, udReevalTime: 1500000900, dividend: 100, mass: 18000, unitBase: 1 }; const HEAD = { number: 60, medianTime: 1500000900, membersCount: 3 }; indexer.prepareUDTime(HEAD, HEAD_1, conf); @@ -35,7 +35,7 @@ describe("Protocol BR_G13 - dividend", function(){ })); it('block with medianTime > udTime', () => co(function*(){ - const conf = { dt: 100, c: 0.0488 }; + const conf = { dt: 100, dtReeval: 100, c: 0.0488 }; const HEAD_1 = { number: 59, udTime: 1500000900, udReevalTime: 1500000900, dividend: 100, mass: 18000, unitBase: 1 }; const HEAD = { number: 60, medianTime: 1500000901, membersCount: 3 }; indexer.prepareUDTime(HEAD, HEAD_1, conf); diff --git a/test/integration/v1.0-double-dividend.js b/test/integration/v1.0-double-dividend.js index 7781c7df96c66430a2c4db4330e6c4c2bf4c606d..e0b33b369c5942ae6e026d3aae0f574c89aba761 100644 --- a/test/integration/v1.0-double-dividend.js +++ b/test/integration/v1.0-double-dividend.js @@ -78,10 +78,10 @@ describe("Protocol 1.0 Dividend Update", function() { })); it('should have block#8 with UD 1010', () => s1.expectThat('/blockchain/block/8', (json) => { - json.dividend.should.equal(1010); + json.dividend.should.equal(1002); })); it('should have block#9 with UD 1010', () => s1.expectThat('/blockchain/block/9', (json) => { - json.dividend.should.equal(1010); + json.dividend.should.equal(1002); })); }); diff --git a/test/integration/v1.0-g1-dividend.js b/test/integration/v1.0-g1-dividend.js index 4659467de77b302d1077a3cb30a0977e2ebe9929..b32b9bd6fbd274816636a7040456024e9252b9e4 100644 --- a/test/integration/v1.0-g1-dividend.js +++ b/test/integration/v1.0-g1-dividend.js @@ -80,13 +80,13 @@ describe("Protocol 1.0 Ğ1 Dividend", function() { json.should.have.property('medianTime').equal(start + aDay * 11); // 2016-03-20 12:00:00 UTC+0 })); - it('should have block#13 with UD 1027', () => s1.expectThat('/blockchain/block/13', (json) => { - json.dividend.should.equal(1027); + it('should have block#13 with UD 1001', () => s1.expectThat('/blockchain/block/13', (json) => { + json.dividend.should.equal(1001); json.should.have.property('medianTime').equal(start + aDay * 12); // 2016-03-21 12:00:00 UTC+0 })); - it('should have block#14 with UD 1027', () => s1.expectThat('/blockchain/block/14', (json) => { - json.dividend.should.equal(1027); + it('should have block#14 with UD 1001', () => s1.expectThat('/blockchain/block/14', (json) => { + json.dividend.should.equal(1001); json.should.have.property('medianTime').equal(start + aDay * 13); // 2016-03-22 12:00:00 UTC+0 })); });