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

feat(stdlibs): simplify time pkg & remove tz + monoclock logic related #3016

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
725c2d7
feat: simplify time pkg
MikaelVallenet Oct 21, 2024
0160c5a
feat: adapt format time file
MikaelVallenet Oct 21, 2024
27ffb42
feat: remove tz logic
MikaelVallenet Oct 21, 2024
df848c6
chore: garbage files
MikaelVallenet Oct 23, 2024
134d594
feat: adapt format to UTC based & without mono clock
MikaelVallenet Oct 23, 2024
6dd23a6
feat: adapt time pkg
MikaelVallenet Oct 23, 2024
780fd5b
feat: fix wrong compute in const
MikaelVallenet Oct 23, 2024
6db8cb0
feat: fix wrong compute in const
MikaelVallenet Oct 23, 2024
b3ed5ba
feat: add data about time pkg
MikaelVallenet Oct 23, 2024
9333968
feat: add data about time pkg
MikaelVallenet Oct 23, 2024
1fe6e3c
fix: remove minWall sub to time injected by syscall
MikaelVallenet Oct 23, 2024
0b33b77
tests: fix text
MikaelVallenet Oct 23, 2024
25b9633
feat: convert tz date into UTC in parse function
MikaelVallenet Oct 24, 2024
39b9d83
feat: simplify time pkg, remove mono clock & location
MikaelVallenet Oct 24, 2024
88e12e7
feat: add Round & Zone method to time
MikaelVallenet Oct 24, 2024
80cd87c
test: delete monotonic clock precision on z filetest
MikaelVallenet Oct 24, 2024
8f54e28
test: delete monotonic clock precision on z filetest
MikaelVallenet Oct 24, 2024
5008c6b
test: fix test remove tz logic
MikaelVallenet Oct 24, 2024
2edfd58
fix: add zone method to avoid breaking changes
MikaelVallenet Oct 24, 2024
305a587
test: fix adapt number of parameters expected
MikaelVallenet Oct 24, 2024
4377e1d
test: fix adapt number of parameters expected
MikaelVallenet Oct 24, 2024
7d87878
test: transform Date to keep the same number of parameters but don't …
MikaelVallenet Oct 24, 2024
350df9b
test: adapt Date to take location even if not used to keep same API a…
MikaelVallenet Oct 24, 2024
c0df26f
chore: remove tmp file test.txt
MikaelVallenet Oct 24, 2024
d12e53d
test: remove tz_location file test
MikaelVallenet Oct 24, 2024
83717c1
Merge branch 'master' into dev/mikaelvallenet/time-pkg-stdlib-utc-def…
MikaelVallenet Oct 24, 2024
fc130f6
test: fix test
MikaelVallenet Oct 24, 2024
411f022
fix: put true to compute month from date function
MikaelVallenet Oct 25, 2024
03cab99
Merge branch 'master' into dev/mikaelvallenet/time-pkg-stdlib-utc-def…
MikaelVallenet Nov 18, 2024
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
49 changes: 10 additions & 39 deletions examples/gno.land/r/demo/boards/z_4_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -308,36 +308,16 @@ func main() {
// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:131]={
// "Fields": [
// {
// "N": "AAAAgJSeXbo=",
// "T": {
// "@type": "/gno.PrimitiveType",
// "value": "65536"
// }
// },
// {
// "N": "AbSNdvQQIhE=",
// "N": "0vknwQ4AAAA=",
// "T": {
// "@type": "/gno.PrimitiveType",
// "value": "1024"
// }
// },
// {
// "T": {
// "@type": "/gno.PointerType",
// "Elt": {
// "@type": "/gno.RefType",
// "ID": "time.Location"
// }
// },
// "V": {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Escaped": true,
// "ObjectID": "336074805fc853987abe6f7fe3ad97a6a6f3077a:2"
// },
// "Index": "182",
// "TV": null
// "@type": "/gno.PrimitiveType",
// "value": "512"
// }
// }
// ],
Expand All @@ -353,22 +333,13 @@ func main() {
// {
// "T": {
// "@type": "/gno.PrimitiveType",
// "value": "65536"
// }
// },
// {
// "T": {
// "@type": "/gno.PrimitiveType",
// "value": "1024"
// }
// },
// {
// "T": {
// "@type": "/gno.PointerType",
// "Elt": {
// "@type": "/gno.RefType",
// "ID": "time.Location"
// }
// "@type": "/gno.PrimitiveType",
// "value": "512"
// }
// }
// ],
Expand Down Expand Up @@ -497,7 +468,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "0fd3352422af0a56a77ef2c9e88f479054e3d51f",
// "Hash": "55cc9b7009f66b35f15d34ceed3fa25c9e36d54d",
// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:131"
// }
// },
Expand All @@ -508,7 +479,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "bed4afa8ffdbbf775451c947fc68b27a345ce32a",
// "Hash": "d8d66a5855b0427c262cfce9891c88d469ab2351",
// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:132"
// }
// }
Expand All @@ -534,7 +505,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "c45bbd47a46681a63af973db0ec2180922e4a8ae",
// "Hash": "6b2cd34f216499f59540555be3fe11f40a67baa1",
// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:127"
// }
// }
Expand Down Expand Up @@ -785,7 +756,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "a416a751c3a45a1e5cba11e737c51340b081e372",
// "Hash": "ed9d8105a90a05bc8d953538dd8810201e26ec6d",
// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:86"
// }
// },
Expand All @@ -803,7 +774,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "36299fccbc13f2a84c4629fad4cb940f0bd4b1c6",
// "Hash": "ef78d14dccddfaa802727058e543d3ecc87157f0",
// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:87"
// }
// },
Expand Down
4 changes: 2 additions & 2 deletions examples/gno.land/r/demo/groups/z_1_a_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ func main() {
//
// Group Creator: gnouser0
//
// Group createdAt: 2009-02-13 23:31:30 +0000 UTC m=+1234567890.000000001
// Group createdAt: 2009-02-13 23:31:30 +0000 UTC
//
// Group Last MemberID: 0000000001
//
// Group Members:
//
// [0000000000, g1vahx7atnv4erxh6lta047h6lta047h6ll85gpy, 32, i am from UAE, 2009-02-13 23:31:30 +0000 UTC m=+1234567890.000000001],
// [0000000000, g1vahx7atnv4erxh6lta047h6lta047h6ll85gpy, 32, i am from UAE, 2009-02-13 23:31:30 +0000 UTC],
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/groups/z_2_a_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func main() {
//
// Group Creator: gnouser0
//
// Group createdAt: 2009-02-13 23:31:30 +0000 UTC m=+1234567890.000000001
// Group createdAt: 2009-02-13 23:31:30 +0000 UTC
//
// Group Last MemberID: 0000000001
//
Expand Down
6 changes: 0 additions & 6 deletions examples/gno.land/r/gnoland/events/events.gno
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,5 @@ func parseTimes(startTime, endTime string) (time.Time, time.Time, error) {
return time.Time{}, time.Time{}, ErrEndBeforeStart
}

_, stOffset := st.Zone()
_, etOffset := et.Zone()
if stOffset != etOffset {
return time.Time{}, time.Time{}, ErrStartEndTimezonemMismatch
}

return st, et, nil
}
3 changes: 0 additions & 3 deletions examples/gno.land/r/gnoland/events/events_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ func TestParseTimes(t *testing.T) {

_, _, err = parseTimes("2009-02-13T23:30:30Z", "2009-02-13T21:30:30Z")
uassert.ErrorContains(t, err, ErrEndBeforeStart.Error())

_, _, err = parseTimes("2009-02-10T23:30:30+02:00", "2009-02-13T21:30:33+05:00")
uassert.ErrorContains(t, err, ErrStartEndTimezonemMismatch.Error())
}

func TestRenderEventWidget(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions examples/gno.land/r/gnoland/monit/monit_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ status=KO`
Incr()
{
expected := `counter=3
last update=2009-02-13 23:31:30 +0000 UTC m=+1234567890.000000001
last update=2009-02-13 23:31:30 +0000 UTC
last caller=g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm
status=OK`
got := Render("")
Expand All @@ -35,7 +35,7 @@ status=OK`
use std.TestSkipTime(time.Hour)
{
expected := `counter=3
last update=2009-02-13 22:31:30 +0000 UTC m=+1234564290.000000001
last update=2009-02-13 22:31:30 +0000 UTC
last caller=g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm
status=KO`
got := Render("")
Expand All @@ -46,7 +46,7 @@ status=OK`
Incr()
{
expected := `counter=4
last update=2009-02-13 23:31:30 +0000 UTC m=+1234567890.000000001
last update=2009-02-13 23:31:30 +0000 UTC
last caller=g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm
status=OK`
got := Render("")
Expand Down
Loading
Loading