-
Notifications
You must be signed in to change notification settings - Fork 211
refactor(test/utils): simplify storage prices configuration in gasUtils #3437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| import "@ton/test-utils"; | ||
| import { cached } from "@/test/utils/cache-state"; | ||
| import { setStoragePrices } from "@/test/utils/gasUtils"; | ||
| import { zeroStoragePrices } from "@/test/utils/gasUtils"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd name this function using the verb as the first word.
What about removeStorageFee or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
turnOffStorageFee or skipStorageFee would be some other alternatives
Kaladin13
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo version bump
|
@skywardboundd merge conflicts :) |
|
Resolved merge conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export function zeroStoragePrices(configRaw: Cell): Cell { | ||
| return setStoragePrices(configRaw, { | ||
| kind: "StoragePrices", | ||
| utime_since: 0, | ||
| bit_price_ps: 0n, | ||
| _cell_price_ps: 0n, | ||
| mc_bit_price_ps: 0n, | ||
| mc_cell_price_ps: 0n, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect StoragePrices field name breaks TypeScript compile
The new zeroStoragePrices helper constructs a StoragePrices object with _cell_price_ps. The generated type in @ton/sandbox/dist/config/config.tlb-gen exposes this property as cell_price_ps (no leading underscore). Because the required field is missing, TypeScript will reject the call to setStoragePrices, so any test importing this helper fails to compile. Use the correct field name when building the StoragePrices object.
Useful? React with 👍 / 👎.
Closes #3436