Adds the missing regression tests for #325. No source change.
resolveTokenDecimals() in src/shared/approvalAmount.js already treats a scale of 0 from the bundled token list or from a tracked token as an answer. No test held it there. tests/approvalAmount.test.js now asserts a scale of 0 from each of those two sources, both from the resolver and on the approval screen's Amount line:
The bundled token is SLP, the bundled list's 0-decimal entry. The resolver test also gives SLP a tracked entry at 18, so a skipped 0 shows up as the wrong scale and not only as a missing one. The tracked-token test adds an explorer report of 18 for the same reason.
The Amount-line tests have no second source, so there a skipped 0 reads "decimals unknown", which is the failure the issue describes.
Mutation: changing the bundled if (d !== null) return d; to if (d) return d; failed the two bundled tests (the resolver returned 18; the Amount line read 5000 base units (decimals unknown)). The same change to the tracked check failed the two tracked tests.
The toDecimals() half of the issue landed earlier with #349. It is defined only in src/shared/transferAmount.js, and every caller imports it from there.
Model: opus-5-5
Adds the missing regression tests for https://git.eeqj.de/sneak/AutistMask/issues/325. No source change.
`resolveTokenDecimals()` in `src/shared/approvalAmount.js` already treats a scale of 0 from the bundled token list or from a tracked token as an answer. No test held it there. `tests/approvalAmount.test.js` now asserts a scale of 0 from each of those two sources, both from the resolver and on the approval screen's Amount line:
- The bundled token is SLP, the bundled list's 0-decimal entry. The resolver test also gives SLP a tracked entry at 18, so a skipped 0 shows up as the wrong scale and not only as a missing one. The tracked-token test adds an explorer report of 18 for the same reason.
- The Amount-line tests have no second source, so there a skipped 0 reads "decimals unknown", which is the failure the issue describes.
Mutation: changing the bundled `if (d !== null) return d;` to `if (d) return d;` failed the two bundled tests (the resolver returned 18; the Amount line read `5000 base units (decimals unknown)`). The same change to the tracked check failed the two tracked tests.
The `toDecimals()` half of the issue landed earlier with https://git.eeqj.de/sneak/AutistMask/issues/349. It is defined only in `src/shared/transferAmount.js`, and every caller imports it from there.
Model: opus-5-5
resolveTokenDecimals() treats a scale of 0 from the bundled list or a
tracked token as an answer, but nothing tested it: changing either
`d !== null` check to a plain truthiness check left every test green
while a zero-decimal token fell through to the next source or to
"decimals unknown".
The approval tests now assert a scale of 0 from each source, both from
the resolver and on the approval screen's Amount line. toDecimals() was
already shared from transferAmount.js since #349.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adds the missing regression tests for #325. No source change.
resolveTokenDecimals()insrc/shared/approvalAmount.jsalready treats a scale of 0 from the bundled token list or from a tracked token as an answer. No test held it there.tests/approvalAmount.test.jsnow asserts a scale of 0 from each of those two sources, both from the resolver and on the approval screen's Amount line:Mutation: changing the bundled
if (d !== null) return d;toif (d) return d;failed the two bundled tests (the resolver returned 18; the Amount line read5000 base units (decimals unknown)). The same change to the tracked check failed the two tracked tests.The
toDecimals()half of the issue landed earlier with #349. It is defined only insrc/shared/transferAmount.js, and every caller imports it from there.Model: opus-5-5
PASS
Model: opus-5-5