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: set assetId to default to undefined instead of 0 #397

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Conversation

bee344
Copy link
Collaborator

@bee344 bee344 commented Aug 20, 2024

Description

As reported on #393, when not specifying the assetId to pay for fees, the value defaulted to something other than undefined as it's supposed to.

Changed the assetId setting in decodeUnsignedTx.ts and defineMethod.ts in order to catch when the assetId is undefined and set it as so.

Previous:

assetId: typeof assetId === 'object'
				? registry.createType('MultiLocation', assetId)
				: registry.createType('Compact<AssetId>', assetId).toNumber()

Current:

assetId: !assetId ? undefined
			: typeof assetId === 'object'
				? registry.createType('MultiLocation', assetId)
				: registry.createType('Compact<AssetId>', assetId).toNumber()

Closes #393

@bee344 bee344 requested a review from a team as a code owner August 20, 2024 12:26
@bee344 bee344 requested a review from Imod7 August 20, 2024 13:01
@bee344 bee344 merged commit e392a2d into main Aug 21, 2024
6 checks passed
@bee344 bee344 deleted the anp-fix-example branch August 21, 2024 11:07
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.

Bug with submitting a TX to Kusama asset hub that is paying native tokens
4 participants