mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 18:51:19 +00:00
e843cafe7d
* WIP * WIP * WIP * Remove unused parameter * Address PR comments Co-authored-by: Radosław Kapka <rkapka@wp.pl>
38 lines
761 B
Go
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
|
|
}
|