Skip to content

Conversation

@patricios-space
Copy link
Collaborator

@patricios-space patricios-space commented Dec 29, 2025

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the tokenPrices getter function where it could revert when encountering missing tokens, contradicting its own documentation that states it should skip missing items.

Key changes:

  • Added a conditional check to verify token existence before loading its value
  • Moved the comment to appear before the conditional check for better readability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@patricios-space patricios-space marked this pull request as ready for review December 29, 2025 23:55
@patricios-space patricios-space requested a review from a team as a code owner December 29, 2025 23:55
huangzhen1997
huangzhen1997 previously approved these changes Jan 2, 2026
val entry = st.usdPerToken.get(token);
list.push(entry.loadValue().toCell());
// NOTE: Need to skip missing items as nil entries rather than fail the query
if (entry.isFound) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect: we need to still store a null for those missing entries. Otherwise you'll get back a tuple of a different size than what you passed as the input and won't be able to correctly associate the prices

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right! Last commit should do it. I've added a quick test just to confirm

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing: does this need any matching changes in the go bindings? I'm not sure if we handle nulls correctly there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a binding for this getter

@patricios-space patricios-space force-pushed the fix/fee-quoter/tokenPrices-getter branch from fa9bd2a to 5047dec Compare January 5, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants