feat: add logs to markets event handler
This commit is contained in:
parent
7663ec2bde
commit
4382bbcc96
@ -554,7 +554,7 @@ func (me *messageEvents) Called(ctx context.Context, check CheckFunc, msgHnd Msg
|
|||||||
|
|
||||||
id, err := me.hcAPI.onHeadChanged(ctx, check, hnd, rev, confidence, timeout)
|
id, err := me.hcAPI.onHeadChanged(ctx, check, hnd, rev, confidence, timeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return xerrors.Errorf("on head changed error: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
me.lk.Lock()
|
me.lk.Lock()
|
||||||
|
@ -72,7 +72,7 @@ func (mgr *SectorCommittedManager) OnDealSectorPreCommitted(ctx context.Context,
|
|||||||
// Note: the error returned from here will end up being returned
|
// Note: the error returned from here will end up being returned
|
||||||
// from OnDealSectorPreCommitted so no need to call the callback
|
// from OnDealSectorPreCommitted so no need to call the callback
|
||||||
// with the error
|
// with the error
|
||||||
return false, false, err
|
return false, false, xerrors.Errorf("failed to check deal activity: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if isActive {
|
if isActive {
|
||||||
@ -89,7 +89,7 @@ func (mgr *SectorCommittedManager) OnDealSectorPreCommitted(ctx context.Context,
|
|||||||
|
|
||||||
diff, err := mgr.dpc.diffPreCommits(ctx, provider, dealInfo.PublishMsgTipSet, ts.Key())
|
diff, err := mgr.dpc.diffPreCommits(ctx, provider, dealInfo.PublishMsgTipSet, ts.Key())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, false, err
|
return false, false, xerrors.Errorf("failed to diff precommits: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, info := range diff.Added {
|
for _, info := range diff.Added {
|
||||||
@ -139,7 +139,7 @@ func (mgr *SectorCommittedManager) OnDealSectorPreCommitted(ctx context.Context,
|
|||||||
// current deal ID from the publish message CID
|
// current deal ID from the publish message CID
|
||||||
res, err := mgr.dealInfo.GetCurrentDealInfo(ctx, ts.Key(), &proposal, publishCid)
|
res, err := mgr.dealInfo.GetCurrentDealInfo(ctx, ts.Key(), &proposal, publishCid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, xerrors.Errorf("failed to get dealinfo: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is a replica update method that succeeded the deal is active
|
// If this is a replica update method that succeeded the deal is active
|
||||||
@ -159,7 +159,7 @@ func (mgr *SectorCommittedManager) OnDealSectorPreCommitted(ctx context.Context,
|
|||||||
// Extract the message parameters
|
// Extract the message parameters
|
||||||
sn, err := dealSectorInPreCommitMsg(msg, res)
|
sn, err := dealSectorInPreCommitMsg(msg, res)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, xerrors.Errorf("failed to extract message params: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if sn != nil {
|
if sn != nil {
|
||||||
|
@ -145,7 +145,7 @@ func TestOnDealSectorPreCommitted(t *testing.T) {
|
|||||||
"error getting current deal info in check func": {
|
"error getting current deal info in check func": {
|
||||||
currentDealInfoErr: errors.New("something went wrong"),
|
currentDealInfoErr: errors.New("something went wrong"),
|
||||||
expectedCBCallCount: 0,
|
expectedCBCallCount: 0,
|
||||||
expectedError: xerrors.Errorf("failed to set up called handler: failed to look up deal on chain: something went wrong"),
|
expectedError: xerrors.Errorf("failed to set up called handler: failed to check deal activity: failed to look up deal on chain: something went wrong"),
|
||||||
},
|
},
|
||||||
"sector already active": {
|
"sector already active": {
|
||||||
currentDealInfo: pipeline.CurrentDealInfo{
|
currentDealInfo: pipeline.CurrentDealInfo{
|
||||||
@ -162,7 +162,7 @@ func TestOnDealSectorPreCommitted(t *testing.T) {
|
|||||||
PublishMsgTipSet: types.EmptyTSK,
|
PublishMsgTipSet: types.EmptyTSK,
|
||||||
},
|
},
|
||||||
expectedCBCallCount: 0,
|
expectedCBCallCount: 0,
|
||||||
expectedError: xerrors.Errorf("failed to set up called handler: deal %d was slashed at epoch %d", dealID, slashedDeal.State.SlashEpoch),
|
expectedError: xerrors.Errorf("failed to set up called handler: failed to check deal activity: deal %d was slashed at epoch %d", dealID, slashedDeal.State.SlashEpoch),
|
||||||
},
|
},
|
||||||
"error getting current deal info in called func": {
|
"error getting current deal info in called func": {
|
||||||
currentDealInfo: pipeline.CurrentDealInfo{
|
currentDealInfo: pipeline.CurrentDealInfo{
|
||||||
@ -180,7 +180,7 @@ func TestOnDealSectorPreCommitted(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
expectedCBCallCount: 1,
|
expectedCBCallCount: 1,
|
||||||
expectedCBError: errors.New("handling applied event: something went wrong"),
|
expectedCBError: errors.New("handling applied event: failed to get dealinfo: something went wrong"),
|
||||||
},
|
},
|
||||||
"proposed deal epoch timeout": {
|
"proposed deal epoch timeout": {
|
||||||
currentDealInfo: pipeline.CurrentDealInfo{
|
currentDealInfo: pipeline.CurrentDealInfo{
|
||||||
|
Loading…
Reference in New Issue
Block a user