mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-05-02 03:02:54 -04:00
add attestations to migration tests
This commit is contained in:
@@ -86,6 +86,25 @@ func Test_V1Alpha1ToV1SignedBlock(t *testing.T) {
|
||||
DepositCount: depositCount,
|
||||
BlockHash: blockHash,
|
||||
}
|
||||
alphaBlock.Block.Body.Attestations = []*ethpbalpha.Attestation{
|
||||
{
|
||||
AggregationBits: bitfield.NewBitlist(2048),
|
||||
Data: ðpbalpha.AttestationData{
|
||||
Slot: slot,
|
||||
CommitteeIndex: 99,
|
||||
BeaconBlockRoot: bodyRoot,
|
||||
Source: ðpbalpha.Checkpoint{
|
||||
Epoch: epoch,
|
||||
Root: bodyRoot,
|
||||
},
|
||||
Target: ðpbalpha.Checkpoint{
|
||||
Epoch: epoch,
|
||||
Root: bodyRoot,
|
||||
},
|
||||
},
|
||||
Signature: signature,
|
||||
},
|
||||
}
|
||||
alphaBlock.Signature = signature
|
||||
|
||||
v1Block, err := V1Alpha1ToV1SignedBlock(alphaBlock)
|
||||
@@ -109,6 +128,25 @@ func Test_V1ToV1Alpha1SignedBlock(t *testing.T) {
|
||||
DepositCount: depositCount,
|
||||
BlockHash: blockHash,
|
||||
}
|
||||
v1Block.Block.Body.Attestations = []*ethpbv1.Attestation{
|
||||
{
|
||||
AggregationBits: bitfield.NewBitlist(2048),
|
||||
Data: ðpbv1.AttestationData{
|
||||
Slot: slot,
|
||||
Index: 99,
|
||||
BeaconBlockRoot: bodyRoot,
|
||||
Source: ðpbv1.Checkpoint{
|
||||
Epoch: epoch,
|
||||
Root: bodyRoot,
|
||||
},
|
||||
Target: ðpbv1.Checkpoint{
|
||||
Epoch: epoch,
|
||||
Root: bodyRoot,
|
||||
},
|
||||
},
|
||||
Signature: signature,
|
||||
},
|
||||
}
|
||||
v1Block.Signature = signature
|
||||
|
||||
alphaBlock, err := V1ToV1Alpha1SignedBlock(v1Block)
|
||||
@@ -132,6 +170,25 @@ func Test_AltairToV1Alpha1SignedBlock(t *testing.T) {
|
||||
DepositCount: depositCount,
|
||||
BlockHash: blockHash,
|
||||
}
|
||||
v2Block.Message.Body.Attestations = []*ethpbv1.Attestation{
|
||||
{
|
||||
AggregationBits: bitfield.NewBitlist(2048),
|
||||
Data: ðpbv1.AttestationData{
|
||||
Slot: slot,
|
||||
Index: 99,
|
||||
BeaconBlockRoot: bodyRoot,
|
||||
Source: ðpbv1.Checkpoint{
|
||||
Epoch: epoch,
|
||||
Root: bodyRoot,
|
||||
},
|
||||
Target: ðpbv1.Checkpoint{
|
||||
Epoch: epoch,
|
||||
Root: bodyRoot,
|
||||
},
|
||||
},
|
||||
Signature: signature,
|
||||
},
|
||||
}
|
||||
syncCommitteeBits := bitfield.NewBitvector512()
|
||||
syncCommitteeBits.SetBitAt(100, true)
|
||||
v2Block.Message.Body.SyncAggregate = ðpbv1.SyncAggregate{
|
||||
@@ -161,6 +218,25 @@ func Test_V1ToV1Alpha1Block(t *testing.T) {
|
||||
DepositCount: depositCount,
|
||||
BlockHash: blockHash,
|
||||
}
|
||||
alphaBlock.Body.Attestations = []*ethpbalpha.Attestation{
|
||||
{
|
||||
AggregationBits: bitfield.NewBitlist(2048),
|
||||
Data: ðpbalpha.AttestationData{
|
||||
Slot: slot,
|
||||
CommitteeIndex: 99,
|
||||
BeaconBlockRoot: bodyRoot,
|
||||
Source: ðpbalpha.Checkpoint{
|
||||
Epoch: epoch,
|
||||
Root: bodyRoot,
|
||||
},
|
||||
Target: ðpbalpha.Checkpoint{
|
||||
Epoch: epoch,
|
||||
Root: bodyRoot,
|
||||
},
|
||||
},
|
||||
Signature: signature,
|
||||
},
|
||||
}
|
||||
|
||||
v1Block, err := V1Alpha1ToV1Block(alphaBlock)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user