Rebuild types

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2019-10-18 14:04:19 +09:00
parent 274673d9c6
commit 737f056c12
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -1060,7 +1060,7 @@ func (t *MultiSigActorState) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{132}); err != nil {
if _, err := w.Write([]byte{135}); err != nil {
return err
}
@ -1084,6 +1084,21 @@ func (t *MultiSigActorState) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.InitialBalance (types.BigInt)
if err := t.InitialBalance.MarshalCBOR(w); err != nil {
return err
}
// t.t.StartingBlock (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, t.StartingBlock)); err != nil {
return err
}
// t.t.UnlockDuration (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, t.UnlockDuration)); err != nil {
return err
}
// t.t.Transactions ([]actors.MTransaction)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Transactions)))); err != nil {
return err
@ -1107,7 +1122,7 @@ func (t *MultiSigActorState) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 4 {
if extra != 7 {
return fmt.Errorf("cbor input had wrong number of fields")
}
@ -1157,6 +1172,35 @@ func (t *MultiSigActorState) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.NextTxID = extra
// t.t.InitialBalance (types.BigInt)
{
if err := t.InitialBalance.UnmarshalCBOR(br); err != nil {
return err
}
}
// t.t.StartingBlock (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.StartingBlock = extra
// t.t.UnlockDuration (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.UnlockDuration = extra
// t.t.Transactions ([]actors.MTransaction)
maj, extra, err = cbg.CborReadHeader(br)
@ -1191,7 +1235,7 @@ func (t *MultiSigConstructorParams) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{130}); err != nil {
if _, err := w.Write([]byte{131}); err != nil {
return err
}
@ -1209,6 +1253,11 @@ func (t *MultiSigConstructorParams) MarshalCBOR(w io.Writer) error {
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, t.Required)); err != nil {
return err
}
// t.t.UnlockDuration (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, t.UnlockDuration)); err != nil {
return err
}
return nil
}
@ -1223,7 +1272,7 @@ func (t *MultiSigConstructorParams) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 2 {
if extra != 3 {
return fmt.Errorf("cbor input had wrong number of fields")
}
@ -1263,6 +1312,16 @@ func (t *MultiSigConstructorParams) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Required = extra
// t.t.UnlockDuration (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.UnlockDuration = extra
return nil
}