diff --git a/blob/blob.go b/blob/blob.go index dc18669e32..c81d83070e 100644 --- a/blob/blob.go +++ b/blob/blob.go @@ -39,33 +39,6 @@ type Proof []*nmt.Proof func (p Proof) Len() int { return len(p) } -func (p Proof) MarshalJSON() ([]byte, error) { - proofs := make([]string, 0, len(p)) - for _, proof := range p { - proofBytes, err := proof.MarshalJSON() - if err != nil { - return nil, err - } - proofs = append(proofs, string(proofBytes)) - } - return json.Marshal(proofs) -} - -func (p *Proof) UnmarshalJSON(b []byte) error { - var proofs []string - if err := json.Unmarshal(b, &proofs); err != nil { - return err - } - for _, proof := range proofs { - var nmtProof nmt.Proof - if err := nmtProof.UnmarshalJSON([]byte(proof)); err != nil { - return err - } - *p = append(*p, &nmtProof) - } - return nil -} - // equal is a temporary method that compares two proofs. // should be removed in BlobService V1. func (p Proof) equal(input Proof) error { diff --git a/nodebuilder/da/service.go b/nodebuilder/da/service.go index b775e10396..ea435a5c36 100644 --- a/nodebuilder/da/service.go +++ b/nodebuilder/da/service.go @@ -3,6 +3,7 @@ package da import ( "context" "encoding/binary" + "encoding/json" "fmt" "strings" @@ -83,7 +84,7 @@ func (s *Service) GetProofs(ctx context.Context, ids []da.ID, namespace da.Names if err != nil { return nil, err } - proofs[i], err = proof.MarshalJSON() + proofs[i], err = json.Marshal(proof) if err != nil { return nil, err } @@ -153,7 +154,7 @@ func (s *Service) Validate( proofs := make([]*blob.Proof, len(ids)) for i, daProof := range daProofs { blobProof := &blob.Proof{} - err := blobProof.UnmarshalJSON(daProof) + err := json.Unmarshal(daProof, blobProof) if err != nil { return nil, err }