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
199
199
}
200
200
};
201
201
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
-
235
202
/* * Writes data to an underlying source stream, while hashing the written data. */
236
203
template <typename Source>
237
204
class 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)
553
553
554
554
BOOST_AUTO_TEST_CASE (streams_hashed)
555
555
{
556
- CDataStream stream (SER_NETWORK, INIT_PROTO_VERSION) ;
556
+ DataStream stream{} ;
557
557
HashedSourceWriter hash_writer{stream};
558
558
const std::string data{" bitcoin" };
559
559
hash_writer << data;
560
560
561
- CHashVerifier hash_verifier{& stream};
561
+ HashVerifier hash_verifier{stream};
562
562
std::string result;
563
563
hash_verifier >> result;
564
564
BOOST_CHECK_EQUAL (data, result);
You can’t perform that action at this time.
0 commit comments