Skip to content

Commit

Permalink
Update utils/proofs/proofs.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
joe-bowman and coderabbitai[bot] authored Nov 14, 2024
1 parent 279dabb commit 5fe4b52
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions utils/proofs/proofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@ func (p *CelestiaProof) Validate(dataHash []byte, txHash string) ([]byte, error)
}

func (p *TendermintProof) Validate(dataHash []byte, txHash string) ([]byte, error) {
tmproof, err := tmtypes.TxProofFromProto(*p.TxProof)
if err != nil {
return nil, fmt.Errorf("unable to marshal proof: %w", err)
}
if p.TxProof == nil {
return nil, fmt.Errorf("TxProof is nil")
}
tmproof, err := tmtypes.TxProofFromProto(*p.TxProof)
if err != nil {
return nil, fmt.Errorf("unable to marshal proof: %w", err)
}
err = tmproof.Validate(dataHash)
if err != nil {
return nil, fmt.Errorf("unable to validate proof: %w", err)
Expand Down

0 comments on commit 5fe4b52

Please sign in to comment.