prysm-pulse/validator/client/beacon-api/test-helpers/test_helpers.go
Patrice Vignola e843cafe7d
Add REST implementation for Validator's GetBeaconBlock (#11772)
* WIP

* WIP

* WIP

* Remove unused parameter

* Address PR comments

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2022-12-15 22:34:05 +00:00

38 lines
761 B
Go

package test_helpers
import (
"github.com/ethereum/go-ethereum/common/hexutil"
)
func FillByteSlice(sliceLength int, value byte) []byte {
bytes := make([]byte, sliceLength)
for index := range bytes {
bytes[index] = value
}
return bytes
}
func FillByteArraySlice(sliceLength int, value []byte) [][]byte {
bytes := make([][]byte, sliceLength)
for index := range bytes {
bytes[index] = value
}
return bytes
}
func FillEncodedByteSlice(sliceLength int, value byte) string {
return hexutil.Encode(FillByteSlice(sliceLength, value))
}
func FillEncodedByteArraySlice(sliceLength int, value string) []string {
encodedBytes := make([]string, sliceLength)
for index := range encodedBytes {
encodedBytes[index] = value
}
return encodedBytes
}