wait.Receipt.ExitCode != 0 to wait.Receipt.ExitCode.IsError()

This commit is contained in:
Geoff Stuart 2022-09-14 14:53:11 -04:00
parent fb0633453a
commit 3ca9b1e331
13 changed files with 47 additions and 47 deletions

View File

@ -120,7 +120,7 @@ var filplusVerifyClientCmd = &cli.Command{
return err
}
if mwait.Receipt.ExitCode != 0 {
if mwait.Receipt.ExitCode.IsError() {
return fmt.Errorf("failed to add verified client: %d", mwait.Receipt.ExitCode)
}

View File

@ -167,7 +167,7 @@ var msigCreateCmd = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "actor creation failed!")
return err
}
@ -456,7 +456,7 @@ var msigProposeCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("proposal returned exit %d", wait.Receipt.ExitCode)
}
@ -605,7 +605,7 @@ var msigApproveCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("approve returned exit %d", wait.Receipt.ExitCode)
}
@ -730,7 +730,7 @@ var msigCancelCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("cancel returned exit %d", wait.Receipt.ExitCode)
}
@ -810,7 +810,7 @@ var msigRemoveProposeCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("add proposal returned exit %d", wait.Receipt.ExitCode)
}
@ -930,7 +930,7 @@ var msigAddProposeCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("add proposal returned exit %d", wait.Receipt.ExitCode)
}
@ -1021,7 +1021,7 @@ var msigAddApproveCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("add approval returned exit %d", wait.Receipt.ExitCode)
}
@ -1107,7 +1107,7 @@ var msigAddCancelCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("add cancellation returned exit %d", wait.Receipt.ExitCode)
}
@ -1188,7 +1188,7 @@ var msigSwapProposeCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("swap proposal returned exit %d", wait.Receipt.ExitCode)
}
@ -1279,7 +1279,7 @@ var msigSwapApproveCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("swap approval returned exit %d", wait.Receipt.ExitCode)
}
@ -1365,7 +1365,7 @@ var msigSwapCancelCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("swap cancellation returned exit %d", wait.Receipt.ExitCode)
}
@ -1461,7 +1461,7 @@ var msigLockProposeCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("lock proposal returned exit %d", wait.Receipt.ExitCode)
}
@ -1567,7 +1567,7 @@ var msigLockApproveCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("lock approval returned exit %d", wait.Receipt.ExitCode)
}
@ -1668,7 +1668,7 @@ var msigLockCancelCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("lock cancellation returned exit %d", wait.Receipt.ExitCode)
}
@ -1814,7 +1814,7 @@ var msigProposeThresholdCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("change threshold proposal returned exit %d", wait.Receipt.ExitCode)
}

View File

@ -286,7 +286,7 @@ var paychSettleCmd = &cli.Command{
if err != nil {
return nil
}
if mwait.Receipt.ExitCode != 0 {
if mwait.Receipt.ExitCode.IsError() {
return fmt.Errorf("settle message execution failed (exit code %d)", mwait.Receipt.ExitCode)
}
@ -326,7 +326,7 @@ var paychCloseCmd = &cli.Command{
if err != nil {
return nil
}
if mwait.Receipt.ExitCode != 0 {
if mwait.Receipt.ExitCode.IsError() {
return fmt.Errorf("collect message execution failed (exit code %d)", mwait.Receipt.ExitCode)
}
@ -634,7 +634,7 @@ var paychVoucherSubmitCmd = &cli.Command{
return err
}
if mwait.Receipt.ExitCode != 0 {
if mwait.Receipt.ExitCode.IsError() {
return fmt.Errorf("message execution failed (exit code %d)", mwait.Receipt.ExitCode)
}

View File

@ -645,7 +645,7 @@ var walletMarketWithdraw = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
afmt.Println(cctx.App.Writer, "withdrawal failed!")
return err
}

View File

@ -290,7 +290,7 @@ var actorWithdrawCmd = &cli.Command{
return xerrors.Errorf("Timeout waiting for withdrawal message %s", wait.Message)
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return xerrors.Errorf("Failed to execute withdrawal message %s: %w", wait.Message, wait.Receipt.ExitCode.Error())
}
@ -799,7 +799,7 @@ var actorSetOwnerCmd = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Println("owner change failed!")
return err
}
@ -905,7 +905,7 @@ var actorProposeChangeWorker = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "Propose worker change failed!")
return err
}
@ -1011,7 +1011,7 @@ var actorConfirmChangeWorker = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "Worker change failed!")
return err
}
@ -1170,7 +1170,7 @@ var actorCompactAllocatedCmd = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Println("Propose owner change failed!")
return err
}

View File

@ -707,7 +707,7 @@ var provingRecoverFaultsCmd = &cli.Command{
return
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
results <- xerrors.Errorf("Failed to execute message %s: %w", wait.Message, wait.Receipt.ExitCode.Error())
return
}

View File

@ -2195,7 +2195,7 @@ var sectorsCompactPartitionsCmd = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Println(cctx.App.Writer, "compact partitions failed!")
return err
}

View File

@ -144,7 +144,7 @@ var actorWithdrawCmd = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Println(cctx.App.Writer, "withdrawal failed!")
return err
}
@ -279,7 +279,7 @@ var actorSetOwnerCmd = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Println("owner change failed!")
return err
}
@ -647,7 +647,7 @@ var actorProposeChangeWorker = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "Propose worker change failed!")
return err
}
@ -768,7 +768,7 @@ var actorConfirmChangeWorker = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "Worker change failed!")
return err
}

View File

@ -101,7 +101,7 @@ var mmProposeWithdrawBalance = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "Propose owner change tx failed!")
return err
}
@ -180,7 +180,7 @@ var mmApproveWithdrawBalance = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "Approve owner change tx failed!")
return err
}
@ -261,7 +261,7 @@ var mmProposeChangeOwner = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "Propose owner change tx failed!")
return err
}
@ -351,7 +351,7 @@ var mmApproveChangeOwner = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "Approve owner change tx failed!")
return err
}
@ -448,7 +448,7 @@ var mmProposeChangeWorker = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "Propose worker change tx failed!")
return err
}
@ -532,7 +532,7 @@ var mmConfirmChangeWorker = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "Propose worker change tx failed!")
return err
}
@ -647,7 +647,7 @@ var mmProposeControlSet = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "Propose worker change tx failed!")
return err
}

View File

@ -475,7 +475,7 @@ var sendInvalidWindowPoStCmd = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Println(cctx.App.Writer, "Invalid PoST message failed!")
return err
}
@ -574,7 +574,7 @@ var generateAndSendConsensusFaultCmd = &cli.Command{
}
// check it executed successfully
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
fmt.Println(cctx.App.Writer, "Report consensus fault failed!")
return err
}

View File

@ -171,7 +171,7 @@ var terminateSectorCmd = &cli.Command{
return err
}
if wait.Receipt.ExitCode != 0 {
if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("terminate sectors message returned exit %d", wait.Receipt.ExitCode)
}

View File

@ -104,7 +104,7 @@ var verifRegAddVerifierFromMsigCmd = &cli.Command{
return err
}
if mwait.Receipt.ExitCode != 0 {
if mwait.Receipt.ExitCode.IsError() {
return fmt.Errorf("failed to add verifier: %d", mwait.Receipt.ExitCode)
}
@ -170,7 +170,7 @@ var verifRegAddVerifierFromAccountCmd = &cli.Command{
return err
}
if mwait.Receipt.ExitCode != 0 {
if mwait.Receipt.ExitCode.IsError() {
return fmt.Errorf("failed to add verified client: %d", mwait.Receipt.ExitCode)
}
@ -246,7 +246,7 @@ var verifRegVerifyClientCmd = &cli.Command{
return err
}
if mwait.Receipt.ExitCode != 0 {
if mwait.Receipt.ExitCode.IsError() {
return fmt.Errorf("failed to add verified client: %d", mwait.Receipt.ExitCode)
}
@ -555,7 +555,7 @@ var verifRegRemoveVerifiedClientDataCapCmd = &cli.Command{
return err
}
if mwait.Receipt.ExitCode != 0 {
if mwait.Receipt.ExitCode.IsError() {
return fmt.Errorf("failed to removed verified data cap: %d", mwait.Receipt.ExitCode)
}

View File

@ -537,7 +537,7 @@ func (ca *channelAccessor) waitPaychCreateMsg(ctx context.Context, channelID str
}
// If channel creation failed
if mwait.Receipt.ExitCode != 0 {
if mwait.Receipt.ExitCode.IsError() {
ca.lk.Lock()
defer ca.lk.Unlock()
@ -651,7 +651,7 @@ func (ca *channelAccessor) waitAddFundsMsg(ctx context.Context, channelID string
return err
}
if mwait.Receipt.ExitCode != 0 {
if mwait.Receipt.ExitCode.IsError() {
err := xerrors.Errorf("voucher channel creation failed: adding funds (exit code %d)", mwait.Receipt.ExitCode)
log.Error(err)