I was commissioned to create a C# RPC client and after successfully implementing SCALE (as verified by
polkadot-java tests), I decided to start by creating a deserializer for the V11 metadata.
Initially I started creating the object model using the Rust documentation and then found the
types-support package that seemed to contain both a reference hex payload as well as the decoded payload, ideal for creating a unit test for the deserializer.
In due process I found some discrepancies that I wasn't able to explain and I hope this question will shed some light. Specifically:
- Some of the keys don't match. e.g.
- Some types seem to have a stripped prefix. e.g.
T::BlockNumberin the decoded data.
- Some other types seem to have a stripped suffix. e.g.
Vec<UncleEntryItem<T::BlockNumber, T::Hash, T::AccountId>>
I understand that V11 is not the latest version of the metadata (and for the life of me I can't remember why I went with V11 instead of V14 for the first test right now), but shouldn't all these match?
Full JSON can be found in this gist.