filecoin-project / go-data-transfer

Data Transfer Shared Component for go-filecoin & go-lotus
Other
39 stars 17 forks source link

fix(channels): avoid panic in Voucher #354

Closed hannahhoward closed 1 year ago

hannahhoward commented 1 year ago

Goals

fix #352

Implementation

Avoid a panic when a decoder is not present for a voucher type. This actually checks for whether a decoder is present and if not, returns nil. Also adds for various other voucher funcs.

The PR is to the release/v1.15.x, which we can maintain while there are data transfer 1.x clients in wide use.

For Discussion

Maybe we should add a nil check as well just to be safe? Thoughts?