Replace uses of BOOST_THROW_EXCEPTION with assertThrow

Where appropriate.
This commit is contained in:
Alex Beregszaszi
2019-11-26 13:07:42 +01:00
parent e2627e2232
commit 991fbd2956
5 changed files with 19 additions and 26 deletions
+2 -5
View File
@@ -17,6 +17,7 @@
#include <libdevcore/IpfsHash.h>
#include <libdevcore/Assertions.h>
#include <libdevcore/Exceptions.h>
#include <libdevcore/picosha2.h>
#include <libdevcore/CommonData.h>
@@ -55,11 +56,7 @@ string base58Encode(bytes const& _data)
bytes dev::ipfsHash(string _data)
{
if (_data.length() >= 1024 * 256)
BOOST_THROW_EXCEPTION(
DataTooLong() <<
errinfo_comment("Ipfs hash for large (chunked) files not yet implemented.")
);
assertThrow(_data.length() < 1024 * 256, DataTooLong, "IPFS hash for large (chunked) files not yet implemented.");
bytes lengthAsVarint = varintEncoding(_data.size());