Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1899 from LiskHQ/1898-indexing-issues-against-the…
Browse files Browse the repository at this point in the history
…-testnet

Indexing issues against the testnet
  • Loading branch information
sameersubudhi authored Oct 26, 2023
2 parents 8d4a2f8 + f019cf3 commit 04d0de9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions services/blockchain-app-registry/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ config.gitHub = {

config.dataDir = `${__dirname}/data`;

config.supportedNetworks = ['mainnet', 'testnet', 'betanet', 'devnet'];
config.supportedNetworks = ['mainnet', 'testnet', 'devnet'];

const DEFAULT_LISK_APPS = ['lisk_mainchain'];
const DEFAULT_USER_APPS = String(process.env.DEFAULT_APPS).split(',');
Expand All @@ -94,7 +94,6 @@ config.ALLOWED_FILE_EXTENSIONS = ['.png', '.svg'];
config.CHAIN_ID_PREFIX_NETWORK_MAP = Object.freeze({
'00': 'mainnet',
'01': 'testnet',
'02': 'betanet',
'04': 'devnet',
});

Expand Down
2 changes: 1 addition & 1 deletion services/blockchain-app-registry/shared/utils/regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Removal or modification of this copyright notice is prohibited.
*
*/
const NETWORK = /^\b(?:mainnet|testnet|betanet|devnet|,)+\b$/;
const NETWORK = /^\b(?:mainnet|testnet|devnet|,)+\b$/;
const MAINCHAIN_ID = /^[a-fA-F0-9]{2}000000$/;

module.exports = {
Expand Down
6 changes: 4 additions & 2 deletions services/blockchain-indexer/shared/utils/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
*/
const { parseToJSONCompatObj } = require('./parser');
const { TRANSACTION_STATUS, EVENT } = require('../constants');
const { TRANSACTION_STATUS, EVENT, EVENT_TOPIC_PREFIX } = require('../constants');

const normalizeTransaction = async tx => {
tx.moduleCommand = `${tx.module}:${tx.command}`;
Expand All @@ -24,7 +24,9 @@ const normalizeTransaction = async tx => {
const getTransactionExecutionStatus = (tx, events) => {
const expectedEventName = `${tx.module}:${EVENT.COMMAND_EXECUTION_RESULT}`;
const commandExecResultEvents = events.filter(e => `${e.module}:${e.name}` === expectedEventName);
const txExecResultEvent = commandExecResultEvents.find(e => e.topics.includes(tx.id));
const txExecResultEvent = commandExecResultEvents.find(
e => e.topics.includes(EVENT_TOPIC_PREFIX.TX_ID.concat(tx.id)) || e.topics.includes(tx.id),
);
if (!txExecResultEvent)
throw Error(`Event unavailable to determine execution status for transaction: ${tx.id}.`);

Expand Down
7 changes: 4 additions & 3 deletions services/market/shared/market/sources/exchangeratesapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ const fetchAllCurrencyConversionRates = async () => {
};

const standardizeCurrencyConversionRates = rawConversionRates => {
const [transformedConversionRates] = Object.entries(rawConversionRates).map(
([baseCur, conversionRates]) =>
const [transformedConversionRates] = Object.entries(rawConversionRates)
.filter(([, conversionRates]) => !!conversionRates)
.map(([baseCur, conversionRates]) =>
Object.getOwnPropertyNames(conversionRates).map(targetCur => ({
symbol: `${baseCur}_${targetCur}`,
price: conversionRates[targetCur],
})),
);
);
const standardizedConversionRates = Array.isArray(transformedConversionRates)
? transformedConversionRates.map(conversionRate => {
const [from, to] = conversionRate.symbol.split('_');
Expand Down

0 comments on commit 04d0de9

Please sign in to comment.