diff --git a/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-request-command.js b/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-request-command.js index 731356946..d8552ac9c 100644 --- a/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-request-command.js +++ b/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-request-command.js @@ -37,7 +37,7 @@ class HandleGetRequestCommand extends HandleProtocolMessageCommand { ual, includeMetadata, isOperationV0, - isOldContract, + isV6Contract, } = commandData; let { assertionId, knowledgeAssetId } = commandData; @@ -229,7 +229,7 @@ class HandleGetRequestCommand extends HandleProtocolMessageCommand { const responseData = { assertion: - (isOperationV0 || notMigrated) && isOldContract + (isOperationV0 || notMigrated) && isV6Contract ? [...(assertion.public ?? []), ...(assertion.private ?? [])] : assertion, ...(includeMetadata && metadata && { metadata }), diff --git a/src/commands/protocols/get/sender/get-validate-asset-command.js b/src/commands/protocols/get/sender/get-validate-asset-command.js index 9831b5c2c..dc65a1025 100644 --- a/src/commands/protocols/get/sender/get-validate-asset-command.js +++ b/src/commands/protocols/get/sender/get-validate-asset-command.js @@ -30,7 +30,7 @@ class GetValidateAssetCommand extends ValidateAssetCommand { knowledgeCollectionId, ual, isOperationV0, - isOldContract, + isV6Contract, } = command.data; await this.operationIdService.updateOperationIdStatus( operationId, @@ -56,7 +56,7 @@ class GetValidateAssetCommand extends ValidateAssetCommand { blockchain, ); // TODO: Update to validate knowledge asset index - if (!isOperationV0 && !isOldContract) { + if (!isOperationV0 && !isV6Contract) { const isValidUal = await this.validationService.validateUal( blockchain, contract, diff --git a/src/commands/protocols/get/sender/local-get-command.js b/src/commands/protocols/get/sender/local-get-command.js index 79d2bc472..ec7abf963 100644 --- a/src/commands/protocols/get/sender/local-get-command.js +++ b/src/commands/protocols/get/sender/local-get-command.js @@ -35,7 +35,7 @@ class LocalGetCommand extends Command { contentType, assertionId, isOperationV0, - isOldContract, + isV6Contract, } = command.data; let { knowledgeAssetId } = command.data; await this.operationIdService.updateOperationIdStatus( @@ -219,7 +219,7 @@ class LocalGetCommand extends Command { const responseData = { assertion: - (isOperationV0 || notMigrated) && isOldContract + (isOperationV0 || notMigrated) && isV6Contract ? [...(assertion?.public ?? []), ...(assertion?.private ?? [])] : assertion, ...(includeMetadata && metadata && { metadata }), diff --git a/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-request-command.js b/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-request-command.js index d292d9e9b..d541816bd 100644 --- a/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-request-command.js +++ b/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-request-command.js @@ -51,7 +51,7 @@ class GetRequestCommand extends ProtocolRequestCommand { paranetId, isOperationV0, assertionId, - isOldContract, + isV6Contract, } = command.data; return { @@ -65,7 +65,7 @@ class GetRequestCommand extends ProtocolRequestCommand { paranetId, isOperationV0, assertionId, - isOldContract, + isV6Contract, }; } @@ -76,7 +76,7 @@ class GetRequestCommand extends ProtocolRequestCommand { knowledgeCollectionId, knowledgeAssetId, isOperationV0, - isOldContract, + isV6Contract, } = command.data; if (responseData?.assertion?.public) { @@ -103,7 +103,7 @@ class GetRequestCommand extends ProtocolRequestCommand { ...kcTools.groupNquadsBySubject(privateHashTriples, true), ); - if (!isOldContract) { + if (!isV6Contract) { try { await this.validationService.validateDatasetOnBlockchain( publicKnowledgeAssetsTriplesGrouped.map((t) => t.sort()).flat(), diff --git a/src/constants/constants.js b/src/constants/constants.js index 0ae75657b..dcc714dd4 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -1187,7 +1187,7 @@ export const TRIPLES_VISIBILITY = { ALL: 'all', }; -export const OLD_CONTENT_STORAGE_MAP = { +export const V6_CONTENT_STORAGE_MAP = { BASE_MAINNET: '0x3bdfA81079B2bA53a25a6641608E5E1E6c464597', BASE_TESTNET: '0x9e3071Dc0730CB6dd0ce42969396D716Ea33E7e1', BASE_DEVNET: '0xBe08A25dcF2B68af88501611e5456571f50327B4', diff --git a/src/controllers/http-api/v0/get-http-api-controller-v0.js b/src/controllers/http-api/v0/get-http-api-controller-v0.js index 60569f7b5..3f8385e7d 100644 --- a/src/controllers/http-api/v0/get-http-api-controller-v0.js +++ b/src/controllers/http-api/v0/get-http-api-controller-v0.js @@ -3,7 +3,7 @@ import { OPERATION_STATUS, ERROR_TYPE, TRIPLES_VISIBILITY, - OLD_CONTENT_STORAGE_MAP, + V6_CONTENT_STORAGE_MAP, } from '../../../constants/constants.js'; import BaseController from '../base-http-api-controller.js'; @@ -65,13 +65,13 @@ class GetController extends BaseController { // Get assertionId - datasetRoot // - const isOldContract = Object.values(OLD_CONTENT_STORAGE_MAP).some((ca) => + const isV6Contract = Object.values(V6_CONTENT_STORAGE_MAP).some((ca) => ca.toLowerCase().includes(contract.toLowerCase()), ); const commandSequence = []; - if (!tripleStoreMigrationAlreadyExecuted && isOldContract) { + if (!tripleStoreMigrationAlreadyExecuted && isV6Contract) { commandSequence.push('getAssertionMerkleRootCommand'); } @@ -90,7 +90,7 @@ class GetController extends BaseController { knowledgeAssetId, operationId, paranetUAL, - isOldContract, + isV6Contract, contentType: contentType ?? TRIPLES_VISIBILITY.ALL, isOperationV0: true, }, diff --git a/src/controllers/http-api/v1/get-http-api-controller-v1.js b/src/controllers/http-api/v1/get-http-api-controller-v1.js index 56cb167ac..d139c5bdb 100644 --- a/src/controllers/http-api/v1/get-http-api-controller-v1.js +++ b/src/controllers/http-api/v1/get-http-api-controller-v1.js @@ -3,7 +3,7 @@ import { OPERATION_STATUS, ERROR_TYPE, TRIPLES_VISIBILITY, - OLD_CONTENT_STORAGE_MAP, + V6_CONTENT_STORAGE_MAP, } from '../../../constants/constants.js'; import BaseController from '../base-http-api-controller.js'; @@ -66,14 +66,14 @@ class GetController extends BaseController { // Get assertionId - datasetRoot // - const isOldContract = Object.values(OLD_CONTENT_STORAGE_MAP).some((ca) => + const isV6Contract = Object.values(V6_CONTENT_STORAGE_MAP).some((ca) => ca.toLowerCase().includes(contract.toLowerCase()), ); const commandSequence = []; commandSequence.push('getValidateAssetCommand'); - if (!tripleStoreMigrationAlreadyExecuted && isOldContract) { + if (!tripleStoreMigrationAlreadyExecuted && isV6Contract) { commandSequence.push('getAssertionMerkleRootCommand'); } @@ -92,7 +92,7 @@ class GetController extends BaseController { knowledgeAssetId, operationId, paranetUAL, - isOldContract, + isV6Contract, contentType: contentType ?? TRIPLES_VISIBILITY.ALL, }, transactional: false, diff --git a/src/controllers/rpc/get-rpc-controller.js b/src/controllers/rpc/get-rpc-controller.js index d587e9144..b04812eb9 100644 --- a/src/controllers/rpc/get-rpc-controller.js +++ b/src/controllers/rpc/get-rpc-controller.js @@ -39,7 +39,7 @@ class GetController extends BaseController { paranetId: message.data.paranetId, isOperationV0: message.data.isOperationV0, assertionId: message.data.assertionId, - isOldContract: message.data.isOldContract, + isV6Contract: message.data.isV6Contract, }, transactional: false, });