Merge pull request #6787 from xloem/fix/deal-segfault
fixes #6786 segfault
This commit is contained in:
commit
8ddd12d144
4
extern/storage-sealing/currentdealinfo.go
vendored
4
extern/storage-sealing/currentdealinfo.go
vendored
@ -69,6 +69,10 @@ func (mgr *CurrentDealInfoManager) dealIDFromPublishDealsMsg(ctx context.Context
|
|||||||
return dealID, nil, xerrors.Errorf("looking for publish deal message %s: search msg failed: %w", publishCid, err)
|
return dealID, nil, xerrors.Errorf("looking for publish deal message %s: search msg failed: %w", publishCid, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if lookup == nil {
|
||||||
|
return dealID, nil, xerrors.Errorf("looking for publish deal message %s: not found", publishCid)
|
||||||
|
}
|
||||||
|
|
||||||
if lookup.Receipt.ExitCode != exitcode.Ok {
|
if lookup.Receipt.ExitCode != exitcode.Ok {
|
||||||
return dealID, nil, xerrors.Errorf("looking for publish deal message %s: non-ok exit code: %s", publishCid, lookup.Receipt.ExitCode)
|
return dealID, nil, xerrors.Errorf("looking for publish deal message %s: non-ok exit code: %s", publishCid, lookup.Receipt.ExitCode)
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errNotFound = errors.New("Could not find")
|
var errNotFound = errors.New("could not find")
|
||||||
|
|
||||||
func TestGetCurrentDealInfo(t *testing.T) {
|
func TestGetCurrentDealInfo(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
@ -180,6 +180,12 @@ func TestGetCurrentDealInfo(t *testing.T) {
|
|||||||
expectedDealID: zeroDealID,
|
expectedDealID: zeroDealID,
|
||||||
expectedError: xerrors.Errorf("looking for publish deal message %s: search msg failed: something went wrong", dummyCid),
|
expectedError: xerrors.Errorf("looking for publish deal message %s: search msg failed: something went wrong", dummyCid),
|
||||||
},
|
},
|
||||||
|
"search message not found": {
|
||||||
|
publishCid: dummyCid,
|
||||||
|
targetProposal: &proposal,
|
||||||
|
expectedDealID: zeroDealID,
|
||||||
|
expectedError: xerrors.Errorf("looking for publish deal message %s: not found", dummyCid),
|
||||||
|
},
|
||||||
"return code not ok": {
|
"return code not ok": {
|
||||||
publishCid: dummyCid,
|
publishCid: dummyCid,
|
||||||
searchMessageLookup: &MsgLookup{
|
searchMessageLookup: &MsgLookup{
|
||||||
|
Loading…
Reference in New Issue
Block a user