1

I have observed few pallets have type alias for primitive types for chain state.

For eg- Grandpa pallet has one storage setIdSession which shows type as SetId even though its primitive type is u64. enter image description here

How can i impl same for custom pallet? I have tried creating type alias like PoolId but it always shows primitive type why?

1 Answer 1

0

It's a feature of PolkadotJS. It was pre-registered here.


Type alias can't work here. But I'm wondering if PoolId(u64) works.

6
  • Thanks alot for replying. I have observed mutiple projects which had defined types alias for primitive types. Did they all registered there type? For eg - Automata ContextFree project have defined BridgeChainId which are primitive underneath. But i do not see BridgeChainId in types file you shared. Also, i tested with tuple struct it didn't work for me but then i tied with normal struct it works but don't you think its not logical to use struct for only a single member? What do you think is the most efficient way to overcome this issue? Commented Sep 16, 2022 at 2:56
  • Could you provide the link?
    – aurexav
    Commented Sep 16, 2022 at 3:13
  • It looks like they also tweak the types. github.com/automata-network/automata
    – aurexav
    Commented Sep 16, 2022 at 3:23
  • How i can too tweak types for my pallet? Commented Sep 16, 2022 at 3:41
  • 1
    It looks like all these projects have added there types here. Automata also defined BridgeChainId Here Commented Sep 16, 2022 at 3:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.