lotus/chain/types/voucher.go
2020-02-25 22:09:22 +01:00

23 lines
427 B
Go

package types
import(
"encoding/base64"
"github.com/filecoin-project/specs-actors/actors/builtin/paych"
cbor "github.com/ipfs/go-ipld-cbor"
)
func DecodeSignedVoucher(s string) (*paych.SignedVoucher, error) {
data, err := base64.RawURLEncoding.DecodeString(s)
if err != nil {
return nil, err
}
var sv paych.SignedVoucher
if err := cbor.DecodeInto(data, &sv); err != nil {
return nil, err
}
return &sv, nil
}