resolve addresses to IDs for checks

This commit is contained in:
Jeromy 2020-04-17 14:23:30 -07:00
parent 24b7661837
commit 073962a60d
2 changed files with 7 additions and 2 deletions

View File

@ -107,7 +107,7 @@ loop:
case storagemarket.StorageDealFailing:
t.Fatal("deal failed")
case storagemarket.StorageDealError:
t.Fatal("deal errored")
t.Fatal("deal errored", di.Message)
case storagemarket.StorageDealActive:
fmt.Println("COMPLETE", di)
break loop

View File

@ -177,7 +177,12 @@ func (c *ClientNodeAdapter) ValidatePublishedDeal(ctx context.Context, deal stor
return 0, xerrors.Errorf("getting miner worker failed: %w", err)
}
if pubmsg.From != mi.Worker {
fromid, err := c.StateLookupID(ctx, pubmsg.From, types.EmptyTSK)
if err != nil {
return 0, xerrors.Errorf("failed to resolve from msg ID addr: %w", err)
}
if fromid != mi.Worker {
return 0, xerrors.Errorf("deal wasn't published by storage provider: from=%s, provider=%s", pubmsg.From, deal.Proposal.Provider)
}