Implement multisig timelock test#12
Conversation
Add a test for multisig timelock enforcement in transactions.
There was a problem hiding this comment.
Pull Request Overview
This PR adds a test to verify that multisig timelock enforcement works correctly for transactions. The test ensures that transactions cannot be executed before the timelock period expires, even when they have sufficient signatures.
Key Changes:
- Adds a new test function
test_multisig_timelock_enforcedthat validates timelock behavior - Tests both the blocking of premature execution and successful execution after the timelock expires
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,19 @@ | |||
| # tests/test_safe_core.py | |||
| import json, os, time | |||
There was a problem hiding this comment.
The imports json and os are not used in this test. Remove unused imports to keep the code clean.
| import json, os, time | |
| import time |
| except Exception as e: | ||
| assert "timelock" in str(e).lower() | ||
| # Wait then execute | ||
| time.sleep(4) |
There was a problem hiding this comment.
The test sleeps for 4 seconds when the timelock is set to 0.001 hours (3.6 seconds). This makes the test unnecessarily slow. Consider reducing the sleep duration to slightly more than 3.6 seconds (e.g., 4 seconds is reasonable but could be optimized) or make the timelock period configurable for testing to avoid long test execution times.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Add a test for multisig timelock enforcement in transactions.