resolve addresses to IDs for checks
This commit is contained in:
parent
24b7661837
commit
073962a60d
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user