Skip to content

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

@TarikGul

Description

@TarikGul

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions