diff --git a/proof_ipa.go b/proof_ipa.go index b6f96107..4c8a5a0f 100644 --- a/proof_ipa.go +++ b/proof_ipa.go @@ -143,7 +143,7 @@ func VerifyVerkleProof(proof *Proof, Cs []*Point, indices []uint8, ys []*Fr, tc func SerializeProof(proof *Proof) (*VerkleProof, StateDiff, error) { otherstems := make([][31]byte, len(proof.PoaStems)) for i, stem := range proof.PoaStems { - copy(otherstems[i][:], stem[:]) + copy(otherstems[i][:], stem) } cbp := make([][32]byte, len(proof.Cs)) diff --git a/proof_json.go b/proof_json.go index a91909df..cbf51708 100644 --- a/proof_json.go +++ b/proof_json.go @@ -88,7 +88,7 @@ func (ipp *IPAProof) UnmarshalJSON(data []byte) error { if err != nil { return fmt.Errorf("error decoding hex string for CL[%d]: %s", i, aux.CL[i]) } - copy(ipp.CL[i][:], val[:]) + copy(ipp.CL[i][:], val) if len(aux.CR[i]) != 64 { return fmt.Errorf("invalid hex string for CR[%d]: %s", i, aux.CR[i]) } @@ -96,7 +96,7 @@ func (ipp *IPAProof) UnmarshalJSON(data []byte) error { if err != nil { return fmt.Errorf("error decoding hex string for CR[%d]: %s", i, aux.CR[i]) } - copy(ipp.CR[i][:], val[:]) + copy(ipp.CR[i][:], val) } copy(ipp.FinalEvaluation[:], currentValueBytes) @@ -114,7 +114,7 @@ type verkleProofMarshaller struct { func (vp *VerkleProof) MarshalJSON() ([]byte, error) { aux := &verkleProofMarshaller{ OtherStems: make([]string, len(vp.OtherStems)), - DepthExtensionPresent: hex.EncodeToString(vp.DepthExtensionPresent[:]), + DepthExtensionPresent: hex.EncodeToString(vp.DepthExtensionPresent), CommitmentsByPath: make([]string, len(vp.CommitmentsByPath)), D: hex.EncodeToString(vp.D[:]), IPAProof: vp.IPAProof, diff --git a/proof_test.go b/proof_test.go index 1faf584a..c9203eab 100644 --- a/proof_test.go +++ b/proof_test.go @@ -354,10 +354,6 @@ func TestProofDeserialize(t *testing.T) { } } -func TestProofDeserializeErrors(t *testing.T) { - // TODO -} - func TestProofOfAbsenceEdgeCase(t *testing.T) { root := New() root.Commit() diff --git a/tree_test.go b/tree_test.go index 14d60ae3..e33b9107 100644 --- a/tree_test.go +++ b/tree_test.go @@ -1122,19 +1122,14 @@ func TestRustBanderwagonBlock48(t *testing.T) { "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", "0000000000000000000000000000000000000000000000000000000000000000", } - var ( - vals [][]byte - initialVals = map[string][]byte{} - ) + var initialVals = map[string][]byte{} for i, s := range valStrings { if s == "" { - vals = append(vals, nil) continue } v, _ := hex.DecodeString(s) - vals = append(vals, v) tree.Insert(keys[i], v, nil) initialVals[string(keys[i])] = v