-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[move] slow wallet v2.0 #332
base: main
Are you sure you want to change the base?
Conversation
added spec for now
clean up
Add Duration Validation and Unit Tests for Lockbox Contract
Add Formal Specifications for Lockbox Module
f0935a5
to
e0d0ec3
Compare
refactor: Remove test specification from lockbox.spec.move
/// Duration not in allowed list | ||
const EINVALID_DURATION: u64 = 9; | ||
|
||
const DEFAULT_LOCKS: vector<u64> = vector[6, 1*12, 2*12, 3*12, 4*12, 8*12, 16*12, 20*12, 24*12, 28*12, 32*12]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps unnecessarily pedantic, but...these aren't "default" lock durations -- they appear to be "valid" or "mandatory" lock durations. You can't create a locked account with a duration that's not in this vector. Default would imply that if you don't provide a duration, you get one of the values in this vector. I think this difference between functionality and naming crosses the line into just the wrong variable name to use, unless I'm not reading the code correctly.
let balance = balance_duration(bob_addr, 4*12); | ||
assert!(balance == 100, 7357003); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general test coverage feels a bit low. E.g. should we test a locked account all the way to the end of its lifetime? Test moving unlocked funds from a lockbox account then continue to drip it after. Test moving locked funds to another lockbox account, then move again to a third. Try to extract more coins from a lockbox account than are currently unlocked.
Implementation of the new "lockbox" structure for slow wallets v2.0.
Does NOT include migration logic.