fix: dispense for multiple boxes with same denom

This commit is contained in:
Rafael Taranto 2024-01-25 14:58:39 +00:00
parent 8d807294c3
commit 1507dcced9

View file

@ -138,7 +138,12 @@ const solutionToOriginalUnits = (solution, units) => {
const billsLeft = _.flow(
_.map(([denomination, provisioned]) => [BN(denomination), provisioned]),
_.fromPairs,
_.reduce((acc, value) => {
acc[value[0]] = (acc[value[0]] || BN(0)).plus(value[1])
return acc
},
{}
)
)(solution)
return _.map(