test(invoice-token): comprehensive test matrix validating Error::NotI… - #423
Open
neyij wants to merge 1 commit into
Open
test(invoice-token): comprehensive test matrix validating Error::NotI…#423neyij wants to merge 1 commit into
neyij wants to merge 1 commit into
Conversation
…nit across all public entry points
|
@neyij 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! 🚀 |
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.
…nit across all public entry points
Description
Added a comprehensive test matrix covering
Error::NotInitbehavior across all public entry points of theInvoiceTokencontract.The new
test_uninitialized_methods_rejectedtest exercises the contract on a freshly deployed instance beforeinitialize()is called. It verifies that all read and write methods reject withError::NotInitand that failed invocations do not modify contract storage.Closes #381
Type of Change
Checklist
Testing
Added a comprehensive unit test that invokes every public
InvoiceTokenentry point against a freshly deployed but uninitialized contract.How to Test
cargo test -p invoice-tokenInvoiceTokencontract instance without callinginitialize().Error::NotInit.Test Coverage
Screenshots (if applicable)
Not applicable — this change adds contract unit tests and does not affect the user interface.
Additional Notes
The test covers the public read methods:
namesymboldecimalstotal_supplybalancebalance_batchallowanceget_nonceinvoice_idtransfer_lockedpausedIt also covers the public write methods:
transfertransfer_fromapproveextend_allowancerevoke_approvalburnburn_frommintmint_batchset_transfer_lockedset_minterset_decimalsset_pausedThe test ensures that an uninitialized contract consistently rejects public operations with
Error::NotInitrather than panicking or allowing unintended state changes.For Reviewers
Please focus on:
In particular, verify that all public entry points are covered, the expected
Error::NotInitvalue is asserted consistently, and failed invocations leave contract storage unchanged.