open-runtime-module-library
open-runtime-module-library copied to clipboard
Oracle should use the `TimestampedValue` from `orml_traits`
Hi!
Both orml_oracle and orml_traits define the same TimestampedValue struct. This is not an issue at all. Nevertheless, orml_oracle is using its own TimestampedValue as a requirement in CombineData and DataProviderExtended traits. This means that if from my pallet I want to have a Config parameter with any of these types, I need to have a hard dependency against the orml_oracle because of that TimestampedValue inside of it, when ideally I only need orml_traits as a dependency, losing the power that abstracting by traits gives.
It seems like the TimestampedValue from orml_oracle can be safely removed, and instead, using the one found in orml_traits.
Yeah that's likely caused by a bad refactor
@xlc I just remembered this issue, if you want, I can open another PR, taking advance of the changes in the oracles to fix it.
Please do!
Go deeper with it. I'm not sure the change is "so" fast-forward.
I feel like if after this change, orml-oracle uses TimestampedValue from orml-traits, then DataProvider should also use that specific TimestampedValue instead of letting it generic.
If not, the only thing we would be doing with this change is "moving" oracle-related implementation to orml-trait which should not be ok.
Having said that, I prefer not to touch anything regarding this now, or maybe only remove the TimestampedValue from orml-traits to avoid confusion with the internal oracle TimestampedValue.