Skip to content
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

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4ad86c7
[deps] update diem to version with feature flag cleanup (#317)
sirouk Sep 6, 2024
be85709
lockbox wip
0o-de-lally Sep 20, 2024
0e181d8
lazy init aggregator factory
0o-de-lally Sep 20, 2024
d44b789
removes coin init without_aggregator option
0o-de-lally Sep 20, 2024
a49835c
remove deprecated governance tests, which fail
0o-de-lally Sep 20, 2024
d454b9e
make a minimal account init for unit tests which don't do a full genesis
0o-de-lally Sep 20, 2024
0371709
initialization of lockboxes, tests
0o-de-lally Sep 20, 2024
b5ae885
can check balances
0o-de-lally Sep 20, 2024
2ab1619
refactor tests for dependency cycling
0o-de-lally Sep 20, 2024
a0f3143
ol_account can trigger unlock in lockbox
0o-de-lally Sep 20, 2024
ebb3891
cleanup drip all with option
0o-de-lally Sep 23, 2024
dab4c03
can check timestamp of unix start of day to not drip twice (instead o…
0o-de-lally Sep 23, 2024
c9e473e
catch cases of zero drip
0o-de-lally Sep 23, 2024
1defc50
POC for shifting delay, or transferring users
0o-de-lally Sep 24, 2024
a476efe
scaffold formal verification
0o-de-lally Sep 24, 2024
724beb3
Update lockbox.move with standard duration validation
Jayfromthe13th Jan 7, 2025
79e3343
Update lockbox.spec.move
Jayfromthe13th Jan 7, 2025
520abdb
Update lockbox.spec.move
Jayfromthe13th Jan 7, 2025
b301d7f
Update lockbox.spec.move
Jayfromthe13th Jan 7, 2025
5e6e18f
feat: Add specifications for lockbox durations
Jayfromthe13th Jan 7, 2025
f832848
Merge pull request #15 from Jayfromthe13th/lockbox-durations
0o-de-lally Jan 7, 2025
5cb5fdb
Merge pull request #16 from Jayfromthe13th/lockbox-durations-spec
0o-de-lally Jan 7, 2025
9bdac8a
Fix expected_failure attributes in lockbox tests
Jayfromthe13th Jan 8, 2025
a63e912
Merge branch 'main' into lockbox-durations
0o-de-lally Jan 8, 2025
e0d0ec3
add #test to lockbox spec
0o-de-lally Jan 9, 2025
a1f1a10
refactor: remove test specification from lockbox.spec.move
Jayfromthe13th Jan 10, 2025
f2114e9
Merge branch 'lockbox-durations' into lockbox-durations-spec
0o-de-lally Jan 10, 2025
15ed9e7
Merge pull request #17 from Jayfromthe13th/lockbox-durations-spec
0o-de-lally Jan 10, 2025
d1862d3
Merge branch 'main' into lockbox-durations
0o-de-lally Jan 10, 2025
040b486
docs
0o-de-lally Jan 10, 2025
ca6548e
cargo lock form main
0o-de-lally Jan 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion framework/libra-framework/sources/coin.move
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ module diem_framework::coin {
friend ol_framework::test_burn;
#[test_only]
friend ol_framework::test_rewards;

#[test_only]
friend ol_framework::lockbox;

//
// Errors.
Expand Down
33 changes: 33 additions & 0 deletions framework/libra-framework/sources/ol_sources/date.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// WIP
// Placeholder for a proper date parsing module

module ol_framework::date {
use diem_framework::timestamp;

friend ol_framework::lockbox;

// Returns start of unix day in seconds, and the seconds since start of day
public(friend) fun start_of_day_seconds(): (u64, u64) {
let timestamp = timestamp::now_seconds();
let since_start = timestamp % 86400;
let start_of_day = timestamp - since_start;
(start_of_day, since_start)
}

#[test(framework = @0x1)]
fun test_day(framework: &signer) {
// use diem_framework::debug::print;

timestamp::set_time_has_started_for_testing(framework);
let then = 1727122878 * 1000000;

timestamp::update_global_time_for_test(then);
let (a,b) = start_of_day_seconds();

let now = 1727123437 * 1000000;
timestamp::update_global_time_for_test(now);
let (a_now, b_now) = start_of_day_seconds();
assert!(a == a_now, 0);
assert!(b != b_now, 1);
}
}
Loading
Loading