fix bug
This commit is contained in:
parent
182da9d4ef
commit
ed4748e8ac
@ -1185,6 +1185,8 @@ var clientRetrieveCmd = &cli.Command{
|
|||||||
return xerrors.Errorf("error setting up retrieval: %w", err)
|
return xerrors.Errorf("error setting up retrieval: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var prevStatus retrievalmarket.DealStatus
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case evt, ok := <-updates:
|
case evt, ok := <-updates:
|
||||||
@ -1195,6 +1197,7 @@ var clientRetrieveCmd = &cli.Command{
|
|||||||
retrievalmarket.ClientEvents[evt.Event],
|
retrievalmarket.ClientEvents[evt.Event],
|
||||||
retrievalmarket.DealStatuses[evt.Status],
|
retrievalmarket.DealStatuses[evt.Status],
|
||||||
)
|
)
|
||||||
|
prevStatus = evt.Status
|
||||||
}
|
}
|
||||||
|
|
||||||
if evt.Err != "" {
|
if evt.Err != "" {
|
||||||
@ -1202,10 +1205,11 @@ var clientRetrieveCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
if evt.Status == retrievalmarket.DealStatusCompleted {
|
if prevStatus == retrievalmarket.DealStatusCompleted {
|
||||||
afmt.Println("Success")
|
afmt.Println("Success")
|
||||||
} else {
|
} else {
|
||||||
afmt.Printf("saw final deal state %s instead of expected success state DealStatusCompleted", retrievalmarket.DealStatuses[evt.Status])
|
afmt.Printf("saw final deal state %s instead of expected success state DealStatusCompleted",
|
||||||
|
retrievalmarket.DealStatuses[prevStatus])
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user