Closed benjaminsalon closed 5 months ago
yes, this is correct.
The way i would explain value query is to go a little deeper in general:
Some
value at a key, or there is None
value at a key.OptionQuery
which exposes exactly that information to you the developerNone
to actually represent some value, the common example is Balance
where None
is exactly the same as having 0
balance. In this case, you would probably rather handle 0
than an option each time you query and use a balance.None
and can be used in scenarios like this.defaultvalue
parameter or whatevr it is called@benjaminsalon @shawntabrizi Thanks for pointing it out guys. Updated
Hey @philoniare, I think this part about the ValueQuery is not true:
https://github.com/philoniare/polkadot-sdk-tutorial-dex/blob/b4611fc2ec6dbae147f15f46e05d0db99778e6ed/README.md?plain=1#L22
The ValueQuery is there to define the default behavior of the storage when we try to
get
something with an unexisting key. You can check here: https://paritytech.github.io/polkadot-sdk/master/frame_support/storage/types/trait.QueryKindTrait.html