Rename pox address helpers
aryzing opened this issue · 1 comments
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?
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.