But in the assertion, we'd have to use assert by_to_script_pub_key.to_bytes() == by_script.to_bytes(). Can we add a special method __eq__ to the Script class that compares their bytes?
I'm open to make a PR on this but I want to know if there are other concerns on that.
The idea is to add a easier way to compare two
Script
instances ofbitcoinutils.script
instances:say I have an
addr: P2pkhAddress
and the twoScript
instances below (by_script
,by_to_script_pub_key
) should be the same.But in the assertion, we'd have to use
assert by_to_script_pub_key.to_bytes() == by_script.to_bytes()
. Can we add a special method__eq__
to theScript
class that compares theirbytes
?I'm open to make a PR on this but I want to know if there are other concerns on that.