File tree Expand file tree Collapse file tree 2 files changed +2
-35
lines changed Expand file tree Collapse file tree 2 files changed +2
-35
lines changed Original file line number Diff line number Diff line change @@ -199,39 +199,6 @@ class HashVerifier : public HashWriter
199199 }
200200};
201201
202- template <typename Source>
203- class CHashVerifier : public CHashWriter
204- {
205- private:
206- Source* source;
207-
208- public:
209- explicit CHashVerifier (Source* source_) : CHashWriter(source_->GetType (), source_->GetVersion()), source(source_) {}
210-
211- void read (Span<std::byte> dst)
212- {
213- source->read (dst);
214- this ->write (dst);
215- }
216-
217- void ignore (size_t nSize)
218- {
219- std::byte data[1024 ];
220- while (nSize > 0 ) {
221- size_t now = std::min<size_t >(nSize, 1024 );
222- read ({data, now});
223- nSize -= now;
224- }
225- }
226-
227- template <typename T>
228- CHashVerifier<Source>& operator >>(T&& obj)
229- {
230- ::Unserialize (*this , obj);
231- return (*this );
232- }
233- };
234-
235202/* * Writes data to an underlying source stream, while hashing the written data. */
236203template <typename Source>
237204class HashedSourceWriter : public HashWriter
Original file line number Diff line number Diff line change @@ -553,12 +553,12 @@ BOOST_AUTO_TEST_CASE(streams_buffered_file_rand)
553553
554554BOOST_AUTO_TEST_CASE (streams_hashed)
555555{
556- CDataStream stream (SER_NETWORK, INIT_PROTO_VERSION) ;
556+ DataStream stream{} ;
557557 HashedSourceWriter hash_writer{stream};
558558 const std::string data{" bitcoin" };
559559 hash_writer << data;
560560
561- CHashVerifier hash_verifier{& stream};
561+ HashVerifier hash_verifier{stream};
562562 std::string result;
563563 hash_verifier >> result;
564564 BOOST_CHECK_EQUAL (data, result);
You can’t perform that action at this time.
0 commit comments