Skip to content
This repository was archived by the owner on May 16, 2022. It is now read-only.
This repository was archived by the owner on May 16, 2022. It is now read-only.

Can't reload saved data #132

Description

@thomasd3

with this type:

[<ZeroFormattable>]
type SourceCandle =
    {
        [<Index(0)>] t: DateTime        // time
        [<Index(1)>] h: double          // high
        [<Index(2)>] l: double          // low
        [<Index(3)>] m: double          // midpoint
        [<Index(4)>] a: double          // average
        [<Index(5)>] v: double          // volume
        [<Index(6)>] d: double          // direction
    }


and the file attached:
[MKRUSDT.zero.zip](https://github.com/neuecc/ZeroFormatter/files/7735974/MKRUSDT.zero.zip)

you can't deserialize with:

    File.ReadAllBytes(filename)
    |> ZeroFormatterSerializer.Deserialize<SourceCandle array>

even though ZeroFormatter created the file.

The error is:

System.InvalidOperationException: Timestamp contains invalid values: Seconds=7035036171763712001; Nanos=0
   at ZeroFormatter.Internal.BinaryUtil.ReadDateTime(Byte[]& bytes, Int32 offset)
   at ZeroFormatter.Formatters.DateTimeFormatter`1.Deserialize(Byte[]& bytes, Int32 offset, DirtyTracker tracker, Int32& byteSize)
   at ZeroFormatter.DynamicObjectSegments.ZeroFormatter_Formatters_FSharpResolver`1\[\[ZeroFormatter_Formatters_DefaultResolver\, ZeroFormatter\, Version=1_6_4_0\, Culture=neutral\, PublicKeyToken=null\]\].FSI_0006\.SourceCandle$Formatter.Deserialize(Byte[]& , Int32 , DirtyTracker , Int32& )
   at ZeroFormatter.Formatters.ArrayFormatter`2.Deserialize(Byte[]& bytes, Int32 offset, DirtyTracker tracker, Int32& byteSize)
   at ZeroFormatter.ZeroFormatterSerializer.CustomSerializer`1.Deserialize[T](Byte[] bytes)
   at ZeroFormatter.FSharp.CustomSerializer`1.Deserialize[T](Byte[] bytes)
   at ZeroFormatter.FSharp.ZeroFormatterSerializer.Deserialize[T](Byte[] bytes)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions