From ed4caac9bff516ffd16544641c5fcc3b17c9c88f Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Tue, 15 Sep 2020 22:24:09 +0100 Subject: [PATCH] fix: remove network version and total fil --- conformance/chaos/actor.go | 27 ++++++++---------- conformance/chaos/cbor_gen.go | 54 ++--------------------------------- 2 files changed, 14 insertions(+), 67 deletions(-) diff --git a/conformance/chaos/actor.go b/conformance/chaos/actor.go index 526dac64c..005a06f0d 100644 --- a/conformance/chaos/actor.go +++ b/conformance/chaos/actor.go @@ -254,14 +254,12 @@ func (a Actor) AbortWith(rt runtime.Runtime, args *AbortWithArgs) *abi.EmptyValu // InspectRuntimeReturn is the return value for the Actor.InspectRuntime method. type InspectRuntimeReturn struct { - NetworkVersion int64 - Caller address.Address - Receiver address.Address - ValueReceived abi.TokenAmount - CurrEpoch abi.ChainEpoch - CurrentBalance abi.TokenAmount - State State - TotalFilCircSupply abi.TokenAmount + Caller address.Address + Receiver address.Address + ValueReceived abi.TokenAmount + CurrEpoch abi.ChainEpoch + CurrentBalance abi.TokenAmount + State State } // InspectRuntime returns a copy of the serializable values available in the Runtime. @@ -270,12 +268,11 @@ func (a Actor) InspectRuntime(rt runtime.Runtime, _ *abi.EmptyValue) *InspectRun var st State rt.StateReadonly(&st) return &InspectRuntimeReturn{ - NetworkVersion: int64(rt.NetworkVersion()), - Caller: rt.Caller(), - Receiver: rt.Receiver(), - ValueReceived: rt.ValueReceived(), - CurrentBalance: rt.CurrentBalance(), - State: st, - TotalFilCircSupply: rt.TotalFilCircSupply(), + Caller: rt.Caller(), + Receiver: rt.Receiver(), + ValueReceived: rt.ValueReceived(), + CurrEpoch: rt.CurrEpoch(), + CurrentBalance: rt.CurrentBalance(), + State: st, } } diff --git a/conformance/chaos/cbor_gen.go b/conformance/chaos/cbor_gen.go index 96b707386..2d9deec93 100644 --- a/conformance/chaos/cbor_gen.go +++ b/conformance/chaos/cbor_gen.go @@ -731,7 +731,7 @@ func (t *AbortWithArgs) UnmarshalCBOR(r io.Reader) error { return nil } -var lengthBufInspectRuntimeReturn = []byte{136} +var lengthBufInspectRuntimeReturn = []byte{134} func (t *InspectRuntimeReturn) MarshalCBOR(w io.Writer) error { if t == nil { @@ -744,17 +744,6 @@ func (t *InspectRuntimeReturn) MarshalCBOR(w io.Writer) error { scratch := make([]byte, 9) - // t.NetworkVersion (int64) (int64) - if t.NetworkVersion >= 0 { - if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.NetworkVersion)); err != nil { - return err - } - } else { - if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajNegativeInt, uint64(-t.NetworkVersion-1)); err != nil { - return err - } - } - // t.Caller (address.Address) (struct) if err := t.Caller.MarshalCBOR(w); err != nil { return err @@ -790,11 +779,6 @@ func (t *InspectRuntimeReturn) MarshalCBOR(w io.Writer) error { if err := t.State.MarshalCBOR(w); err != nil { return err } - - // t.TotalFilCircSupply (big.Int) (struct) - if err := t.TotalFilCircSupply.MarshalCBOR(w); err != nil { - return err - } return nil } @@ -812,35 +796,10 @@ func (t *InspectRuntimeReturn) UnmarshalCBOR(r io.Reader) error { return fmt.Errorf("cbor input should be of type array") } - if extra != 8 { + if extra != 6 { return fmt.Errorf("cbor input had wrong number of fields") } - // t.NetworkVersion (int64) (int64) - { - maj, extra, err := cbg.CborReadHeaderBuf(br, scratch) - var extraI int64 - if err != nil { - return err - } - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") - } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") - } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) - } - - t.NetworkVersion = int64(extraI) - } // t.Caller (address.Address) (struct) { @@ -910,15 +869,6 @@ func (t *InspectRuntimeReturn) UnmarshalCBOR(r io.Reader) error { return xerrors.Errorf("unmarshaling t.State: %w", err) } - } - // t.TotalFilCircSupply (big.Int) (struct) - - { - - if err := t.TotalFilCircSupply.UnmarshalCBOR(br); err != nil { - return xerrors.Errorf("unmarshaling t.TotalFilCircSupply: %w", err) - } - } return nil }