Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename pox address helpers #1691

Open
aryzing opened this issue May 8, 2024 · 1 comment
Open

Rename pox address helpers #1691

aryzing opened this issue May 8, 2024 · 1 comment
Labels
feature Brand new functionality. New pages, workflows, endpoints, etc.

Comments

@aryzing
Copy link

aryzing commented May 8, 2024

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?

@aryzing aryzing added the feature Brand new functionality. New pages, workflows, endpoints, etc. label May 8, 2024
@janniks
Copy link
Collaborator

janniks commented May 13, 2024

Nice idea!

Right now I'm thinking more in the direction of adding it to the Cl. namespace object.
Cl.poxAddressTuple("string") but that would just be an alias to another function, so that should definitely be inverseable 👍 and pull them down from the stacking package into transactions probably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Brand new functionality. New pages, workflows, endpoints, etc.
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants