Skip to content

Rename pox address helpers #1691

Open
Open
@aryzing

Description

@aryzing

Problem

If I understood correctly, the poxAddressToTuple() and poxAddressToBtcAddress() methods convert a bitcoin pox address b/w the string format and the tupleCV format used by the pox-4 contract.

Going by the name alone, I wouldn't say that's obvious. They also take different amounts of args, not sure if it would make sense for both to default to mainnet?

Solution

Rename the methods and have them accept the same number of args if possible. Since they perform inverse operations, I'd imagine that we could have something like the following

const poxAddress = "bc1...";

poxContractAddressCVToPoxAddress(poxAddressToPoxContractAddressCV(poxAddress)) === poxAddress;

wdyt?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureBrand new functionality. New pages, workflows, endpoints, etc.

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions