Skip to content

Commit

Permalink
fix: nil pointer when search fails (#1997)
Browse files Browse the repository at this point in the history
* fix nil pointer when search fails

* fix error message

* fix RPC logging
  • Loading branch information
LexLuthr authored Feb 12, 2025
1 parent 3a9ae32 commit b6ed3dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/boost/direct_deal.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,12 @@ var directDealAllocate = &cli.Command{
eg.Go(func() error {
wait, err := gapi.StateWaitMsg(ctx, m, uint64(cctx.Int("confidence")), 2000, true)
if err != nil {
return fmt.Errorf("timeout waiting for message to land on chain %s", wait.Message)
return fmt.Errorf("timeout waiting for message to land on chain %s", m.String())

}

if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("failed to execute message %s: %w", wait.Message, wait.Receipt.ExitCode)
return fmt.Errorf("failed to execute message %s: %w", m.String(), wait.Receipt.ExitCode)
}
return nil
})
Expand Down Expand Up @@ -687,12 +687,12 @@ If the client id different then claim can be extended up to maximum 5 years from
eg.Go(func() error {
wait, err := gapi.StateWaitMsg(ctx, m, uint64(cctx.Int("confidence")), 2000, true)
if err != nil {
return fmt.Errorf("timeout waiting for message to land on chain %s", wait.Message)
return fmt.Errorf("timeout waiting for message to land on chain %s", m.String())

}

if wait.Receipt.ExitCode.IsError() {
return fmt.Errorf("failed to execute message %s: %w", wait.Message, wait.Receipt.ExitCode)
return fmt.Errorf("failed to execute message %s: %w", m.String(), wait.Receipt.ExitCode)
}
return nil
})
Expand Down
2 changes: 1 addition & 1 deletion cmd/boostd/import_direct_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ var importDirectDataCmd = &cli.Command{
}
alloc, err := lapi.StateGetAllocation(ctx, clientAddr, verifreg.AllocationId(allocationId), head.Key())
if err != nil {
return fmt.Errorf("getting claim details from chain: %w", err)
return fmt.Errorf("getting allocation details from chain: %w", err)
}
if alloc == nil {
return fmt.Errorf("no allocation found with ID %d", allocationId)
Expand Down
1 change: 1 addition & 0 deletions cmd/boostd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func before(cctx *cli.Context) error {
_ = logging.SetLogLevel("piecedirectory", "INFO")
_ = logging.SetLogLevel("sectorstatemgr", "INFO")
_ = logging.SetLogLevel("migrations", "INFO")
_ = logging.SetLogLevel("rpc", "ERROR")

if cliutil.IsVeryVerbose {
_ = logging.SetLogLevel("boostd", "DEBUG")
Expand Down

0 comments on commit b6ed3dc

Please sign in to comment.