Browse Source

Merge pull request #2406 from LefterisJP/fixed_hash_strctor_throw

Throw on FixedHash failure of String construction
cl-refactor
Gav Wood 10 years ago
parent
commit
d3116f3257
  1. 2
      libdevcore/FixedHash.h

2
libdevcore/FixedHash.h

@ -81,7 +81,7 @@ public:
explicit FixedHash(byte const* _bs, ConstructFromPointerType) { memcpy(m_data.data(), _bs, N); }
/// Explicitly construct, copying from a string.
explicit FixedHash(std::string const& _s, ConstructFromStringType _t = FromHex, ConstructFromHashType _ht = FailIfDifferent): FixedHash(_t == FromHex ? fromHex(_s) : dev::asBytes(_s), _ht) {}
explicit FixedHash(std::string const& _s, ConstructFromStringType _t = FromHex, ConstructFromHashType _ht = FailIfDifferent): FixedHash(_t == FromHex ? fromHex(_s, WhenError::Throw) : dev::asBytes(_s), _ht) {}
/// Convert to arithmetic type.
operator Arith() const { return fromBigEndian<Arith>(m_data); }

Loading…
Cancel
Save