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

Allow to have fixed-width integer types in the autogenerator #3769

Open
fyfyrchik opened this issue Dec 19, 2024 · 1 comment
Open

Allow to have fixed-width integer types in the autogenerator #3769

fyfyrchik opened this issue Dec 19, 2024 · 1 comment
Labels
blocked Can't be done because of something enhancement Improving existing functionality I2 Regular impact I3 Minimal impact S3 Minimally significant U4 Nothing urgent

Comments

@fyfyrchik
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Sometimes I want to use uint32 instead of big.Int in the auto-generated wrappers.
Currently, I need to add another struct.

Describe the solution you'd like

pkg/rpcclient/unwrap has a beautiful unwrapper

func LimitedInt64(r *result.Invoke, err error, minI int64, maxI int64) (int64, error) {

Allow to use it from inside the autogenerator.
A possible value to use for a type in rpcbinding configuration is Integer:int64. Another option is base: Integer; Name: int64.
We may also have other types (e.g. uint32), the details can be discussed. E.g. have LimitedInt[T interface { ~int* }] and LimitedUint[T interface{ ~uint* }] in unwrap and reuse them.

Describe alternatives you've considered

Provide custom type/unmarshaler defined outside the generated code. With it, we can have SDK types reused in the autogenerated code for contracts.

@fyfyrchik fyfyrchik added feature Completely new functionality I2 Regular impact labels Dec 19, 2024
@roman-khimov
Copy link
Member

This will be possible with NEP-25 implementation, it has a notion of type width.

@roman-khimov roman-khimov added I3 Minimal impact U4 Nothing urgent enhancement Improving existing functionality S3 Minimally significant blocked Can't be done because of something and removed feature Completely new functionality labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Can't be done because of something enhancement Improving existing functionality I2 Regular impact I3 Minimal impact S3 Minimally significant U4 Nothing urgent
Projects
None yet
Development

No branches or pull requests

2 participants