Skip to content

transaction_submitAndWatch: consider returning "index" as integer, not string #83

@jsdw

Description

@jsdw

Just a small thing for consideration; events like "finalized" look like:

{
    "event": "finalized",
    "block": {
        "hash": "0x...",
        "index": "2"
    }
}

The "index" is a string, not a number. Given that we never expect indexes to be particularly huge (certainly not outside what JS can interpret as a number), should we just return the integer instead?

Consistency is a reason for doing so, eg with this event on the same subscription, numPeers is an integer, not a string:

{
    "event": "broadcasted",
    "numPeers": ...
}

What's your preference?

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