Open IkerAlus opened 2 weeks ago
Yes, this is certainly an odd issue - I would of imagined the api underneath would accept any value and transform it as necessary but this seems to not be the case. This issue is probably related to: https://github.com/polkadot-js/api/releases/tag/v13.2.1
The issue seems to appear when upgrading the api
from 12.4.2 to 13.0.1.
In v12.4.2
if I call
await apiAt.call.transactionPaymentApi.queryInfo(extrinsic, extrinsic.length);
where extrinsic is a Hex string, it will return the fees with no issues.
As soon as I upgrade to v13.0.1
the same call returns a wasm panic error and I need to change it to
await apiAt.call.transactionPaymentApi.queryInfo(u8a, u8a.length);
where u8a is
const ext = api.registry.createType('Extrinsic', extrinsic);
const u8a = ext.toU8a();
to get the fees with no issues again.
What I noticed in apps is that for the same extrinsic, when it goes in OnSubmit and I check the value of the extrinsic submitted (values[0].value
) it looks like apps converted the input extrinsic into Bytes
type
api.registry.createType('Bytes', transaction);
and not into Extrinsic
type like I did above. Maybe this is related to the error ?
The script that I used to debug the different versions of the api.
When querying any of the
queryInfo
andqueryFeeDetails
methods of thetransactionPaymentApi
Runtime API in any chain from the developer tab the following error is returned:It seems that the new release of PJS API has introduced some changes in certain expected types for these queries on PJS apps.
We had a similar issue on API Sidecar and converting the extrinsic to u8a solved the issue.
Environment: