fix percentage for destinations when is notional (#389)

This commit is contained in:
ftocal 2023-06-08 10:38:34 -03:00 committed by GitHub
parent 598db1b876
commit b02d602b14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -268,9 +268,6 @@ func (c *Controller) createChainActivityResponse(activity []transactions.ChainAc
percentage, _ := item.Volume.Div(total).Mul(oneHundred).Float64()
item.Percentage = percentage
}
if isNotional {
item.Volume = convertToDecimal(item.Volume)
}
for i, destination := range item.Destinations {
if item.Volume.GreaterThan(decimal.Zero) {
percentage, _ := destination.Volume.Div(item.Volume).Mul(oneHundred).Float64()
@ -280,6 +277,9 @@ func (c *Controller) createChainActivityResponse(activity []transactions.ChainAc
item.Destinations[i].Volume = convertToDecimal(destination.Volume)
}
}
if isNotional {
item.Volume = convertToDecimal(item.Volume)
}
txs = append(txs, *item)
}
return txs, nil