4

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

For most of the time we use older polkadot.js apps v0.96.1 - that version 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 but maybe we are missing something. Anyway when we try to submit extrinsic to our node.

1010: Invalid transaction: Transaction has bad signature.

We spotted same problem already when:

  • we don't inject custom definitions in js scripts, but it works when types are injected
  const api = await ApiPromise.create({
    provider: wsProvider,
    types: {
      ShufflingSeed: {
        seed: 'H256',
        proof: 'H512'
      },
      Header: {
        parentHash: "Hash",
        number: "Compact<BlockNumber>",
        stateRoot: "Hash",
        extrinsicsRoot: "Hash",
        digest: "Digest",
        seed: "ShufflingSeed",
        count: "BlockNumber"
      },
    },
  })
  • we use older version of polkdot ui (0.96.1) and types are not injected using developer tab, but it works fine after providing the header type definition.
1

1 Answer 1

1

I checked the current apps UI against these chains. As explained in the comment above, it seems to have indeed been a misconfiguration when the chain was added on the UI - the types were not mapped on the correct spec.

As of now, even checking in the developer console as per the linked issue in the comment above, the header is correctly constructed.

Your Answer

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

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