Skip to content

Commit

Permalink
fixing issue with multiple senders in one event (#273)
Browse files Browse the repository at this point in the history
* fixing issue with multiple senders in one event

* Update lib/source/cosmosV2-source.js

Co-authored-by: Fabian <[email protected]>
  • Loading branch information
iambeone and faboweb committed Jan 17, 2020
1 parent 1208ff8 commit 56be30d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/source/cosmosV2-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 56be30d

Please sign in to comment.