Skip to content

Commit

Permalink
considering only if have contractId and assetId
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigobranas committed Sep 23, 2024
1 parent d7849e8 commit e8c2e3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/graphql/src/application/uc/NewAddBlockRange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ export default class NewAddBlockRange {
}
if (transaction.data?.status?.receipts) {
for (const receipt of transaction.data.status.receipts) {
if (receipt.receiptType === 'TRANSFER_OUT') {
if (
receipt.receiptType === 'TRANSFER_OUT' &&
receipt.assetId &&
receipt.id
) {
queries.push({
statement:
'insert into indexer.assets_contracts (asset_id, contract_id) values ($1, $2) on conflict do nothing',
Expand Down
6 changes: 5 additions & 1 deletion packages/graphql/src/migrate-transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ async function migrate(from: number, to: number) {
);
for (const transaction of transactions) {
for (const receipt of transaction.data.status.receipts) {
if (receipt.receiptType === 'TRANSFER_OUT') {
if (
receipt.receiptType === 'TRANSFER_OUT' &&
receipt.assetId &&
receipt.id
) {
await connection.query(
'insert into indexer.assets_contracts (asset_id, contract_id) values ($1, $2) on conflict do nothing',
[receipt.assetId, receipt.id],
Expand Down

0 comments on commit e8c2e3f

Please sign in to comment.