Skip to content

Commit

Permalink
Merge pull request #1 from filecoin-project/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
chunqizhi authored Jun 16, 2020
2 parents a032bbe + 87e5c38 commit c5a9f18
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
3 changes: 3 additions & 0 deletions chain/gen/genesis/miners.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
st.TotalQualityAdjPower = big.Sub(st.TotalQualityAdjPower, big.NewInt(1))
return nil
})
if err != nil {
return cid.Undef, xerrors.Errorf("mutating state: %w", err)
}

c, err := vm.Flush(ctx)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions cli/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ var chainStatObjCmd = &cli.Command{
base := cid.Undef
if cctx.IsSet("base") {
base, err = cid.Decode(cctx.String("base"))
if err != nil {
return err
}
}

stats, err := api.ChainStatObj(ctx, obj, base)
Expand Down
11 changes: 6 additions & 5 deletions cli/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ var stateReplaySetCmd = &cli.Command{
return fmt.Errorf("message cid was invalid: %s", err)
}

api, closer, err := GetFullNodeAPI(cctx)
fapi, closer, err := GetFullNodeAPI(cctx)
if err != nil {
return err
}
Expand All @@ -381,7 +381,7 @@ var stateReplaySetCmd = &cli.Command{
if len(tscids) > 0 {
var headers []*types.BlockHeader
for _, c := range tscids {
h, err := api.ChainGetBlock(ctx, c)
h, err := fapi.ChainGetBlock(ctx, c)
if err != nil {
return err
}
Expand All @@ -391,20 +391,21 @@ var stateReplaySetCmd = &cli.Command{

ts, err = types.NewTipSet(headers)
} else {
r, err := api.StateWaitMsg(ctx, mcid)
var r *api.MsgLookup
r, err = fapi.StateWaitMsg(ctx, mcid)
if err != nil {
return xerrors.Errorf("finding message in chain: %w", err)
}

ts, err = api.ChainGetTipSet(ctx, r.TipSet.Parents())
ts, err = fapi.ChainGetTipSet(ctx, r.TipSet.Parents())
}
if err != nil {
return err
}

}

res, err := api.StateReplay(ctx, ts.Key(), mcid)
res, err := fapi.StateReplay(ctx, ts.Key(), mcid)
if err != nil {
return xerrors.Errorf("replay call failed: %w", err)
}
Expand Down
7 changes: 6 additions & 1 deletion cli/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ var walletBalance = &cli.Command{
return err
}

fmt.Printf("%s\n", types.FIL(balance))
if balance.Equals(types.NewInt(0)) {
fmt.Printf("%s (warning: may display 0 if chain sync in progress)\n", types.FIL(balance))
} else {
fmt.Printf("%s\n", types.FIL(balance))
}

return nil
},
}
Expand Down
9 changes: 6 additions & 3 deletions cmd/lotus-storage-miner/proving.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ import (
)

var provingCmd = &cli.Command{
Name: "proving",
Name: "proving",
Usage: "View proving information",
Subcommands: []*cli.Command{
provingInfoCmd,
provingDeadlinesCmd,
},
}

var provingInfoCmd = &cli.Command{
Name: "info",
Name: "info",
Usage: "View current state information",
Action: func(cctx *cli.Context) error {
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil {
Expand Down Expand Up @@ -145,7 +147,8 @@ func epochTime(curr, e abi.ChainEpoch) string {
}

var provingDeadlinesCmd = &cli.Command{
Name: "deadlines",
Name: "deadlines",
Usage: "View the current proving period deadlines information",
Action: func(cctx *cli.Context) error {
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil {
Expand Down

0 comments on commit c5a9f18

Please sign in to comment.