Skip to content

Add input validation #84

@dastanbeksamatov

Description

@dastanbeksamatov

Input validation

  • Currently most of our Runtime APIs do not validate the incoming input and throws generic Runtime: Unreachable error. In most of the cases, when we receive the input, we decode it to the desired type and expect it to be encoded correctly. For instance, in /api/others.ts in function system_accountNonce we decode input to AccountId like this
const account = AccountId.fromU8Array(input).result.

which does not assume the case when input might be encoded incorrectly.

TO-DO

  • Implement new function/tool that validates each input incoming to the runtime and returns corresponding error code and message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions