post-upstream-merge fixes

This commit is contained in:
Łukasz Magiera 2020-02-24 18:45:25 +01:00
parent d787aa5007
commit 794429dd55
6 changed files with 8 additions and 16 deletions

View File

@ -5,6 +5,7 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
miner2 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
"reflect" "reflect"
"strconv" "strconv"
"strings" "strings"
@ -93,24 +94,16 @@ var stateMinerInfo = &cli.Command{
return err return err
} }
var mst actors.StorageMinerActorState var mst miner2.State
if err := mst.UnmarshalCBOR(bytes.NewReader(aso)); err != nil { if err := mst.UnmarshalCBOR(bytes.NewReader(aso)); err != nil {
return err return err
} }
mio, err := api.ChainReadObj(ctx, mst.Info) mi := mst.Info
if err != nil {
return err
}
var mi actors.MinerInfo
if err := mi.UnmarshalCBOR(bytes.NewReader(mio)); err != nil {
return err
}
fmt.Printf("Owner:\t%s\n", mi.Owner) fmt.Printf("Owner:\t%s\n", mi.Owner)
fmt.Printf("Worker:\t%s\n", mi.Worker) fmt.Printf("Worker:\t%s\n", mi.Worker)
fmt.Printf("PeerID:\t%s\n", mi.PeerID) fmt.Printf("PeerID:\t%s\n", mi.PeerId)
fmt.Printf("SectorSize:\t%s (%d)\n", units.BytesSize(float64(mi.SectorSize)), mi.SectorSize) fmt.Printf("SectorSize:\t%s (%d)\n", units.BytesSize(float64(mi.SectorSize)), mi.SectorSize)
return nil return nil

View File

@ -7,7 +7,6 @@ import (
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
"github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types"
"github.com/mitchellh/go-homedir"
"io/ioutil" "io/ioutil"
"os" "os"
"runtime/pprof" "runtime/pprof"

View File

@ -105,7 +105,6 @@ func (t *HelloMessage) UnmarshalCBOR(r io.Reader) error {
if maj != cbg.MajUnsignedInt { if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field") return fmt.Errorf("wrong type for uint64 field")
} }
t.HeaviestTipSetHeight = uint64(extra)
// t.HeaviestTipSetWeight (types.BigInt) (struct) // t.HeaviestTipSetWeight (types.BigInt) (struct)
{ {

View File

@ -2,6 +2,7 @@ package hello
import ( import (
"context" "context"
"github.com/filecoin-project/specs-actors/actors/abi"
"time" "time"
"github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/abi/big"
@ -25,7 +26,7 @@ var log = logging.Logger("hello")
type HelloMessage struct { type HelloMessage struct {
HeaviestTipSet []cid.Cid HeaviestTipSet []cid.Cid
HeaviestTipSetHeight uint64 HeaviestTipSetHeight abi.ChainEpoch
HeaviestTipSetWeight big.Int HeaviestTipSetWeight big.Int
GenesisHash cid.Cid GenesisHash cid.Cid
} }

View File

@ -57,7 +57,7 @@ type storageMinerApi interface {
MpoolPushMessage(context.Context, *types.Message) (*types.SignedMessage, error) MpoolPushMessage(context.Context, *types.Message) (*types.SignedMessage, error)
ChainHead(context.Context) (types.TipSetKey, error) ChainHead(context.Context) (*types.TipSet, error)
ChainNotify(context.Context) (<-chan []*store.HeadChange, error) ChainNotify(context.Context) (<-chan []*store.HeadChange, error)
ChainGetRandomness(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) ChainGetRandomness(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error)
ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error) ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)

View File

@ -45,7 +45,7 @@ type sealingApi interface { // TODO: trim down
MpoolPushMessage(context.Context, *types.Message) (*types.SignedMessage, error) MpoolPushMessage(context.Context, *types.Message) (*types.SignedMessage, error)
ChainHead(context.Context) (types.TipSetKey, error) ChainHead(context.Context) (*types.TipSet, error)
ChainNotify(context.Context) (<-chan []*store.HeadChange, error) ChainNotify(context.Context) (<-chan []*store.HeadChange, error)
ChainGetRandomness(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) ChainGetRandomness(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error)
ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error) ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)