Open tnull opened 2 weeks ago
ACK 142ea5dd209c982c092110bea521f3f8924ffc6a
Sounds good to me.
I think it makes sense to call it Script
because we won't expose the pair Script/ScriptBuf
. And the name only makes sense for people using rust-bitcoin
that know what they are. But I don't have any strong preferences.
Sorry I saw this last week and forgot to get back to it.
I see this one as balancing two ideas: (a) our usual rule of "don't name types differently than their Rust counterparts", and (b) providing a type that's appropriately named for the target languages (is the "spirit of the law" vs. "letter of the law" a good analogy here?)
I'm not 100% against using ScriptBuf
, but I do think it has downsides:
Script
. The answer "well that's what it's named in rust-bitcoin" is unsatisfying IMO.The questions I have echo what @Davidson-Souza asked: did you intend to offer both types to the target languages? Will there be advantages for them?
Unless we have a clear use case for having both, I think in this very specific instance, naming the type Script
keeps it closer to what it is in spirit than naming it correctly. Just my 2 sats.
Previously, we exposed
bitcoin::ScriptBuf
asScript
which is pretty confusing givenbitcoin::Script
exists.Here, we rename
Script
toScriptBuf
to align the type names withrust-bitcoin
.IMO, we should stick as close as possible to the
rust-bitcoin
API to avoid confusion and naming collisions in the future.