Skip to content

Commit

Permalink
Merge pull request #3642 from OriginTrail/v6/release/testnet
Browse files Browse the repository at this point in the history
V8.0.0+hotfix.3 Mainnet Prerelease
  • Loading branch information
Mihajlo-Pavlovic authored Dec 27, 2024
2 parents 85f86b9 + 43e9364 commit cca1a77
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 12 deletions.
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": "8.0.0+hotfix.1",
"version": "8.0.0+hotfix.3",
"description": "OTNode V8",
"main": "index.js",
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ class BlockchainEventListenerCommand extends Command {
}

async handleParameterChangedEvent(event) {
const { blockchainId, contract, data } = event;
const { blockchain, contract, data } = event;
const { parameterName, parameterValue } = JSON.parse(data);
switch (contract) {
case CONTRACTS.PARAMETERS_STORAGE:
this.blockchainModuleManager.setContractCallCache(
blockchainId,
blockchain,
CONTRACTS.PARAMETERS_STORAGE,
parameterName,
parameterValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class ProtocolScheduleMessagesCommand extends Command {
currentBatchNodes.length
}, leftover for retry: ${currentBatchLeftoverNodes.length}`,
);
const nextCommandData = this.getNextCommandData(command);

const addCommandPromises = currentBatchNodes.map(async (node) => {
const commandSequence = this.protocolService.getSenderCommandSequence(node.protocol);
Expand All @@ -48,7 +49,7 @@ class ProtocolScheduleMessagesCommand extends Command {
sequence: commandSequence.slice(1),
delay: 0,
data: {
...this.getNextCommandData(command),
...nextCommandData,
blockchain,
operationId,
node,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,15 @@ class HandleGetRequestCommand extends HandleProtocolMessageCommand {
burned: [],
};
}
} else {
// kaId is number, so transform it to range
knowledgeAssetId = {
startTokenId: knowledgeAssetId,
endTokenId: knowledgeAssetId,
burned: [],
};
}

assertionPromise = this.tripleStoreService
.getAssertion(
blockchain,
Expand Down
8 changes: 8 additions & 0 deletions src/commands/protocols/get/sender/local-get-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,15 @@ class LocalGetCommand extends Command {
burned: [],
};
}
} else {
// kaId is number, so transform it to range
knowledgeAssetId = {
startTokenId: knowledgeAssetId,
endTokenId: knowledgeAssetId,
burned: [],
};
}

assertionPromise = this.tripleStoreService
.getAssertion(
blockchain,
Expand Down
16 changes: 10 additions & 6 deletions src/modules/blockchain/blockchain-module-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ class BlockchainModuleManager extends BaseModuleManager {
}

callImplementationFunction(blockchain, functionName, args = []) {
if (blockchain) {
if (this.getImplementation(blockchain)) {
return this.getImplementation(blockchain).module[functionName](...args);
}
} else {
return this.getImplementation().module[functionName](...args);
if (this.getImplementation(blockchain)) {
return this.getImplementation(blockchain).module[functionName](...args);
}
}

Expand Down Expand Up @@ -282,6 +278,14 @@ class BlockchainModuleManager extends BaseModuleManager {
tokenId,
]);
}

getImplementation(name = null) {
const keys = Object.keys(this.handlers);
if (!keys.includes(name)) {
throw new Error(`Blockchain: ${name} implementation is not enabled.`);
}
return this.handlers[name];
}
}

export default BlockchainModuleManager;

0 comments on commit cca1a77

Please sign in to comment.