Remove implicit conversion functions in transaction_identifier

This commit is contained in:
marcofleon 2025-04-01 16:12:11 +01:00
parent 13f95efab5
commit acbd6faa78

View file

@ -17,9 +17,6 @@ class transaction_identifier
// Note: Use FromUint256 externally instead. // Note: Use FromUint256 externally instead.
transaction_identifier(const uint256& wrapped) : m_wrapped{wrapped} {} transaction_identifier(const uint256& wrapped) : m_wrapped{wrapped} {}
// TODO: Comparisons with uint256 should be disallowed once we have
// converted most of the code to using the new txid types.
constexpr int Compare(const uint256& other) const { return m_wrapped.Compare(other); }
constexpr int Compare(const transaction_identifier<has_witness>& other) const { return m_wrapped.Compare(other.m_wrapped); } constexpr int Compare(const transaction_identifier<has_witness>& other) const { return m_wrapped.Compare(other.m_wrapped); }
template <typename Other> template <typename Other>
constexpr int Compare(const Other& other) const constexpr int Compare(const Other& other) const
@ -58,15 +55,6 @@ public:
constexpr const std::byte* end() const { return reinterpret_cast<const std::byte*>(m_wrapped.end()); } constexpr const std::byte* end() const { return reinterpret_cast<const std::byte*>(m_wrapped.end()); }
template <typename Stream> void Serialize(Stream& s) const { m_wrapped.Serialize(s); } template <typename Stream> void Serialize(Stream& s) const { m_wrapped.Serialize(s); }
template <typename Stream> void Unserialize(Stream& s) { m_wrapped.Unserialize(s); } template <typename Stream> void Unserialize(Stream& s) { m_wrapped.Unserialize(s); }
/** Conversion function to `uint256`.
*
* Note: new code should use `ToUint256`.
*
* TODO: This should be removed once the majority of the code has switched
* to using the Txid and Wtxid types. Until then it makes for a smoother
* transition to allow this conversion. */
operator const uint256&() const LIFETIMEBOUND { return m_wrapped; }
}; };
/** Txid commits to all transaction fields except the witness. */ /** Txid commits to all transaction fields except the witness. */