lotus/chain/actors/cbor_gen.go
Łukasz Magiera 41daf5ad28 gofmt
2020-02-08 03:18:37 +01:00

2139 lines
43 KiB
Go

// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT.
package actors
import (
"fmt"
"io"
"sort"
"github.com/filecoin-project/lotus/chain/types"
"github.com/libp2p/go-libp2p-core/peer"
cbg "github.com/whyrusleeping/cbor-gen"
xerrors "golang.org/x/xerrors"
)
var _ = xerrors.Errorf
func (t *InitActorState) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{130}); err != nil {
return err
}
// t.AddressMap (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.AddressMap); err != nil {
return xerrors.Errorf("failed to write cid field t.AddressMap: %w", err)
}
// t.NextID (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.NextID))); err != nil {
return err
}
return nil
}
func (t *InitActorState) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 2 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.AddressMap (cid.Cid) (struct)
{
c, err := cbg.ReadCid(br)
if err != nil {
return xerrors.Errorf("failed to read cid field t.AddressMap: %w", err)
}
t.AddressMap = c
}
// t.NextID (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.NextID = uint64(extra)
return nil
}
func (t *ExecParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{130}); err != nil {
return err
}
// t.Code (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Code); err != nil {
return xerrors.Errorf("failed to write cid field t.Code: %w", err)
}
// t.Params ([]uint8) (slice)
if len(t.Params) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.Params was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Params)))); err != nil {
return err
}
if _, err := w.Write(t.Params); err != nil {
return err
}
return nil
}
func (t *ExecParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 2 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Code (cid.Cid) (struct)
{
c, err := cbg.ReadCid(br)
if err != nil {
return xerrors.Errorf("failed to read cid field t.Code: %w", err)
}
t.Code = c
}
// t.Params ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.Params: byte array too large (%d)", extra)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}
t.Params = make([]byte, extra)
if _, err := io.ReadFull(br, t.Params); err != nil {
return err
}
return nil
}
func (t *AccountActorState) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{129}); err != nil {
return err
}
// t.Address (address.Address) (struct)
if err := t.Address.MarshalCBOR(w); err != nil {
return err
}
return nil
}
func (t *AccountActorState) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 1 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Address (address.Address) (struct)
{
if err := t.Address.UnmarshalCBOR(br); err != nil {
return err
}
}
return nil
}
func (t *StorageMinerActorState) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{138}); err != nil {
return err
}
// t.PreCommittedSectors (map[string]*actors.PreCommittedSector) (map)
{
if len(t.PreCommittedSectors) > 4096 {
return xerrors.Errorf("cannot marshal t.PreCommittedSectors map too large")
}
if err := cbg.CborWriteHeader(w, cbg.MajMap, uint64(len(t.PreCommittedSectors))); err != nil {
return err
}
keys := make([]string, 0, len(t.PreCommittedSectors))
for k := range t.PreCommittedSectors {
keys = append(keys, k)
}
sort.Strings(keys)
for _, k := range keys {
v := t.PreCommittedSectors[k]
if len(k) > cbg.MaxLength {
return xerrors.Errorf("Value in field k was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(k)))); err != nil {
return err
}
if _, err := w.Write([]byte(k)); err != nil {
return err
}
if err := v.MarshalCBOR(w); err != nil {
return err
}
}
}
// t.Sectors (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Sectors); err != nil {
return xerrors.Errorf("failed to write cid field t.Sectors: %w", err)
}
// t.ProvingSet (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.ProvingSet); err != nil {
return xerrors.Errorf("failed to write cid field t.ProvingSet: %w", err)
}
// t.Info (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Info); err != nil {
return xerrors.Errorf("failed to write cid field t.Info: %w", err)
}
// t.FaultSet (types.BitField) (struct)
if err := t.FaultSet.MarshalCBOR(w); err != nil {
return err
}
// t.LastFaultSubmission (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.LastFaultSubmission))); err != nil {
return err
}
// t.Power (types.BigInt) (struct)
if err := t.Power.MarshalCBOR(w); err != nil {
return err
}
// t.Active (bool) (bool)
if err := cbg.WriteBool(w, t.Active); err != nil {
return err
}
// t.SlashedAt (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.SlashedAt))); err != nil {
return err
}
// t.ElectionPeriodStart (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.ElectionPeriodStart))); err != nil {
return err
}
return nil
}
func (t *StorageMinerActorState) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 10 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.PreCommittedSectors (map[string]*actors.PreCommittedSector) (map)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajMap {
return fmt.Errorf("expected a map (major type 5)")
}
if extra > 4096 {
return fmt.Errorf("t.PreCommittedSectors: map too large")
}
t.PreCommittedSectors = make(map[string]*PreCommittedSector, extra)
for i, l := 0, int(extra); i < l; i++ {
var k string
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
k = string(sval)
}
var v *PreCommittedSector
{
pb, err := br.PeekByte()
if err != nil {
return err
}
if pb == cbg.CborNull[0] {
var nbuf [1]byte
if _, err := br.Read(nbuf[:]); err != nil {
return err
}
} else {
v = new(PreCommittedSector)
if err := v.UnmarshalCBOR(br); err != nil {
return err
}
}
}
t.PreCommittedSectors[k] = v
}
// t.Sectors (cid.Cid) (struct)
{
c, err := cbg.ReadCid(br)
if err != nil {
return xerrors.Errorf("failed to read cid field t.Sectors: %w", err)
}
t.Sectors = c
}
// t.ProvingSet (cid.Cid) (struct)
{
c, err := cbg.ReadCid(br)
if err != nil {
return xerrors.Errorf("failed to read cid field t.ProvingSet: %w", err)
}
t.ProvingSet = c
}
// t.Info (cid.Cid) (struct)
{
c, err := cbg.ReadCid(br)
if err != nil {
return xerrors.Errorf("failed to read cid field t.Info: %w", err)
}
t.Info = c
}
// t.FaultSet (types.BitField) (struct)
{
if err := t.FaultSet.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.LastFaultSubmission (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.LastFaultSubmission = uint64(extra)
// t.Power (types.BigInt) (struct)
{
if err := t.Power.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.Active (bool) (bool)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajOther {
return fmt.Errorf("booleans must be major type 7")
}
switch extra {
case 20:
t.Active = false
case 21:
t.Active = true
default:
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
}
// t.SlashedAt (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.SlashedAt = uint64(extra)
// t.ElectionPeriodStart (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.ElectionPeriodStart = uint64(extra)
return nil
}
func (t *StorageMinerConstructorParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{132}); err != nil {
return err
}
// t.Owner (address.Address) (struct)
if err := t.Owner.MarshalCBOR(w); err != nil {
return err
}
// t.Worker (address.Address) (struct)
if err := t.Worker.MarshalCBOR(w); err != nil {
return err
}
// t.SectorSize (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.SectorSize))); err != nil {
return err
}
// t.PeerID (peer.ID) (string)
if len(t.PeerID) > cbg.MaxLength {
return xerrors.Errorf("Value in field t.PeerID was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(t.PeerID)))); err != nil {
return err
}
if _, err := w.Write([]byte(t.PeerID)); err != nil {
return err
}
return nil
}
func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{132}); err != nil {
return err
}
// t.SectorNumber (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.SectorNumber))); err != nil {
return err
}
// t.CommR ([]uint8) (slice)
if len(t.CommR) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.CommR was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.CommR)))); err != nil {
return err
}
if _, err := w.Write(t.CommR); err != nil {
return err
}
// t.SealEpoch (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.SealEpoch))); err != nil {
return err
}
// t.DealIDs ([]uint64) (slice)
if len(t.DealIDs) > cbg.MaxLength {
return xerrors.Errorf("Slice value in field t.DealIDs was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.DealIDs)))); err != nil {
return err
}
for _, v := range t.DealIDs {
if err := cbg.CborWriteHeader(w, cbg.MajUnsignedInt, v); err != nil {
return err
}
}
return nil
}
func (i IsValidMinerParam) MarshalCBOR(io.Writer) error {
panic("implement me")
}
func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 4 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.SectorNumber (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
// t.CommR ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.CommR: byte array too large (%d)", extra)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}
t.CommR = make([]byte, extra)
if _, err := io.ReadFull(br, t.CommR); err != nil {
return err
}
// t.SealEpoch (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.SealEpoch = uint64(extra)
// t.DealIDs ([]uint64) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if extra > cbg.MaxLength {
return fmt.Errorf("t.DealIDs: array too large (%d)", extra)
}
if maj != cbg.MajArray {
return fmt.Errorf("expected cbor array")
}
if extra > 0 {
t.DealIDs = make([]uint64, extra)
}
for i := 0; i < int(extra); i++ {
maj, val, err := cbg.CborReadHeader(br)
if err != nil {
return xerrors.Errorf("failed to read uint64 for t.DealIDs slice: %w", err)
}
if maj != cbg.MajUnsignedInt {
return xerrors.Errorf("value read for array t.DealIDs was not a uint, instead got %d", maj)
}
t.DealIDs[i] = val
}
return nil
}
func (t *PreCommittedSector) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{130}); err != nil {
return err
}
// t.Info (actors.SectorPreCommitInfo) (struct)
if err := t.Info.MarshalCBOR(w); err != nil {
return err
}
// t.ReceivedEpoch (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.ReceivedEpoch))); err != nil {
return err
}
return nil
}
func (t *PreCommittedSector) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 2 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Info (actors.SectorPreCommitInfo) (struct)
{
if err := t.Info.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.ReceivedEpoch (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.ReceivedEpoch = uint64(extra)
return nil
}
func (t *MinerInfo) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{132}); err != nil {
return err
}
// t.Owner (address.Address) (struct)
if err := t.Owner.MarshalCBOR(w); err != nil {
return err
}
// t.Worker (address.Address) (struct)
if err := t.Worker.MarshalCBOR(w); err != nil {
return err
}
// t.PeerID (peer.ID) (string)
if len(t.PeerID) > cbg.MaxLength {
return xerrors.Errorf("Value in field t.PeerID was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(t.PeerID)))); err != nil {
return err
}
if _, err := w.Write([]byte(t.PeerID)); err != nil {
return err
}
// t.SectorSize (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.SectorSize))); err != nil {
return err
}
return nil
}
func (t *MinerInfo) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 4 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Owner (address.Address) (struct)
{
if err := t.Owner.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.Worker (address.Address) (struct)
{
if err := t.Worker.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.PeerID (peer.ID) (string)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
t.PeerID = peer.ID(sval)
}
// t.SectorSize (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
return nil
}
func (t *SubmitFallbackPoStParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{130}); err != nil {
return err
}
// t.Proof ([]uint8) (slice)
if len(t.Proof) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.Proof was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Proof)))); err != nil {
return err
}
if _, err := w.Write(t.Proof); err != nil {
return err
}
// t.Candidates ([]types.EPostTicket) (slice)
if len(t.Candidates) > cbg.MaxLength {
return xerrors.Errorf("Slice value in field t.Candidates was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Candidates)))); err != nil {
return err
}
for _, v := range t.Candidates {
if err := v.MarshalCBOR(w); err != nil {
return err
}
}
return nil
}
func (t *SubmitFallbackPoStParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 2 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Proof ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.Proof: byte array too large (%d)", extra)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}
t.Proof = make([]byte, extra)
if _, err := io.ReadFull(br, t.Proof); err != nil {
return err
}
// t.Candidates ([]types.EPostTicket) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if extra > cbg.MaxLength {
return fmt.Errorf("t.Candidates: array too large (%d)", extra)
}
if maj != cbg.MajArray {
return fmt.Errorf("expected cbor array")
}
if extra > 0 {
t.Candidates = make([]types.EPostTicket, extra)
}
for i := 0; i < int(extra); i++ {
var v types.EPostTicket
if err := v.UnmarshalCBOR(br); err != nil {
return err
}
t.Candidates[i] = v
}
return nil
}
func (t *PaymentVerifyParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{130}); err != nil {
return err
}
// t.Extra ([]uint8) (slice)
if len(t.Extra) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.Extra was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Extra)))); err != nil {
return err
}
if _, err := w.Write(t.Extra); err != nil {
return err
}
// t.Proof ([]uint8) (slice)
if len(t.Proof) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.Proof was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Proof)))); err != nil {
return err
}
if _, err := w.Write(t.Proof); err != nil {
return err
}
return nil
}
func (t *PaymentVerifyParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 2 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Extra ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.Extra: byte array too large (%d)", extra)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}
t.Extra = make([]byte, extra)
if _, err := io.ReadFull(br, t.Extra); err != nil {
return err
}
// t.Proof ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.Proof: byte array too large (%d)", extra)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}
t.Proof = make([]byte, extra)
if _, err := io.ReadFull(br, t.Proof); err != nil {
return err
}
return nil
}
func (t *UpdatePeerIDParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{129}); err != nil {
return err
}
// t.PeerID (peer.ID) (string)
if len(t.PeerID) > cbg.MaxLength {
return xerrors.Errorf("Value in field t.PeerID was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(t.PeerID)))); err != nil {
return err
}
if _, err := w.Write([]byte(t.PeerID)); err != nil {
return err
}
return nil
}
func (t *UpdatePeerIDParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 1 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.PeerID (peer.ID) (string)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
t.PeerID = peer.ID(sval)
}
return nil
}
func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{129}); err != nil {
return err
}
// t.Faults (types.BitField) (struct)
if err := t.Faults.MarshalCBOR(w); err != nil {
return err
}
return nil
}
func (t *DeclareFaultsParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 1 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Faults (types.BitField) (struct)
{
if err := t.Faults.UnmarshalCBOR(br); err != nil {
return err
}
}
return nil
}
func (t *PaymentChannelActorState) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{134}); err != nil {
return err
}
// t.From (address.Address) (struct)
if err := t.From.MarshalCBOR(w); err != nil {
return err
}
// t.To (address.Address) (struct)
if err := t.To.MarshalCBOR(w); err != nil {
return err
}
// t.ToSend (types.BigInt) (struct)
if err := t.ToSend.MarshalCBOR(w); err != nil {
return err
}
// t.ClosingAt (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.ClosingAt))); err != nil {
return err
}
// t.MinCloseHeight (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.MinCloseHeight))); err != nil {
return err
}
// t.LaneStates (map[string]*actors.LaneState) (map)
{
if len(t.LaneStates) > 4096 {
return xerrors.Errorf("cannot marshal t.LaneStates map too large")
}
if err := cbg.CborWriteHeader(w, cbg.MajMap, uint64(len(t.LaneStates))); err != nil {
return err
}
keys := make([]string, 0, len(t.LaneStates))
for k := range t.LaneStates {
keys = append(keys, k)
}
sort.Strings(keys)
for _, k := range keys {
v := t.LaneStates[k]
if len(k) > cbg.MaxLength {
return xerrors.Errorf("Value in field k was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(k)))); err != nil {
return err
}
if _, err := w.Write([]byte(k)); err != nil {
return err
}
if err := v.MarshalCBOR(w); err != nil {
return err
}
}
}
return nil
}
func (t *PaymentChannelActorState) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 6 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.From (address.Address) (struct)
{
if err := t.From.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.To (address.Address) (struct)
{
if err := t.To.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.ToSend (types.BigInt) (struct)
{
if err := t.ToSend.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.ClosingAt (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.ClosingAt = uint64(extra)
// t.MinCloseHeight (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.MinCloseHeight = uint64(extra)
// t.LaneStates (map[string]*actors.LaneState) (map)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajMap {
return fmt.Errorf("expected a map (major type 5)")
}
if extra > 4096 {
return fmt.Errorf("t.LaneStates: map too large")
}
t.LaneStates = make(map[string]*LaneState, extra)
for i, l := 0, int(extra); i < l; i++ {
var k string
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
k = string(sval)
}
var v *LaneState
{
pb, err := br.PeekByte()
if err != nil {
return err
}
if pb == cbg.CborNull[0] {
var nbuf [1]byte
if _, err := br.Read(nbuf[:]); err != nil {
return err
}
} else {
v = new(LaneState)
if err := v.UnmarshalCBOR(br); err != nil {
return err
}
}
}
t.LaneStates[k] = v
}
return nil
}
func (t *PCAConstructorParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{129}); err != nil {
return err
}
// t.To (address.Address) (struct)
if err := t.To.MarshalCBOR(w); err != nil {
return err
}
return nil
}
func (t *PCAConstructorParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 1 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.To (address.Address) (struct)
{
if err := t.To.UnmarshalCBOR(br); err != nil {
return err
}
}
return nil
}
func (t *LaneState) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{131}); err != nil {
return err
}
// t.Closed (bool) (bool)
if err := cbg.WriteBool(w, t.Closed); err != nil {
return err
}
// t.Redeemed (types.BigInt) (struct)
if err := t.Redeemed.MarshalCBOR(w); err != nil {
return err
}
// t.Nonce (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Nonce))); err != nil {
return err
}
return nil
}
func (t *LaneState) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 3 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Closed (bool) (bool)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajOther {
return fmt.Errorf("booleans must be major type 7")
}
switch extra {
case 20:
t.Closed = false
case 21:
t.Closed = true
default:
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
}
// t.Redeemed (types.BigInt) (struct)
{
if err := t.Redeemed.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.Nonce (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.Nonce = uint64(extra)
return nil
}
func (t *PCAUpdateChannelStateParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{131}); err != nil {
return err
}
// t.Sv (types.SignedVoucher) (struct)
if err := t.Sv.MarshalCBOR(w); err != nil {
return err
}
// t.Secret ([]uint8) (slice)
if len(t.Secret) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.Secret was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Secret)))); err != nil {
return err
}
if _, err := w.Write(t.Secret); err != nil {
return err
}
// t.Proof ([]uint8) (slice)
if len(t.Proof) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.Proof was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Proof)))); err != nil {
return err
}
if _, err := w.Write(t.Proof); err != nil {
return err
}
return nil
}
func (t *PCAUpdateChannelStateParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 3 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Sv (types.SignedVoucher) (struct)
{
if err := t.Sv.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.Secret ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.Secret: byte array too large (%d)", extra)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}
t.Secret = make([]byte, extra)
if _, err := io.ReadFull(br, t.Secret); err != nil {
return err
}
// t.Proof ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.Proof: byte array too large (%d)", extra)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}
t.Proof = make([]byte, extra)
if _, err := io.ReadFull(br, t.Proof); err != nil {
return err
}
return nil
}
func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{132}); err != nil {
return err
}
// t.PayChActor (address.Address) (struct)
if err := t.PayChActor.MarshalCBOR(w); err != nil {
return err
}
// t.Payer (address.Address) (struct)
if err := t.Payer.MarshalCBOR(w); err != nil {
return err
}
// t.ChannelMessage (cid.Cid) (struct)
if t.ChannelMessage == nil {
if _, err := w.Write(cbg.CborNull); err != nil {
return err
}
} else {
if err := cbg.WriteCid(w, *t.ChannelMessage); err != nil {
return xerrors.Errorf("failed to write cid field t.ChannelMessage: %w", err)
}
}
// t.Vouchers ([]*types.SignedVoucher) (slice)
if len(t.Vouchers) > cbg.MaxLength {
return xerrors.Errorf("Slice value in field t.Vouchers was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Vouchers)))); err != nil {
return err
}
for _, v := range t.Vouchers {
if err := v.MarshalCBOR(w); err != nil {
return err
}
}
return nil
}
func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 4 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.PayChActor (address.Address) (struct)
{
if err := t.PayChActor.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.Payer (address.Address) (struct)
{
if err := t.Payer.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.ChannelMessage (cid.Cid) (struct)
{
pb, err := br.PeekByte()
if err != nil {
return err
}
if pb == cbg.CborNull[0] {
var nbuf [1]byte
if _, err := br.Read(nbuf[:]); err != nil {
return err
}
} else {
c, err := cbg.ReadCid(br)
if err != nil {
return xerrors.Errorf("failed to read cid field t.ChannelMessage: %w", err)
}
t.ChannelMessage = &c
}
}
// t.Vouchers ([]*types.SignedVoucher) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if extra > cbg.MaxLength {
return fmt.Errorf("t.Vouchers: array too large (%d)", extra)
}
if maj != cbg.MajArray {
return fmt.Errorf("expected cbor array")
}
if extra > 0 {
t.Vouchers = make([]*types.SignedVoucher, extra)
}
for i := 0; i < int(extra); i++ {
var v types.SignedVoucher
if err := v.UnmarshalCBOR(br); err != nil {
return err
}
t.Vouchers[i] = &v
}
return nil
}
func (t *StoragePowerState) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{133}); err != nil {
return err
}
// t.Miners (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Miners); err != nil {
return xerrors.Errorf("failed to write cid field t.Miners: %w", err)
}
// t.ProvingBuckets (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.ProvingBuckets); err != nil {
return xerrors.Errorf("failed to write cid field t.ProvingBuckets: %w", err)
}
// t.MinerCount (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.MinerCount))); err != nil {
return err
}
// t.LastMinerCheck (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.LastMinerCheck))); err != nil {
return err
}
// t.TotalStorage (types.BigInt) (struct)
if err := t.TotalStorage.MarshalCBOR(w); err != nil {
return err
}
return nil
}
func (t *StoragePowerState) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 5 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Miners (cid.Cid) (struct)
{
c, err := cbg.ReadCid(br)
if err != nil {
return xerrors.Errorf("failed to read cid field t.Miners: %w", err)
}
t.Miners = c
}
// t.ProvingBuckets (cid.Cid) (struct)
{
c, err := cbg.ReadCid(br)
if err != nil {
return xerrors.Errorf("failed to read cid field t.ProvingBuckets: %w", err)
}
t.ProvingBuckets = c
}
// t.MinerCount (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.MinerCount = uint64(extra)
// t.LastMinerCheck (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.LastMinerCheck = uint64(extra)
// t.TotalStorage (types.BigInt) (struct)
{
if err := t.TotalStorage.UnmarshalCBOR(br); err != nil {
return err
}
}
return nil
}
func (t *CreateStorageMinerParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{132}); err != nil {
return err
}
// t.Owner (address.Address) (struct)
if err := t.Owner.MarshalCBOR(w); err != nil {
return err
}
// t.Worker (address.Address) (struct)
if err := t.Worker.MarshalCBOR(w); err != nil {
return err
}
// t.SectorSize (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.SectorSize))); err != nil {
return err
}
// t.PeerID (peer.ID) (string)
if len(t.PeerID) > cbg.MaxLength {
return xerrors.Errorf("Value in field t.PeerID was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(t.PeerID)))); err != nil {
return err
}
if _, err := w.Write([]byte(t.PeerID)); err != nil {
return err
}
return nil
}
func (t *PowerLookupParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{129}); err != nil {
return err
}
// t.Miner (address.Address) (struct)
if err := t.Miner.MarshalCBOR(w); err != nil {
return err
}
return nil
}
func (t *PowerLookupParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 1 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Miner (address.Address) (struct)
{
if err := t.Miner.UnmarshalCBOR(br); err != nil {
return err
}
}
return nil
}
func (t *UpdateStorageParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{131}); err != nil {
return err
}
// t.Delta (types.BigInt) (struct)
if err := t.Delta.MarshalCBOR(w); err != nil {
return err
}
// t.NextSlashDeadline (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.NextSlashDeadline))); err != nil {
return err
}
// t.PreviousSlashDeadline (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.PreviousSlashDeadline))); err != nil {
return err
}
return nil
}
func (t *UpdateStorageParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 3 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Delta (types.BigInt) (struct)
{
if err := t.Delta.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.NextSlashDeadline (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.NextSlashDeadline = uint64(extra)
// t.PreviousSlashDeadline (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.PreviousSlashDeadline = uint64(extra)
return nil
}
func (t *ArbitrateConsensusFaultParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{130}); err != nil {
return err
}
// t.Block1 (types.BlockHeader) (struct)
if err := t.Block1.MarshalCBOR(w); err != nil {
return err
}
// t.Block2 (types.BlockHeader) (struct)
if err := t.Block2.MarshalCBOR(w); err != nil {
return err
}
return nil
}
func (t *ArbitrateConsensusFaultParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 2 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Block1 (types.BlockHeader) (struct)
{
pb, err := br.PeekByte()
if err != nil {
return err
}
if pb == cbg.CborNull[0] {
var nbuf [1]byte
if _, err := br.Read(nbuf[:]); err != nil {
return err
}
} else {
t.Block1 = new(types.BlockHeader)
if err := t.Block1.UnmarshalCBOR(br); err != nil {
return err
}
}
}
// t.Block2 (types.BlockHeader) (struct)
{
pb, err := br.PeekByte()
if err != nil {
return err
}
if pb == cbg.CborNull[0] {
var nbuf [1]byte
if _, err := br.Read(nbuf[:]); err != nil {
return err
}
} else {
t.Block2 = new(types.BlockHeader)
if err := t.Block2.UnmarshalCBOR(br); err != nil {
return err
}
}
}
return nil
}
func (t *PledgeCollateralParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{129}); err != nil {
return err
}
// t.Size (types.BigInt) (struct)
if err := t.Size.MarshalCBOR(w); err != nil {
return err
}
return nil
}
func (t *PledgeCollateralParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 1 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Size (types.BigInt) (struct)
{
if err := t.Size.UnmarshalCBOR(br); err != nil {
return err
}
}
return nil
}
func (t *MinerSlashConsensusFault) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{131}); err != nil {
return err
}
// t.Slasher (address.Address) (struct)
if err := t.Slasher.MarshalCBOR(w); err != nil {
return err
}
// t.AtHeight (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.AtHeight))); err != nil {
return err
}
// t.SlashedCollateral (types.BigInt) (struct)
if err := t.SlashedCollateral.MarshalCBOR(w); err != nil {
return err
}
return nil
}
func (t *MinerSlashConsensusFault) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 3 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.Slasher (address.Address) (struct)
{
if err := t.Slasher.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.AtHeight (uint64) (uint64)
// t.SlashedCollateral (types.BigInt) (struct)
{
if err := t.SlashedCollateral.UnmarshalCBOR(br); err != nil {
return err
}
}
return nil
}
func (t *CheckMinerParams) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{129}); err != nil {
return err
}
// t.NetworkPower (types.BigInt) (struct)
if err := t.NetworkPower.MarshalCBOR(w); err != nil {
return err
}
return nil
}
func (t *CheckMinerParams) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 1 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.NetworkPower (types.BigInt) (struct)
{
if err := t.NetworkPower.UnmarshalCBOR(br); err != nil {
return err
}
}
return nil
}
func (t *CronActorState) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{128}); err != nil {
return err
}
return nil
}
func (t *CronActorState) UnmarshalCBOR(r io.Reader) error {
br := cbg.GetPeeker(r)
maj, extra, err := cbg.CborReadHeader(br)
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 0 {
return fmt.Errorf("cbor input had wrong number of fields")
}
return nil
}