2022-12-12 10:39:51 +00:00
|
|
|
package test_helpers
|
|
|
|
|
2022-12-15 22:34:05 +00:00
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
|
|
|
)
|
|
|
|
|
2022-12-12 10:39:51 +00:00
|
|
|
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
|
|
|
|
}
|
2022-12-15 22:34:05 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|