diff --git a/src/transformers/_common/parties.ts b/src/transformers/_common/parties.ts index 8e8bc48..adcca73 100644 --- a/src/transformers/_common/parties.ts +++ b/src/transformers/_common/parties.ts @@ -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 !== '') : []; @@ -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 !== ''); @@ -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 !== '');