Skip to content

Commit

Permalink
log transaction if tag is empty (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
faboweb authored Oct 30, 2019
1 parent f0a78d4 commit 5832099
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/cosmosV0-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class CosmosV0API extends RESTDataSource {

extractInvolvedAddresses(transaction) {
const involvedAddresses = transaction.tags.reduce((addresses, tag) => {
// temporary in here to identify why this fails
if (!tag.value) {
console.log(JSON.stringify(transaction))
return addresses
}
if (tag.value.startsWith(`cosmos`)) {
addresses.push(tag.value)
}
Expand Down Expand Up @@ -146,8 +151,8 @@ class CosmosV0API extends RESTDataSource {
const consensusAddress = pubkeyToAddress(validator.consensus_pubkey)
validator.voting_power = consensusValidators[consensusAddress]
? BigNumber(consensusValidators[consensusAddress].voting_power)
.div(totalVotingPower)
.toNumber()
.div(totalVotingPower)
.toNumber()
: 0
validator.signing_info = signingInfos[consensusAddress]
})
Expand Down

0 comments on commit 5832099

Please sign in to comment.