Merge pull request #2017 from jsign/jsign/nits

nit: unchecked errors
This commit is contained in:
Łukasz Magiera 2020-06-15 11:31:57 +02:00 committed by GitHub
commit fdbda6f608
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View File

@ -239,6 +239,9 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
st.TotalQualityAdjPower = big.Sub(st.TotalQualityAdjPower, big.NewInt(1)) st.TotalQualityAdjPower = big.Sub(st.TotalQualityAdjPower, big.NewInt(1))
return nil return nil
}) })
if err != nil {
return cid.Undef, xerrors.Errorf("mutating state: %w", err)
}
c, err := vm.Flush(ctx) c, err := vm.Flush(ctx)
if err != nil { if err != nil {

View File

@ -221,6 +221,9 @@ var chainStatObjCmd = &cli.Command{
base := cid.Undef base := cid.Undef
if cctx.IsSet("base") { if cctx.IsSet("base") {
base, err = cid.Decode(cctx.String("base")) base, err = cid.Decode(cctx.String("base"))
if err != nil {
return err
}
} }
stats, err := api.ChainStatObj(ctx, obj, base) stats, err := api.ChainStatObj(ctx, obj, base)

View File

@ -359,7 +359,7 @@ var stateReplaySetCmd = &cli.Command{
return fmt.Errorf("message cid was invalid: %s", err) return fmt.Errorf("message cid was invalid: %s", err)
} }
api, closer, err := GetFullNodeAPI(cctx) fapi, closer, err := GetFullNodeAPI(cctx)
if err != nil { if err != nil {
return err return err
} }
@ -381,7 +381,7 @@ var stateReplaySetCmd = &cli.Command{
if len(tscids) > 0 { if len(tscids) > 0 {
var headers []*types.BlockHeader var headers []*types.BlockHeader
for _, c := range tscids { for _, c := range tscids {
h, err := api.ChainGetBlock(ctx, c) h, err := fapi.ChainGetBlock(ctx, c)
if err != nil { if err != nil {
return err return err
} }
@ -391,12 +391,13 @@ var stateReplaySetCmd = &cli.Command{
ts, err = types.NewTipSet(headers) ts, err = types.NewTipSet(headers)
} else { } else {
r, err := api.StateWaitMsg(ctx, mcid) var r *api.MsgLookup
r, err = fapi.StateWaitMsg(ctx, mcid)
if err != nil { if err != nil {
return xerrors.Errorf("finding message in chain: %w", err) 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 { if err != nil {
return err return err
@ -404,7 +405,7 @@ var stateReplaySetCmd = &cli.Command{
} }
res, err := api.StateReplay(ctx, ts.Key(), mcid) res, err := fapi.StateReplay(ctx, ts.Key(), mcid)
if err != nil { if err != nil {
return xerrors.Errorf("replay call failed: %w", err) return xerrors.Errorf("replay call failed: %w", err)
} }