stellar / soroban-examples

Example Soroban Contracts
Apache License 2.0
65 stars 68 forks source link

API for storage get is awkward #210

Open willemneal opened 1 year ago

willemneal commented 1 year ago

Currently in this repo every example of retrieving things from storage is either storage().get(..).unwrap() or storage().get_unchecked(..), both of which are followed by an .unwrap().

I also find it strange that it's an option wrapping a result. Intuitively to me the operation either success or fails and then the value returned is an option.

And get_unchecked makes more sense if it is not checking the de-serialization not whether the value is present.