mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
34 lines
849 B
Go
34 lines
849 B
Go
package params
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
|
|
)
|
|
|
|
func TestMaxRequestBlock(t *testing.T) {
|
|
testCases := []struct {
|
|
epoch primitives.Epoch
|
|
expectedMaxBlock uint64
|
|
description string
|
|
}{
|
|
{
|
|
epoch: primitives.Epoch(mainnetDenebForkEpoch - 1), // Assuming the fork epoch is not 0
|
|
expectedMaxBlock: mainnetBeaconConfig.MaxRequestBlocks,
|
|
},
|
|
{
|
|
epoch: primitives.Epoch(mainnetDenebForkEpoch),
|
|
expectedMaxBlock: mainnetBeaconConfig.MaxRequestBlocksDeneb,
|
|
},
|
|
}
|
|
|
|
for _, tc := range testCases {
|
|
t.Run(tc.description, func(t *testing.T) {
|
|
maxBlocks := MaxRequestBlock(tc.epoch)
|
|
if maxBlocks != tc.expectedMaxBlock {
|
|
t.Errorf("For epoch %d, expected max blocks %d, got %d", tc.epoch, tc.expectedMaxBlock, maxBlocks)
|
|
}
|
|
})
|
|
}
|
|
}
|