fix(asset_scaling): match base asset exactly, not as a string prefix#140
fix(asset_scaling): match base asset exactly, not as a string prefix#140gfyrag wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## test/asset-scaling-prefix-match-bug #140 +/- ##
======================================================================
Coverage ? 66.95%
======================================================================
Files ? 47
Lines ? 5069
Branches ? 0
======================================================================
Hits ? 3394
Misses ? 1477
Partials ? 198 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6556b5b to
077d45e
Compare
ff49c47 to
7b65e3f
Compare
Tighten `getAssets` so an entry belongs to the scaling pool iff its key
is exactly `baseAsset` or has the form `baseAsset/N`. Drops the
spurious matches that the regression test (introduced in the stacked
parent PR) pins:
- `USDT`, `USDT/2`: unrelated asset, shared prefix
- `USD_RED`, `USD_RED/2`: color-suffix-encoded variants from the
experimental asset-colors feature flag
This flips `TestGetAssetsRejectsSpuriousPrefixMatches` from red to
green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
077d45e to
bcb2496
Compare
Summary
Tightens
getAssets(ininternal/interpreter/asset_scaling.go) so an entrybelongs to the
baseAssetscaling pool iff its key is exactlybaseAssetor has the formbaseAsset/N. Drops the spurious matchesthe parent test PR pins.
This PR is stacked on #141 (the failing regression test). Merging
this flips
TestGetAssetsRejectsSpuriousPrefixMatchesfrom red togreen.
Stack
maingetAssetsexact-matchDiff vs the parent test branch
Single 5-line change in
getAssets:Plus a doc-comment on the function.
Test plan
TestGetAssetsRejectsSpuriousPrefixMatchespasses (red on test(asset_scaling): pin getAssets prefix-match bug (failing) #141, green here).🤖 Generated with Claude Code