-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DryRunApi implementation doesn't seem to work properly #6041
Comments
What version of the API are you using? |
Hey so after some quick sanity checks everything works, i'll explain the mistake above - (I understand the confusion though). The If you want to use the new const extrinsic = api.tx[xcmPallet][method](...Object.values(crossChainSendPayload));
// Origin can be defined by https://github.com/polkadot-js/api/blob/master/packages/types-augment/src/lookup/types-kusama.ts#L24-L35
const dryRunResult = await api.call.dryRunApi.dryRunCall(<origin>, extrinsic.method);
console.log(dryRunResult)
// Conversely for xcm calls
const dryRunResult = await api.call.dryRunApi.dryRunXcm(<origin_location>, <xcm>); |
Let me know if anything isn't clear. |
Thanks a lot for your answer, indeed much clearer and working like a charm !
|
And we are using last version 15.0.1 |
@TarikGul Do you have an idea why ? |
I am not really sure what the actual issue is here: Any chance can share the input params you are passing so I can do some testing.
I was seeing some odd behavior just now with the metadata versions which could be affecting the way the api initializes which could affect the runtime apis. Looking into this now. ex:
|
Here is the call I am making in hex |
What is weird is, it is correctly decoded here so it means the message is ok, but if you use this call inside the dryRunApi dryRunCall, the result is wrongly decoded |
But it works in kusama and polkadot |
Thank you!
There could have been a recent runtime upgrade as well which is causing this issue in westend. I remember hearing about some upgrades in westend to fix some things with v4, and potentially introduce v5. I could be wrong here but that could very well be it as well. |
when will it be fixed then ? We would need it to work in our testnet environment |
Not sure. I still don't know the exact source of the issue. I asked internally, and will update here with answers. If its working correctly in polkadot and kusama through PJS but not in westend assethub I would say its safe to assume there is an issue with the runtime, but I can't say for certain. |
In terms of |
Im double checking the |
Okay good news I found an issue locally with the metadataVersions - lets see if it fixes how the types are being resolved. |
Okay so I have a fix for the |
Okay so I got a fix that also fixes the call. The execution still fails on the node that being said I let the correct individual know of the error and they are looking into it. That being said, the above PR fixes the actual call and types itself. |
Fix is active in: https://github.com/polkadot-js/api/releases/tag/v15.0.2 |
Thanks a lot for your time and effort, will check if it is working asap |
The reason the call doesn't work is you're specifying |
Yes thanks! I realised that. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
Issue type:
I saw that some time ago the dryRunApi has been implemented to be able to calculate fees for both extrinsic and XCMs.
I am trying to use this API using polkadot js library but I can't make it work.
I am getting this error:
Or
![image](https://private-user-images.githubusercontent.com/22212853/393790013-dd21d2c7-2f4e-41ba-907c-26ddc1374b14.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNDgxNjgsIm5iZiI6MTczOTM0Nzg2OCwicGF0aCI6Ii8yMjIxMjg1My8zOTM3OTAwMTMtZGQyMWQyYzctMmY0ZS00MWJhLTkwN2MtMjZkZGMxMzc0YjE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDA4MTEwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdkZjQyNWU3N2EyZWE3NWViOTc1MzNmNTc3NDJhN2ZkZWU1NjNkZmJhNTg2YzRhMjZjOTRmOTg5N2IxYmRhZDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.QQbUPlurOTAHvDfdsvKX4EufHKvgyVyW4ulxTmlrDsc)
This error:
with this code
I have seen the implementation here, either we need to set a blockhash or a signer. But isn't it possible to dry run without a signer and blockhash ? By just giving an address it should be enough right ?
We need to calculate the fees for both XCM and basic extrinsic so we need this call to make it consistantly working.
Thanks
Version:
Environment:
Language:
The text was updated successfully, but these errors were encountered: