Skip to content

fix: add xcmVersion arg to DryRunCall#553

Merged
Imod7 merged 2 commits into
mainfrom
domi-fix-dry-run
May 10, 2025
Merged

fix: add xcmVersion arg to DryRunCall#553
Imod7 merged 2 commits into
mainfrom
domi-fix-dry-run

Conversation

@Imod7

@Imod7 Imod7 commented May 9, 2025

Copy link
Copy Markdown

Closes: #547

Description

The Kusama runtime was upgraded to version 1005000 and the DryRunCall now takes also the xcmVersion as an argument. Polkadot is still in version 1004001 so it still takes 2 arguments. The change in this PR makes asset-transfer-api work for both upgraded and non-upgraded runtimes.

Testing

You can test the change by running the below demo for Kusama by adding the xcmVersion in the arguments:

const { AssetTransferApi, constructApiPromise } = require('../asset-transfer-api'); // the locally linked package

const main = async () => {
    const { api, specName, safeXcmVersion } = await constructApiPromise('wss://kusama-rpc-tn.dwellir.com');
    const assetTransferApi = new AssetTransferApi(api, specName, safeXcmVersion);
    const sendersAddr = '16FNntR3F4ZjsTdYHysWSiP2vGHoVL7uZ9tyfyd4o5Cdaghf';
    const tx = '0x040000886d225c2e5ea37cf074eedbeb62d7e1e737e36e8e0b74d6e302cac82269ab491300408b43d2ee2e06';
    
    const dryRunResult = await assetTransferApi.dryRunCall(sendersAddr, tx, 'call', safeXcmVersion);
    console.log('dryRunResult', JSON.stringify(dryRunResult));
}
main();

and this demo for Polkadot without giving the xcmVersion as an argument

import { AssetTransferApi, constructApiPromise } from 'asset-transfer-api'; // the locally linked package

const main = async () => {
    const { api, specName, safeXcmVersion } = await constructApiPromise('wss://rpc-polkadot.luckyfriday.io');
    const assetTransferApi = new AssetTransferApi(api, specName, safeXcmVersion);
    const sendersAddr = '16FNntR3F4ZjsTdYHysWSiP2vGHoVL7uZ9tyfyd4o5Cdaghf';
    const tx = '0x07000f0040396b3a350100';
    
    const dryRunResult = await assetTransferApi.dryRunCall(sendersAddr, tx, 'call');
    console.log('dryRunResult', JSON.stringify(dryRunResult));
}
main();

Please link the above demos to the asset-transfer-api package that you have cloned locally and checked out in the current branch (which contains the fix).

Todos

  • Update docs

@Imod7 Imod7 requested review from TarikGul, bee344 and filvecchiato May 10, 2025 06:13
@Imod7 Imod7 merged commit 5cda6e6 into main May 10, 2025
6 checks passed
@andrew-ifrita andrew-ifrita deleted the domi-fix-dry-run branch May 20, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Upcoming Breaking Change] dryRunCall will take 3 arguments instead of 2

2 participants