chore: refactor proposal cancel tests#808
Draft
ecPablo wants to merge 13 commits into
Draft
Conversation
… reused by other chain Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
# Conflicts: # e2e/tests/aptos/timelock_cancel.go # e2e/tests/ton/executable.go
Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
|
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.





This pull request significantly refactors the
TestTimelock_Cancelend-to-end test for the Aptos timelock module, making the test more modular, maintainable, and reusable. The refactor replaces a large, monolithic function with a structured approach that leverages shared test hooks and utility functions, reducing duplication and improving clarity.Key improvements and refactoring:
Test structure and modularization:
e2ecommon.RunScheduleAndCancelTest, centralizing the scheduling and cancellation logic and enabling code reuse across tests.initTransferOwnership,configureRole, andbuildAcceptOwnershipTransaction.Signer and role management:
testutils.MakeNewECDSASignersto generate signers for both proposer and canceller roles, and adds akeysToAddressesutility for address extraction, simplifying signer management and reducing boilerplate. [1] [2]Flexible test hooks and assertions:
Setup,Sign,DeriveCancellationMetadata,WaitForTransaction,AssertExtraAfterCancel) to allow custom logic at each stage of the test, improving extensibility and clarity of test intent.Improved readability and maintainability:
Overall, these changes modernize the test by adopting best practices for modularization and code reuse, making future maintenance and extension much easier.
Most important changes:
Test modularization and reuse:
e2ecommon.RunScheduleAndCancelTestwith custom hooks, replacing the previous large inline test