Documentation
¶
Index ¶
- func Abs[T constraints.Integer](x T) T
- func AbsDiff[T constraints.Integer](x T, y T) T
- func CheckContextDone(ctx context.Context) bool
- func ConstrainIntegerToBitLength(b *big.Int, signed bool, bitLength int) *big.Int
- func ConstrainIntegerToBounds(b *big.Int, min *big.Int, max *big.Int) *big.Int
- func CopyChainConfig(config *params.ChainConfig) (*params.ChainConfig, error)
- func CopyDirectory(sourcePath string, targetPath string, recursively bool) error
- func CopyFile(sourcePath string, targetPath string) error
- func DeleteDirectory(directoryPath string) error
- func GetFileNameWithoutExtension(filePath string) string
- func GetFilePathWithoutExtension(filePath string) string
- func GetIntegerConstraints(signed bool, bitLength int) (*big.Int, *big.Int)
- func HexStringToAddress(addressHexString string) (common.Address, error)
- func HexStringsToAddresses(addressHexStrings []string) ([]common.Address, error)
- func IsLinuxEnvironment() bool
- func IsMacOSEnvironment() bool
- func IsWindowsEnvironment() bool
- func MakeDirectory(dirToMake string) error
- func Max[T constraints.Ordered](x T, y T) T
- func MessageToTransaction(msg core.Message) *types.Transaction
- func Min[T constraints.Ordered](x T, y T) T
- func RunCommandWithOutputAndError(command *exec.Cmd) ([]byte, []byte, []byte, error)
- func SlicePointersToValues[T any](x []*T) []T
- func SliceSelect[T any, K any](x []T, f func(x T) K) []K
- func SliceValuesToPointers[T any](x []T) []*T
- func SliceWhere[T any](x []T, f func(x T) bool) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
func Abs[T constraints.Integer](x T) T
Abs provides a way of taking the absolute value of an integer
func AbsDiff ¶
func AbsDiff[T constraints.Integer](x T, y T) T
AbsDiff provides a way of taking the absolute difference between two integers
func CheckContextDone ¶
CheckContextDone checks if a provided context has indicated it is done, and returns a boolean indicating if it is.
func ConstrainIntegerToBitLength ¶
ConstrainIntegerToBitLength takes a provided big integer, signed indicator, and bit length and ensures that the provided integer is represented in those bounds. In effect, this simulates overflow and underflow. Returns the constrained integer.
func ConstrainIntegerToBounds ¶
ConstrainIntegerToBounds takes a provided big integer and minimum/maximum bounds (inclusive) and ensures that the provided integer is represented in those bounds. In effect, this simulates overflow and underflow. Returns the constrained integer.
func CopyChainConfig ¶
func CopyChainConfig(config *params.ChainConfig) (*params.ChainConfig, error)
CopyChainConfig takes a chain configuration and creates a copy. Returns the copy of the chain configuration, or an error if one occurs.
func CopyDirectory ¶
CopyDirectory copies a directory from a source path to a destination path. If recursively, all subdirectories will be copied. If not, only files within the directory will be copied. Returns an error if one occurs.
func CopyFile ¶
CopyFile copies a file from a source path to a destination path. File permissions are retained. Returns an error if one occurs.
func DeleteDirectory ¶
DeleteDirectory deletes a directory at the provided path. Returns an error if one occurred.
func GetFileNameWithoutExtension ¶
GetFileNameWithoutExtension obtains a filename without the extension. This does not contain any preceding directory paths.
func GetFilePathWithoutExtension ¶
GetFilePathWithoutExtension obtains a file path without the extension. This retains all preceding directory paths.
func GetIntegerConstraints ¶
GetIntegerConstraints takes a given signed indicator and bit length for a prospective integer and determines the minimum/maximum value boundaries. Returns the minimum and maximum value for the provided integer properties. Minimums and maximums are inclusive.
func HexStringToAddress ¶
HexStringToAddress converts a hex string (with or without the "0x" prefix) to a common.Address. Returns the parsed address, or an error if one occurs during conversion.
func HexStringsToAddresses ¶
HexStringsToAddresses converts hex strings (with or without the "0x" prefix) to common.Address objects. Returns the parsed address, or an error if one occurs during conversion.
func IsLinuxEnvironment ¶
func IsLinuxEnvironment() bool
IsLinuxEnvironment returns a boolean indicating whether the current execution environment is a Linux platform.
func IsMacOSEnvironment ¶
func IsMacOSEnvironment() bool
IsMacOSEnvironment returns a boolean indicating whether the current execution environment is a macOS platform.
func IsWindowsEnvironment ¶
func IsWindowsEnvironment() bool
IsWindowsEnvironment returns a boolean indicating whether the current execution environment is a Windows platform.
func MakeDirectory ¶
MakeDirectory creates a directory at the given path
func Max ¶
func Max[T constraints.Ordered](x T, y T) T
Max provides generic support for various integer types to be compared and the maximum of two values returned. Returns the maximum of the two values provided.
func MessageToTransaction ¶
func MessageToTransaction(msg core.Message) *types.Transaction
MessageToTransaction derives a types.Transaction from a types.Message.
func Min ¶
func Min[T constraints.Ordered](x T, y T) T
Min provides generic support for various integer types to be compared and the minimum of two values returned. Returns the minimum of the two values provided.
func RunCommandWithOutputAndError ¶
RunCommandWithOutputAndError runs a given exec.Cmd and returns the stdout, stderr, and combined output as bytes, or an error if one occurred.
func SlicePointersToValues ¶
func SlicePointersToValues[T any](x []*T) []T
SlicePointersToValues takes a slice of pointers and returns a slice of values de-referenced from them.
func SliceSelect ¶
SliceSelect provides a way of querying a specific element from a slice's elements into a slice of its own.
func SliceValuesToPointers ¶
func SliceValuesToPointers[T any](x []T) []*T
SliceValuesToPointers takes a slice of values and returns a slice of pointers to them.
func SliceWhere ¶
SliceWhere provides a way of querying specific elements which fit some criteria into a new slice.
Types ¶
This section is empty.