# utils

import "command-line-arguments"

# Index

  • Constants
  • Variables
  • func ChecksumAddressString(address string) string
  • func EnsureDir(dir string)
  • func EtherToWei(eth *big.Float) *big.Int
  • func EtherToWeiFloatToUint64(eth float64) uint64
  • func HexStringArrayToBytesArray(strArray []string) [][]byte
  • func LogErrorWhileRetrying(msg string, err error, retrying *bool, logger *zap.Logger)
  • func Min(a, b int) int
  • func RecoverSigAddress(sigHex string, msg []byte) (address string, err error)
  • func SplitAddressList(addressList string, separator string) []common.Address
  • func VerifySig(from string, sigHex string, msg []byte) (bool, string, error)

# Constants

RetryAttempts is how many attempts are made to reconnect to an Ethereum client before failing.

const RetryAttempts = 60 * 60

RetryDelay is the delay between reconnects to an Ethereum client.

const RetryDelay = 1 * time.Second

# Variables

var ServiceDelayType = retry.DelayType(func(n uint, err error, config *retry.Config) time.Duration {
    return retry.FixedDelay(n, err, config)
})
var ServiceRetryAttempts = retry.Attempts(RetryAttempts)
var ServiceRetryDelay = retry.Delay(RetryDelay)

# func ChecksumAddressString

func ChecksumAddressString(address string) string

# func EnsureDir

func EnsureDir(dir string)

EnsureDir creates a given dir directory in case it does not already exist.

# func EtherToWei

func EtherToWei(eth *big.Float) *big.Int

# func EtherToWeiFloatToUint64

func EtherToWeiFloatToUint64(eth float64) uint64

# func HexStringArrayToBytesArray

func HexStringArrayToBytesArray(strArray []string) [][]byte

# func LogErrorWhileRetrying

func LogErrorWhileRetrying(msg string, err error, retrying *bool, logger *zap.Logger)

LogErrorWhileRetrying is a wrapper for less verbose logging when retrying some actions, for instance, reconnecting to an Ethereum client.

# func Min

func Min(a, b int) int

# func RecoverSigAddress

func RecoverSigAddress(sigHex string, msg []byte) (address string, err error)

# func SplitAddressList

func SplitAddressList(addressList string, separator string) []common.Address

SplitAddressList splits a list of addresses initially given as a string addressList along with a separator to use to split the string.

# func VerifySig

func VerifySig(from string, sigHex string, msg []byte) (bool, string, error)

Generated by gomarkdoc