Right now, when decoding and event or querying the storage, we are checking for the corresponding storage and event version one by one like here.
Given that in the near future we will most likely introduce several new versions, we should refactor the code and add some function like the one introduced in this PR that allows to select automatically the storage/event version corresponding to the context, and decode it.
Right now, when decoding and event or querying the storage, we are checking for the corresponding storage and event version one by one like here.
Given that in the near future we will most likely introduce several new versions, we should refactor the code and add some function like the one introduced in this PR that allows to select automatically the storage/event version corresponding to the context, and decode it.