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

decode should include an option like decodeMethodToHex?: boolean #193

Open
TarikGul opened this issue Mar 24, 2022 · 0 comments
Open

decode should include an option like decodeMethodToHex?: boolean #193

TarikGul opened this issue Mar 24, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@TarikGul
Copy link
Member

Currently the decode function will return a method field for each case including decodeUnsignedTx, decodeSignedTx, and decodeSigningPayload. The method will be of type TxMethod, but it would be nice to have an option within OptionsWithMeta called decodeMethodToHex which allows the method to be returned as a hex value.

In order to have this work, within each decode method used in decode you would need a conditional to check whether the option exists and/or is true, then after:

const methodCall = registry.createType('Call', tx.method);

You would return method as something like:

const method = methodCall.toHex();

This would take a bit of type refactoring, as the TxMethod type would need to be adjusted and will have residual affects across the core code base.

@TarikGul TarikGul added the enhancement New feature or request label Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant