test(creator-keys): add regression tests and storage extension docs#335
Merged
Chucks1093 merged 8 commits intoMay 29, 2026
Merged
Conversation
|
@buinntalen Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Resolves accesslayerorg#325 Resolves accesslayerorg#326 Resolves accesslayerorg#327 Resolves accesslayerorg#328 - Issue accesslayerorg#325: Add regression test for sell execution after protocol fee config update, verifying the updated fee applies to the actual token transfer on the sell side - Issue accesslayerorg#326: Add unit tests for buy quote at zero supply, confirming the function returns the correct non-zero first-key price from the bonding curve - Issue accesslayerorg#327: Add documentation for the safe pattern to extend contract storage without migration, showing best practices for optional fields and versioned keys, with unsafe patterns explicitly called out - Issue accesslayerorg#328: Add regression test for creator fee recipient change taking effect on next trade, verifying new recipient receives fee immediately after update
Remove extra argument from sell_key() calls - method signature takes 2 arguments (creator, seller) not 3.
40b2bed to
813ff12
Compare
Remove extra argument from sell_key() call on line 117.
The test was added but uses unimplemented contract methods. It should not be included until the contract API is updated.
Use array literal instead of vec! macro to satisfy clippy::useless_vec.
The assertion should verify that total_amount equals price plus fees, not that price equals the sum of all components.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds four regression tests and documentation for safe storage extension patterns in the creator-keys contract. Tests cover protocol fee updates on sell, zero-supply buy quotes, and creator fee recipient updates. Documentation provides clear guidance on safe patterns for extending deployed contract storage.
Issues Resolved
Closes #325
Closes #326
Closes #327
Closes #328
Changes
#325 - Add regression test for sell execution after protocol fee config update
Added
sell_after_fee_config_update.rswith two test cases verifying that the sell execution applies updated protocol fee configurations correctly to the actual token transfer, not just the quote.#326 - Add unit tests for buy quote returning zero for zero supply
Added
buy_quote_zero_supply.rswith tests confirming that when total supply is zero, the buy quote function returns the correct non-zero first-key price from the bonding curve formula, with multiple price points and consistent behavior across calls.#327 - Add docs for safe pattern to extend contract storage without migration
Added
docs/STORAGE_EXTENSION_PATTERN.mddocumenting the recommended patterns for adding new storage fields to deployed contracts, including optional fields, versioned keys, and lazy migration approaches, with explicit guidance on unsafe patterns to avoid.#328 - Add regression test for creator fee recipient change taking effect on next trade
Added
creator_fee_recipient_change.rswith tests verifying that when the creator fee recipient address is updated, the new address receives the fee on the very next trade without delay, including multiple updates and both buy/sell scenarios.