core/types, crypto/kzg4844: update tests

This commit is contained in:
Martin Holst Swende 2024-03-08 09:06:18 +01:00
parent 779c8b628c
commit 1102b4636a
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
2 changed files with 4 additions and 4 deletions

View file

@ -59,7 +59,7 @@ func TestBlobTxSize(t *testing.T) {
}
var (
emptyBlob = kzg4844.Blob{}
emptyBlob = new(kzg4844.Blob)
emptyBlobCommit, _ = kzg4844.BlobToCommitment(emptyBlob)
emptyBlobProof, _ = kzg4844.ComputeBlobProof(emptyBlob, emptyBlobCommit)
)
@ -72,7 +72,7 @@ func createEmptyBlobTx(key *ecdsa.PrivateKey, withSidecar bool) *Transaction {
func createEmptyBlobTxInner(withSidecar bool) *BlobTx {
sidecar := &BlobTxSidecar{
Blobs: []kzg4844.Blob{emptyBlob},
Blobs: []kzg4844.Blob{*emptyBlob},
Commitments: []kzg4844.Commitment{emptyBlobCommit},
Proofs: []kzg4844.Proof{emptyBlobProof},
}

View file

@ -36,13 +36,13 @@ func randFieldElement() [32]byte {
return gokzg4844.SerializeScalar(r)
}
func randBlob() Blob {
func randBlob() *Blob {
var blob Blob
for i := 0; i < len(blob); i += gokzg4844.SerializedScalarSize {
fieldElementBytes := randFieldElement()
copy(blob[i:i+gokzg4844.SerializedScalarSize], fieldElementBytes[:])
}
return blob
return &blob
}
func TestCKZGWithPoint(t *testing.T) { testKZGWithPoint(t, true) }