Latest Front End with the latest node-template extrinsic transactions not working
See original GitHub issueI have a node based on the latest substrate-node-template and I am trying to get this working with it. On the node template the main thing I have changed is the ss58 address prefix.
I launched the template and noticed first of all that this does not seem to change the address prefix used based on the metadata sent out by the node like the apps gui does. However secondly, and more importantly, when I try to submit an extrinsic for the template-pallet I get the following vague error:
Unhandled Rejection (Error): createType(ExtrinsicV4):: Struct: failed on signature: Type:: Enum(Index):: AccountIndex: Input too large. Found input with 33 bits, expected 32
I have been trying to wrap my head around why this could possibly be happening. Why on earth is it sending 33 bits instead of 32? Is it using the wrong Account type? is it because of the ss58 prefix?
I have gone in and tried messing with the following in the types file: “Address”: “MultiAddress”, “LookupSource”: “MultiAddress”, “Signature”: “MultiSignature”, to no avail.
and I went into SubstrateContext.js to force it onto the correct address prefix:
const ss58Format = 0xCE;
keyring.setSS58Format(ss58Format);
///
// Loading accounts from dev and polkadot-js extension
let loadAccts = false;
const loadAccounts = (state, dispatch) => {
const asyncLoadAccounts = async () => {
dispatch({ type: 'LOAD_KEYRING' });
try {
await web3Enable(config.APP_NAME);
let allAccounts = await web3Accounts();
allAccounts = allAccounts.map(({ address, meta }) =>
({ address, meta: { ...meta, name: `${meta.name} (${meta.source})` } }));
keyring.loadAll({ isDevelopment: config.DEVELOPMENT_KEYRING, ss58Format: ss58Format }, allAccounts);
dispatch({ type: 'SET_KEYRING', payload: keyring });
} catch (e) {
console.error(e);
dispatch({ type: 'KEYRING_ERROR' });
}
};
But still no dice.
If anyone knows why this is happening, I would love to know.
And in terms of issues to be fixed, if the current front end template and node-templates are not compatible that should be addressed. This could possibly be an issue with the substrate js-api itself though i’m not sure.
And additionally this really should be reading the meta data sent from the node as to what ss58 prefix to use just like on apps https://polkadot.js.org/docs/substrate/constants#ss58prefix-u8 https://github.com/polkadot-js/apps/pull/3879/files
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
Thanks for reporting @ConnorBP. Will take a look in this issue.
This should work now. Let me know if you still have any issue. If yes, please reopen this. Thanks.