GalaChain/sdk

checkAllowances() erroneously filters out allowances that have not expired

Closed this issue · 0 comments

The checkAllowances() function defined in chaincode/src/allowances/checkAllowances/ts contains a bug that filters out allowances that have not expired, instead of allowances that have expired.

https://github.com/GalaChain/sdk/blob/main/chaincode/src/allowances/checkAllowances.ts#L114

      (allowance.expires === 0 || isAllowanceExpired(ctx, allowance))

should be

      (allowance.expires === 0 || !isAllowanceExpired(ctx, allowance))

We'll want some unit tests to replicate the issue and a patch to fix it.