Scenario: You are developing a FRAME pallet for a custom Substrate node that uses custom types within Storage or Events. To interact with your custom Substrate node, you use the Polkadot/Substrate frontend
Problem:
Unable to retrieve the specified block details. createType(Vec):: Struct: failed on 'data':: Cannot construct unknown type YOUR_CUSTOM_TYPE
Solution: You have to specify your custom types in the Polkadot/Substrate frontend. To do so, select "Settings" -> "Developer" in the top menu bar:
Below you can see a text field titled "Additional types as a JSON file". In this text field you have to enter your custom types for the frontend to be able to interpret those correctly. In the top right corner, right below the version numbers, a big white question mark in a gray circle should be visible. By clicking on this question mark, an help dialog slides in.
Example configuration: Let's take the pallet I learned this lesson with as an example. In the highlighted lines, you see the custom enum "States":
pub enum States {
Propose,
VotePropose,
Concern,
VoteConcern,
VoteCouncil,
}
Using the help dialog (the white question mark), it turns out that the correct configuration JSON snippet looks like this:
"States": {
"_enum": [
"Propose",
"VotePropose",
"Concern",
"VoteConcern",
"VoteCouncil"
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With