From 56be30d83b301afb8c0af21297c1e41e45677c93 Mon Sep 17 00:00:00 2001 From: iambeone Date: Fri, 17 Jan 2020 20:46:06 +0500 Subject: [PATCH] fixing issue with multiple senders in one event (#273) * fixing issue with multiple senders in one event * Update lib/source/cosmosV2-source.js Co-authored-by: Fabian --- lib/source/cosmosV2-source.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/source/cosmosV2-source.js b/lib/source/cosmosV2-source.js index 6e82dc212a..4e6e1724ee 100644 --- a/lib/source/cosmosV2-source.js +++ b/lib/source/cosmosV2-source.js @@ -56,11 +56,11 @@ class CosmosV2API extends CosmosV0API { // extract all addresses from events that are either sender or recipient const involvedAddresses = transaction.events.reduce( (involvedAddresses, event) => { - const senderAttribute = event.attributes.find( - ({ key }) => key === 'sender' - ) - if (senderAttribute) { - involvedAddresses.push(senderAttribute.value) + const senderAttributes = event.attributes + .filter(({ key }) => key === 'sender') + .map(sender => sender.value) + if (senderAttributes.length) { + involvedAddresses = [...involvedAddresses, ...senderAttributes] } const recipientAttribute = event.attributes.find(