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

Support Option in contracttype #877

Closed
dmkozh opened this issue Mar 1, 2023 · 3 comments · Fixed by #1145, stellar/rs-stellar-xdr#320 or stellar/rs-soroban-env#1198
Closed

Support Option in contracttype #877

dmkozh opened this issue Mar 1, 2023 · 3 comments · Fixed by #1145, stellar/rs-stellar-xdr#320 or stellar/rs-soroban-env#1198
Assignees

Comments

@dmkozh
Copy link
Contributor

dmkozh commented Mar 1, 2023

We should allow using Option in UDT structs. Currently some necessary trait(s) are missing implementation, such as:

the trait From<&std::option::Option>is not implemented forstellar_xdr::ScVal`

There is seemingly no good reason to not support this, so we should implement the missing traits.

@Jenietoc
Copy link

Any approach to solve this? @dmkozh

@willemneal
Copy link
Member

To get around it for now you can create your own Option type. Not optimal, but that's what I've done to get around this.

@Jenietoc
Copy link

Yes, we also opted to create our own Option type. I'm trying to solve this issue in the source code

@leighmcculloch leighmcculloch self-assigned this Nov 11, 2023
github-merge-queue bot pushed a commit to stellar/rs-soroban-env that referenced this issue Nov 14, 2023
### What
Update stellar-xdr.

### Why
To get changes in stellar-xdr that fix Option<T> <> ScVal for:
- Close stellar/rs-soroban-sdk#877
- Close #444

Dependent on:
- stellar/rs-stellar-xdr#320
github-merge-queue bot pushed a commit that referenced this issue Nov 14, 2023
### What
Try to make Option<T> work with contracttype

### Why
Close stellar/rs-soroban-env#444
Close #877

Dependent on:
- stellar/rs-stellar-xdr#320
- stellar/rs-soroban-env#1198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants