some errcheck discoveries
This commit is contained in:
parent
613a0a05a0
commit
df069af5e5
14
cli/state.go
14
cli/state.go
@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/address"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"gopkg.in/urfave/cli.v2"
|
||||
@ -176,7 +177,18 @@ var stateReplaySetCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
api.StateReplay(ctx, ts, mcid)
|
||||
res, err := api.StateReplay(ctx, ts, mcid)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("replay call failed: %w", err)
|
||||
}
|
||||
|
||||
fmt.Println("Replay receipt:")
|
||||
fmt.Printf("Exit code: %d\n", res.Receipt.ExitCode)
|
||||
fmt.Printf("Return: %x\n", res.Receipt.Return)
|
||||
fmt.Printf("Gas Used: %s\n", res.Receipt.GasUsed)
|
||||
if res.Receipt.ExitCode != 0 {
|
||||
fmt.Printf("Error message: %q\n", res.Error)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
|
@ -49,7 +49,9 @@ func ClientBlockstore(fstore dtypes.ClientFilestore) dtypes.ClientBlockstore {
|
||||
// request validator with the data transfer module as the validator for
|
||||
// StorageDataTransferVoucher types
|
||||
func RegisterClientValidator(crv *deals.ClientRequestValidator, dtm dtypes.ClientDataTransfer) {
|
||||
dtm.RegisterVoucherType(reflect.TypeOf(deals.StorageDataTransferVoucher{}), crv)
|
||||
if err := dtm.RegisterVoucherType(reflect.TypeOf(deals.StorageDataTransferVoucher{}), crv); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// NewClientDAGServiceDataTransfer returns a data transfer manager that just
|
||||
|
@ -139,7 +139,9 @@ func HandleDeals(mctx helpers.MetricsCtx, lc fx.Lifecycle, host host.Host, h *de
|
||||
// request validator with the data transfer module as the validator for
|
||||
// StorageDataTransferVoucher types
|
||||
func RegisterProviderValidator(mrv *deals.ProviderRequestValidator, dtm dtypes.ProviderDataTransfer) {
|
||||
dtm.RegisterVoucherType(reflect.TypeOf(deals.StorageDataTransferVoucher{}), mrv)
|
||||
if err := dtm.RegisterVoucherType(reflect.TypeOf(deals.StorageDataTransferVoucher{}), mrv); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// NewProviderDAGServiceDataTransfer returns a data transfer manager that just
|
||||
|
Loading…
Reference in New Issue
Block a user