Commit 3df56aaf authored by Éloïs's avatar Éloïs Committed by Cédric Moreau
Browse files

[ref] rename BLOCK_NEW_GENERATED_VERSION -> DUBP_NEXT_VERSION

parent 64db2c5b
......@@ -103,7 +103,8 @@ export const CommonConstants = {
// Version of genesis block
BLOCK_GENESIS_VERSION: 10,
BLOCK_NEW_GENERATED_VERSION: 11, // Put it to 11 when ready
// Highest supported version of DUBP protocol (= next version of the protocol)
DUBP_NEXT_VERSION: 11,
LAST_VERSION_FOR_TX: 10,
TRANSACTION_VERSION: 10,
DOCUMENTS_VERSION: 10,
......
......@@ -540,7 +540,7 @@ export const LOCAL_RULES_HELPERS = {
// More than 70% of the computing network converted? Let's go to next version.
if (Math.floor(nbNoncesWithNextVersionCode / uniqIssuersInFrame.length) > 0.6) {
return constants.BLOCK_NEW_GENERATED_VERSION
return constants.DUBP_NEXT_VERSION
}
// Otherwise, we stay on same version
......
......@@ -163,7 +163,7 @@ export class BlockProver {
const remainder = difficulty % 16;
const nbZeros = (difficulty - remainder) / 16;
const highMark = CommonConstants.PROOF_OF_WORK.UPPER_BOUND[remainder];
const notifyVersionJumpReady = block.version === 10 && CommonConstants.BLOCK_NEW_GENERATED_VERSION === 11
const notifyVersionJumpReady = block.version === 10 && CommonConstants.DUBP_NEXT_VERSION === 11
return (async () => {
......
......@@ -43,7 +43,7 @@ describe("Revert two blocks", function() {
before(async () => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11
CommonConstants.DUBP_NEXT_VERSION = 11
s1 = NewTestingServer(
Underscore.extend({
......@@ -291,6 +291,6 @@ describe("Revert two blocks", function() {
})
after(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10
CommonConstants.DUBP_NEXT_VERSION = 10
})
});
......@@ -21,7 +21,7 @@ describe('Certification expiry + trimming', () => writeBasicTestWithConfAnd2User
}, (test) => {
before(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11
CommonConstants.DUBP_NEXT_VERSION = 11
})
const now = 1500000000
......@@ -109,6 +109,6 @@ describe('Certification expiry + trimming', () => writeBasicTestWithConfAnd2User
})
after(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10
CommonConstants.DUBP_NEXT_VERSION = 10
})
}))
......@@ -23,7 +23,7 @@ describe('Certification replay', () => writeBasicTestWithConfAnd2Users({
}, (test) => {
before(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11
CommonConstants.DUBP_NEXT_VERSION = 11
})
const now = 1500000000
......@@ -126,6 +126,6 @@ describe('Certification replay', () => writeBasicTestWithConfAnd2Users({
})
after(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10
CommonConstants.DUBP_NEXT_VERSION = 10
})
}))
......@@ -28,7 +28,7 @@ describe("Fork blocks", function() {
before(async () => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11
CommonConstants.DUBP_NEXT_VERSION = 11
s1 = NewTestingServer({
......@@ -235,6 +235,6 @@ describe("Fork blocks", function() {
})
after(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11
CommonConstants.DUBP_NEXT_VERSION = 11
})
})
......@@ -35,18 +35,18 @@ describe("Membership chainability", function() {
const res1 = await simpleNodeWith2Users(conf)
s1 = res1.s1
cat = res1.cat
const nowVersion = CommonConstants.BLOCK_NEW_GENERATED_VERSION
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10
const nowVersion = CommonConstants.DUBP_NEXT_VERSION
CommonConstants.DUBP_NEXT_VERSION = 10
await s1.commit({ time: now })
await s1.commit({ time: now })
await s1.commit({ time: now, actives: [
'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd:rppB5NEwmdMUCxw3N/QPMk+V1h2Jpn0yxTzdO2xxcNN3MACv6x8vNTChWwM6DOq+kXiQHTczFzoux+82WkMfDQ==:1-12D7B9BEBE941F6929A4A61CDC06DEEEFCB00FD1DA72E42FFF7B19A338D421E1:0-E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855:cat'
]})
CommonConstants.BLOCK_NEW_GENERATED_VERSION = nowVersion
CommonConstants.DUBP_NEXT_VERSION = nowVersion
})
before(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11
CommonConstants.DUBP_NEXT_VERSION = 11
})
it('current should be the 2nd', () => s1.expect('/blockchain/current', (res:any) => {
......@@ -55,7 +55,7 @@ describe("Membership chainability", function() {
}))
before(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10
CommonConstants.DUBP_NEXT_VERSION = 10
})
after(async () => {
......
......@@ -24,7 +24,7 @@ describe('Expired certifications', () => writeBasicTestWithConfAnd2Users({
}, (test) => {
before(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11
CommonConstants.DUBP_NEXT_VERSION = 11
})
const now = 1500000000
......@@ -58,6 +58,6 @@ describe('Expired certifications', () => writeBasicTestWithConfAnd2Users({
})
after(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10
CommonConstants.DUBP_NEXT_VERSION = 10
})
}))
......@@ -23,7 +23,7 @@ describe('Expired identities', () => writeBasicTestWithConfAnd2Users({
}, (test) => {
before(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11
CommonConstants.DUBP_NEXT_VERSION = 11
})
const now = 1500000000
......@@ -47,6 +47,6 @@ describe('Expired identities', () => writeBasicTestWithConfAnd2Users({
})
after(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10
CommonConstants.DUBP_NEXT_VERSION = 10
})
}))
......@@ -23,7 +23,7 @@ describe('Expired membership', () => writeBasicTestWithConfAnd2Users({
}, (test) => {
before(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11
CommonConstants.DUBP_NEXT_VERSION = 11
})
const now = 1500000000
......@@ -58,6 +58,6 @@ describe('Expired membership', () => writeBasicTestWithConfAnd2Users({
})
after(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10
CommonConstants.DUBP_NEXT_VERSION = 10
})
}))
......@@ -22,7 +22,7 @@ describe('Expired transactions', () => writeBasicTestWithConfAnd2Users({
let oldTxWindowValue: number
before(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11
CommonConstants.DUBP_NEXT_VERSION = 11
oldTxWindowValue = CommonConstants.TX_WINDOW
CommonConstants.TX_WINDOW = 2 // We need a low value to pass time bounds rules
})
......@@ -48,7 +48,7 @@ describe('Expired transactions', () => writeBasicTestWithConfAnd2Users({
})
after(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10
CommonConstants.DUBP_NEXT_VERSION = 10
CommonConstants.TX_WINDOW = oldTxWindowValue
})
}))
......@@ -59,7 +59,7 @@ describe("WOTB module", () => {
before(async () => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11
CommonConstants.DUBP_NEXT_VERSION = 11
s1 = NewTestingServer(
Underscore.extend({
......@@ -452,7 +452,7 @@ describe("WOTB module", () => {
});
after(() => {
CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10
CommonConstants.DUBP_NEXT_VERSION = 10
})
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment