-
Notifications
You must be signed in to change notification settings - Fork 360
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
Decode of assetId
hex string fails for signed payload because of Option
#6074
Comments
I'll move this to |
Unfortunately, #5968 adds the Also see #5967. Maybe it's what you have been talking about here. |
assetId
hex string fails for signed payload because of Option
Little tip: When you are constructing a value like above, you shouldn't be using Example: const main = async () => {
const api = await ApiPromise.create({
provider: new WsProvider('wss://kusama-asset-hub-rpc.polkadot.io'),
typesBundle: {
spec: {
'statemine': {
types: [
{
minmax: [0, undefined],
TAssetConversion: 'Option<MultiLocationV3>'
}
]
}
}
}
});
// Encoding here just to show it works.
const asset = api.registry.createType('TAssetConversion', {
parents: 1,
interior: {
X3: [
{ Parachain: 1000 },
{ PalletInstance: 50 },
{ GeneralIndex: 1337 }
]
}
})
console.log(asset.unwrap().toJSON());
}; When you actually plug in the value lets say to the |
It's interesting, I am using the Substrate front end template right now. As soon as I use the Polkadot extension, I get the following error: Before the failure it correctly shows the assetId in the extension: If I use the normal account selector for Alice, the transaction goes through and uses USDC as fee payment asset: Btw. I don't use |
Mmm, try and use master of the api. I just merged in #6083 which fixes how the assetId is decoded when a value is passed in from the signer. This was related to apps but it could also be related here. I have it working on live Kusama, and Polkadot - but haven't checked the front end template yet. |
Yes, perfect! This PR fixed it. Thanks! |
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. |
In the above error it expects
AccountKey20
(derived from[u8;20]
). The index of this is3
inJunctionV3
. TheassetId
hex string always starts with0x0103
, in which0x01
is used forparent: 1
and0x03
should be used forX3
ofJunctionsV3
. However, the0x03
occurs to be used not only forJunctionsV3
but also for the first entry into the tuple ofX3
, which isJunctionV3
. So, it seems to be like a mistaken overlap for the decode functionality.I want to use the following
assetId
(which isUSDC
on AssetHub for our Zeitgeist Parachain):Here is some useful debug output of
@polkadot/types-codec
:Btw. I used a local fork of
@polkadot/api
and@polkadot/known-types
to override theTAssetConversion
forzeitgeist
to beOption<MultiLocationV3>
.The text was updated successfully, but these errors were encountered: