3

We have a customized substrate chain currently running and we are facing some signature issues (repo). This chain has custom types, custom header and an additional extension to check a parameter called appId. This extension does not add an additional signed value.

When running with polkadot api and a keyring, everything is fine :

const extrinsic = api.tx.balances.transfer(
  "5CDGXH8Q9DzD3TnATTG6qm6f4yR1kbECBGUmh2XbEBQ8Jfa5",
  1
);
const accountKeyring = getKeyringFromSeed("...");
await extrinsic.signAndSend(accountKeyring, ({ status }) => { // <-- Successful
  if (status.isInBlock) {
    setStatus(`Transaction included in block: ${status.asInBlock}`);
  }
});

But when signing with extension, I got a bad transaction has a bad signature error from the node.

const extrinsic = api.tx.balances.transfer(
  "5CDGXH8Q9DzD3TnATTG6qm6f4yR1kbECBGUmh2XbEBQ8Jfa5",
  1
);
extrinsic.signAndSend(
  account.address,
  { signer: injector.signer },
  ({ status }) => { // <-- Fails
    if (status.isInBlock) {
      setStatus(`Transaction included in block: ${status.asInBlock}`);
    }
  }
);

I don't know where to look at since:

  1. The local script initialize the types correctly
  2. From a local built extension, data are correctly received even with the additional extension
  3. From the node I can seem to find the difference between what I receive

What did I miss that could cause this issue ?

0

Your Answer

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