Skip to content
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

fix(bug): fix fetchFeeInfo partial fee #439

Merged
merged 4 commits into from
Oct 2, 2024

Conversation

marshacb
Copy link
Contributor

@marshacb marshacb commented Oct 2, 2024

Fixes a bug where an incorrect extrinsic argument to queryInfo caused the partialFee of the returned RuntimeDispatchInfo to always be 0.

example Bifrost Polkadot -> Polkadot AssetHub input:

		callInfo = await assetApi.createTransferTransaction(
			'1000',
			'0xc4db7bcb733e117c0b34ac96354b10d47e84a006b9e7e66a229d174e8ff2a063',
			['WETH'],
			['1000000000000000000'],
			{
				format: 'call',
				xcmVersion: safeXcmVersion,
			},
		);

		const feeInfo = await assetApi.fetchFeeInfo(callInfo.tx, 'call');

		console.log(
			`${PURPLE}The following feeInfo data that is returned:\n${GREEN}${JSON.stringify(feeInfo?.toHuman(), null, 4)}`,
		);

expected output:

The following feeInfo data that is returned:
{
    "weight": {
        "refTime": "1,600,000,000",
        "proofSize": "0"
    },
    "class": "Normal",
    "partialFee": "83.0091 mBNC"
}

@marshacb marshacb requested review from TarikGul and bee344 October 2, 2024 17:52
@marshacb marshacb merged commit 8238bf0 into main Oct 2, 2024
6 checks passed
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.

2 participants