mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/devp2p, internal/ethapi: update tests
This commit is contained in:
parent
1102b4636a
commit
5f17a2c658
2 changed files with 11 additions and 10 deletions
|
|
@ -754,8 +754,8 @@ func makeSidecar(data ...byte) *types.BlobTxSidecar {
|
||||||
)
|
)
|
||||||
for i := range blobs {
|
for i := range blobs {
|
||||||
blobs[i][0] = data[i]
|
blobs[i][0] = data[i]
|
||||||
c, _ := kzg4844.BlobToCommitment(blobs[i])
|
c, _ := kzg4844.BlobToCommitment(&blobs[i])
|
||||||
p, _ := kzg4844.ComputeBlobProof(blobs[i], c)
|
p, _ := kzg4844.ComputeBlobProof(&blobs[i], c)
|
||||||
commitments = append(commitments, c)
|
commitments = append(commitments, c)
|
||||||
proofs = append(proofs, p)
|
proofs = append(proofs, p)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1088,7 +1088,8 @@ func TestFillBlobTransaction(t *testing.T) {
|
||||||
Config: params.MergedTestChainConfig,
|
Config: params.MergedTestChainConfig,
|
||||||
Alloc: types.GenesisAlloc{},
|
Alloc: types.GenesisAlloc{},
|
||||||
}
|
}
|
||||||
emptyBlob = kzg4844.Blob{}
|
emptyBlob = new(kzg4844.Blob)
|
||||||
|
emptyBlobs = []kzg4844.Blob{*emptyBlob}
|
||||||
emptyBlobCommit, _ = kzg4844.BlobToCommitment(emptyBlob)
|
emptyBlobCommit, _ = kzg4844.BlobToCommitment(emptyBlob)
|
||||||
emptyBlobProof, _ = kzg4844.ComputeBlobProof(emptyBlob, emptyBlobCommit)
|
emptyBlobProof, _ = kzg4844.ComputeBlobProof(emptyBlob, emptyBlobCommit)
|
||||||
emptyBlobHash common.Hash = kzg4844.CalcBlobHashV1(sha256.New(), &emptyBlobCommit)
|
emptyBlobHash common.Hash = kzg4844.CalcBlobHashV1(sha256.New(), &emptyBlobCommit)
|
||||||
|
|
@ -1171,14 +1172,14 @@ func TestFillBlobTransaction(t *testing.T) {
|
||||||
From: &b.acc.Address,
|
From: &b.acc.Address,
|
||||||
To: &to,
|
To: &to,
|
||||||
Value: (*hexutil.Big)(big.NewInt(1)),
|
Value: (*hexutil.Big)(big.NewInt(1)),
|
||||||
Blobs: []kzg4844.Blob{emptyBlob},
|
Blobs: emptyBlobs,
|
||||||
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
||||||
Proofs: []kzg4844.Proof{emptyBlobProof},
|
Proofs: []kzg4844.Proof{emptyBlobProof},
|
||||||
},
|
},
|
||||||
want: &result{
|
want: &result{
|
||||||
Hashes: []common.Hash{emptyBlobHash},
|
Hashes: []common.Hash{emptyBlobHash},
|
||||||
Sidecar: &types.BlobTxSidecar{
|
Sidecar: &types.BlobTxSidecar{
|
||||||
Blobs: []kzg4844.Blob{emptyBlob},
|
Blobs: emptyBlobs,
|
||||||
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
||||||
Proofs: []kzg4844.Proof{emptyBlobProof},
|
Proofs: []kzg4844.Proof{emptyBlobProof},
|
||||||
},
|
},
|
||||||
|
|
@ -1191,14 +1192,14 @@ func TestFillBlobTransaction(t *testing.T) {
|
||||||
To: &to,
|
To: &to,
|
||||||
Value: (*hexutil.Big)(big.NewInt(1)),
|
Value: (*hexutil.Big)(big.NewInt(1)),
|
||||||
BlobHashes: []common.Hash{emptyBlobHash},
|
BlobHashes: []common.Hash{emptyBlobHash},
|
||||||
Blobs: []kzg4844.Blob{emptyBlob},
|
Blobs: emptyBlobs,
|
||||||
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
||||||
Proofs: []kzg4844.Proof{emptyBlobProof},
|
Proofs: []kzg4844.Proof{emptyBlobProof},
|
||||||
},
|
},
|
||||||
want: &result{
|
want: &result{
|
||||||
Hashes: []common.Hash{emptyBlobHash},
|
Hashes: []common.Hash{emptyBlobHash},
|
||||||
Sidecar: &types.BlobTxSidecar{
|
Sidecar: &types.BlobTxSidecar{
|
||||||
Blobs: []kzg4844.Blob{emptyBlob},
|
Blobs: emptyBlobs,
|
||||||
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
||||||
Proofs: []kzg4844.Proof{emptyBlobProof},
|
Proofs: []kzg4844.Proof{emptyBlobProof},
|
||||||
},
|
},
|
||||||
|
|
@ -1211,7 +1212,7 @@ func TestFillBlobTransaction(t *testing.T) {
|
||||||
To: &to,
|
To: &to,
|
||||||
Value: (*hexutil.Big)(big.NewInt(1)),
|
Value: (*hexutil.Big)(big.NewInt(1)),
|
||||||
BlobHashes: []common.Hash{{0x01, 0x22}},
|
BlobHashes: []common.Hash{{0x01, 0x22}},
|
||||||
Blobs: []kzg4844.Blob{emptyBlob},
|
Blobs: emptyBlobs,
|
||||||
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
||||||
Proofs: []kzg4844.Proof{emptyBlobProof},
|
Proofs: []kzg4844.Proof{emptyBlobProof},
|
||||||
},
|
},
|
||||||
|
|
@ -1223,12 +1224,12 @@ func TestFillBlobTransaction(t *testing.T) {
|
||||||
From: &b.acc.Address,
|
From: &b.acc.Address,
|
||||||
To: &to,
|
To: &to,
|
||||||
Value: (*hexutil.Big)(big.NewInt(1)),
|
Value: (*hexutil.Big)(big.NewInt(1)),
|
||||||
Blobs: []kzg4844.Blob{emptyBlob},
|
Blobs: emptyBlobs,
|
||||||
},
|
},
|
||||||
want: &result{
|
want: &result{
|
||||||
Hashes: []common.Hash{emptyBlobHash},
|
Hashes: []common.Hash{emptyBlobHash},
|
||||||
Sidecar: &types.BlobTxSidecar{
|
Sidecar: &types.BlobTxSidecar{
|
||||||
Blobs: []kzg4844.Blob{emptyBlob},
|
Blobs: emptyBlobs,
|
||||||
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
Commitments: []kzg4844.Commitment{emptyBlobCommit},
|
||||||
Proofs: []kzg4844.Proof{emptyBlobProof},
|
Proofs: []kzg4844.Proof{emptyBlobProof},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue