Page MenuHomePhabricator

Generalize/simplify VectorReader into SpanReader
ClosedPublic

Authored by PiRK on Apr 5 2024, 11:04.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC23ac3f84c939: Generalize/simplify VectorReader into SpanReader
Summary

Generalize/simplify VectorReader into SpanReader

Remove unused (and broken) functionality in SpanReader

This removes the ability to set an offset in the SpanReader constructor,
as the current code is broken. All call sites use pos=0, so it is actually
unused. If future call sites need it, SpanReader{a, b, c, d} is equivalent
to SpanReader{a, b, c.subspan(d)}.

It also removes the ability to deserialize from SpanReader directly from
the constructor. This too is unused, and can be more idiomatically
simulated using (SpanReader{a, b, c} >> x >> y >> z) instead of
SpanReader{a, b, c, x, y, z}.

This is a backport of core#23653 and core#23687
Depends on D15902

Test Plan

ninja all check-all bitcoin-fuzzers

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable