aefec9b10f
This commit adds an additional return value to Stream.DecodeWithParsedTypes, which returns the set of types that were encountered during decoding. The set will contain all known types that were decoded, as well as unknown odd types that were ignored. The rationale for the return value (rather than an internal member) is so that the stream remains stateless. This return value can be used by callers during decoding to make assertions as to whether specific types were included in the stream. This is need, for example, when parsing onion payloads where certain fields must be included/omitted depending on the hop type. The original Decode method would incur the additional performance hit of needing to track the parsed types, so we can selectively enable this functionality when a decoder requires it by using a helper which conditionally tracks the parsed types. |
||
---|---|---|
.. | ||
hodl | ||
hop | ||
circuit_map.go | ||
circuit_test.go | ||
circuit.go | ||
decayedlog_test.go | ||
decayedlog.go | ||
failure.go | ||
interfaces.go | ||
iterator_test.go | ||
iterator.go | ||
link_test.go | ||
link.go | ||
linkfailure.go | ||
log.go | ||
mailbox_test.go | ||
mailbox.go | ||
mock.go | ||
packet.go | ||
payment_result_test.go | ||
payment_result.go | ||
queue_test.go | ||
queue.go | ||
sequencer.go | ||
switch_test.go | ||
switch.go | ||
test_utils.go |