Closed yytomives closed 2 years ago
I found the culprit, the library doesn't check the "signed extensions" that is included in the metadata of the chain. The node you provided does not have the CheckTxVersion
extensions, so the transaction_version
should be excluded when the library is signing the extrinsic.
I will fix this by determining the ExtrinsicPayloadValue
dynamically according to the provided "signed extensions" in the metadata, so this will work automatically. Until then you can make it work for your node by adding:
substrate = SubstrateInterface(
url="wss://apps.dico.io",
type_registry_preset="default",
type_registry={
"types": {
"ExtrinsicPayloadValue": {
"type": "struct",
"type_mapping": [
[
"call",
"CallBytes"
],
[
"era",
"Era"
],
[
"nonce",
"Compact<Index>"
],
[
"tip",
"Compact<Balance>"
],
[
"spec_version",
"u32"
],
[
"genesis_hash",
"Hash"
],
[
"block_hash",
"Hash"
]
]
}
}
}
)
Thank you very much for your help!
Released signed extension support in https://github.com/polkascan/py-substrate-interface/releases/tag/v1.1.2
The --dev version can transfer transactions normally, but the parchain version cannot do so
The script is as follows:
Return results: Failed to send: {'code': 1010, 'message': 'Invalid Transaction', 'data': 'Transaction has a bad signature'}
Is there a problem there?