polkadot-js / apps

Basic Polkadot/Substrate UI for interacting with a Polkadot and Substrate node. This is the main user-facing application, allowing access to all features available on Substrate chains.
https://dotapps.io
Apache License 2.0
1.75k stars 1.55k forks source link

types definitions not propagated correctly #7227

Closed mateuszaaa closed 2 years ago

mateuszaaa commented 2 years ago

Hi, in Mangata we run into some problems when integrating polkadot-ui with our chain.

For most of the time we are using polkadot.js apps v0.96.1 that allows for types definition injection using developer tab. It works without problem but that feature was removed in newer versions of apps(>0.96.1). As we are going live soon we would like to integrate with the most recent version hosted on https://polkadot.js.org/apps/

We created dedicated npm package @mangata-finance/types with our types definitions both generated using typegen and custom ones: https://github.com/mangata-finance/types/blob/main/src/interfaces/definitions.ts#L2-L23 https://www.npmjs.com/package/@mangata-finance/types

One of the modifications we did is custom Header definitions that introduces 2 new fields. It seems that that type is not propagated properly because whenever we want to submit extrinsic using ui i`m getting error

1010: Invalid transaction: Transaction has bad signature.

Same problem occures when:


- we use older version of polkdot ui (0.96.1) and types are not injected using developer tab, *but it works fine after submiting the type definitions*

That makes me think that some of the core types(like Header definition) are not propagated/handled correctly even though updated definitions are included. 

Any ideas why it doesnt work ?
jacogr commented 2 years ago

If you are looking at the parachain connected to Kusama, it is because you don't have a spec -> types mapping.

On Kusama your spec is called mangata-parachain not just mangata. So the API has no way of mapping the specName from getRuntimeVersion() to your types, since there is no definition.

You need an extra - 'mangata-parachain': mangata on the mapping - https://github.com/polkadot-js/apps/blob/9108b3a22b92f74cf9b92fb5ef07b9b09f5668dc/packages/apps-config/src/api/spec/index.ts#L209

If you add that, you should see -

image

polkadot-js-bot commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.