Skip to content

Commit

Permalink
fix toOwner field
Browse files Browse the repository at this point in the history
  • Loading branch information
ashkuc committed Jul 25, 2023
1 parent 1680416 commit 478c86b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions apps/crawler/src/services/extrinsic.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export class ExtrinsicService {
method.toLowerCase() === EventMethod.TRANSFER.toLowerCase()
) {
acc.amount = values.amount;
acc.toOwner = values.to?.value || null;
acc.toOwner =
typeof values.to === 'string' ? values.to : values.to?.value || null;
} else if (
section.toLowerCase() === EventSection.TREASURY.toLowerCase() &&
method.toLowerCase() === EventMethod.DEPOSIT.toLowerCase()
Expand All @@ -88,7 +89,8 @@ export class ExtrinsicService {
section.toLowerCase() === EventSection.UNIQUE.toLowerCase() ) &&
method.toLowerCase() === EventMethod.TRANSFER.toLowerCase()
) {
acc.toOwner = values.to?.value || null;
acc.toOwner =
typeof values.to === 'string' ? values.to : values.to?.value || null;
}
}
return acc;
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": "polkastats-backend-uniquenetwork",
"version": "2.0.56",
"version": "2.0.57",
"description": "",
"author": "Unique Network Team",
"private": true,
Expand Down

0 comments on commit 478c86b

Please sign in to comment.