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

[ref] rename BLOCK_GENERATED_VERSION -> BLOCK_GENESIS_VERSION

parent 24bd5270
......@@ -101,7 +101,8 @@ export const CommonConstants = {
SIGNATURE
},
BLOCK_GENERATED_VERSION: 10,
// Version of genesis block
BLOCK_GENESIS_VERSION: 10,
BLOCK_NEW_GENERATED_VERSION: 11, // Put it to 11 when ready
LAST_VERSION_FOR_TX: 10,
TRANSACTION_VERSION: 10,
......
......@@ -53,7 +53,7 @@ export class BlockchainContext {
// But if no HEAD_1 exist, we must initialize a block with default values
if (!this.vHEAD_1) {
block = {
version: constants.BLOCK_GENERATED_VERSION,
version: constants.BLOCK_GENESIS_VERSION,
time: Math.round(Date.now() / 1000),
powMin: this.conf.powMin || 0,
powZeros: 0,
......
......@@ -99,7 +99,7 @@ module.exports = {
PUBLIC_KEY: exact(PUBKEY),
DOCUMENTS_VERSION: CommonConstants.DOCUMENTS_VERSION,
BLOCK_GENERATED_VERSION: CommonConstants.BLOCK_GENERATED_VERSION,
BLOCK_GENESIS_VERSION: CommonConstants.BLOCK_GENESIS_VERSION,
LAST_VERSION_FOR_TX: 10,
TRANSACTION_VERSION: CommonConstants.TRANSACTION_VERSION,
......
......@@ -529,7 +529,7 @@ export const LOCAL_RULES_HELPERS = {
return !current
// 1. We use legacy version
? constants.BLOCK_GENERATED_VERSION : (async () => {
? constants.BLOCK_GENESIS_VERSION : (async () => {
// 2. If we can, we go to the next version
const blocksInFrame = (await dal.getBlocksBetween(current.number - current.issuersFrame + 1, current.number))
......
......@@ -149,7 +149,7 @@ export class IdentityService extends FIFOService {
}
toSave.expires_on = basedBlock.medianTime + this.conf.idtyWindow;
}
await GLOBAL_RULES_FUNCTIONS.checkIdentitiesAreWritable({ identities: [idtyObj.inline()], version: (current && current.version) || constants.BLOCK_GENERATED_VERSION }, this.conf, this.dal);
await GLOBAL_RULES_FUNCTIONS.checkIdentitiesAreWritable({ identities: [idtyObj.inline()], version: (current && current.version) || constants.BLOCK_GENESIS_VERSION }, this.conf, this.dal);
if (byAbsorption !== BY_ABSORPTION) {
if (!(await this.dal.idtyDAL.sandbox.acceptNewSandBoxEntry({
certsCount: 0,
......
......@@ -34,7 +34,7 @@ var mocks = {
block0: {
"hash" : "00063EB6E83F8717CEF1D25B3E2EE308374A14B1",
"signature" : "+78w7251vvRdhoIJ6IWHEiEOLxNrmfQf45Y5sYvPdnAdXkVpO1unMV5YA/G5Vhphyz1dICrbeKCPM5qbFsoWAQ==",
"version" : constants.BLOCK_GENERATED_VERSION,
"version" : constants.BLOCK_GENESIS_VERSION,
"currency" : "meta_brouzouf",
"issuer" : "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk",
"parameters" : "0.1:86400:100:604800:2629800:3:3:2629800:3:11:600:20:144:0.67",
......
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