HomePhabricator

Generalize/simplify VectorReader into SpanReader

Description

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

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D15903

Details

Provenance
Pieter Wuille <pieter@wuille.net>Authored on Dec 1 2021, 19:40
PiRKCommitted on Apr 5 2024, 13:50
PiRKPushed on Apr 5 2024, 13:50
Reviewer
Restricted Project
Differential Revision
D15903: Generalize/simplify VectorReader into SpanReader
Parents
rABC99baccd8350f: [e.cash] Fix small typo on Staking page
Branches
Unknown
Tags
Unknown