This commit is contained in:
vyzo 2022-11-09 10:45:11 +02:00
parent 674d127701
commit 6bf7b0312e
7 changed files with 158 additions and 17 deletions

View File

@ -2364,10 +2364,10 @@ func (mr *MockFullNodeMockRecorder) StateCall(arg0, arg1, arg2 interface{}) *gom
}
// StateChangedActors mocks base method.
func (m *MockFullNode) StateChangedActors(arg0 context.Context, arg1, arg2 cid.Cid) (map[string]types.Actor, error) {
func (m *MockFullNode) StateChangedActors(arg0 context.Context, arg1, arg2 cid.Cid) (map[string]types.ActorV5, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateChangedActors", arg0, arg1, arg2)
ret0, _ := ret[0].(map[string]types.Actor)
ret0, _ := ret[0].(map[string]types.ActorV5)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@ -2469,10 +2469,10 @@ func (mr *MockFullNodeMockRecorder) StateEncodeParams(arg0, arg1, arg2, arg3 int
}
// StateGetActor mocks base method.
func (m *MockFullNode) StateGetActor(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*types.Actor, error) {
func (m *MockFullNode) StateGetActor(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*types.ActorV5, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetActor", arg0, arg1, arg2)
ret0, _ := ret[0].(*types.Actor)
ret0, _ := ret[0].(*types.ActorV5)
ret1, _ := ret[1].(error)
return ret0, ret1
}

View File

@ -2249,10 +2249,10 @@ func (mr *MockFullNodeMockRecorder) StateCall(arg0, arg1, arg2 interface{}) *gom
}
// StateChangedActors mocks base method.
func (m *MockFullNode) StateChangedActors(arg0 context.Context, arg1, arg2 cid.Cid) (map[string]types.Actor, error) {
func (m *MockFullNode) StateChangedActors(arg0 context.Context, arg1, arg2 cid.Cid) (map[string]types.ActorV5, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateChangedActors", arg0, arg1, arg2)
ret0, _ := ret[0].(map[string]types.Actor)
ret0, _ := ret[0].(map[string]types.ActorV5)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@ -2324,10 +2324,10 @@ func (mr *MockFullNodeMockRecorder) StateDecodeParams(arg0, arg1, arg2, arg3, ar
}
// StateGetActor mocks base method.
func (m *MockFullNode) StateGetActor(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*types.Actor, error) {
func (m *MockFullNode) StateGetActor(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*types.ActorV5, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetActor", arg0, arg1, arg2)
ret0, _ := ret[0].(*types.Actor)
ret0, _ := ret[0].(*types.ActorV5)
ret1, _ := ret[1].(error)
return ret0, ret1
}

Binary file not shown.

Binary file not shown.

View File

@ -12,6 +12,7 @@ import (
cbg "github.com/whyrusleeping/cbor-gen"
xerrors "golang.org/x/xerrors"
address "github.com/filecoin-project/go-address"
abi "github.com/filecoin-project/go-state-types/abi"
crypto "github.com/filecoin-project/go-state-types/crypto"
exitcode "github.com/filecoin-project/go-state-types/exitcode"
@ -1040,9 +1041,9 @@ func (t *MsgMeta) UnmarshalCBOR(r io.Reader) (err error) {
return nil
}
var lengthBufActor = []byte{132}
var lengthBufActorV4 = []byte{132}
func (t *Actor) MarshalCBOR(w io.Writer) error {
func (t *ActorV4) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
@ -1050,7 +1051,7 @@ func (t *Actor) MarshalCBOR(w io.Writer) error {
cw := cbg.NewCborWriter(w)
if _, err := cw.Write(lengthBufActor); err != nil {
if _, err := cw.Write(lengthBufActorV4); err != nil {
return err
}
@ -1079,8 +1080,8 @@ func (t *Actor) MarshalCBOR(w io.Writer) error {
return nil
}
func (t *Actor) UnmarshalCBOR(r io.Reader) (err error) {
*t = Actor{}
func (t *ActorV4) UnmarshalCBOR(r io.Reader) (err error) {
*t = ActorV4{}
cr := cbg.NewCborReader(r)
@ -1152,6 +1153,142 @@ func (t *Actor) UnmarshalCBOR(r io.Reader) (err error) {
return nil
}
var lengthBufActorV5 = []byte{133}
func (t *ActorV5) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
cw := cbg.NewCborWriter(w)
if _, err := cw.Write(lengthBufActorV5); err != nil {
return err
}
// t.Code (cid.Cid) (struct)
if err := cbg.WriteCid(cw, t.Code); err != nil {
return xerrors.Errorf("failed to write cid field t.Code: %w", err)
}
// t.Head (cid.Cid) (struct)
if err := cbg.WriteCid(cw, t.Head); err != nil {
return xerrors.Errorf("failed to write cid field t.Head: %w", err)
}
// t.Nonce (uint64) (uint64)
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Nonce)); err != nil {
return err
}
// t.Balance (big.Int) (struct)
if err := t.Balance.MarshalCBOR(cw); err != nil {
return err
}
// t.Address (address.Address) (struct)
if err := t.Address.MarshalCBOR(cw); err != nil {
return err
}
return nil
}
func (t *ActorV5) UnmarshalCBOR(r io.Reader) (err error) {
*t = ActorV5{}
cr := cbg.NewCborReader(r)
maj, extra, err := cr.ReadHeader()
if err != nil {
return err
}
defer func() {
if err == io.EOF {
err = io.ErrUnexpectedEOF
}
}()
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.Code (cid.Cid) (struct)
{
c, err := cbg.ReadCid(cr)
if err != nil {
return xerrors.Errorf("failed to read cid field t.Code: %w", err)
}
t.Code = c
}
// t.Head (cid.Cid) (struct)
{
c, err := cbg.ReadCid(cr)
if err != nil {
return xerrors.Errorf("failed to read cid field t.Head: %w", err)
}
t.Head = c
}
// t.Nonce (uint64) (uint64)
{
maj, extra, err = cr.ReadHeader()
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.Nonce = uint64(extra)
}
// t.Balance (big.Int) (struct)
{
if err := t.Balance.UnmarshalCBOR(cr); err != nil {
return xerrors.Errorf("unmarshaling t.Balance: %w", err)
}
}
// t.Address (address.Address) (struct)
{
b, err := cr.ReadByte()
if err != nil {
return err
}
if b != cbg.CborNull[0] {
if err := cr.UnreadByte(); err != nil {
return err
}
t.Address = new(address.Address)
if err := t.Address.UnmarshalCBOR(cr); err != nil {
return xerrors.Errorf("unmarshaling t.Address pointer: %w", err)
}
}
}
return nil
}
var lengthBufMessageReceipt = []byte{131}
func (t *MessageReceipt) MarshalCBOR(w io.Writer) error {

View File

@ -4932,7 +4932,8 @@ Response:
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Nonce": 42,
"Balance": "0"
"Balance": "0",
"Address": "\u003cempty\u003e"
}
}
```
@ -5257,7 +5258,8 @@ Response:
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Nonce": 42,
"Balance": "0"
"Balance": "0",
"Address": "\u003cempty\u003e"
}
```

View File

@ -5364,7 +5364,8 @@ Response:
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Nonce": 42,
"Balance": "0"
"Balance": "0",
"Address": "\u003cempty\u003e"
}
}
```
@ -5740,7 +5741,8 @@ Response:
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Nonce": 42,
"Balance": "0"
"Balance": "0",
"Address": "\u003cempty\u003e"
}
```