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

Node SequenceId and lastNodeSequenceId type discrepancy #12

Open
StevenSterzik opened this issue Nov 4, 2020 · 3 comments
Open

Node SequenceId and lastNodeSequenceId type discrepancy #12

StevenSterzik opened this issue Nov 4, 2020 · 3 comments

Comments

@StevenSterzik
Copy link

The two properties set on the SequenceId for the node object inside the order schema results in the type being compiled to a 'long' within c#.

"minimum": 0,
"maximum": 4294967296,

The lack of these two properties on the lastNodeSequenceId for the state object inside the state schema results the type being compiled to a integer within c#.

SequenceId and lastNodeSequenceId should share the same type definition.

@MaximilianRies
Copy link
Contributor

I'm not sure if I can follow correctly.
Since the type "Integer" is defined, but without limits, the code generation in C# automatically creates a long?
And what is the problem with that?

@StevenSterzik
Copy link
Author

The problem with this is that in c# an integer does not equal a long, therefore if I were to do a compare if a SequenceId is equal to a lastNodeSequenceId or set the value of lastNodeSequenceId to some specific SequenceId, I would need to explicitly cast the one type to the other type every time.

Considering these two properties represent the same value in two separate objects, it would be a nice to have if we would not need to cast between types to interact with these two properties.

I hope this explains the scenario a bit better.

@TorstenRobitzki
Copy link

If both 0 and 4294967296 should be possible values, then at least 33 bits are required to store these 4294967297 possible values. If the maximum is reduced by one to 4294967295 (0xFFFFFFFF), then the value could be stored in 32 bits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants