Closed joemonem closed 2 months ago
The changes involve updates to the Cargo.toml
file, including version constraints for dependencies and enhancements to the handling of lock times in multiple contracts. The lock_time
parameter has been standardized to utilize the Expiry
type, improving clarity and type safety. Additionally, error handling has been refined with the introduction of a new error variant related to invalid expiration times.
Files | Change Summary |
---|---|
Cargo.toml |
Updated dependency versions and changed cw-asset version specification to an exact constraint. |
contracts/finance/.../contract.rs |
Modified time constants to milliseconds, updated lock time initialization, and streamlined validation logic. |
contracts/finance/.../mock.rs |
Changed lock_time type from Option<u64> to Option<Expiry> . |
contracts/finance/.../testing/tests.rs |
Updated lock_time handling to use Expiry type and added new test cases for lock time scenarios. |
packages/andromeda-finance/src/conditional_splitter.rs |
Changed lock_time in ConditionalSplitter to a required field and updated InstantiateMsg accordingly. |
packages/std/src/error.rs |
Introduced a new error variant InvalidExpirationTime for improved error handling related to expiration. |
Objective | Addressed | Explanation |
---|---|---|
Splitter lock time handling issues (Issue #544) | β | |
Conditional splitter lock time type consistency (Issue #544) | β |
π° "In the meadow, we hop with glee,
New locks and times, oh what a spree!
With Expiry now, our paths are clear,
No more errors, letβs all cheer!
Hops and jumps, weβll dance tonight,
Thanks to the changes, everythingβs right!" π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Motivation
Closes #544
Implementation
Was comparing the lock time's timestamp with a representation of one day and one year in seconds. Now it's being compared with the current time in addition to one day and one year in milliseconds.
Made Conditional Splitter's lock the same as the one in Splitter.
Testing
test_different_lock_times
for both splitter contracts. Tests for too short, long and correct lock times using bothExpiry::AtTime
andExpirty::FromNow
.Version Changes
Bumped splitter from 2.0.0 to 2.1.0 and conditional splitter from 1.1.0 to 1.2.0
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Refactor