-
Notifications
You must be signed in to change notification settings - Fork 177
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
Add support for I256
and U256
#1477
Conversation
7806859
to
810a8d2
Compare
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.
That's a lot of places to touch for new primitive types to be defined!
I256
and U256
I256
and U256
728dab8
to
2563697
Compare
c41b116
to
c465d56
Compare
662248d
to
e282924
Compare
@@ -175,7 +175,7 @@ public void Write(BinaryWriter writer, Inner? value) | |||
new AlgebraicType.U64(default); | |||
} | |||
|
|||
public readonly struct U128 : IReadWrite<SpacetimeDB.U128> | |||
public readonly struct U128Stdb : IReadWrite<SpacetimeDB.U128> |
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.
Why not call this one U128 and the other UInt128?
Or make both explicit by naming the other U128Sys?
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.
Why not call this one U128 and the other UInt128?
This seemed to me the right way, but when I tried it, C# was unhappy about Int128
not having dibs on SpacetimedB.BSATN.I128
.
## Description of Changes These types have been moved to the main repo, where they are used by bindings-csharp as well. ## Requires SpacetimeDB PRs - clockworklabs/SpacetimeDB#1477 --------- Co-authored-by: Ingvar Stepanyan <[email protected]> Co-authored-by: Zeke Foppa <[email protected]>
## Description of Changes These types have been moved to the main repo, where they are used by bindings-csharp as well. ## Requires SpacetimeDB PRs - clockworklabs/SpacetimeDB#1477 --------- Co-authored-by: Ingvar Stepanyan <[email protected]> Co-authored-by: Zeke Foppa <[email protected]>
## Description of Changes These types have been moved to the main repo, where they are used by bindings-csharp as well. ## Requires SpacetimeDB PRs - clockworklabs/SpacetimeDB#1477 --------- Co-authored-by: Ingvar Stepanyan <[email protected]> Co-authored-by: Zeke Foppa <[email protected]>
Description of Changes
Fixes #1097.
Implements support for
256
-width integers in SATS and friends.The integer types are backed by the crate
ethnum
which provides support as-if they were primitive Rust types.API and ABI breaking changes
Breaks the BSATN-encoding of
AlgebraicType
.Expected complexity level and risk
2 -- some subtle considerations:
u128::MAX
for e.g.,u256
)Testing
Unit tests and SDK tests have been amended.