Skip to content

Commit 0142024

Browse files
authored
Merge pull request #388 from hack-a-chain-software/dataloader-fix
fix: remove unnecessary error throwing in dataloaders
2 parents 15c23de + cbaf8b7 commit 0142024

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

indexer/src/kadena-server/repository/infra/repository/block-db-repository.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -610,12 +610,6 @@ export default class BlockDbRepository implements BlockRepository {
610610
[eventIds],
611611
);
612612

613-
if (blockRows.length !== eventIds.length) {
614-
throw new Error(
615-
`[ERROR][DB][DATA_CORRUPT] Fetched blocks count (${blockRows.length}) does not match event IDs count (${eventIds.length}).`,
616-
);
617-
}
618-
619613
const blockMap = blockRows.reduce(
620614
(acum, row) => ({
621615
...acum,
@@ -663,12 +657,6 @@ export default class BlockDbRepository implements BlockRepository {
663657
[transactionIds],
664658
);
665659

666-
if (blockRows.length !== transactionIds.length) {
667-
throw new Error(
668-
`[ERROR][DB][DATA_CORRUPT] Fetched blocks count (${blockRows.length}) does not match transaction IDs count (${transactionIds.length}).`,
669-
);
670-
}
671-
672660
const blockMap = blockRows.reduce(
673661
(acum, row) => ({
674662
...acum,
@@ -714,12 +702,6 @@ export default class BlockDbRepository implements BlockRepository {
714702
[hashes],
715703
);
716704

717-
if (blockRows.length !== hashes.length) {
718-
throw new Error(
719-
`[ERROR][DB][DATA_CORRUPT] Fetched blocks count (${blockRows.length}) does not match requested hashes count (${hashes.length}).`,
720-
);
721-
}
722-
723705
const blockMap = blockRows.reduce(
724706
(acum, row) => ({
725707
...acum,

indexer/src/kadena-server/repository/infra/repository/transaction-db-repository.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -772,12 +772,6 @@ export default class TransactionDbRepository implements TransactionRepository {
772772
[eventIds],
773773
);
774774

775-
if (rows.length !== eventIds.length) {
776-
throw new Error(
777-
`[ERROR][DB][DATA_CORRUPT] Fetched blocks count (${rows.length}) does not match event IDs count (${eventIds.length}).`,
778-
);
779-
}
780-
781775
const transactionMap = rows.reduce(
782776
(acum, row) => ({
783777
...acum,

0 commit comments

Comments
 (0)