Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OriginTrail Testnet Release v6.5.1 #3264

Merged
merged 9 commits into from
Jul 19, 2024
12 changes: 6 additions & 6 deletions ot-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ class OTNode {
this.config,
);

await MigrationExecutor.executeServiceAgreementPruningMigration(
this.container,
this.logger,
this.config,
);

await this.initializeRouters();
await this.startNetworkModule();
this.startTelemetryModule();
Expand All @@ -96,6 +90,12 @@ class OTNode {
this.config,
);

MigrationExecutor.executeServiceAgreementPruningMigration(
this.container,
this.logger,
this.config,
);

MigrationExecutor.executeRemoveDuplicateServiceAgreementMigration(
this.container,
this.logger,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "origintrail_node",
"version": "6.5.1+hotfix.2",
"version": "6.5.1",
"description": "OTNode V6",
"main": "index.js",
"type": "module",
Expand Down
22 changes: 13 additions & 9 deletions src/migration/remove-duplicate-service-agreement-migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ class RemoveDuplicateServiceAgreementMigration extends BaseMigration {
blockchainId,
);
for (const serviceAgreement of findDuplicateServiceAgreements) {
const blockchainAssertionId =
// eslint-disable-next-line no-await-in-loop
await this.blockchainModuleManager.getAssertionIdByIndex(
blockchainId,
serviceAgreement.assetStorageContractAddress,
serviceAgreement.tokenId,
serviceAgreement.stateIndex,
);
if (serviceAgreement.assertionId !== blockchainAssertionId) {
try {
const blockchainAssertionId =
// eslint-disable-next-line no-await-in-loop
await this.blockchainModuleManager.getAssertionIdByIndex(
blockchainId,
serviceAgreement.assetStorageContractAddress,
serviceAgreement.tokenId,
serviceAgreement.stateIndex,
);
if (serviceAgreement.assertionId !== blockchainAssertionId) {
incorrectServiceAgreementId.push(serviceAgreement.agreementId);
}
} catch (error) {
incorrectServiceAgreementId.push(serviceAgreement.agreementId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ class ServiceAgreementRepository {
const query = `
DELETE FROM service_agreement
WHERE blockchain_id = '${blockchainId}'
AND asset_storage_contract_address = '${contract}'
AND asset_storage_contract_address != '${contract}'
LIMIT 100000;
`;
await this.model.query(query, {
await this.sequelize.query(query, {
type: Sequelize.QueryTypes.DELETE,
});
}
Expand Down
Loading