Skip to content

Different return types for getblockhash, getbestblockhash #73

@welshjf

Description

@welshjf

Confusingly, bitcoin.rpc.Proxy.getblockhash returns raw bytes, while getbestblockhash returns the hex string, as there's no wrapper implemented for the latter. And there's probably more like this, since as noted, object conversion is not fully implemented.

I guess the question is how much risk there is to existing code of fixing it now.

Perhaps, with a sufficiently major version bump to warn of the API breakage, we should get rid of the magic __getattr__ in Proxy and de-underscore _call. Thus, only explicitly wrapped RPCs can be called directly, while others can be called such as proxy.call("getbestblockhash"). Ugly in that it kinda breaks the logic of calling it a "proxy" if you have to make such calls, but it allows new wrappers to be implemented compatibly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions