diff --git a/app/lib/common-libs/constants.ts b/app/lib/common-libs/constants.ts index f39c4e76fd08fd8c12fa0f15d8c1c26b8433b811..cf5224b66ae5f8e20cab28f932e135bd368a31ef 100755 --- a/app/lib/common-libs/constants.ts +++ b/app/lib/common-libs/constants.ts @@ -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, diff --git a/app/lib/computation/BlockchainContext.ts b/app/lib/computation/BlockchainContext.ts index 015a9047eb3836a420160ee826c4c75e369ced81..899b4b266336e9763a6ec2bc0f87654c3b71af71 100644 --- a/app/lib/computation/BlockchainContext.ts +++ b/app/lib/computation/BlockchainContext.ts @@ -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, diff --git a/app/lib/constants.ts b/app/lib/constants.ts index ee55efaa0229b188d87e50d1018478c667655d12..8e2b5c6bf9f1b4ce8e208dbd3b2adcc827cb1733 100644 --- a/app/lib/constants.ts +++ b/app/lib/constants.ts @@ -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, diff --git a/app/lib/rules/local_rules.ts b/app/lib/rules/local_rules.ts index 35ed12a8a1ac1fad33d040cadd9dab3d198cc6ef..81a536cbcfee126a3cb7d071fc80d0fe1251eca6 100644 --- a/app/lib/rules/local_rules.ts +++ b/app/lib/rules/local_rules.ts @@ -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)) diff --git a/app/service/IdentityService.ts b/app/service/IdentityService.ts index db27bbf8a6faa57fb0be151af85ceb843662658e..99b1b1d534e9d5db12d81f77217822cffbd87578 100644 --- a/app/service/IdentityService.ts +++ b/app/service/IdentityService.ts @@ -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, diff --git a/test/dal/basic-dal-tests.ts b/test/dal/basic-dal-tests.ts index 6b578f7d5ca597ed18ffa22d0023605dce018d23..3692640125fed0f48cdd96f1cb9945fd1985a809 100644 --- a/test/dal/basic-dal-tests.ts +++ b/test/dal/basic-dal-tests.ts @@ -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",