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

endianness problem in assetId in signAndSend #5690

Closed
sander2 opened this issue Jul 13, 2023 · 2 comments
Closed

endianness problem in assetId in signAndSend #5690

sander2 opened this issue Jul 13, 2023 · 2 comments

Comments

@sander2
Copy link
Contributor

sander2 commented Jul 13, 2023

the signAndSend function takes an optional assetId. We've been trying to use this for statemine/statemint to pay tx fees using USDT. In our test scripts, we've got it working, but when we deploy our code it doesn't. When inspecting the constructed extrinsics, it seems that there is some inconsistency in endianness used for the serialization. When using signAndSend(address, { assetId: 1984 }) in our scripts, we see in the polkadotjs explorer that the assetId is 01 c0070000, which corresponds to Some(1984) using little endian encoding. However, when we deploy our code, we see that instead it has 01 000007c0. If we use { assetId: 3221684224 }, which is 0xc0070000, it works in the deployed code.

The type of the assetId is type AnyNumber = BN | bigint | Uint8Array | number | string;. We tried passing an explicit Uint8Array or string but that didn't work.

So it seems like somehow there is something wrong with the encoding of this assetId. Any help would be much appreciated

@jacogr
Copy link
Member

jacogr commented Aug 30, 2023

Closed in #5716

@jacogr jacogr closed this as completed Aug 30, 2023
@polkadot-js-bot
Copy link

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.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Sep 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants