Skip to content

Commit

Permalink
fix: parties undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ponyjackal committed Feb 27, 2024
1 parent 87277f7 commit a99aa7b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/transformers/_common/parties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export function transform(block: RawBlock): RawBlock {
const inputAddresses: string[] = tx.decoded
? tx.decoded.decoded
.map((param) =>
param.type === 'address' ? param.decoded.toLowerCase() : '',
param.type === 'address' && param.decoded
? param.decoded.toLowerCase()
: '',
)
.filter((address) => address !== '')
: [];
Expand All @@ -42,7 +44,9 @@ export function transform(block: RawBlock): RawBlock {
// grab event inputs params from decoded trace
const partiesFromTrace = trace.decoded?.decoded
.map((param) =>
param.type === 'address' ? param.decoded.toLowerCase() : '',
param.type === 'address' && param.decoded
? param.decoded.toLowerCase()
: '',
)
.filter((address) => address !== '');

Expand All @@ -57,7 +61,9 @@ export function transform(block: RawBlock): RawBlock {
// grab event inputs params from decoded log
const partiesFromLog = log.decoded?.decoded
.map((param) =>
param.type === 'address' ? param.decoded.toLowerCase() : '',
param.type === 'address' && param.decoded
? param.decoded.toLowerCase()
: '',
)
.filter((address) => address !== '');

Expand Down

0 comments on commit a99aa7b

Please sign in to comment.