Skip to content

Commit

Permalink
feat: skip signature validation for f4 (fvm contract) addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc committed Feb 13, 2023
1 parent 9707366 commit 28f8d36
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions storagemarket/deal_acceptance.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ func (p *Provider) validateAsk(deal types.ProviderDealState) error {
}

func (p *Provider) validateSignature(tok shared.TipSetToken, deal types.ProviderDealState) (bool, error) {
// Check if the client is an f4 address, ie an FVM contract
clientAddr := deal.ClientDealProposal.Proposal.Client.String()
if len(clientAddr) >= 2 && clientAddr[:2] == "f4" {
// TODO: Simulate publish storage deals message to check f4 signature
return true, nil
}

b, err := cborutil.Dump(&deal.ClientDealProposal.Proposal)
if err != nil {
return false, fmt.Errorf("failed to serialize client deal proposal: %w", err)
Expand Down

0 comments on commit 28f8d36

Please sign in to comment.