Skip to content

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

@Imod7

Description

@Imod7

Description

The upcoming runtime release, v1.5.0, will introduce a breaking change to the DryRunApi. Specifically, it includes PR #7689 which backports PR #7438. The #7438 PR will modify the dry_run_call function signature by adding a third argument (currently only two are required).

Confirm the breaking change

After compiling the v1.5.0 runtime and launching a dev node with this runtime (related resource), I run the following demo code:

const { AssetTransferApi, constructApiPromise } = require('@substrate/asset-transfer-api');

const main = async () => {
    const { api, specName, safeXcmVersion } = await constructApiPromise('ws://127.0.0.1:9944');

    const assetTransferApi = new AssetTransferApi(api, specName, safeXcmVersion);

    const sendersAddr = '16FNntR3F4ZjsTdYHysWSiP2vGHoVL7uZ9tyfyd4o5Cdaghf';
    const tx = '0x1f0b04010100c91f0400010100e823f55dbee3d394f448f2f74194078ba4259e4b31c28e155c29531106a8ea0804080002043205011f0002093d000100000700e40b54020000000000';
    const dryRunResult = await assetTransferApi.dryRunCall(sendersAddr, tx, 'call');
    
    const destinationFees = await AssetTransferApi.getDestinationXcmWeightToFeeAsset(
      'interlay-parachain',
      'wss://rpc-interlay.luckyfriday.io',
      4,
      dryRunResult,
      'USDC',
    );

    console.log('payload', JSON.stringify(destinationFees));
}
main();

and it returned the following error:

 throw new Error(`${def.name}:: Expected ${def.params.length} arguments, found ${args.length}`);
                      ^

Error: DryRunApi_dry_run_call:: Expected 3 arguments, found 2

Actions required in asset-transfer-api repo

Check where this call (dryRunApi.dryRunCall) is used in asset-transfer-api's codebase and update it accordingly.

### Additional Info
The timeline and relevant resources can be found in the corresponding Sidecar issue, #1644.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions